summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorwrstuden <wrstuden@NetBSD.org>1999-12-23 00:15:12 +0000
committerwrstuden <wrstuden@NetBSD.org>1999-12-23 00:15:12 +0000
commitba7b2b412442921d09abc7f09cc0c2b9de40d7d9 (patch)
treed6d7fb1e475bfea8843c411fa789b12c4cb423bb /sys/dev
parent0e7b1b9ec1f747fde21d979dfd723b317663d8f8 (diff)
Make the bitfields in here work on big-endian machines. How this ever
worked is unclear. Patch from thorpej, tested by me.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/bhareg.h43
1 files changed, 37 insertions, 6 deletions
diff --git a/sys/dev/ic/bhareg.h b/sys/dev/ic/bhareg.h
index 57de5967b11..e7b820005a3 100644
--- a/sys/dev/ic/bhareg.h
+++ b/sys/dev/ic/bhareg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: bhareg.h,v 1.13 1999/09/30 23:12:29 thorpej Exp $ */
+/* $NetBSD: bhareg.h,v 1.14 1999/12/23 00:15:12 wrstuden Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -191,11 +191,19 @@ struct bha_scat_gath {
struct bha_ccb {
u_int8_t opcode;
+#if BYTE_ORDER == LITTLE_ENDIAN
u_int8_t :3,
data_in :1,
data_out :1,
wide_tag_enable :1, /* Wide Lun CCB format */
wide_tag_type :2; /* Wide Lun CCB format */
+#else
+ u_int8_t wide_tag_type :2, /* Wide Lun CCB format */
+ wide_tag_enable :1, /* Wide Lun CCB format */
+ data_out :1,
+ data_in :1,
+ :3;
+#endif
u_int8_t scsi_cmd_length;
u_int8_t req_sense_length;
/*------------------------------------longword boundary */
@@ -208,9 +216,15 @@ struct bha_ccb {
u_int8_t target_stat;
/*------------------------------------longword boundary */
u_int8_t target;
+#if BYTE_ORDER == LITTLE_ENDIAN
u_int8_t lun :5,
tag_enable :1,
tag_type :2;
+#else
+ u_int8_t tag_type :2,
+ tag_enable :1,
+ lun :5;
+#endif
u_int8_t scsi_cmd[12];
u_int8_t reserved2[1];
u_int8_t link_id;
@@ -320,8 +334,13 @@ struct bha_config {
struct {
u_char chan;
u_char intr;
- u_char scsi_dev:3;
- u_char :5;
+#if BYTE_ORDER == LITTLE_ENDIAN
+ u_char scsi_dev :3,
+ :5;
+#else
+ u_char :5,
+ scsi_dev :3;
+#endif
} reply;
};
@@ -382,15 +401,27 @@ struct bha_devices {
};
struct bha_sync {
- u_char offset:4;
- u_char period:3;
- u_char valid:1;
+#if BYTE_ORDER == LITTLE_ENDIAN
+ u_char offset :4,
+ period :3,
+ valid :1;
+#else
+ u_char valid :1,
+ period :3,
+ offset :4;
+#endif
};
struct bha_setup_reply {
+#if BYTE_ORDER == LITTLE_ENDIAN
u_int8_t sync_neg :1,
parity :1,
:6;
+#else
+ u_int8_t :6,
+ parity :1,
+ sync_neg :1;
+#endif
u_int8_t speed;
u_int8_t bus_on;
u_int8_t bus_off;