diff options
Diffstat (limited to 'payloads')
-rw-r--r-- | payloads/libpayload/drivers/usb/usb.c | 4 | ||||
-rw-r--r-- | payloads/libpayload/include/usb/usb.h | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c index accb228b95..b14abb4b35 100644 --- a/payloads/libpayload/drivers/usb/usb.c +++ b/payloads/libpayload/drivers/usb/usb.c @@ -86,6 +86,10 @@ usb_poll (void) { if (usb_hcs == 0) return; + + if (usb_poll_prepare) + usb_poll_prepare(); + hci_t *controller = usb_hcs; while (controller != NULL) { int i; diff --git a/payloads/libpayload/include/usb/usb.h b/payloads/libpayload/include/usb/usb.h index 8f3169ef09..f79fc27711 100644 --- a/payloads/libpayload/include/usb/usb.h +++ b/payloads/libpayload/include/usb/usb.h @@ -345,6 +345,13 @@ static inline void usb_debug(const char *fmt, ...) } /** + * To be implemented by libpayload-client. It's called by the USB + * stack just before iterating over known devices to poll them for + * status change. + */ +void __attribute__((weak)) usb_poll_prepare (void); + +/** * To be implemented by libpayload-client. It's called by the USB stack * when a new USB device is found which isn't claimed by a built in driver, * so the client has the chance to know about it. |