summaryrefslogtreecommitdiffstats
path: root/utils/imxtools/scsitools/stmp_scsi.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-01-03 23:06:53 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2017-01-07 15:52:33 +0100
commit0fd869423ab3456288fcd323cff3206f37363153 (patch)
tree715e7a6047b90426d1c661b04f4b226792f9b8f8 /utils/imxtools/scsitools/stmp_scsi.h
parentae84354b4062e4c4ceb3ce402468d6c095a760c2 (diff)
downloadrockbox-0fd869423ab3456288fcd323cff3206f37363153.tar.gz
rockbox-0fd869423ab3456288fcd323cff3206f37363153.tar.bz2
rockbox-0fd869423ab3456288fcd323cff3206f37363153.zip
imxtools/scsitools: use new SCSI library
The function names and prototypes are also normalized so make subsequent reworks easier. Change-Id: Ifa5d64aa144b11f8c087517ddc904744e3037361
Diffstat (limited to 'utils/imxtools/scsitools/stmp_scsi.h')
-rw-r--r--utils/imxtools/scsitools/stmp_scsi.h43
1 files changed, 31 insertions, 12 deletions
diff --git a/utils/imxtools/scsitools/stmp_scsi.h b/utils/imxtools/scsitools/stmp_scsi.h
index f46bdb14b3..1a035cc649 100644
--- a/utils/imxtools/scsitools/stmp_scsi.h
+++ b/utils/imxtools/scsitools/stmp_scsi.h
@@ -22,6 +22,12 @@
#define __STMP_SCSI__
#include <stdint.h>
+#include <stdbool.h>
+#include "rbscsi.h"
+
+/**
+ * Low-Level SCSI stuff
+ */
#define SCSI_STMP_READ 0xc0
#define SCSI_STMP_WRITE 0xc1
@@ -83,18 +89,21 @@ struct scsi_stmp_logical_table_t
uint16_t count; /* big-endian */
} __attribute__((packed));
-#define SCSI_STMP_MEDIA_INFO_NR_DRIVES 0
-#define SCSI_STMP_MEDIA_INFO_SIZE 1 /* in bytes */
-#define SCSI_STMP_MEDIA_INFO_ALLOC_UNIT_SIZE 2 /* in bytes */
-#define SCSI_STMP_MEDIA_INFO_IS_INITIALISED 3
-#define SCSI_STMP_MEDIA_INFO_STATE 4
-#define SCSI_STMP_MEDIA_INFO_IS_WRITE_PROTECTED 5
-#define SCSI_STMP_MEDIA_INFO_TYPE 6
-#define SCSI_STMP_MEDIA_INFO_SERIAL_NUMBER_SIZE 7 /* in bytes */
-#define SCSI_STMP_MEDIA_INFO_SERIAL_NUMBER 8
-#define SCSI_STMP_MEDIA_INFO_IS_SYSTEM_MEDIA 9
-#define SCSI_STMP_MEDIA_INFO_IS_MEDIA_PRESENT 10
-#define SCSI_STMP_MEDIA_INFO_VENDOR 12
+#define SCSI_STMP_MEDIA_INFO_NR_DRIVES 0 /** Number of drives (obsolete) */
+#define SCSI_STMP_MEDIA_INFO_SIZE 1 /** Total size (bytes) */
+#define SCSI_STMP_MEDIA_INFO_ALLOC_UNIT_SIZE 2 /** Allocation unit size (bytes) */
+#define SCSI_STMP_MEDIA_INFO_IS_INITIALISED 3 /** Is initialised ? */
+#define SCSI_STMP_MEDIA_INFO_STATE 4 /** Media state */
+#define SCSI_STMP_MEDIA_INFO_IS_WRITE_PROTECTED 5 /** Is write protected ? */
+#define SCSI_STMP_MEDIA_INFO_TYPE 6 /** Physical media type */
+#define SCSI_STMP_MEDIA_INFO_SERIAL_NUMBER_SIZE 7 /** Serial number size (bytes) */
+#define SCSI_STMP_MEDIA_INFO_SERIAL_NUMBER 8 /** Serial number */
+#define SCSI_STMP_MEDIA_INFO_IS_SYSTEM_MEDIA 9 /** Is system media ? */
+#define SCSI_STMP_MEDIA_INFO_IS_MEDIA_PRESENT 10 /** Is media present ? */
+#define SCSI_STMP_MEDIA_INFO_PAGE_SIZE 11 /** Page size (bytes) */
+#define SCSI_STMP_MEDIA_INFO_VENDOR 12 /** Vendor ID */
+#define SCSI_STMP_MEDIA_INFO_NAND_ID 13 /** Full NAND ID */
+#define SCSI_STMP_MEDIA_INFO_NR_DEVICES 14 /** Number of physical devices */
#define SCSI_STMP_MEDIA_STATE_UNKNOWN 0
#define SCSI_STMP_MEDIA_STATE_ERASED 1
@@ -178,4 +187,14 @@ struct scsi_stmp_logical_drive_info_type_t
uint8_t type;
} __attribute__((packed));
+typedef struct stmp_device_t *stmp_device_t;
+
+typedef void (*stmp_printf_t)(void *user, const char *fmt, ...);
+
+/* open flags */
+#define STMP_DEBUG (1 << 0)
+/* scsi flags */
+#define STMP_READ (1 << 1)
+#define STMP_WRITE (1 << 2)
+
#endif /* __STMP_SCSI__ */