23 #include <linux/module.h>
25 #include <linux/netdevice.h>
26 #include <linux/ethtool.h>
28 #include <linux/mii.h>
65 if (!skb_cloned(skb)) {
66 int tailroom = skb_tailroom(skb);
67 if ((padlen + 4) <= tailroom)
80 *
skb_put (skb, 1) = (fcs>> 8) & 0xff;
81 *
skb_put (skb, 1) = (fcs>>16) & 0xff;
82 *
skb_put (skb, 1) = (fcs>>24) & 0xff;
92 dev->
net->hard_header_len += 6;
98 static int always_connected (
struct usbnet *dev)
103 static const struct driver_info zaurus_sl5x00_info = {
104 .description =
"Sharp Zaurus SL-5x00",
106 .check_connect = always_connected,
109 .tx_fixup = zaurus_tx_fixup,
111 #define ZAURUS_STRONGARM_INFO ((unsigned long)&zaurus_sl5x00_info)
113 static const struct driver_info zaurus_pxa_info = {
114 .description =
"Sharp Zaurus, PXA-2xx based",
116 .check_connect = always_connected,
119 .tx_fixup = zaurus_tx_fixup,
121 #define ZAURUS_PXA_INFO ((unsigned long)&zaurus_pxa_info)
123 static const struct driver_info olympus_mxl_info = {
124 .description =
"Olympus R1000",
126 .check_connect = always_connected,
129 .tx_fixup = zaurus_tx_fixup,
131 #define OLYMPUS_MXL_INFO ((unsigned long)&olympus_mxl_info)
141 static const u8 safe_guid[16] = {
142 0x5d, 0x34, 0xcf, 0x66, 0x11, 0x18, 0x11, 0xd6,
143 0xa2, 0x1a, 0x00, 0x01, 0x02, 0xca, 0x9a, 0x7f,
145 static const u8 blan_guid[16] = {
146 0x74, 0xf0, 0x3d, 0xbd, 0x1e, 0xc1, 0x44, 0x70,
147 0xa3, 0x67, 0x71, 0x34, 0xc9, 0xf5, 0x54, 0x37,
152 u8 *
buf = intf->cur_altsetting->extra;
153 int len = intf->cur_altsetting->extralen;
167 dev_dbg(&intf->dev,
"extra MDLM\n");
171 if (desc->
bLength !=
sizeof *desc) {
172 dev_dbg(&intf->dev,
"MDLM len %u\n",
180 dev_dbg(&intf->dev,
"MDLM guid\n");
186 dev_dbg(&intf->dev,
"extra MDLM detail\n");
189 detail = (
void *) buf;
192 if (detail->
bLength != (
sizeof *detail + 2))
196 if (detail->
bLength != (
sizeof *detail + 3))
222 "bad MDLM detail, %d %d %d\n",
230 dev->
net->hard_header_len += 6;
240 if (!desc || !detail) {
241 dev_dbg(&intf->dev,
"missing cdc mdlm %s%sdescriptor\n",
243 detail ?
"" :
"detail ");
255 dev_info(&dev->
udev->dev,
"unsupported MDLM descriptors\n");
259 static const struct driver_info bogus_mdlm_info = {
260 .description =
"pseudo-MDLM (BLAN) device",
262 .check_connect = always_connected,
263 .tx_fixup = zaurus_tx_fixup,
264 .bind = blan_mdlm_bind,
268 #define ZAURUS_MASTER_INTERFACE \
269 .bInterfaceClass = USB_CLASS_COMM, \
270 .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
271 .bInterfaceProtocol = USB_CDC_PROTO_NONE
275 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
276 | USB_DEVICE_ID_MATCH_DEVICE,
291 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
292 | USB_DEVICE_ID_MATCH_DEVICE,
298 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
299 | USB_DEVICE_ID_MATCH_DEVICE,
305 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
306 | USB_DEVICE_ID_MATCH_DEVICE,
312 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
313 | USB_DEVICE_ID_MATCH_DEVICE,
322 .driver_info = (
unsigned long) &bogus_mdlm_info,
324 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
325 | USB_DEVICE_ID_MATCH_DEVICE,
331 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
332 | USB_DEVICE_ID_MATCH_DEVICE,
343 .driver_info = (
unsigned long) &bogus_mdlm_info,
348 .driver_info = (
unsigned long) &bogus_mdlm_info,
355 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
356 | USB_DEVICE_ID_MATCH_DEVICE,
367 .driver_info = (
unsigned long) &bogus_mdlm_info,
373 static struct usb_driver zaurus_driver = {
375 .id_table = products,
380 .disable_hub_initiated_lpm = 1,