aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/cdc_ether.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/cdc_ether.c')
-rw-r--r--drivers/net/usb/cdc_ether.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index b3fe0de40469..c924ea2bce07 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -99,9 +99,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
99 */ 99 */
100 buf = dev->udev->actconfig->extra; 100 buf = dev->udev->actconfig->extra;
101 len = dev->udev->actconfig->extralen; 101 len = dev->udev->actconfig->extralen;
102 if (len) 102 dev_dbg(&intf->dev, "CDC descriptors on config\n");
103 dev_dbg(&intf->dev,
104 "CDC descriptors on config\n");
105 } 103 }
106 104
107 /* Maybe CDC descriptors are after the endpoint? This bug has 105 /* Maybe CDC descriptors are after the endpoint? This bug has
@@ -380,7 +378,7 @@ static void dumpspeed(struct usbnet *dev, __le32 *speeds)
380 __le32_to_cpu(speeds[1]) / 1000); 378 __le32_to_cpu(speeds[1]) / 1000);
381} 379}
382 380
383static void cdc_status(struct usbnet *dev, struct urb *urb) 381void usbnet_cdc_status(struct usbnet *dev, struct urb *urb)
384{ 382{
385 struct usb_cdc_notification *event; 383 struct usb_cdc_notification *event;
386 384
@@ -420,8 +418,9 @@ static void cdc_status(struct usbnet *dev, struct urb *urb)
420 break; 418 break;
421 } 419 }
422} 420}
421EXPORT_SYMBOL_GPL(usbnet_cdc_status);
423 422
424static int cdc_bind(struct usbnet *dev, struct usb_interface *intf) 423int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
425{ 424{
426 int status; 425 int status;
427 struct cdc_state *info = (void *) &dev->data; 426 struct cdc_state *info = (void *) &dev->data;
@@ -443,6 +442,7 @@ static int cdc_bind(struct usbnet *dev, struct usb_interface *intf)
443 */ 442 */
444 return 0; 443 return 0;
445} 444}
445EXPORT_SYMBOL_GPL(usbnet_cdc_bind);
446 446
447static int cdc_manage_power(struct usbnet *dev, int on) 447static int cdc_manage_power(struct usbnet *dev, int on)
448{ 448{
@@ -452,25 +452,26 @@ static int cdc_manage_power(struct usbnet *dev, int on)
452 452
453static const struct driver_info cdc_info = { 453static const struct driver_info cdc_info = {
454 .description = "CDC Ethernet Device", 454 .description = "CDC Ethernet Device",
455 .flags = FLAG_ETHER, 455 .flags = FLAG_ETHER | FLAG_POINTTOPOINT,
456 // .check_connect = cdc_check_connect, 456 // .check_connect = cdc_check_connect,
457 .bind = cdc_bind, 457 .bind = usbnet_cdc_bind,
458 .unbind = usbnet_cdc_unbind, 458 .unbind = usbnet_cdc_unbind,
459 .status = cdc_status, 459 .status = usbnet_cdc_status,
460 .manage_power = cdc_manage_power, 460 .manage_power = cdc_manage_power,
461}; 461};
462 462
463static const struct driver_info mbm_info = { 463static const struct driver_info wwan_info = {
464 .description = "Mobile Broadband Network Device", 464 .description = "Mobile Broadband Network Device",
465 .flags = FLAG_WWAN, 465 .flags = FLAG_WWAN,
466 .bind = cdc_bind, 466 .bind = usbnet_cdc_bind,
467 .unbind = usbnet_cdc_unbind, 467 .unbind = usbnet_cdc_unbind,
468 .status = cdc_status, 468 .status = usbnet_cdc_status,
469 .manage_power = cdc_manage_power, 469 .manage_power = cdc_manage_power,
470}; 470};
471 471
472/*-------------------------------------------------------------------------*/ 472/*-------------------------------------------------------------------------*/
473 473
474#define HUAWEI_VENDOR_ID 0x12D1
474 475
475static const struct usb_device_id products [] = { 476static const struct usb_device_id products [] = {
476/* 477/*
@@ -562,6 +563,13 @@ static const struct usb_device_id products [] = {
562 .driver_info = 0, 563 .driver_info = 0,
563}, 564},
564 565
566/* LG Electronics VL600 wants additional headers on every frame */
567{
568 USB_DEVICE_AND_INTERFACE_INFO(0x1004, 0x61aa, USB_CLASS_COMM,
569 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
570 .driver_info = (unsigned long)&wwan_info,
571},
572
565/* 573/*
566 * WHITELIST!!! 574 * WHITELIST!!!
567 * 575 *
@@ -580,8 +588,17 @@ static const struct usb_device_id products [] = {
580}, { 588}, {
581 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM, 589 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
582 USB_CDC_PROTO_NONE), 590 USB_CDC_PROTO_NONE),
583 .driver_info = (unsigned long)&mbm_info, 591 .driver_info = (unsigned long)&wwan_info,
584 592
593}, {
594 /* Various Huawei modems with a network port like the UMG1831 */
595 .match_flags = USB_DEVICE_ID_MATCH_VENDOR
596 | USB_DEVICE_ID_MATCH_INT_INFO,
597 .idVendor = HUAWEI_VENDOR_ID,
598 .bInterfaceClass = USB_CLASS_COMM,
599 .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
600 .bInterfaceProtocol = 255,
601 .driver_info = (unsigned long)&wwan_info,
585}, 602},
586 { }, // END 603 { }, // END
587}; 604};