summaryrefslogtreecommitdiffstats
path: root/firmware/export
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-09-19 11:44:38 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-10-16 15:58:43 -0400
commitec164c389c99d8129f9d6cacda2731bde9b08257 (patch)
tree224a2f675de8e6ce82f179b38cbe44326db30ddd /firmware/export
parent71cc1e78fd81818428cbd1b55fcf096979b529ef (diff)
downloadrockbox-ec164c389c99d8129f9d6cacda2731bde9b08257.tar.gz
rockbox-ec164c389c99d8129f9d6cacda2731bde9b08257.zip
usb: introduce new control request API
Change-Id: I6545d8985ab683c026f28f6a7c0e23b40d0a6506
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/usb_core.h4
-rw-r--r--firmware/export/usb_drv.h8
2 files changed, 11 insertions, 1 deletions
diff --git a/firmware/export/usb_core.h b/firmware/export/usb_core.h
index 78a80435e1..fe1f7459cf 100644
--- a/firmware/export/usb_core.h
+++ b/firmware/export/usb_core.h
@@ -51,7 +51,9 @@ struct usb_class_driver;
void usb_core_init(void);
void usb_core_exit(void);
-void usb_core_control_request(struct usb_ctrlrequest* req);
+void usb_core_control_request(struct usb_ctrlrequest* req, void* data);
+void usb_core_control_complete(int status);
+void usb_core_legacy_control_request(struct usb_ctrlrequest* req);
void usb_core_transfer_complete(int endpoint,int dir,int status,int length);
void usb_core_bus_reset(void);
bool usb_core_any_exclusive_storage(void);
diff --git a/firmware/export/usb_drv.h b/firmware/export/usb_drv.h
index 01535c2786..3ef4db3c9c 100644
--- a/firmware/export/usb_drv.h
+++ b/firmware/export/usb_drv.h
@@ -56,6 +56,12 @@
* -> usb_drv_int_enable(false) [ditto]
* -> soc specific controller/clock deinit */
+enum usb_control_response {
+ USB_CONTROL_ACK,
+ USB_CONTROL_STALL,
+ USB_CONTROL_RECEIVE,
+};
+
/* one-time initialisation of the USB driver */
void usb_drv_startup(void);
void usb_drv_int_enable(bool enable); /* Target implemented */
@@ -69,6 +75,8 @@ bool usb_drv_stalled(int endpoint,bool in);
int usb_drv_send(int endpoint, void* ptr, int length);
int usb_drv_send_nonblocking(int endpoint, void* ptr, int length);
int usb_drv_recv_nonblocking(int endpoint, void* ptr, int length);
+void usb_drv_control_response(enum usb_control_response resp,
+ void* data, int length);
void usb_drv_set_address(int address);
void usb_drv_reset_endpoint(int endpoint, bool send);
bool usb_drv_powered(void);