public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Sachin Sant <sachinp@in.ibm.com>
To: linux-scsi@vger.kernel.org
Subject: [Patch]Status_byte() in drivers/scsi/scsi.h
Date: Fri, 20 Jun 2003 14:10:09 +0530	[thread overview]
Message-ID: <3EF2C869.F794F1A6@in.ibm.com> (raw)
In-Reply-To: 3EF17DFC.8030700@torque.net


According to Dougs comments , here is the patch to include new macros
for SAM status codes . Patch is in drivers/scsi/scsi.h

--- scsi.h	2003-06-19 14:26:54.000000000 +0530
+++ scsi.h.new	2003-06-20 13:54:46.000000000 +0530
@@ -95,6 +95,13 @@
  *      host_byte   = set by low-level driver to indicate status.
  *      driver_byte = set by mid-level.
  */
+
+/* 
+ * Define a new macro sam_status_value for the status codes
+ * defined for new SCSI Architecture Model SAM 
+ */
+#define sam_status_value(scmd_result) ((scmd_result) & 0x7e)
+
 #define status_byte(result) (((result) >> 1) & 0x1f)
 #define msg_byte(result)    (((result) >> 8) & 0xff)

Any comments are welcome.

Thanks
-Sachin 
-----------------------------------------------------------------------------------

Douglas Gilbert wrote:
> Sachin,
> The status_byte() macro is for SCSI-2 and earlier and
> matches a Linux-specific set of defines that are
> shifted from the "standard" values (e.g. CHECK_CONDITION).
> In those days bit 6 was not in use.
> 
> We are still arguing about the exact form of the macro
> to use that matches the SAM_STAT_ defines show above.
> In the meantime you could use:
>    #define sam_status_value(scmd_result) ((scmd_result) & 0x7e)
> and compare the result with the SAM_STAT_ defines above.
> 
> Doug Gilbert
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2003-06-20  8:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-19  8:47 Status_byte() in drivers/scsi/scsi.h Sachin Sant
2003-06-19  9:10 ` Douglas Gilbert
2003-06-20  8:40   ` Sachin Sant [this message]
2003-06-20 12:37     ` [Patch]Status_byte() " James Bottomley
2003-06-20 13:52       ` Douglas Gilbert
2003-06-20 14:39         ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EF2C869.F794F1A6@in.ibm.com \
    --to=sachinp@in.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox