Skip to content

Commit 86d3402

Browse files
Prashanth Kjfvogel
authored andcommitted
usb: gadget: f_ecm: Add get_status callback
commit 8e38202 upstream. When host sends GET_STATUS to ECM interface, handle the request from the function driver. Since the interface is wakeup capable, set the corresponding bit, and set RW bit if the function is already armed for wakeup by the host. Cc: stable <[email protected]> Fixes: 481c225 ("usb: gadget: Handle function suspend feature selector") Signed-off-by: Prashanth K <[email protected]> Reviewed-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 75f23e49add86a2ede5214dd03f3e3976197a880) Signed-off-by: Jack Vogel <[email protected]>
1 parent 93556b0 commit 86d3402

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/usb/gadget/function/f_ecm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,12 @@ static void ecm_resume(struct usb_function *f)
892892
gether_resume(&ecm->port);
893893
}
894894

895+
static int ecm_get_status(struct usb_function *f)
896+
{
897+
return (f->func_wakeup_armed ? USB_INTRF_STAT_FUNC_RW : 0) |
898+
USB_INTRF_STAT_FUNC_RW_CAP;
899+
}
900+
895901
static void ecm_free(struct usb_function *f)
896902
{
897903
struct f_ecm *ecm;
@@ -960,6 +966,7 @@ static struct usb_function *ecm_alloc(struct usb_function_instance *fi)
960966
ecm->port.func.disable = ecm_disable;
961967
ecm->port.func.free_func = ecm_free;
962968
ecm->port.func.suspend = ecm_suspend;
969+
ecm->port.func.get_status = ecm_get_status;
963970
ecm->port.func.resume = ecm_resume;
964971

965972
return &ecm->port.func;

0 commit comments

Comments
 (0)