Bob Frey wrote:
> Don't use bitfields
Ok. I browsed the existing scsi drivers to see if bitfields was kosher and
since most existing drivers use them, I thought it was ok. Oh well.
Here's version two. No bitfields.
/Björn
--- scsi.h Tue Sep 5 23:08:55 2000
+++ /home/bjst/src/scsi.h Thu Mar 15 18:56:13 2001
@@ -78,13 +78,17 @@
#define MODE_SENSE_10 0x5a
#define PERSISTENT_RESERVE_IN 0x5e
#define PERSISTENT_RESERVE_OUT 0x5f
+#define REPORT_LUNS 0xa0
+#define SET_DEVICE_ID 0xa4
#define MOVE_MEDIUM 0xa5
+#define MOVE_MEDIUM_ATTACHED 0xa7
#define READ_12 0xa8
#define WRITE_12 0xaa
#define WRITE_VERIFY_12 0xae
#define SEARCH_HIGH_12 0xb0
#define SEARCH_EQUAL_12 0xb1
#define SEARCH_LOW_12 0xb2
+#define READ_ELEMENT_STATUS_ATTACHED 0xb4
#define READ_ELEMENT_STATUS 0xb8
#define SEND_VOLUME_TAG 0xb6
#define WRITE_LONG_2 0xea
@@ -138,8 +142,78 @@
* - treated as TYPE_DISK */
#define TYPE_MEDIUM_CHANGER 0x08
#define TYPE_COMM 0x09 /* Communications device */
+#define TYPE_RAID 0x0c /* Storage array controller device */
#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
+#define TYPE_SIMPLE_DISK 0x0e /* Simplified direct-access device */
+#define TYPE_CARD 0x0f /* Optical card reader/writer device */
+#define TYPE_OBJECT 0x11 /* Object-based Storage Device */
#define TYPE_NO_LUN 0x7f
+
+/*
+ * The SCSI INQUIRY command result data format
+ * (From SCSI-2 final draft, section 8.2.5.1
+ * and SCSI-3 SPC draft 18, section 7.6.2)
+ */
+
+#define INQ_DEV_TYPE_MASK 0x1f
+#define INQ_DEV_QUAL_MASK 0xe0
+
+#define INQ_B1_REMOVABLE 0x80
+
+#define INQ_B3_RESPONSE_VER_MASK 0x0f
+#define INQ_B3_HIERARCHIAL_ADDR 0x10
+#define INQ_B3_NORMAL_ACA 0x20
+#define INQ_B3_TERM_IO_PROC 0x40
+#define INQ_B3_ASYNC_EVENT_REPORT 0x80
+
+#define INQ_B5_STORAGE_ARRAY 0x80
+
+#define INQ_B6_ADDR16 0x01
+#define INQ_B6_CHANGER 0x08
+#define INQ_B6_MULTIPORT 0x10
+#define INQ_B6_ENCLOSURE 0x40
+#define INQ_B6_BASIC_QUEUE 0x80
+
+#define INQ_B7_SOFT_RESET 0x01
+#define INQ_B7_CMD_QUEUE 0x02
+#define INQ_B7_TRANSFER_DISABLE 0x04
+#define INQ_B7_LINKED 0x08
+#define INQ_B7_SYNC 0x10
+#define INQ_B7_WBUS16 0x20
+#define INQ_B7_WBUS32 0x40
+#define INQ_B7_REL_ADDR 0x80
+
+#define INQ_B56_INFO_UNIT 0x01
+#define INQ_B56_QUICK_ARBITRATE 0x02
+#define INQ_B56_CLOCKING_MASK 0x0c
+
+struct scsi_inquiry_response
+{
+ u8 device_type;
+ u8 byte1;
+ u8 scsi_version;
+ u8 byte3;
+ u8 additional_length;
+ u8 byte5;
+ u8 byte6;
+ u8 byte7;
+ u8 vendor[8];
+ u8 product[16];
+ u8 revision[4];
+ u8 vendor_specific[20];
+ u8 byte56;
+ u8 _reserved1;
+ u16 standard1;
+ u16 standard2;
+ u16 standard3;
+ u16 standard4;
+ u16 standard5;
+ u16 standard6;
+ u16 standard7;
+ u16 standard8;
+ u8 _reserved2[22];
+};
+
/*
* standard mode-select header prepended to all mode-select commands
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]