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

Commit 326f421a authored by Maya Erez's avatar Maya Erez
Browse files

usb: gadget: ECM: Add support for ECM over DWC3 controller



ECM is a USB tethering interface that is using HW accelerated
path via BAM2BAM.

This change adds the required support to enable the BAM2BAM
path for ECM also on DWC3 new USB controller.

Change-Id: Iad12e534ae05a6ef46fabf89ce71601b7ea67ecf
Signed-off-by: default avatarBar Weiner <bweiner@codeaurora.org>
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
parent a6bf0f28
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -608,6 +608,16 @@ static int ecm_qc_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
					return PTR_ERR(net);
			}

			if (ecm->xport == USB_GADGET_XPORT_BAM2BAM_IPA &&
			    gadget_is_dwc3(cdev->gadget)) {
				if (msm_ep_config(ecm->port.in_ep) ||
				    msm_ep_config(ecm->port.out_ep)) {
					pr_err("%s: ep_config failed\n",
						__func__);
					goto fail;
				}
			}

			if (ecm_qc_bam_connect(ecm))
				goto fail;
		}
+10 −4
Original line number Diff line number Diff line
@@ -264,7 +264,9 @@ static void bam2bam_data_connect_work(struct work_struct *w)
				__func__, ret);
			return;
		}
		if (d->func_type == USB_FUNC_RNDIS && gadget_is_dwc3(gadget)) {
		if ((d->func_type == USB_FUNC_RNDIS ||
			d->func_type == USB_FUNC_ECM) &&
			gadget_is_dwc3(gadget)) {
			u8 idx;
			struct usb_bam_data_connect_info bam_info;

@@ -301,7 +303,9 @@ static void bam2bam_data_connect_work(struct work_struct *w)
				__func__, ret);
			return;
		}
		if (d->func_type == USB_FUNC_RNDIS && gadget_is_dwc3(gadget)) {
		if ((d->func_type == USB_FUNC_RNDIS ||
			d->func_type == USB_FUNC_ECM)
			&& gadget_is_dwc3(gadget)) {
			u8 idx;
			struct usb_bam_data_connect_info bam_info;

@@ -403,7 +407,8 @@ static void bam2bam_data_connect_work(struct work_struct *w)
	d->rx_req->length = 0;
	d->rx_req->no_interrupt = 1;

	if (d->func_type == USB_FUNC_RNDIS && gadget_is_dwc3(gadget)) {
	if ((d->func_type == USB_FUNC_RNDIS || d->func_type == USB_FUNC_ECM)
		&& gadget_is_dwc3(gadget)) {
		sps_params = MSM_SPS_MODE | MSM_DISABLE_WB | MSM_PRODUCER |
			d->src_pipe_idx;
		d->rx_req->length = 32*1024;
@@ -421,7 +426,8 @@ static void bam2bam_data_connect_work(struct work_struct *w)
	d->tx_req->length = 0;
	d->tx_req->no_interrupt = 1;

	if (d->func_type == USB_FUNC_RNDIS && gadget_is_dwc3(gadget)) {
	if ((d->func_type == USB_FUNC_RNDIS || d->func_type == USB_FUNC_ECM)
		&& gadget_is_dwc3(gadget)) {
		sps_params = MSM_SPS_MODE | MSM_DISABLE_WB | d->dst_pipe_idx;
		d->tx_req->length = 32*1024;
	} else