summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/lib/hwstub.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-05-25 16:06:31 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2014-09-07 17:45:10 +0200
commit12ce7fc2cce5531723ea7d141df80142891989d7 (patch)
treedc4e3320f8ed0932265b3c917448a83f7dcecafe /utils/hwstub/lib/hwstub.h
parent1dc1a9310e8a078a633dd90def13103f80e01ce7 (diff)
downloadrockbox-12ce7fc2cce5531723ea7d141df80142891989d7.tar.gz
rockbox-12ce7fc2cce5531723ea7d141df80142891989d7.tar.bz2
rockbox-12ce7fc2cce5531723ea7d141df80142891989d7.zip
hwstub: remove protocol to make it use its own interface
This way, hwstub can be implemented along with other usb features/interfaces. Change-Id: I7148cab845049cc0a8b8e740fa0d52d3a385eaed
Diffstat (limited to 'utils/hwstub/lib/hwstub.h')
-rw-r--r--utils/hwstub/lib/hwstub.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/hwstub/lib/hwstub.h b/utils/hwstub/lib/hwstub.h
index 69fdc63988..1599f6508b 100644
--- a/utils/hwstub/lib/hwstub.h
+++ b/utils/hwstub/lib/hwstub.h
@@ -36,6 +36,12 @@ extern "C" {
struct hwstub_device_t;
+/* Returns hwstub interface, or -1 if none was found */
+int hwstub_probe(libusb_device *dev);
+/* Helper function which returns a list of all hwstub devices found. The caller
+ * must unref all of them when done, possibly using libusb_free_device_list().
+ * Return number of devices or <0 on error */
+ssize_t hwstub_get_device_list(libusb_context *ctx, libusb_device ***list);
/* Returns NULL on error */
struct hwstub_device_t *hwstub_open(libusb_device_handle *handle);
/* Returns 0 on success. Does *NOT* close the usb handle */
@@ -46,6 +52,8 @@ int hwstub_get_desc(struct hwstub_device_t *dev, uint16_t desc, void *info, size
/* Returns number of bytes filled */
int hwstub_get_log(struct hwstub_device_t *dev, void *buf, size_t sz);
/* Returns number of bytes written/read or <0 on error */
+int hwstub_read(struct hwstub_device_t *dev, uint32_t addr, void *buf, size_t sz);
+int hwstub_write(struct hwstub_device_t *dev, uint32_t addr, void *buf, size_t sz);
int hwstub_rw_mem(struct hwstub_device_t *dev, int read, uint32_t addr, void *buf, size_t sz);
/* Returns <0 on error */
int hwstub_call(struct hwstub_device_t *dev, uint32_t addr);