summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa_cmd.h
diff options
context:
space:
mode:
authorStephen M. Cameron <stephenmcameron@gmail.com>2014-11-14 17:27:04 -0600
committerChristoph Hellwig <hch@lst.de>2014-11-20 09:11:25 +0100
commita505b86fde5903944828fa04f775e79a6636791d (patch)
tree71cc00cd3e49f6049ccd851826c20325ef03d323 /drivers/scsi/hpsa_cmd.h
parent50a0decf75b66480aa5b076d4e1bca11bc202efe (diff)
downloadlinux-a505b86fde5903944828fa04f775e79a6636791d.tar.gz
linux-a505b86fde5903944828fa04f775e79a6636791d.tar.bz2
linux-a505b86fde5903944828fa04f775e79a6636791d.zip
hpsa: get rid of type/attribute/direction bit field where possible
Using bit fields for hardware command fields isn't portable and relies on assumptions about how the compiler lays out the bits. We can fix this in the driver's internal command structure, but the ioctl interface we can't change because it is part of the userland ABI. Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Webb Scales <webb.scales@hp.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/hpsa_cmd.h')
-rw-r--r--drivers/scsi/hpsa_cmd.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h
index 575eda8a8c5e..cb988c41cad9 100644
--- a/drivers/scsi/hpsa_cmd.h
+++ b/drivers/scsi/hpsa_cmd.h
@@ -320,11 +320,19 @@ struct CommandListHeader {
struct RequestBlock {
u8 CDBLen;
- struct {
- u8 Type:3;
- u8 Attribute:3;
- u8 Direction:2;
- } Type;
+ /*
+ * type_attr_dir:
+ * type: low 3 bits
+ * attr: middle 3 bits
+ * dir: high 2 bits
+ */
+ u8 type_attr_dir;
+#define TYPE_ATTR_DIR(t, a, d) ((((d) & 0x03) << 6) |\
+ (((a) & 0x07) << 3) |\
+ ((t) & 0x07))
+#define GET_TYPE(tad) ((tad) & 0x07)
+#define GET_ATTR(tad) (((tad) >> 3) & 0x07)
+#define GET_DIR(tad) (((tad) >> 6) & 0x03)
u16 Timeout;
u8 CDB[16];
};