diff options
Diffstat (limited to 'drivers/net/usb/cdc_ncm.c')
-rw-r--r-- | drivers/net/usb/cdc_ncm.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 71b6e92b8e9b..9197b2c72ca3 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c | |||
@@ -435,6 +435,13 @@ advance: | |||
435 | len -= temp; | 435 | len -= temp; |
436 | } | 436 | } |
437 | 437 | ||
438 | /* some buggy devices have an IAD but no CDC Union */ | ||
439 | if (!ctx->union_desc && intf->intf_assoc && intf->intf_assoc->bInterfaceCount == 2) { | ||
440 | ctx->control = intf; | ||
441 | ctx->data = usb_ifnum_to_if(dev->udev, intf->cur_altsetting->desc.bInterfaceNumber + 1); | ||
442 | dev_dbg(&intf->dev, "CDC Union missing - got slave from IAD\n"); | ||
443 | } | ||
444 | |||
438 | /* check if we got everything */ | 445 | /* check if we got everything */ |
439 | if ((ctx->control == NULL) || (ctx->data == NULL) || | 446 | if ((ctx->control == NULL) || (ctx->data == NULL) || |
440 | ((!ctx->mbim_desc) && ((ctx->ether_desc == NULL) || (ctx->control != intf)))) | 447 | ((!ctx->mbim_desc) && ((ctx->ether_desc == NULL) || (ctx->control != intf)))) |
@@ -497,7 +504,8 @@ advance: | |||
497 | error2: | 504 | error2: |
498 | usb_set_intfdata(ctx->control, NULL); | 505 | usb_set_intfdata(ctx->control, NULL); |
499 | usb_set_intfdata(ctx->data, NULL); | 506 | usb_set_intfdata(ctx->data, NULL); |
500 | usb_driver_release_interface(driver, ctx->data); | 507 | if (ctx->data != ctx->control) |
508 | usb_driver_release_interface(driver, ctx->data); | ||
501 | error: | 509 | error: |
502 | cdc_ncm_free((struct cdc_ncm_ctx *)dev->data[0]); | 510 | cdc_ncm_free((struct cdc_ncm_ctx *)dev->data[0]); |
503 | dev->data[0] = 0; | 511 | dev->data[0] = 0; |
@@ -1155,6 +1163,20 @@ static const struct driver_info wwan_info = { | |||
1155 | .tx_fixup = cdc_ncm_tx_fixup, | 1163 | .tx_fixup = cdc_ncm_tx_fixup, |
1156 | }; | 1164 | }; |
1157 | 1165 | ||
1166 | /* Same as wwan_info, but with FLAG_NOARP */ | ||
1167 | static const struct driver_info wwan_noarp_info = { | ||
1168 | .description = "Mobile Broadband Network Device (NO ARP)", | ||
1169 | .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET | ||
1170 | | FLAG_WWAN | FLAG_NOARP, | ||
1171 | .bind = cdc_ncm_bind, | ||
1172 | .unbind = cdc_ncm_unbind, | ||
1173 | .check_connect = cdc_ncm_check_connect, | ||
1174 | .manage_power = usbnet_manage_power, | ||
1175 | .status = cdc_ncm_status, | ||
1176 | .rx_fixup = cdc_ncm_rx_fixup, | ||
1177 | .tx_fixup = cdc_ncm_tx_fixup, | ||
1178 | }; | ||
1179 | |||
1158 | static const struct usb_device_id cdc_devs[] = { | 1180 | static const struct usb_device_id cdc_devs[] = { |
1159 | /* Ericsson MBM devices like F5521gw */ | 1181 | /* Ericsson MBM devices like F5521gw */ |
1160 | { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO | 1182 | { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO |
@@ -1194,6 +1216,13 @@ static const struct usb_device_id cdc_devs[] = { | |||
1194 | .driver_info = (unsigned long)&wwan_info, | 1216 | .driver_info = (unsigned long)&wwan_info, |
1195 | }, | 1217 | }, |
1196 | 1218 | ||
1219 | /* Infineon(now Intel) HSPA Modem platform */ | ||
1220 | { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, | ||
1221 | USB_CLASS_COMM, | ||
1222 | USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE), | ||
1223 | .driver_info = (unsigned long)&wwan_noarp_info, | ||
1224 | }, | ||
1225 | |||
1197 | /* Generic CDC-NCM devices */ | 1226 | /* Generic CDC-NCM devices */ |
1198 | { USB_INTERFACE_INFO(USB_CLASS_COMM, | 1227 | { USB_INTERFACE_INFO(USB_CLASS_COMM, |
1199 | USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE), | 1228 | USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE), |