diff options
Diffstat (limited to 'drivers/net/usb/cdc_mbim.c')
-rw-r--r-- | drivers/net/usb/cdc_mbim.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c index bbde9884ab8a..8973abdec9f6 100644 --- a/drivers/net/usb/cdc_mbim.c +++ b/drivers/net/usb/cdc_mbim.c | |||
@@ -158,7 +158,7 @@ static int cdc_mbim_bind(struct usbnet *dev, struct usb_interface *intf) | |||
158 | if (!cdc_ncm_comm_intf_is_mbim(intf->cur_altsetting)) | 158 | if (!cdc_ncm_comm_intf_is_mbim(intf->cur_altsetting)) |
159 | goto err; | 159 | goto err; |
160 | 160 | ||
161 | ret = cdc_ncm_bind_common(dev, intf, data_altsetting, 0); | 161 | ret = cdc_ncm_bind_common(dev, intf, data_altsetting, dev->driver_info->data); |
162 | if (ret) | 162 | if (ret) |
163 | goto err; | 163 | goto err; |
164 | 164 | ||
@@ -582,6 +582,26 @@ static const struct driver_info cdc_mbim_info_zlp = { | |||
582 | .tx_fixup = cdc_mbim_tx_fixup, | 582 | .tx_fixup = cdc_mbim_tx_fixup, |
583 | }; | 583 | }; |
584 | 584 | ||
585 | /* The spefication explicitly allows NDPs to be placed anywhere in the | ||
586 | * frame, but some devices fail unless the NDP is placed after the IP | ||
587 | * packets. Using the CDC_NCM_FLAG_NDP_TO_END flags to force this | ||
588 | * behaviour. | ||
589 | * | ||
590 | * Note: The current implementation of this feature restricts each NTB | ||
591 | * to a single NDP, implying that multiplexed sessions cannot share an | ||
592 | * NTB. This might affect performace for multiplexed sessions. | ||
593 | */ | ||
594 | static const struct driver_info cdc_mbim_info_ndp_to_end = { | ||
595 | .description = "CDC MBIM", | ||
596 | .flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_WWAN, | ||
597 | .bind = cdc_mbim_bind, | ||
598 | .unbind = cdc_mbim_unbind, | ||
599 | .manage_power = cdc_mbim_manage_power, | ||
600 | .rx_fixup = cdc_mbim_rx_fixup, | ||
601 | .tx_fixup = cdc_mbim_tx_fixup, | ||
602 | .data = CDC_NCM_FLAG_NDP_TO_END, | ||
603 | }; | ||
604 | |||
585 | static const struct usb_device_id mbim_devs[] = { | 605 | static const struct usb_device_id mbim_devs[] = { |
586 | /* This duplicate NCM entry is intentional. MBIM devices can | 606 | /* This duplicate NCM entry is intentional. MBIM devices can |
587 | * be disguised as NCM by default, and this is necessary to | 607 | * be disguised as NCM by default, and this is necessary to |
@@ -597,6 +617,10 @@ static const struct usb_device_id mbim_devs[] = { | |||
597 | { USB_VENDOR_AND_INTERFACE_INFO(0x0bdb, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), | 617 | { USB_VENDOR_AND_INTERFACE_INFO(0x0bdb, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), |
598 | .driver_info = (unsigned long)&cdc_mbim_info, | 618 | .driver_info = (unsigned long)&cdc_mbim_info, |
599 | }, | 619 | }, |
620 | /* Huawei E3372 fails unless NDP comes after the IP packets */ | ||
621 | { USB_DEVICE_AND_INTERFACE_INFO(0x12d1, 0x157d, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), | ||
622 | .driver_info = (unsigned long)&cdc_mbim_info_ndp_to_end, | ||
623 | }, | ||
600 | /* default entry */ | 624 | /* default entry */ |
601 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), | 625 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), |
602 | .driver_info = (unsigned long)&cdc_mbim_info_zlp, | 626 | .driver_info = (unsigned long)&cdc_mbim_info_zlp, |