Linux SCSI subsystem development
 help / color / mirror / Atom feed
* Some constants I don't understand in sym2
@ 2004-09-20 20:25 Matthew Wilcox
  2004-09-20 21:12 ` Tony Battersby
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox @ 2004-09-20 20:25 UTC (permalink / raw)
  To: linux-scsi


I'd like to convert sym2 over to using the same constants as the
rest of Linux SCSI.  I think this process has uncovered a bug, but
it may simply be history that I'm missing.  Here's one bit:

-#define        S_GOOD          (0x00)
-#define        S_CHECK_COND    (0x02)
[...]
+#define        S_GOOD          SAM_STAT_GOOD
+#define        S_CHECK_COND    SAM_STAT_CHECK_CONDITION
[...]
 #define        S_TERMINATED    (0x20)
-#define        S_QUEUE_FULL    (0x28)
+#define        S_QUEUE_FULL    SAM_STAT_TASK_SET_FULL
 #define        S_ILLEGAL       (0xff)

I don't know what S_TERMINATED should be.  There's
SAM_STAT_COMMAND_TERMINATED 0x22, marked as obsolete in SAM-3.  Was there
ever a TERMINATED that was 0x20, or is this simply a mistake?  This same
definition can also be found in drivers/scsi/sym53c8xx_defs.h (from
the same author).  aiclib.h thinks SCSI_STATUS_CMD_TERMINATED (0x22)
is obsolete in SAM-2 instead of SAM-3.

Other symbolic tags I haven't found Linux names for yet include:

 #define        M_ABORT_TAG     (0x0d)
 #define        M_CLEAR_QUEUE   (0x0e)
-#define        M_INIT_REC      (0x0f)
-#define        M_REL_REC       (0x10)
+#define        M_INIT_REC      INITIATE_RECOVERY
+#define        M_REL_REC       RELEASE_RECOVERY
 #define        M_TERMINATE     (0x11)
 #define        M_IGN_RESIDUE   (0x23)
 #define        M_IDENTIFY      (0x80)

Again, history lesson / pointers to specs appreciated (I have sam3r09,
spc3r15 and spi5r06 handy).

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

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

* RE: Some constants I don't understand in sym2
  2004-09-20 20:25 Some constants I don't understand in sym2 Matthew Wilcox
@ 2004-09-20 21:12 ` Tony Battersby
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Battersby @ 2004-09-20 21:12 UTC (permalink / raw)
  To: 'Matthew Wilcox', linux-scsi

> Was there ever a TERMINATED that was 0x20, or is this simply a
mistake?

SCSI-2 defines "COMMAND TERMINATED" status as 0x22.  This status value
is special because the target is supposed to have sense data available
after returning COMMAND TERMINATED status (just like after returning
CHECK CONDITION).  The sym2 driver requests sense data after seeing a
status of S_TERMINATED or S_CHECK_COND, so this looks like a typo.  The
correct value is 0x22.

> Other symbolic tags I haven't found Linux names for yet include:
>
>  #define        M_ABORT_TAG     (0x0d)
>  #define        M_CLEAR_QUEUE   (0x0e)
> -#define        M_INIT_REC      (0x0f)
> -#define        M_REL_REC       (0x10)
> +#define        M_INIT_REC      INITIATE_RECOVERY
> +#define        M_REL_REC       RELEASE_RECOVERY
>  #define        M_TERMINATE     (0x11)
>  #define        M_IGN_RESIDUE   (0x23)
>  #define        M_IDENTIFY      (0x80)
>
> Again, history lesson / pointers to specs appreciated (I have sam3r09,
> spc3r15 and spi5r06 handy).

These are SCSI-2 names for various SPI messages.  SCSI-3 gave them
different names but kept the same meanings.  Do a reverse lookup on the
message code in the SPI spec to get the new names:

ABORT TAG -> ABORT TASK
CLEAR QUEUE -> CLEAR TASK SET
TERMINATE TASK -> defined in SPI2 but not in SPI3 and above
IGNORE WIDE RESIDUE (same)
IDENTIFY (actually a bitmask - any message with the high bit set is
IDENTIFY)

As always, SCSI-related specs can be downloaded from www.t10.org

Anthony J. Battersby
Cybernetics


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

end of thread, other threads:[~2004-09-20 21:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-20 20:25 Some constants I don't understand in sym2 Matthew Wilcox
2004-09-20 21:12 ` Tony Battersby

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