Skip to content

Commit 7e176dc

Browse files
TomServo3000gregkh
authored andcommitted
usb: wusbcore: implement hwahc_op_get_frame_number
This patch adds an implementation for hwahc_op_get_frame_number. The request is fulfulled by forwarding it to the lower hcd. This was done because the GET_TIME request on the HWA requires sending an URB to the HWA and waiting for the results which cannot be done in atomic context. Signed-off-by: Thomas Pugliese <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 33186c4 commit 7e176dc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/usb/host/hwa-hc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,14 @@ static int hwahc_op_get_frame_number(struct usb_hcd *usb_hcd)
199199
{
200200
struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd);
201201
struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc);
202+
struct wahc *wa = &hwahc->wa;
202203

203-
dev_err(wusbhc->dev, "%s (%p [%p]) UNIMPLEMENTED\n", __func__,
204-
usb_hcd, hwahc);
205-
return -ENOSYS;
204+
/*
205+
* We cannot query the HWA for the WUSB time since that requires sending
206+
* a synchronous URB and this function can be called in_interrupt.
207+
* Instead, query the USB frame number for our parent and use that.
208+
*/
209+
return usb_get_current_frame_number(wa->usb_dev);
206210
}
207211

208212
static int hwahc_op_urb_enqueue(struct usb_hcd *usb_hcd, struct urb *urb,

0 commit comments

Comments
 (0)