masked_status

The Linux SCSI Generic (sg) HOWTO
Prev | Chapter 6. The sg_io_hdr_t structure in detail | Next

# 6.15. masked_status

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:

- GOOD [0x00]

- CHECK_CONDITION [0x01]

- CONDITION_GOOD [0x02]

- BUSY 0x04

- INTERMEDIATE_GOOD 0x08

- INTERMEDIATE_C_GOOD 0x0a

- RESERVATION_CONFLICT 0x0c

- COMMAND_TERMINATED 0x11

- QUEUE_FULL 0x14

N.B. 1 bit offset from usual SCSI status values

Note that SCSI 3 defines some additional status codes. [1] The type of masked_status is unsigned char .

### Notes

[1] | 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.

Prev | Home | Next
status | Up | msg_status