summaryrefslogtreecommitdiffstats
path: root/utils/scsi/rbscsi.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2018-11-30 15:14:30 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2018-11-30 15:37:10 +0100
commite01248efcd622211c0451e6dc4ed47cc4b758cfa (patch)
treeba0d979d82579f67b75b074e38eeaf34b3599cfe /utils/scsi/rbscsi.h
parent43654371591feab23ce0a52af42bb88de0abfbca (diff)
downloadrockbox-e01248efcd622211c0451e6dc4ed47cc4b758cfa.tar.gz
rockbox-e01248efcd622211c0451e6dc4ed47cc4b758cfa.tar.bz2
rockbox-e01248efcd622211c0451e6dc4ed47cc4b758cfa.zip
rbscsi: add experimental API to list connected SCSI devices
For now it is only implemented on linux using /sys scanning Change-Id: Ifdfe7564e6e8d0307ae6ddc53e49bb9aaf5a8268
Diffstat (limited to 'utils/scsi/rbscsi.h')
-rw-r--r--utils/scsi/rbscsi.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/utils/scsi/rbscsi.h b/utils/scsi/rbscsi.h
index c7345a6cdf..322d94ec53 100644
--- a/utils/scsi/rbscsi.h
+++ b/utils/scsi/rbscsi.h
@@ -89,6 +89,31 @@ void rb_scsi_decode_sense(rb_scsi_device_t dev, void *sense, int sense_len);
/* close a device */
void rb_scsi_close(rb_scsi_device_t dev);
+/* SCSI device reported by rb_scsi_list() */
+struct rb_scsi_devent_t
+{
+ /* device path to the raw SCSI device, typically:
+ * - Linux: /dev/sgX
+ * - Windows: TODO
+ * This path can be used directly with scsi_rb_open(), and is guaranteed to
+ * be valid. */
+ char *scsi_path;
+ /* device path to the corresponding block device, if it exists, typically:
+ * - Linux: /dev/sdX
+ * - Windows: TODO
+ * If this path is not-NULL, then it can used directly with scsi_rb_open() */
+ char *block_path;
+ /* various information about the device, can be NULL on error */
+ char *vendor;
+ char *model;
+ char *rev;
+};
+/* try to list all SCSI devices, returns a list of devices or NULL on error
+ * the list is terminated by an entry with scsi_path=NULL */
+struct rb_scsi_devent_t *rb_scsi_list(void);
+/* free the list returned by rb_scsi_list */
+void rb_scsi_free_list(struct rb_scsi_devent_t *list);
+
#ifdef __cplusplus
}
#endif