public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi_level constants in scsi.h
@ 2004-08-24 11:39 Douglas Gilbert
  2004-08-24 11:52 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Douglas Gilbert @ 2004-08-24 11:39 UTC (permalink / raw)
  To: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 282 bytes --]

The scsi_level value in struct scsi_device is a bit
mysterious. Hopefully this patch makes it a bit clearer
since it is visible via sysfs.

Changes:
   - add scsi_level constants for SPC-2 and SPC-3
   - comment on relationship between scsi_level and INQUIRY response

Doug Gilbert

[-- Attachment #2: scsi_h_2681.diff --]
[-- Type: text/x-patch, Size: 769 bytes --]

--- linux/include/scsi/scsi.h	2004-08-14 21:12:52.000000000 +1000
+++ linux/include/scsi/scsi.h2681sl	2004-08-24 21:34:25.866435024 +1000
@@ -353,14 +353,19 @@
 		     ((lun) & 0x07))
 
 /*
- *  SCSI command sets
+ *  struct scsi_device::scsi_level values. For SCSI devices other than those
+ *  prior to SCSI-2 (i.e. over 12 years old) this value is (resp[2] + 1)
+ *  where "resp" is a byte array of the response to an INQUIRY. The scsi_level
+ *  variable is visible to the user via sysfs.
  */
 
 #define SCSI_UNKNOWN    0
 #define SCSI_1          1
 #define SCSI_1_CCS      2
 #define SCSI_2          3
-#define SCSI_3          4
+#define SCSI_3          4        /* SPC */
+#define SCSI_SPC_2      5
+#define SCSI_SPC_3      6
 
 /*
  * INQ PERIPHERAL QUALIFIERS

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi_level constants in scsi.h
  2004-08-24 11:39 [PATCH] scsi_level constants in scsi.h Douglas Gilbert
@ 2004-08-24 11:52 ` Christoph Hellwig
  2004-08-25  1:33   ` Douglas Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2004-08-24 11:52 UTC (permalink / raw)
  To: Douglas Gilbert; +Cc: linux-scsi

On Tue, Aug 24, 2004 at 09:39:36PM +1000, Douglas Gilbert wrote:
> The scsi_level value in struct scsi_device is a bit
> mysterious. Hopefully this patch makes it a bit clearer
> since it is visible via sysfs.
> 
> Changes:
>    - add scsi_level constants for SPC-2 and SPC-3
>    - comment on relationship between scsi_level and INQUIRY response

Looks cool.  What about turning it into an enum while you're at it?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi_level constants in scsi.h
  2004-08-24 11:52 ` Christoph Hellwig
@ 2004-08-25  1:33   ` Douglas Gilbert
  0 siblings, 0 replies; 3+ messages in thread
From: Douglas Gilbert @ 2004-08-25  1:33 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-scsi, James.Bottomley

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

Christoph Hellwig wrote:
> On Tue, Aug 24, 2004 at 09:39:36PM +1000, Douglas Gilbert wrote:
> 
>>The scsi_level value in struct scsi_device is a bit
>>mysterious. Hopefully this patch makes it a bit clearer
>>since it is visible via sysfs.
>>
>>Changes:
>>   - add scsi_level constants for SPC-2 and SPC-3
>>   - comment on relationship between scsi_level and INQUIRY response
> 
> 
> Looks cool.  What about turning it into an enum while you're at it?

Christoph,
Changes:
     - convert scsi_level defines to enumerations
     - add scsi_level enumerations for SPC-2, SPC-3 and proposed SPC-4
     - comment on relationship between scsi_level and INQUIRY response

Patch against lk 2.6.9-rc1 attached.

Doug Gilbert


[-- Attachment #2: scsi_h_269rc1.diff --]
[-- Type: text/x-patch, Size: 846 bytes --]

--- linux/include/scsi/scsi.h	2004-08-25 10:06:42.597842752 +1000
+++ linux/include/scsi/scsi.h269rc1sl2	2004-08-25 10:20:24.314922768 +1000
@@ -354,14 +354,22 @@
 		     ((lun) & 0x07))
 
 /*
- *  SCSI command sets
+ *  struct scsi_device::scsi_level values. For SCSI devices other than those
+ *  prior to SCSI-2 (i.e. over 12 years old) this value is (resp[2] + 1)
+ *  where "resp" is a byte array of the response to an INQUIRY. The scsi_level
+ *  variable is visible to the user via sysfs.
  */
 
-#define SCSI_UNKNOWN    0
-#define SCSI_1          1
-#define SCSI_1_CCS      2
-#define SCSI_2          3
-#define SCSI_3          4
+enum scsi_level_state {
+	SCSI_UNKNOWN =	0,
+	SCSI_1 =	1,
+	SCSI_1_CCS =	2,
+	SCSI_2 =	3,
+	SCSI_3 =	4,	/* SPC */
+	SCSI_SPC_2 =	5,
+	SCSI_SPC_3 =	6,
+	SCSI_SPC_4 =	7
+};
 
 /*
  * INQ PERIPHERAL QUALIFIERS

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-08-25  1:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-24 11:39 [PATCH] scsi_level constants in scsi.h Douglas Gilbert
2004-08-24 11:52 ` Christoph Hellwig
2004-08-25  1:33   ` Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox