Commit 7a635ea9 authored by Andrzej Zaborowski's avatar Andrzej Zaborowski Committed by David S. Miller

net/usb: Ethernet quirks for the LG-VL600 4G modem

This adds a driver for the CDC Ethernet part of this modem.  The
device's ID is blacklisted in cdc_ether.c and is white-listed in
this new driver because of the quirks needed to make it useful.
The modem's firmware exposes a CDC ACM port for modem control and a
CDC Ethernet port for network data.  The descriptors look fine but
both ports actually are some sort of multiplexers requiring non-
standard headers added/removed from every packet or they get
ignored.  All information is based on a usb traffic log from a
Windows machine.

On the Verizon 4G network I've seen speeds up to 1.1MB/s so far with
this driver, a speed-o-meter site reports 16.2Mbps/10.5Mbps.
Userspace scripts are required to talk to the CDC ACM port.
Signed-off-by: default avatarAndrzej Zaborowski <balrogg@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d005a09e
...@@ -433,4 +433,19 @@ config USB_SIERRA_NET ...@@ -433,4 +433,19 @@ config USB_SIERRA_NET
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called sierra_net. module will be called sierra_net.
config USB_VL600
tristate "LG VL600 modem dongle"
depends on USB_NET_CDCETHER
select USB_ACM
help
Select this if you want to use an LG Electronics 4G/LTE usb modem
called VL600. This driver only handles the ethernet
interface exposed by the modem firmware. To establish a connection
you will first need a userspace program that sends the right
command to the modem through its CDC ACM port, and most
likely also a DHCP client. See this thread about using the
4G modem from Verizon:
http://ubuntuforums.org/showpost.php?p=10589647&postcount=17
endmenu endmenu
...@@ -27,4 +27,5 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o ...@@ -27,4 +27,5 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o
obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o
obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o
obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o
obj-$(CONFIG_USB_VL600) += lg-vl600.o
...@@ -378,7 +378,7 @@ static void dumpspeed(struct usbnet *dev, __le32 *speeds) ...@@ -378,7 +378,7 @@ static void dumpspeed(struct usbnet *dev, __le32 *speeds)
__le32_to_cpu(speeds[1]) / 1000); __le32_to_cpu(speeds[1]) / 1000);
} }
static void cdc_status(struct usbnet *dev, struct urb *urb) void usbnet_cdc_status(struct usbnet *dev, struct urb *urb)
{ {
struct usb_cdc_notification *event; struct usb_cdc_notification *event;
...@@ -418,8 +418,9 @@ static void cdc_status(struct usbnet *dev, struct urb *urb) ...@@ -418,8 +418,9 @@ static void cdc_status(struct usbnet *dev, struct urb *urb)
break; break;
} }
} }
EXPORT_SYMBOL_GPL(usbnet_cdc_status);
static int cdc_bind(struct usbnet *dev, struct usb_interface *intf) int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
{ {
int status; int status;
struct cdc_state *info = (void *) &dev->data; struct cdc_state *info = (void *) &dev->data;
...@@ -441,6 +442,7 @@ static int cdc_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -441,6 +442,7 @@ static int cdc_bind(struct usbnet *dev, struct usb_interface *intf)
*/ */
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(usbnet_cdc_bind);
static int cdc_manage_power(struct usbnet *dev, int on) static int cdc_manage_power(struct usbnet *dev, int on)
{ {
...@@ -452,18 +454,18 @@ static const struct driver_info cdc_info = { ...@@ -452,18 +454,18 @@ static const struct driver_info cdc_info = {
.description = "CDC Ethernet Device", .description = "CDC Ethernet Device",
.flags = FLAG_ETHER, .flags = FLAG_ETHER,
// .check_connect = cdc_check_connect, // .check_connect = cdc_check_connect,
.bind = cdc_bind, .bind = usbnet_cdc_bind,
.unbind = usbnet_cdc_unbind, .unbind = usbnet_cdc_unbind,
.status = cdc_status, .status = usbnet_cdc_status,
.manage_power = cdc_manage_power, .manage_power = cdc_manage_power,
}; };
static const struct driver_info mbm_info = { static const struct driver_info mbm_info = {
.description = "Mobile Broadband Network Device", .description = "Mobile Broadband Network Device",
.flags = FLAG_WWAN, .flags = FLAG_WWAN,
.bind = cdc_bind, .bind = usbnet_cdc_bind,
.unbind = usbnet_cdc_unbind, .unbind = usbnet_cdc_unbind,
.status = cdc_status, .status = usbnet_cdc_status,
.manage_power = cdc_manage_power, .manage_power = cdc_manage_power,
}; };
...@@ -560,6 +562,13 @@ static const struct usb_device_id products [] = { ...@@ -560,6 +562,13 @@ static const struct usb_device_id products [] = {
.driver_info = 0, .driver_info = 0,
}, },
/* LG Electronics VL600 wants additional headers on every frame */
{
USB_DEVICE_AND_INTERFACE_INFO(0x1004, 0x61aa, USB_CLASS_COMM,
USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
.driver_info = 0,
},
/* /*
* WHITELIST!!! * WHITELIST!!!
* *
......
This diff is collapsed.
...@@ -387,8 +387,12 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) ...@@ -387,8 +387,12 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) static inline void rx_process (struct usbnet *dev, struct sk_buff *skb)
{ {
if (dev->driver_info->rx_fixup && if (dev->driver_info->rx_fixup &&
!dev->driver_info->rx_fixup (dev, skb)) !dev->driver_info->rx_fixup (dev, skb)) {
goto error; /* With RX_ASSEMBLE, rx_fixup() must update counters */
if (!(dev->driver_info->flags & FLAG_RX_ASSEMBLE))
dev->net->stats.rx_errors++;
goto done;
}
// else network stack removes extra byte if we forced a short packet // else network stack removes extra byte if we forced a short packet
if (skb->len) { if (skb->len) {
...@@ -401,8 +405,8 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) ...@@ -401,8 +405,8 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb)
} }
netif_dbg(dev, rx_err, dev->net, "drop\n"); netif_dbg(dev, rx_err, dev->net, "drop\n");
error:
dev->net->stats.rx_errors++; dev->net->stats.rx_errors++;
done:
skb_queue_tail(&dev->done, skb); skb_queue_tail(&dev->done, skb);
} }
......
...@@ -102,6 +102,7 @@ struct driver_info { ...@@ -102,6 +102,7 @@ struct driver_info {
* Affects statistic (counters) and short packet handling. * Affects statistic (counters) and short packet handling.
*/ */
#define FLAG_MULTI_PACKET 0x1000 #define FLAG_MULTI_PACKET 0x1000
#define FLAG_RX_ASSEMBLE 0x2000 /* rx packets may span >1 frames */
/* init device ... can sleep, or cause probe() failure */ /* init device ... can sleep, or cause probe() failure */
int (*bind)(struct usbnet *, struct usb_interface *); int (*bind)(struct usbnet *, struct usb_interface *);
...@@ -172,7 +173,9 @@ struct cdc_state { ...@@ -172,7 +173,9 @@ struct cdc_state {
}; };
extern int usbnet_generic_cdc_bind(struct usbnet *, struct usb_interface *); extern int usbnet_generic_cdc_bind(struct usbnet *, struct usb_interface *);
extern int usbnet_cdc_bind(struct usbnet *, struct usb_interface *);
extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *); extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *);
extern void usbnet_cdc_status(struct usbnet *, struct urb *);
/* CDC and RNDIS support the same host-chosen packet filters for IN transfers */ /* CDC and RNDIS support the same host-chosen packet filters for IN transfers */
#define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment