diff options
author | ps <ps@FreeBSD.org> | 2004-07-29 08:06:22 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2004-07-29 08:06:22 +0000 |
commit | 5bf78408ff129570850d1f9ab78b86f77233e9a3 (patch) | |
tree | 0759d4c507abc2a3c9d33398d41878ba1b077aab /sys/dev/ciss | |
parent | 9cfc8592d316a9a16911b6e171312132fa5b65f2 (diff) | |
download | FreeBSD-src-5bf78408ff129570850d1f9ab78b86f77233e9a3.zip FreeBSD-src-5bf78408ff129570850d1f9ab78b86f77233e9a3.tar.gz |
Clean up structure packing.
Diffstat (limited to 'sys/dev/ciss')
-rw-r--r-- | sys/dev/ciss/cissio.h | 43 | ||||
-rw-r--r-- | sys/dev/ciss/cissreg.h | 4 |
2 files changed, 22 insertions, 25 deletions
diff --git a/sys/dev/ciss/cissio.h b/sys/dev/ciss/cissio.h index a9136bd..baf9b88 100644 --- a/sys/dev/ciss/cissio.h +++ b/sys/dev/ciss/cissio.h @@ -108,84 +108,81 @@ typedef union { u_int8_t Dev; u_int8_t Bus:6; u_int8_t Mode:2; - } PeripDev __packed; + } __packed PeripDev; struct { u_int8_t DevLSB; u_int8_t DevMSB:6; u_int8_t Mode:2; - } LogDev __packed; + } __packed LogDev; struct { u_int8_t Dev:5; u_int8_t Bus:3; u_int8_t Targ:6; u_int8_t Mode:2; - } LogUnit __packed; + } __packed LogUnit; } SCSI3Addr_struct; -struct PhysDevAddr { +typedef struct { u_int32_t TargetId:24; u_int32_t Bus:6; u_int32_t Mode:2; SCSI3Addr_struct Target[2]; -} __packed; +} __packed PhysDevAddr_struct; -struct LogDevAddr { +typedef struct { u_int32_t VolId:30; u_int32_t Mode:2; u_int8_t reserved[4]; -} __packed; +} __packed LogDevAddr_struct; typedef union { u_int8_t LunAddrBytes[8]; SCSI3Addr_struct SCSI3Lun[4]; - struct PhysDevAddr PhysDev; - struct LogDevAddr LogDev; -} LUNAddr_struct; + PhysDevAddr_struct PhysDev; + LogDevAddr_struct LogDev; +} __packed LUNAddr_struct; -struct RequestBlock { +typedef struct { u_int8_t CDBLen; struct { u_int8_t Type:3; u_int8_t Attribute:3; u_int8_t Direction:2; - } Type __packed; + } __packed Type; u_int16_t Timeout; u_int8_t CDB[16]; -} __packed; -typedef struct RequestBlock RequestBlock_struct; +} __packed RequestBlock_struct; typedef union { struct { u_int8_t Reserved[3]; u_int8_t Type; u_int32_t ErrorInfo; - } Common_Info __packed; + } __packed Common_Info; struct { u_int8_t Reserved[2]; u_int8_t offense_size; u_int8_t offense_num; u_int32_t offense_value; - } Invalid_Cmd __packed; -} MoreErrInfo_struct; + } __packed Invalid_Cmd; +} __packed MoreErrInfo_struct; -struct ErrorInfo { +typedef struct { u_int8_t ScsiStatus; u_int8_t SenseLen; u_int16_t CommandStatus; u_int32_t ResidualCnt; MoreErrInfo_struct MoreErrInfo; u_int8_t SenseInfo[SENSEINFOBYTES]; -} __packed; -typedef struct ErrorInfo ErrorInfo_struct; +} __packed ErrorInfo_struct; -struct IOCTL_Command { +typedef struct { LUNAddr_struct LUN_info; /* 8 */ RequestBlock_struct Request; /* 20 */ ErrorInfo_struct error_info; /* 48 */ u_int16_t buf_size; /* 2 */ u_int8_t *buf; /* 4 */ -} __packed; -typedef struct IOCTL_Command IOCTL_Command_struct; +} __packed IOCTL_Command_struct; /* * Note that we'd normally pass the struct in directly, but diff --git a/sys/dev/ciss/cissreg.h b/sys/dev/ciss/cissreg.h index 09024d1..b621ce4 100644 --- a/sys/dev/ciss/cissreg.h +++ b/sys/dev/ciss/cissreg.h @@ -138,13 +138,13 @@ struct ciss_error_info u_int8_t res1[3]; u_int8_t type; u_int32_t error_info; - } common_info __packed; + } __packed common_info; struct { u_int8_t res1[2]; u_int8_t offense_size; u_int8_t offense_offset; u_int32_t offense_value; - } invalid_command __packed; + } __packed invalid_command; } additional_error_info; u_int8_t sense_info[0]; } __packed; |