hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/include/scsi/scsi.h
....@@ -88,6 +88,21 @@
8888 return (lun & 0xff00) == SCSI_W_LUN_BASE;
8989 }
9090
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
+}
91106
92107 /*
93108 * MESSAGE CODES
....@@ -273,11 +288,5 @@
273288
274289 /* Used to obtain the PCI location of a device */
275290 #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
-}
282291
283292 #endif /* _SCSI_SCSI_H */