21 #include <linux/module.h>
23 #include <linux/netdevice.h>
25 #include <linux/ctype.h>
26 #include <linux/ethtool.h>
28 #include <linux/mii.h>
34 #include <linux/if_vlan.h>
55 static void eem_linkcmd_complete(
struct urb *
urb)
57 dev_kfree_skb(urb->context);
70 usb_fill_bulk_urb(urb, dev->
udev, dev->
out,
71 skb->
data, skb->
len, eem_linkcmd_complete, skb);
78 netdev_warn(dev->
net,
"link cmd failure\n");
89 usb_set_intfdata(intf,
NULL);
123 if (!skb_cloned(skb)) {
124 int headroom = skb_headroom(skb);
125 int tailroom = skb_tailroom(skb);
131 if ((headroom + tailroom)
137 skb_set_tail_pointer(skb, len);
162 put_unaligned_le16(
BIT(14) | len,
skb_push(skb, 2));
166 put_unaligned_le16(0,
skb_put(skb, 2));
171 static int eem_rx_fixup(
struct usbnet *dev,
struct sk_buff *skb)
198 header = get_unaligned_le16(skb->
data);
207 if (header &
BIT(15)) {
217 if (header &
BIT(14)) {
223 bmEEMCmd = (header >> 11) & 0x7;
228 len = header & 0x7FF;
238 put_unaligned_le16(
BIT(15) | (1 << 11) | len,
240 eem_linkcmd(dev, skb2);
266 netdev_warn(dev->
net,
267 "unexpected link command %d\n",
286 len = header & 0x3FFF;
303 is_last = (len == skb->
len);
318 if (header &
BIT(14)) {
334 dev->
net->stats.rx_errors++;
348 .description =
"CDC EEM Device",
351 .rx_fixup = eem_rx_fixup,
352 .tx_fixup = eem_tx_fixup,
361 .driver_info = (
unsigned long) &eem_info,
369 static struct usb_driver eem_driver = {
371 .id_table = products,
376 .disable_hub_initiated_lpm = 1,