cdc_eem.c (0588000eac9ba4178cebade437da3b28e8fad48f) cdc_eem.c (a66fe1653f4e81c007a68ca975067432a42df05b)
1/*
2 * USB CDC EEM network interface driver
3 * Copyright (C) 2009 Oberthur Technologies
4 * by Omar Laazimani, Olivier Condemine
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 17 unchanged lines hidden (view full) ---

26#include <linux/ethtool.h>
27#include <linux/workqueue.h>
28#include <linux/mii.h>
29#include <linux/usb.h>
30#include <linux/crc32.h>
31#include <linux/usb/cdc.h>
32#include <linux/usb/usbnet.h>
33#include <linux/gfp.h>
1/*
2 * USB CDC EEM network interface driver
3 * Copyright (C) 2009 Oberthur Technologies
4 * by Omar Laazimani, Olivier Condemine
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 17 unchanged lines hidden (view full) ---

26#include <linux/ethtool.h>
27#include <linux/workqueue.h>
28#include <linux/mii.h>
29#include <linux/usb.h>
30#include <linux/crc32.h>
31#include <linux/usb/cdc.h>
32#include <linux/usb/usbnet.h>
33#include <linux/gfp.h>
34#include <linux/if_vlan.h>
34
35
36/*
37 * This driver is an implementation of the CDC "Ethernet Emulation
38 * Model" (EEM) specification, which encapsulates Ethernet frames
39 * for transport over USB using a simpler USB device model than the
40 * previous CDC "Ethernet Control Model" (ECM, or "CDC Ethernet").
41 *

--- 45 unchanged lines hidden (view full) ---

87 if (status < 0) {
88 usb_set_intfdata(intf, NULL);
89 usb_driver_release_interface(driver_of(intf), intf);
90 return status;
91 }
92
93 /* no jumbogram (16K) support for now */
94
35
36
37/*
38 * This driver is an implementation of the CDC "Ethernet Emulation
39 * Model" (EEM) specification, which encapsulates Ethernet frames
40 * for transport over USB using a simpler USB device model than the
41 * previous CDC "Ethernet Control Model" (ECM, or "CDC Ethernet").
42 *

--- 45 unchanged lines hidden (view full) ---

88 if (status < 0) {
89 usb_set_intfdata(intf, NULL);
90 usb_driver_release_interface(driver_of(intf), intf);
91 return status;
92 }
93
94 /* no jumbogram (16K) support for now */
95
95 dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN;
96 dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN + VLAN_HLEN;
96 dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
97
98 return 0;
99}
100
101/*
102 * EEM permits packing multiple Ethernet frames into USB transfers
103 * (a "bundle"), but for TX we don't try to do that.

--- 279 unchanged lines hidden ---
97 dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
98
99 return 0;
100}
101
102/*
103 * EEM permits packing multiple Ethernet frames into USB transfers
104 * (a "bundle"), but for TX we don't try to do that.

--- 279 unchanged lines hidden ---