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

Commit 397ff16b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: MBIM: Add support for MBIM over DWC3 controller"

parents ef766ce4 7c589653
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -1324,6 +1324,16 @@ static int mbim_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
				pr_info("Set mbim port out_desc = 0x%p",
					mbim->bam_port.out->desc);

				if (mbim->xport == USB_GADGET_XPORT_BAM2BAM_IPA
					&& gadget_is_dwc3(cdev->gadget)) {
					if (msm_ep_config(mbim->bam_port.in) ||
					   msm_ep_config(mbim->bam_port.out)) {
						pr_err("%s: ep_config failed\n",
							__func__);
						goto fail;
					}
				}

				pr_debug("Activate mbim\n");
				mbim_bam_connect(mbim);

@@ -1370,6 +1380,7 @@ static int mbim_get_alt(struct usb_function *f, unsigned intf)
static void mbim_disable(struct usb_function *f)
{
	struct f_mbim	*mbim = func_to_mbim(f);
	struct usb_composite_dev *cdev = mbim->cdev;

	pr_info("SET DEVICE OFFLINE");
	atomic_set(&mbim->online, 0);
@@ -1379,6 +1390,12 @@ static void mbim_disable(struct usb_function *f)
	mbim_clear_queues(mbim);
	mbim_reset_function_queue(mbim);

	if (mbim->xport == USB_GADGET_XPORT_BAM2BAM_IPA &&
			gadget_is_dwc3(cdev->gadget)) {
		msm_ep_unconfig(mbim->bam_port.out);
		msm_ep_unconfig(mbim->bam_port.in);
	}

	mbim_bam_disconnect(mbim);

	if (mbim->not_port.notify->driver_data) {
+4 −10
Original line number Diff line number Diff line
@@ -295,9 +295,7 @@ static void bam2bam_data_connect_work(struct work_struct *w)
				__func__, ret);
			return;
		}
		if ((d->func_type == USB_FUNC_RNDIS ||
			d->func_type == USB_FUNC_ECM) &&
			gadget_is_dwc3(gadget)) {
		if (gadget_is_dwc3(gadget)) {
			u8 idx;

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

			idx = usb_bam_get_connection_idx(gadget->name,
@@ -424,8 +420,7 @@ 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 || d->func_type == USB_FUNC_ECM)
		&& gadget_is_dwc3(gadget)) {
	if (gadget_is_dwc3(gadget)) {
		sps_params = MSM_SPS_MODE | MSM_DISABLE_WB | MSM_PRODUCER |
			d->src_pipe_idx;
		d->rx_req->length = 32*1024;
@@ -443,8 +438,7 @@ 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 || d->func_type == USB_FUNC_ECM)
		&& gadget_is_dwc3(gadget)) {
	if (gadget_is_dwc3(gadget)) {
		sps_params = MSM_SPS_MODE | MSM_DISABLE_WB | d->dst_pipe_idx;
		d->tx_req->length = 32*1024;
	} else