mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 00:24:12 +08:00
usbnet: Use wwan%d interface name for mobile broadband devices
Add support for usbnet based devices like CDC-Ether to indicate that they are actually mobile broadband devices. In that case use wwan%d as default interface name. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0bfbedb14a
commit
e1e499eef2
@ -420,6 +420,14 @@ static const struct driver_info cdc_info = {
|
||||
.status = cdc_status,
|
||||
};
|
||||
|
||||
static const struct driver_info mbm_info = {
|
||||
.description = "Mobile Broadband Network Device",
|
||||
.flags = FLAG_WWAN,
|
||||
.bind = cdc_bind,
|
||||
.unbind = usbnet_cdc_unbind,
|
||||
.status = cdc_status,
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -532,32 +540,32 @@ static const struct usb_device_id products [] = {
|
||||
/* Ericsson F3507g */
|
||||
USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1900, USB_CLASS_COMM,
|
||||
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
|
||||
.driver_info = (unsigned long) &cdc_info,
|
||||
.driver_info = (unsigned long) &mbm_info,
|
||||
}, {
|
||||
/* Ericsson F3507g ver. 2 */
|
||||
USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1902, USB_CLASS_COMM,
|
||||
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
|
||||
.driver_info = (unsigned long) &cdc_info,
|
||||
.driver_info = (unsigned long) &mbm_info,
|
||||
}, {
|
||||
/* Ericsson F3607gw */
|
||||
USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1904, USB_CLASS_COMM,
|
||||
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
|
||||
.driver_info = (unsigned long) &cdc_info,
|
||||
.driver_info = (unsigned long) &mbm_info,
|
||||
}, {
|
||||
/* Ericsson F3307 */
|
||||
USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1906, USB_CLASS_COMM,
|
||||
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
|
||||
.driver_info = (unsigned long) &cdc_info,
|
||||
.driver_info = (unsigned long) &mbm_info,
|
||||
}, {
|
||||
/* Toshiba F3507g */
|
||||
USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130b, USB_CLASS_COMM,
|
||||
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
|
||||
.driver_info = (unsigned long) &cdc_info,
|
||||
.driver_info = (unsigned long) &mbm_info,
|
||||
}, {
|
||||
/* Dell F3507g */
|
||||
USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8147, USB_CLASS_COMM,
|
||||
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
|
||||
.driver_info = (unsigned long) &cdc_info,
|
||||
.driver_info = (unsigned long) &mbm_info,
|
||||
},
|
||||
{ }, // END
|
||||
};
|
||||
|
@ -1295,6 +1295,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
|
||||
/* WLAN devices should always be named "wlan%d" */
|
||||
if ((dev->driver_info->flags & FLAG_WLAN) != 0)
|
||||
strcpy(net->name, "wlan%d");
|
||||
/* WWAN devices should always be named "wwan%d" */
|
||||
if ((dev->driver_info->flags & FLAG_WWAN) != 0)
|
||||
strcpy(net->name, "wwan%d");
|
||||
|
||||
/* maybe the remote can't receive an Ethernet MTU */
|
||||
if (net->mtu > (dev->hard_mtu - net->hard_header_len))
|
||||
|
@ -90,6 +90,7 @@ struct driver_info {
|
||||
#define FLAG_WLAN 0x0080 /* use "wlan%d" names */
|
||||
#define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */
|
||||
#define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */
|
||||
#define FLAG_WWAN 0x0400 /* use "wwan%d" names */
|
||||
|
||||
|
||||
/* init device ... can sleep, or cause probe() failure */
|
||||
|
Loading…
Reference in New Issue
Block a user