summaryrefslogtreecommitdiff
path: root/include/scsi.h
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-06-22 10:26:17 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-25 09:31:03 +0200
commit57313f83e83e1fac87c1a9088175f12ebd3577a0 (patch)
tree482524b18f1763b804cc039fd433420f85ce2264 /include/scsi.h
parenta62e5d2f3350bffb7be52397066f9900e1908348 (diff)
downloadbarebox-57313f83e83e1fac87c1a9088175f12ebd3577a0.tar.gz
usbgadget: add support for USB mass storage gadget
This driver is based on the f_mass_storage drivers in Linux v5.11 and U-Boot v2021.01. Unlike the U-Boot version, it runs asynchronously without blocking the bootloader from doing other tasks, like exporting other USB gadgets at the same time or enabling shell access. With pollers and workqueues, enabling this would need a large rework of the code to be completely callback based, whenever the original Linux code sleeps waiting for events. With the new bthread support, we can actually sleep and handover control to other bthreads until there is actual work to do. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/scsi.h')
-rw-r--r--include/scsi.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/scsi.h b/include/scsi.h
index f84513b813..23fc7abbaf 100644
--- a/include/scsi.h
+++ b/include/scsi.h
@@ -109,12 +109,15 @@
#define SCSI_MED_REMOVL 0x1E /* Prevent/Allow medium Removal (O) */
#define SCSI_READ6 0x08 /* Read 6-byte (MANDATORY) */
#define SCSI_READ10 0x28 /* Read 10-byte (MANDATORY) */
+#define SCSI_READ12 0xA8 /* Read 12-byte (O) */
#define SCSI_READ16 0x88 /* Read 16-byte (O) */
#define SCSI_RD_CAPAC 0x25 /* Read Capacity (MANDATORY) */
+#define SCSI_RD_FMT_CAPAC 0x23
#define SCSI_RD_DEFECT 0x37 /* Read Defect Data (O) */
#define SCSI_READ_LONG 0x3E /* Read Long (O) */
#define SCSI_REASS_BLK 0x07 /* Reassign Blocks (O) */
#define SCSI_RCV_DIAG 0x1C /* Receive Diagnostic Results (O) */
+#define SCSI_RESERVE 0x16
#define SCSI_RELEASE 0x17 /* Release Unit (MANDATORY) */
#define SCSI_REZERO 0x01 /* Rezero Unit (O) */
#define SCSI_SRCH_DAT_E 0x31 /* Search Data Equal (O) */
@@ -129,10 +132,13 @@
#define SCSI_VERIFY 0x2F /* Verify (O) */
#define SCSI_WRITE6 0x0A /* Write 6-Byte (MANDATORY) */
#define SCSI_WRITE10 0x2A /* Write 10-Byte (MANDATORY) */
+#define SCSI_WRITE12 0xAA /* Write 12-Byte (O) */
#define SCSI_WRITE16 0x8A /* Write 16-Byte (O) */
#define SCSI_WRT_VERIFY 0x2E /* Write and Verify (O) */
#define SCSI_WRITE_LONG 0x3F /* Write Long (O) */
#define SCSI_WRITE_SAME 0x41 /* Write Same (O) */
+#define SCSI_RD_TOC 0x43
+#define SCSI_RD_HEADER 0x44
#define SERVICE_ACTION_IN_16 0x9e
/* values for service action in */
@@ -170,4 +176,10 @@ void scsi_init(void);
#define FALSE 0
#endif
+/*
+ * DEVICE TYPES
+ */
+
+#define TYPE_DISK 0x00
+
#endif /* _SCSI_H */