mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-18 14:28:33 +03:00
firmware: More common infrastructure for USB handling
Let's move low-level handling of endpoint queue refill from the individual apps into common/shared code. Now the main simply has to call usb_process() for every interface, and inbound messages will be dispatched to call-back functions from there. Change-Id: Ic6f9c6c1ffdbb0c9c3b284371ecc83b17e3be746
This commit is contained in:
@@ -42,5 +42,15 @@ int usb_drain_queue(uint8_t ep);
|
||||
void usb_buf_init(void);
|
||||
struct usb_buffered_ep *usb_get_buf_ep(uint8_t ep);
|
||||
|
||||
int usb_refill_to_host(uint8_t ep);
|
||||
int usb_refill_from_host(uint8_t ep);
|
||||
struct usb_if {
|
||||
uint8_t if_num; /* interface number */
|
||||
uint8_t ep_out; /* OUT endpoint (0 if none) */
|
||||
uint8_t ep_in; /* IN endpint (0 if none) */
|
||||
uint8_t ep_int; /* INT endpoint (0 if none) */
|
||||
void *data; /* opaque data, passed through */
|
||||
struct {
|
||||
/* call-back to be called for inclming messages on OUT EP */
|
||||
void (*rx_out)(struct msgb *msg, const struct usb_if *usb_if);
|
||||
} ops;
|
||||
};
|
||||
void usb_process(const struct usb_if *usb_if);
|
||||
|
||||
Reference in New Issue
Block a user