.. | .. |
---|
88 | 88 | return (lun & 0xff00) == SCSI_W_LUN_BASE; |
---|
89 | 89 | } |
---|
90 | 90 | |
---|
| 91 | +/** |
---|
| 92 | + * scsi_status_is_check_condition - check the status return. |
---|
| 93 | + * |
---|
| 94 | + * @status: the status passed up from the driver (including host and |
---|
| 95 | + * driver components) |
---|
| 96 | + * |
---|
| 97 | + * This returns true if the status code is SAM_STAT_CHECK_CONDITION. |
---|
| 98 | + */ |
---|
| 99 | +static inline int scsi_status_is_check_condition(int status) |
---|
| 100 | +{ |
---|
| 101 | + if (status < 0) |
---|
| 102 | + return false; |
---|
| 103 | + status &= 0xfe; |
---|
| 104 | + return status == SAM_STAT_CHECK_CONDITION; |
---|
| 105 | +} |
---|
91 | 106 | |
---|
92 | 107 | /* |
---|
93 | 108 | * MESSAGE CODES |
---|
.. | .. |
---|
273 | 288 | |
---|
274 | 289 | /* Used to obtain the PCI location of a device */ |
---|
275 | 290 | #define SCSI_IOCTL_GET_PCI 0x5387 |
---|
276 | | - |
---|
277 | | -/* Pull a u32 out of a SCSI message (using BE SCSI conventions) */ |
---|
278 | | -static inline __u32 scsi_to_u32(__u8 *ptr) |
---|
279 | | -{ |
---|
280 | | - return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3]; |
---|
281 | | -} |
---|
282 | 291 | |
---|
283 | 292 | #endif /* _SCSI_SCSI_H */ |
---|