diff mbox series

[11/15] sandbox: scsi: Move structs to header file

Message ID 20220827151513.736395-12-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show
Series scsi: Convert sandbox SCSI to driver model | expand

Commit Message

Simon Glass Aug. 27, 2022, 3:15 p.m. UTC
Move these to the SCSI header file so we can access them from multiple
emulators.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/usb/emul/sandbox_flash.c | 26 --------------------------
 include/scsi.h                   | 26 ++++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 26 deletions(-)

Comments

Heinrich Schuchardt Aug. 29, 2022, 2:51 p.m. UTC | #1
On 8/27/22 17:15, Simon Glass wrote:
> Move these to the SCSI header file so we can access them from multiple
> emulators.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>   drivers/usb/emul/sandbox_flash.c | 26 --------------------------
>   include/scsi.h                   | 26 ++++++++++++++++++++++++++
>   2 files changed, 26 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/usb/emul/sandbox_flash.c b/drivers/usb/emul/sandbox_flash.c
> index 7b9a99c1a38..2059fc7fe42 100644
> --- a/drivers/usb/emul/sandbox_flash.c
> +++ b/drivers/usb/emul/sandbox_flash.c
> @@ -57,32 +57,6 @@ struct sandbox_flash_plat {
>   	struct usb_string flash_strings[STRINGID_COUNT];
>   };
>
> -struct scsi_inquiry_resp {
> -	u8 type;
> -	u8 flags;
> -	u8 version;
> -	u8 data_format;
> -	u8 additional_len;
> -	u8 spare[3];
> -	char vendor[8];
> -	char product[16];
> -	char revision[4];
> -};
> -
> -struct scsi_read_capacity_resp {
> -	u32 last_block_addr;
> -	u32 block_len;
> -};
> -
> -struct __packed scsi_read10_req {
> -	u8 cmd;
> -	u8 lun_flags;
> -	u32 lba;
> -	u8 spare;
> -	u16 xfer_len;
> -	u8 spare2[3];
> -};
> -
>   static struct usb_device_descriptor flash_device_desc = {
>   	.bLength =		sizeof(flash_device_desc),
>   	.bDescriptorType =	USB_DT_DEVICE,
> diff --git a/include/scsi.h b/include/scsi.h
> index 5d63963bed0..d8f0d9c7dcd 100644
> --- a/include/scsi.h
> +++ b/include/scsi.h
> @@ -173,6 +173,32 @@ enum scsi_cmd_phase {
>   	SCSIPH_STATUS,
>   };
>
> +struct scsi_inquiry_resp {

Where is the (Sphinx style) description?

Best regards

Heinrich


> +	u8 type;
> +	u8 flags;
> +	u8 version;
> +	u8 data_format;
> +	u8 additional_len;
> +	u8 spare[3];
> +	char vendor[8];
> +	char product[16];
> +	char revision[4];
> +};
> +
> +struct scsi_read_capacity_resp {
> +	u32 last_block_addr;
> +	u32 block_len;
> +};
> +
> +struct __packed scsi_read10_req {
> +	u8 cmd;
> +	u8 lun_flags;
> +	u32 lba;
> +	u8 spare;
> +	u16 xfer_len;
> +	u8 spare2[3];
> +};
> +
>   /**
>    * struct scsi_plat - stores information about SCSI controller
>    *
diff mbox series

Patch

diff --git a/drivers/usb/emul/sandbox_flash.c b/drivers/usb/emul/sandbox_flash.c
index 7b9a99c1a38..2059fc7fe42 100644
--- a/drivers/usb/emul/sandbox_flash.c
+++ b/drivers/usb/emul/sandbox_flash.c
@@ -57,32 +57,6 @@  struct sandbox_flash_plat {
 	struct usb_string flash_strings[STRINGID_COUNT];
 };
 
-struct scsi_inquiry_resp {
-	u8 type;
-	u8 flags;
-	u8 version;
-	u8 data_format;
-	u8 additional_len;
-	u8 spare[3];
-	char vendor[8];
-	char product[16];
-	char revision[4];
-};
-
-struct scsi_read_capacity_resp {
-	u32 last_block_addr;
-	u32 block_len;
-};
-
-struct __packed scsi_read10_req {
-	u8 cmd;
-	u8 lun_flags;
-	u32 lba;
-	u8 spare;
-	u16 xfer_len;
-	u8 spare2[3];
-};
-
 static struct usb_device_descriptor flash_device_desc = {
 	.bLength =		sizeof(flash_device_desc),
 	.bDescriptorType =	USB_DT_DEVICE,
diff --git a/include/scsi.h b/include/scsi.h
index 5d63963bed0..d8f0d9c7dcd 100644
--- a/include/scsi.h
+++ b/include/scsi.h
@@ -173,6 +173,32 @@  enum scsi_cmd_phase {
 	SCSIPH_STATUS,
 };
 
+struct scsi_inquiry_resp {
+	u8 type;
+	u8 flags;
+	u8 version;
+	u8 data_format;
+	u8 additional_len;
+	u8 spare[3];
+	char vendor[8];
+	char product[16];
+	char revision[4];
+};
+
+struct scsi_read_capacity_resp {
+	u32 last_block_addr;
+	u32 block_len;
+};
+
+struct __packed scsi_read10_req {
+	u8 cmd;
+	u8 lun_flags;
+	u32 lba;
+	u8 spare;
+	u16 xfer_len;
+	u8 spare2[3];
+};
+
 /**
  * struct scsi_plat - stores information about SCSI controller
  *