]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: core: target: Add INQUIRY-related constants to scsi_common.h
authorBart Van Assche <bvanassche@acm.org>
Fri, 15 May 2026 20:52:19 +0000 (13:52 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 23 May 2026 01:49:04 +0000 (21:49 -0400)
Move three constants from target/target_core_base.h into
scsi/scsi_common.h. Add three new constants in the scsi_common.h header
file. This patch prepares for using these constants in the SCSI core.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Brian Bunker <brian@purestorage.com>
Link: https://patch.msgid.link/20260515205222.1754621-2-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
include/scsi/scsi_common.h
include/target/target_core_base.h

index fb58715fac869b2b4cc8c01393fef7fc0137395c..00c8a16d3cd24bcd4f12a1807e55993ebf4977df 100644 (file)
 #include <uapi/linux/pr.h>
 #include <scsi/scsi_proto.h>
 
+/* From the standard INQUIRY data description in SPC-6. */
+#define INQUIRY_VENDOR_OFFSET  8
+#define INQUIRY_VENDOR_LEN     8
+#define INQUIRY_MODEL_OFFSET   16
+#define INQUIRY_MODEL_LEN      16
+#define INQUIRY_REVISION_OFFSET        32
+#define INQUIRY_REVISION_LEN   4
+
 enum scsi_pr_type {
        SCSI_PR_WRITE_EXCLUSIVE                 = 0x01,
        SCSI_PR_EXCLUSIVE_ACCESS                = 0x03,
index 9a0e9f9e1ec4478d8d32c27318a0230ff2c1a9a5..002b0fc57587659004d3b746608fc3ce7b4743ce 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/percpu-refcount.h>
 #include <linux/semaphore.h>     /* struct semaphore */
 #include <linux/completion.h>
+#include <scsi/scsi_common.h>
 
 #define TARGET_CORE_VERSION            "v5.0"
 
 /* Used by transport_get_inquiry_vpd_device_ident() */
 #define INQUIRY_VPD_DEVICE_IDENTIFIER_LEN      254
 
-#define INQUIRY_VENDOR_LEN                     8
-#define INQUIRY_MODEL_LEN                      16
-#define INQUIRY_REVISION_LEN                   4
-
 /* Attempts before moving from SHORT to LONG */
 #define PYX_TRANSPORT_WINDOW_CLOSED_THRESHOLD  3
 #define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_SHORT 3  /* In milliseconds */