Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10a7254c authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru Committed by Hemant Kumar
Browse files

usb: f_gsi: Report Function Remote Wake capabilities



Add support for sending Function Wake capabilities in
response to GET_STATUS from the host. GET_STATUS addressed
to an Interface allows the device to report if it is capable
of doing a Function Remote Wake. Windows8/10 MBIM hosts request
this information before enabling Suspend in SS mode.

Change-Id: Ic0a6db57b2b46804a82847de511feb433a3dfca6
Signed-off-by: default avatarDevdutt Patnaik <dpatnaik@codeaurora.org>
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent 1ebab292
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ MODULE_PARM_DESC(enable_dwc3_u1u2, "Enable support for U1U2 low power modes");
static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep);
static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
		struct dwc3_ep *dep, struct dwc3_request *req);
static int dwc3_ep0_delegate_req(struct dwc3 *dwc,
		struct usb_ctrlrequest *ctrl);

static void dwc3_ep0_prepare_one_trb(struct dwc3_ep *dep,
		dma_addr_t buf_dma, u32 len, u32 type, bool chain)
@@ -322,12 +324,14 @@ static struct dwc3_ep *dwc3_wIndex_to_dep(struct dwc3 *dwc, __le16 wIndex_le)
static void dwc3_ep0_status_cmpl(struct usb_ep *ep, struct usb_request *req)
{
}

/*
 * ch 9.4.5
 */
static int dwc3_ep0_handle_status(struct dwc3 *dwc,
		struct usb_ctrlrequest *ctrl)
{
	int ret;
	struct dwc3_ep		*dep;
	u32			recip;
	u32			value;
@@ -367,7 +371,8 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc,
		 * Function Remote Wake Capable	D0
		 * Function Remote Wakeup	D1
		 */
		break;
		ret = dwc3_ep0_delegate_req(dwc, ctrl);
		return ret;

	case USB_RECIP_ENDPOINT:
		dep = dwc3_wIndex_to_dep(dwc, ctrl->wIndex);
@@ -524,6 +529,9 @@ static int dwc3_ep0_handle_intf(struct dwc3 *dwc,
		 * For now, we're not doing anything, just making sure we return
		 * 0 so USB Command Verifier tests pass without any errors.
		 */
		ret = dwc3_ep0_delegate_req(dwc, ctrl);
		if (ret)
			return ret;
		break;
	default:
		ret = -EINVAL;
+3 −0
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@
#define FUNC_SUSPEND_OPT_SUSP_MASK BIT(0)
#define FUNC_SUSPEND_OPT_RW_EN_MASK BIT(1)

#define FUNC_WAKEUP_CAPABLE_SHIFT  0
#define FUNC_WAKEUP_ENABLE_SHIFT   1

/*
 * USB function drivers should return USB_GADGET_DELAYED_STATUS if they
 * wish to delay the data/status stages of the control transfer till they