summaryrefslogtreecommitdiff
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.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);
89/* close a device */ 89/* close a device */
90void rb_scsi_close(rb_scsi_device_t dev); 90void rb_scsi_close(rb_scsi_device_t dev);
91 91
92/* SCSI device reported by rb_scsi_list() */
93struct rb_scsi_devent_t
94{
95 /* device path to the raw SCSI device, typically:
96 * - Linux: /dev/sgX
97 * - Windows: TODO
98 * This path can be used directly with scsi_rb_open(), and is guaranteed to
99 * be valid. */
100 char *scsi_path;
101 /* device path to the corresponding block device, if it exists, typically:
102 * - Linux: /dev/sdX
103 * - Windows: TODO
104 * If this path is not-NULL, then it can used directly with scsi_rb_open() */
105 char *block_path;
106 /* various information about the device, can be NULL on error */
107 char *vendor;
108 char *model;
109 char *rev;
110};
111/* try to list all SCSI devices, returns a list of devices or NULL on error
112 * the list is terminated by an entry with scsi_path=NULL */
113struct rb_scsi_devent_t *rb_scsi_list(void);
114/* free the list returned by rb_scsi_list */
115void rb_scsi_free_list(struct rb_scsi_devent_t *list);
116
92#ifdef __cplusplus 117#ifdef __cplusplus
93} 118}
94#endif 119#endif