diff options
author | BH Hsieh <bhsieh@nvidia.com> | 2012-01-18 13:10:14 +0800 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2012-01-20 13:44:11 -0800 |
commit | aab7c14c8814cd1a8f56ff61cd1eb8811e691073 (patch) | |
tree | dcf45b775e6179c7588a37d56d37e7fabad2e871 | |
parent | 06bc7bef9dcf7f11d370429ded0e0e9a6a47359b (diff) |
cdc_ncm: Modify NCM network interface.
Adding FLAG_RMNET to change ncm net device name
for Ericsson modem.
Bug 901367
Change-Id: I4a029cc10a02176035319ed4ac1e7b9af349cbd1
Reviewed-on: http://git-master/r/74912
Reviewed-by: WK Tsai <wtsai@nvidia.com>
Reviewed-by: Steve Lin <stlin@nvidia.com>
Signed-off-by: BH Hsieh <bhsieh@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/76459
Reviewed-by: Automatic_Commit_Validation_User
-rw-r--r-- | drivers/net/usb/cdc_ncm.c | 24 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 3 | ||||
-rw-r--r-- | include/linux/usb/usbnet.h | 3 |
3 files changed, 28 insertions, 2 deletions
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index f06fb78383a1..df82afdf62ce 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -137,11 +137,21 @@ struct cdc_ncm_ctx { static void cdc_ncm_tx_timeout(unsigned long arg); static const struct driver_info cdc_ncm_info; +static const struct driver_info cdc_mbm_info; static struct usb_driver cdc_ncm_driver; static struct ethtool_ops cdc_ncm_ethtool_ops; static const struct usb_device_id cdc_devs[] = { - { USB_INTERFACE_INFO(USB_CLASS_COMM, + { + /* Ericsson f5521gw */ + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO + | USB_DEVICE_ID_MATCH_DEVICE, + USB_DEVICE(0x0BDB,0x190D), + .driver_info = (unsigned long)&cdc_mbm_info, + }, + { + /* Standard NCM class device */ + USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE), .driver_info = (unsigned long)&cdc_ncm_info, }, @@ -1211,6 +1221,18 @@ static const struct driver_info cdc_ncm_info = { .tx_fixup = cdc_ncm_tx_fixup, }; +static const struct driver_info cdc_mbm_info = { + .description = "CDC NCM", + .flags = FLAG_RMNET | FLAG_NO_SETINT | FLAG_MULTI_PACKET, + .bind = cdc_ncm_bind, + .unbind = cdc_ncm_unbind, + .check_connect = cdc_ncm_check_connect, + .manage_power = cdc_ncm_manage_power, + .status = cdc_ncm_status, + .rx_fixup = cdc_ncm_rx_fixup, + .tx_fixup = cdc_ncm_tx_fixup, +}; + static struct usb_driver cdc_ncm_driver = { .name = "cdc_ncm", .id_table = cdc_devs, diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index ce395fe5de26..82965e20e076 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1394,6 +1394,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) /* WWAN devices should always be named "wwan%d" */ if ((dev->driver_info->flags & FLAG_WWAN) != 0) strcpy(net->name, "wwan%d"); + /* RMNET devices should always be named "rmnet%d" */ + if ((dev->driver_info->flags & FLAG_RMNET) != 0) + strcpy(net->name, "rmnet%d"); /* maybe the remote can't receive an Ethernet MTU */ if (net->mtu > (dev->hard_mtu - net->hard_header_len)) diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 605b0aa8d852..a4d4163953d8 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h @@ -98,7 +98,8 @@ struct driver_info { #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ -#define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */ +#define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */ +#define FLAG_RMNET 0x2000 /* use "rmnet%d" names */ /* * Indicates to usbnet, that USB driver accumulates multiple IP packets. |