<HTML ><HEAD ><TITLE >masked_status</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ "><LINK REL="HOME" TITLE="The Linux SCSI Generic (sg) HOWTO" HREF="index.html"><LINK REL="UP" TITLE="The sg_io_hdr_t structure in detail" HREF="sg_io_hdr_t.html"><LINK REL="PREVIOUS" TITLE="status" HREF="x255.html"><LINK REL="NEXT" TITLE="msg_status" HREF="x285.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >The Linux SCSI Generic (sg) HOWTO</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="x255.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 6. The sg_io_hdr_t structure in detail</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="x285.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="AEN260">6.15. masked_status</H1 ><P > Logically: masked_status == ((status & 0x3e) >> 1) . So 'masked_status' strips the vendor information bits off 'status' and then shifts it right one position. This makes it easier to do things like "if (CHECK_CONDITION == masked_status) ..." using the definitions in <scsi/scsi.h>. The defined values in this file are: <P ></P ><UL ><LI ><P > GOOD [0x00]</P ></LI ><LI ><P > CHECK_CONDITION [0x01]</P ></LI ><LI ><P > CONDITION_GOOD [0x02]</P ></LI ><LI ><P > BUSY 0x04</P ></LI ><LI ><P > INTERMEDIATE_GOOD 0x08</P ></LI ><LI ><P > INTERMEDIATE_C_GOOD 0x0a</P ></LI ><LI ><P > RESERVATION_CONFLICT 0x0c</P ></LI ><LI ><P > COMMAND_TERMINATED 0x11</P ></LI ><LI ><P > QUEUE_FULL 0x14</P ></LI ></UL > N.B. 1 bit offset from usual SCSI status values</P ><P > Note that SCSI 3 defines some additional status codes. <A NAME="AEN283" HREF="#FTN.AEN283" >[1]</A > The type of masked_status is unsigned char .</P ></DIV ><H3 CLASS="FOOTNOTES" >Notes</H3 ><TABLE BORDER="0" CLASS="FOOTNOTES" WIDTH="100%" ><TR ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="5%" ><A NAME="FTN.AEN283" HREF="x260.html#AEN283" >[1]</A ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="95%" ><P >Some lower level drivers (e.g. ide-scsi) clear this masked_status field even when a CHECK_CONDITION or COMMAND_TERMINATED status has occurred. However they do set DRIVER_SENSE in driver_status field. Also a (sb_len_wr > 0) indicates there is a sense buffer.</P ></TD ></TR ></TABLE ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="x255.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="x285.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >status</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="sg_io_hdr_t.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >msg_status</TD ></TR ></TABLE ></DIV ></BODY ></HTML >