Commit 5ffbe4daa8104145cca4050d717d68b0b256df45
Committed by
David S. Miller
1 parent
9c06a2b582
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
usbnet: net1080: apply introduced usb command APIs
Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 30 additions and 80 deletions Inline Diff
drivers/net/usb/net1080.c
1 | /* | 1 | /* |
2 | * Net1080 based USB host-to-host cables | 2 | * Net1080 based USB host-to-host cables |
3 | * Copyright (C) 2000-2005 by David Brownell | 3 | * Copyright (C) 2000-2005 by David Brownell |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | 19 | ||
20 | // #define DEBUG // error path messages, extra info | 20 | // #define DEBUG // error path messages, extra info |
21 | // #define VERBOSE // more; success messages | 21 | // #define VERBOSE // more; success messages |
22 | 22 | ||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/netdevice.h> | 25 | #include <linux/netdevice.h> |
26 | #include <linux/etherdevice.h> | 26 | #include <linux/etherdevice.h> |
27 | #include <linux/ethtool.h> | 27 | #include <linux/ethtool.h> |
28 | #include <linux/workqueue.h> | 28 | #include <linux/workqueue.h> |
29 | #include <linux/mii.h> | 29 | #include <linux/mii.h> |
30 | #include <linux/usb.h> | 30 | #include <linux/usb.h> |
31 | #include <linux/usb/usbnet.h> | 31 | #include <linux/usb/usbnet.h> |
32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
33 | 33 | ||
34 | #include <asm/unaligned.h> | 34 | #include <asm/unaligned.h> |
35 | 35 | ||
36 | 36 | ||
37 | /* | 37 | /* |
38 | * Netchip 1080 driver ... http://www.netchip.com | 38 | * Netchip 1080 driver ... http://www.netchip.com |
39 | * (Sept 2004: End-of-life announcement has been sent.) | 39 | * (Sept 2004: End-of-life announcement has been sent.) |
40 | * Used in (some) LapLink cables | 40 | * Used in (some) LapLink cables |
41 | */ | 41 | */ |
42 | 42 | ||
43 | #define frame_errors data[1] | 43 | #define frame_errors data[1] |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * NetChip framing of ethernet packets, supporting additional error | 46 | * NetChip framing of ethernet packets, supporting additional error |
47 | * checks for links that may drop bulk packets from inside messages. | 47 | * checks for links that may drop bulk packets from inside messages. |
48 | * Odd USB length == always short read for last usb packet. | 48 | * Odd USB length == always short read for last usb packet. |
49 | * - nc_header | 49 | * - nc_header |
50 | * - Ethernet header (14 bytes) | 50 | * - Ethernet header (14 bytes) |
51 | * - payload | 51 | * - payload |
52 | * - (optional padding byte, if needed so length becomes odd) | 52 | * - (optional padding byte, if needed so length becomes odd) |
53 | * - nc_trailer | 53 | * - nc_trailer |
54 | * | 54 | * |
55 | * This framing is to be avoided for non-NetChip devices. | 55 | * This framing is to be avoided for non-NetChip devices. |
56 | */ | 56 | */ |
57 | 57 | ||
58 | struct nc_header { // packed: | 58 | struct nc_header { // packed: |
59 | __le16 hdr_len; // sizeof nc_header (LE, all) | 59 | __le16 hdr_len; // sizeof nc_header (LE, all) |
60 | __le16 packet_len; // payload size (including ethhdr) | 60 | __le16 packet_len; // payload size (including ethhdr) |
61 | __le16 packet_id; // detects dropped packets | 61 | __le16 packet_id; // detects dropped packets |
62 | #define MIN_HEADER 6 | 62 | #define MIN_HEADER 6 |
63 | 63 | ||
64 | // all else is optional, and must start with: | 64 | // all else is optional, and must start with: |
65 | // __le16 vendorId; // from usb-if | 65 | // __le16 vendorId; // from usb-if |
66 | // __le16 productId; | 66 | // __le16 productId; |
67 | } __packed; | 67 | } __packed; |
68 | 68 | ||
69 | #define PAD_BYTE ((unsigned char)0xAC) | 69 | #define PAD_BYTE ((unsigned char)0xAC) |
70 | 70 | ||
71 | struct nc_trailer { | 71 | struct nc_trailer { |
72 | __le16 packet_id; | 72 | __le16 packet_id; |
73 | } __packed; | 73 | } __packed; |
74 | 74 | ||
75 | // packets may use FLAG_FRAMING_NC and optional pad | 75 | // packets may use FLAG_FRAMING_NC and optional pad |
76 | #define FRAMED_SIZE(mtu) (sizeof (struct nc_header) \ | 76 | #define FRAMED_SIZE(mtu) (sizeof (struct nc_header) \ |
77 | + sizeof (struct ethhdr) \ | 77 | + sizeof (struct ethhdr) \ |
78 | + (mtu) \ | 78 | + (mtu) \ |
79 | + 1 \ | 79 | + 1 \ |
80 | + sizeof (struct nc_trailer)) | 80 | + sizeof (struct nc_trailer)) |
81 | 81 | ||
82 | #define MIN_FRAMED FRAMED_SIZE(0) | 82 | #define MIN_FRAMED FRAMED_SIZE(0) |
83 | 83 | ||
84 | /* packets _could_ be up to 64KB... */ | 84 | /* packets _could_ be up to 64KB... */ |
85 | #define NC_MAX_PACKET 32767 | 85 | #define NC_MAX_PACKET 32767 |
86 | 86 | ||
87 | 87 | ||
88 | /* | 88 | /* |
89 | * Zero means no timeout; else, how long a 64 byte bulk packet may be queued | 89 | * Zero means no timeout; else, how long a 64 byte bulk packet may be queued |
90 | * before the hardware drops it. If that's done, the driver will need to | 90 | * before the hardware drops it. If that's done, the driver will need to |
91 | * frame network packets to guard against the dropped USB packets. The win32 | 91 | * frame network packets to guard against the dropped USB packets. The win32 |
92 | * driver sets this for both sides of the link. | 92 | * driver sets this for both sides of the link. |
93 | */ | 93 | */ |
94 | #define NC_READ_TTL_MS ((u8)255) // ms | 94 | #define NC_READ_TTL_MS ((u8)255) // ms |
95 | 95 | ||
96 | /* | 96 | /* |
97 | * We ignore most registers and EEPROM contents. | 97 | * We ignore most registers and EEPROM contents. |
98 | */ | 98 | */ |
99 | #define REG_USBCTL ((u8)0x04) | 99 | #define REG_USBCTL ((u8)0x04) |
100 | #define REG_TTL ((u8)0x10) | 100 | #define REG_TTL ((u8)0x10) |
101 | #define REG_STATUS ((u8)0x11) | 101 | #define REG_STATUS ((u8)0x11) |
102 | 102 | ||
103 | /* | 103 | /* |
104 | * Vendor specific requests to read/write data | 104 | * Vendor specific requests to read/write data |
105 | */ | 105 | */ |
106 | #define REQUEST_REGISTER ((u8)0x10) | 106 | #define REQUEST_REGISTER ((u8)0x10) |
107 | #define REQUEST_EEPROM ((u8)0x11) | 107 | #define REQUEST_EEPROM ((u8)0x11) |
108 | 108 | ||
109 | static int | 109 | static int |
110 | nc_vendor_read(struct usbnet *dev, u8 req, u8 regnum, u16 *retval_ptr) | 110 | nc_vendor_read(struct usbnet *dev, u8 req, u8 regnum, u16 *retval_ptr) |
111 | { | 111 | { |
112 | int status = usb_control_msg(dev->udev, | 112 | int status = usbnet_read_cmd(dev, req, |
113 | usb_rcvctrlpipe(dev->udev, 0), | 113 | USB_DIR_IN | USB_TYPE_VENDOR | |
114 | req, | 114 | USB_RECIP_DEVICE, |
115 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 115 | 0, regnum, retval_ptr, |
116 | 0, regnum, | 116 | sizeof *retval_ptr); |
117 | retval_ptr, sizeof *retval_ptr, | ||
118 | USB_CTRL_GET_TIMEOUT); | ||
119 | if (status > 0) | 117 | if (status > 0) |
120 | status = 0; | 118 | status = 0; |
121 | if (!status) | 119 | if (!status) |
122 | le16_to_cpus(retval_ptr); | 120 | le16_to_cpus(retval_ptr); |
123 | return status; | 121 | return status; |
124 | } | 122 | } |
125 | 123 | ||
126 | static inline int | 124 | static inline int |
127 | nc_register_read(struct usbnet *dev, u8 regnum, u16 *retval_ptr) | 125 | nc_register_read(struct usbnet *dev, u8 regnum, u16 *retval_ptr) |
128 | { | 126 | { |
129 | return nc_vendor_read(dev, REQUEST_REGISTER, regnum, retval_ptr); | 127 | return nc_vendor_read(dev, REQUEST_REGISTER, regnum, retval_ptr); |
130 | } | 128 | } |
131 | 129 | ||
132 | // no retval ... can become async, usable in_interrupt() | 130 | // no retval ... can become async, usable in_interrupt() |
133 | static void | 131 | static void |
134 | nc_vendor_write(struct usbnet *dev, u8 req, u8 regnum, u16 value) | 132 | nc_vendor_write(struct usbnet *dev, u8 req, u8 regnum, u16 value) |
135 | { | 133 | { |
136 | usb_control_msg(dev->udev, | 134 | usbnet_write_cmd(dev, req, |
137 | usb_sndctrlpipe(dev->udev, 0), | 135 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
138 | req, | 136 | value, regnum, NULL, 0); |
139 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
140 | value, regnum, | ||
141 | NULL, 0, // data is in setup packet | ||
142 | USB_CTRL_SET_TIMEOUT); | ||
143 | } | 137 | } |
144 | 138 | ||
145 | static inline void | 139 | static inline void |
146 | nc_register_write(struct usbnet *dev, u8 regnum, u16 value) | 140 | nc_register_write(struct usbnet *dev, u8 regnum, u16 value) |
147 | { | 141 | { |
148 | nc_vendor_write(dev, REQUEST_REGISTER, regnum, value); | 142 | nc_vendor_write(dev, REQUEST_REGISTER, regnum, value); |
149 | } | 143 | } |
150 | 144 | ||
151 | 145 | ||
152 | #if 0 | 146 | #if 0 |
153 | static void nc_dump_registers(struct usbnet *dev) | 147 | static void nc_dump_registers(struct usbnet *dev) |
154 | { | 148 | { |
155 | u8 reg; | 149 | u8 reg; |
156 | u16 *vp = kmalloc(sizeof (u16)); | 150 | u16 *vp = kmalloc(sizeof (u16)); |
157 | 151 | ||
158 | if (!vp) | 152 | if (!vp) |
159 | return; | 153 | return; |
160 | 154 | ||
161 | netdev_dbg(dev->net, "registers:\n"); | 155 | netdev_dbg(dev->net, "registers:\n"); |
162 | for (reg = 0; reg < 0x20; reg++) { | 156 | for (reg = 0; reg < 0x20; reg++) { |
163 | int retval; | 157 | int retval; |
164 | 158 | ||
165 | // reading some registers is trouble | 159 | // reading some registers is trouble |
166 | if (reg >= 0x08 && reg <= 0xf) | 160 | if (reg >= 0x08 && reg <= 0xf) |
167 | continue; | 161 | continue; |
168 | if (reg >= 0x12 && reg <= 0x1e) | 162 | if (reg >= 0x12 && reg <= 0x1e) |
169 | continue; | 163 | continue; |
170 | 164 | ||
171 | retval = nc_register_read(dev, reg, vp); | 165 | retval = nc_register_read(dev, reg, vp); |
172 | if (retval < 0) | 166 | if (retval < 0) |
173 | netdev_dbg(dev->net, "reg [0x%x] ==> error %d\n", | 167 | netdev_dbg(dev->net, "reg [0x%x] ==> error %d\n", |
174 | reg, retval); | 168 | reg, retval); |
175 | else | 169 | else |
176 | netdev_dbg(dev->net, "reg [0x%x] = 0x%x\n", reg, *vp); | 170 | netdev_dbg(dev->net, "reg [0x%x] = 0x%x\n", reg, *vp); |
177 | } | 171 | } |
178 | kfree(vp); | 172 | kfree(vp); |
179 | } | 173 | } |
180 | #endif | 174 | #endif |
181 | 175 | ||
182 | 176 | ||
183 | /*-------------------------------------------------------------------------*/ | 177 | /*-------------------------------------------------------------------------*/ |
184 | 178 | ||
185 | /* | 179 | /* |
186 | * Control register | 180 | * Control register |
187 | */ | 181 | */ |
188 | 182 | ||
189 | #define USBCTL_WRITABLE_MASK 0x1f0f | 183 | #define USBCTL_WRITABLE_MASK 0x1f0f |
190 | // bits 15-13 reserved, r/o | 184 | // bits 15-13 reserved, r/o |
191 | #define USBCTL_ENABLE_LANG (1 << 12) | 185 | #define USBCTL_ENABLE_LANG (1 << 12) |
192 | #define USBCTL_ENABLE_MFGR (1 << 11) | 186 | #define USBCTL_ENABLE_MFGR (1 << 11) |
193 | #define USBCTL_ENABLE_PROD (1 << 10) | 187 | #define USBCTL_ENABLE_PROD (1 << 10) |
194 | #define USBCTL_ENABLE_SERIAL (1 << 9) | 188 | #define USBCTL_ENABLE_SERIAL (1 << 9) |
195 | #define USBCTL_ENABLE_DEFAULTS (1 << 8) | 189 | #define USBCTL_ENABLE_DEFAULTS (1 << 8) |
196 | // bits 7-4 reserved, r/o | 190 | // bits 7-4 reserved, r/o |
197 | #define USBCTL_FLUSH_OTHER (1 << 3) | 191 | #define USBCTL_FLUSH_OTHER (1 << 3) |
198 | #define USBCTL_FLUSH_THIS (1 << 2) | 192 | #define USBCTL_FLUSH_THIS (1 << 2) |
199 | #define USBCTL_DISCONN_OTHER (1 << 1) | 193 | #define USBCTL_DISCONN_OTHER (1 << 1) |
200 | #define USBCTL_DISCONN_THIS (1 << 0) | 194 | #define USBCTL_DISCONN_THIS (1 << 0) |
201 | 195 | ||
202 | static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl) | 196 | static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl) |
203 | { | 197 | { |
204 | netif_dbg(dev, link, dev->net, | 198 | netif_dbg(dev, link, dev->net, |
205 | "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s; this%s%s; other%s%s; r/o 0x%x\n", | 199 | "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s; this%s%s; other%s%s; r/o 0x%x\n", |
206 | dev->udev->bus->bus_name, dev->udev->devpath, | 200 | dev->udev->bus->bus_name, dev->udev->devpath, |
207 | usbctl, | 201 | usbctl, |
208 | (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "", | 202 | (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "", |
209 | (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "", | 203 | (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "", |
210 | (usbctl & USBCTL_ENABLE_PROD) ? " prod" : "", | 204 | (usbctl & USBCTL_ENABLE_PROD) ? " prod" : "", |
211 | (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "", | 205 | (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "", |
212 | (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "", | 206 | (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "", |
213 | 207 | ||
214 | (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "", | 208 | (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "", |
215 | (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "", | 209 | (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "", |
216 | 210 | ||
217 | (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "", | 211 | (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "", |
218 | (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "", | 212 | (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "", |
219 | 213 | ||
220 | usbctl & ~USBCTL_WRITABLE_MASK); | 214 | usbctl & ~USBCTL_WRITABLE_MASK); |
221 | } | 215 | } |
222 | 216 | ||
223 | /*-------------------------------------------------------------------------*/ | 217 | /*-------------------------------------------------------------------------*/ |
224 | 218 | ||
225 | /* | 219 | /* |
226 | * Status register | 220 | * Status register |
227 | */ | 221 | */ |
228 | 222 | ||
229 | #define STATUS_PORT_A (1 << 15) | 223 | #define STATUS_PORT_A (1 << 15) |
230 | 224 | ||
231 | #define STATUS_CONN_OTHER (1 << 14) | 225 | #define STATUS_CONN_OTHER (1 << 14) |
232 | #define STATUS_SUSPEND_OTHER (1 << 13) | 226 | #define STATUS_SUSPEND_OTHER (1 << 13) |
233 | #define STATUS_MAILBOX_OTHER (1 << 12) | 227 | #define STATUS_MAILBOX_OTHER (1 << 12) |
234 | #define STATUS_PACKETS_OTHER(n) (((n) >> 8) & 0x03) | 228 | #define STATUS_PACKETS_OTHER(n) (((n) >> 8) & 0x03) |
235 | 229 | ||
236 | #define STATUS_CONN_THIS (1 << 6) | 230 | #define STATUS_CONN_THIS (1 << 6) |
237 | #define STATUS_SUSPEND_THIS (1 << 5) | 231 | #define STATUS_SUSPEND_THIS (1 << 5) |
238 | #define STATUS_MAILBOX_THIS (1 << 4) | 232 | #define STATUS_MAILBOX_THIS (1 << 4) |
239 | #define STATUS_PACKETS_THIS(n) (((n) >> 0) & 0x03) | 233 | #define STATUS_PACKETS_THIS(n) (((n) >> 0) & 0x03) |
240 | 234 | ||
241 | #define STATUS_UNSPEC_MASK 0x0c8c | 235 | #define STATUS_UNSPEC_MASK 0x0c8c |
242 | #define STATUS_NOISE_MASK ((u16)~(0x0303|STATUS_UNSPEC_MASK)) | 236 | #define STATUS_NOISE_MASK ((u16)~(0x0303|STATUS_UNSPEC_MASK)) |
243 | 237 | ||
244 | 238 | ||
245 | static inline void nc_dump_status(struct usbnet *dev, u16 status) | 239 | static inline void nc_dump_status(struct usbnet *dev, u16 status) |
246 | { | 240 | { |
247 | netif_dbg(dev, link, dev->net, | 241 | netif_dbg(dev, link, dev->net, |
248 | "net1080 %s-%s status 0x%x: this (%c) PKT=%d%s%s%s; other PKT=%d%s%s%s; unspec 0x%x\n", | 242 | "net1080 %s-%s status 0x%x: this (%c) PKT=%d%s%s%s; other PKT=%d%s%s%s; unspec 0x%x\n", |
249 | dev->udev->bus->bus_name, dev->udev->devpath, | 243 | dev->udev->bus->bus_name, dev->udev->devpath, |
250 | status, | 244 | status, |
251 | 245 | ||
252 | // XXX the packet counts don't seem right | 246 | // XXX the packet counts don't seem right |
253 | // (1 at reset, not 0); maybe UNSPEC too | 247 | // (1 at reset, not 0); maybe UNSPEC too |
254 | 248 | ||
255 | (status & STATUS_PORT_A) ? 'A' : 'B', | 249 | (status & STATUS_PORT_A) ? 'A' : 'B', |
256 | STATUS_PACKETS_THIS(status), | 250 | STATUS_PACKETS_THIS(status), |
257 | (status & STATUS_CONN_THIS) ? " CON" : "", | 251 | (status & STATUS_CONN_THIS) ? " CON" : "", |
258 | (status & STATUS_SUSPEND_THIS) ? " SUS" : "", | 252 | (status & STATUS_SUSPEND_THIS) ? " SUS" : "", |
259 | (status & STATUS_MAILBOX_THIS) ? " MBOX" : "", | 253 | (status & STATUS_MAILBOX_THIS) ? " MBOX" : "", |
260 | 254 | ||
261 | STATUS_PACKETS_OTHER(status), | 255 | STATUS_PACKETS_OTHER(status), |
262 | (status & STATUS_CONN_OTHER) ? " CON" : "", | 256 | (status & STATUS_CONN_OTHER) ? " CON" : "", |
263 | (status & STATUS_SUSPEND_OTHER) ? " SUS" : "", | 257 | (status & STATUS_SUSPEND_OTHER) ? " SUS" : "", |
264 | (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "", | 258 | (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "", |
265 | 259 | ||
266 | status & STATUS_UNSPEC_MASK); | 260 | status & STATUS_UNSPEC_MASK); |
267 | } | 261 | } |
268 | 262 | ||
269 | /*-------------------------------------------------------------------------*/ | 263 | /*-------------------------------------------------------------------------*/ |
270 | 264 | ||
271 | /* | 265 | /* |
272 | * TTL register | 266 | * TTL register |
273 | */ | 267 | */ |
274 | 268 | ||
275 | #define TTL_THIS(ttl) (0x00ff & ttl) | 269 | #define TTL_THIS(ttl) (0x00ff & ttl) |
276 | #define TTL_OTHER(ttl) (0x00ff & (ttl >> 8)) | 270 | #define TTL_OTHER(ttl) (0x00ff & (ttl >> 8)) |
277 | #define MK_TTL(this,other) ((u16)(((other)<<8)|(0x00ff&(this)))) | 271 | #define MK_TTL(this,other) ((u16)(((other)<<8)|(0x00ff&(this)))) |
278 | 272 | ||
279 | static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl) | 273 | static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl) |
280 | { | 274 | { |
281 | netif_dbg(dev, link, dev->net, "net1080 %s-%s ttl 0x%x this = %d, other = %d\n", | 275 | netif_dbg(dev, link, dev->net, "net1080 %s-%s ttl 0x%x this = %d, other = %d\n", |
282 | dev->udev->bus->bus_name, dev->udev->devpath, | 276 | dev->udev->bus->bus_name, dev->udev->devpath, |
283 | ttl, TTL_THIS(ttl), TTL_OTHER(ttl)); | 277 | ttl, TTL_THIS(ttl), TTL_OTHER(ttl)); |
284 | } | 278 | } |
285 | 279 | ||
286 | /*-------------------------------------------------------------------------*/ | 280 | /*-------------------------------------------------------------------------*/ |
287 | 281 | ||
288 | static int net1080_reset(struct usbnet *dev) | 282 | static int net1080_reset(struct usbnet *dev) |
289 | { | 283 | { |
290 | u16 usbctl, status, ttl; | 284 | u16 usbctl, status, ttl; |
291 | u16 *vp = kmalloc(sizeof (u16), GFP_KERNEL); | 285 | u16 vp; |
292 | int retval; | 286 | int retval; |
293 | 287 | ||
294 | if (!vp) | ||
295 | return -ENOMEM; | ||
296 | |||
297 | // nc_dump_registers(dev); | 288 | // nc_dump_registers(dev); |
298 | 289 | ||
299 | if ((retval = nc_register_read(dev, REG_STATUS, vp)) < 0) { | 290 | if ((retval = nc_register_read(dev, REG_STATUS, &vp)) < 0) { |
300 | netdev_dbg(dev->net, "can't read %s-%s status: %d\n", | 291 | netdev_dbg(dev->net, "can't read %s-%s status: %d\n", |
301 | dev->udev->bus->bus_name, dev->udev->devpath, retval); | 292 | dev->udev->bus->bus_name, dev->udev->devpath, retval); |
302 | goto done; | 293 | goto done; |
303 | } | 294 | } |
304 | status = *vp; | 295 | status = vp; |
305 | nc_dump_status(dev, status); | 296 | nc_dump_status(dev, status); |
306 | 297 | ||
307 | if ((retval = nc_register_read(dev, REG_USBCTL, vp)) < 0) { | 298 | if ((retval = nc_register_read(dev, REG_USBCTL, &vp)) < 0) { |
308 | netdev_dbg(dev->net, "can't read USBCTL, %d\n", retval); | 299 | netdev_dbg(dev->net, "can't read USBCTL, %d\n", retval); |
309 | goto done; | 300 | goto done; |
310 | } | 301 | } |
311 | usbctl = *vp; | 302 | usbctl = vp; |
312 | nc_dump_usbctl(dev, usbctl); | 303 | nc_dump_usbctl(dev, usbctl); |
313 | 304 | ||
314 | nc_register_write(dev, REG_USBCTL, | 305 | nc_register_write(dev, REG_USBCTL, |
315 | USBCTL_FLUSH_THIS | USBCTL_FLUSH_OTHER); | 306 | USBCTL_FLUSH_THIS | USBCTL_FLUSH_OTHER); |
316 | 307 | ||
317 | if ((retval = nc_register_read(dev, REG_TTL, vp)) < 0) { | 308 | if ((retval = nc_register_read(dev, REG_TTL, &vp)) < 0) { |
318 | netdev_dbg(dev->net, "can't read TTL, %d\n", retval); | 309 | netdev_dbg(dev->net, "can't read TTL, %d\n", retval); |
319 | goto done; | 310 | goto done; |
320 | } | 311 | } |
321 | ttl = *vp; | 312 | ttl = vp; |
322 | // nc_dump_ttl(dev, ttl); | 313 | // nc_dump_ttl(dev, ttl); |
323 | 314 | ||
324 | nc_register_write(dev, REG_TTL, | 315 | nc_register_write(dev, REG_TTL, |
325 | MK_TTL(NC_READ_TTL_MS, TTL_OTHER(ttl)) ); | 316 | MK_TTL(NC_READ_TTL_MS, TTL_OTHER(ttl)) ); |
326 | netdev_dbg(dev->net, "assigned TTL, %d ms\n", NC_READ_TTL_MS); | 317 | netdev_dbg(dev->net, "assigned TTL, %d ms\n", NC_READ_TTL_MS); |
327 | 318 | ||
328 | netif_info(dev, link, dev->net, "port %c, peer %sconnected\n", | 319 | netif_info(dev, link, dev->net, "port %c, peer %sconnected\n", |
329 | (status & STATUS_PORT_A) ? 'A' : 'B', | 320 | (status & STATUS_PORT_A) ? 'A' : 'B', |
330 | (status & STATUS_CONN_OTHER) ? "" : "dis"); | 321 | (status & STATUS_CONN_OTHER) ? "" : "dis"); |
331 | retval = 0; | 322 | retval = 0; |
332 | 323 | ||
333 | done: | 324 | done: |
334 | kfree(vp); | ||
335 | return retval; | 325 | return retval; |
336 | } | 326 | } |
337 | 327 | ||
338 | static int net1080_check_connect(struct usbnet *dev) | 328 | static int net1080_check_connect(struct usbnet *dev) |
339 | { | 329 | { |
340 | int retval; | 330 | int retval; |
341 | u16 status; | 331 | u16 status; |
342 | u16 *vp = kmalloc(sizeof (u16), GFP_KERNEL); | 332 | u16 vp; |
343 | 333 | ||
344 | if (!vp) | 334 | retval = nc_register_read(dev, REG_STATUS, &vp); |
345 | return -ENOMEM; | 335 | status = vp; |
346 | retval = nc_register_read(dev, REG_STATUS, vp); | ||
347 | status = *vp; | ||
348 | kfree(vp); | ||
349 | if (retval != 0) { | 336 | if (retval != 0) { |
350 | netdev_dbg(dev->net, "net1080_check_conn read - %d\n", retval); | 337 | netdev_dbg(dev->net, "net1080_check_conn read - %d\n", retval); |
351 | return retval; | 338 | return retval; |
352 | } | 339 | } |
353 | if ((status & STATUS_CONN_OTHER) != STATUS_CONN_OTHER) | 340 | if ((status & STATUS_CONN_OTHER) != STATUS_CONN_OTHER) |
354 | return -ENOLINK; | 341 | return -ENOLINK; |
355 | return 0; | 342 | return 0; |
356 | } | 343 | } |
357 | 344 | ||
358 | static void nc_flush_complete(struct urb *urb) | ||
359 | { | ||
360 | kfree(urb->context); | ||
361 | usb_free_urb(urb); | ||
362 | } | ||
363 | |||
364 | static void nc_ensure_sync(struct usbnet *dev) | 345 | static void nc_ensure_sync(struct usbnet *dev) |
365 | { | 346 | { |
366 | dev->frame_errors++; | 347 | if (++dev->frame_errors <= 5) |
367 | if (dev->frame_errors > 5) { | 348 | return; |
368 | struct urb *urb; | ||
369 | struct usb_ctrlrequest *req; | ||
370 | int status; | ||
371 | 349 | ||
372 | /* Send a flush */ | 350 | if (usbnet_write_cmd_async(dev, REQUEST_REGISTER, |
373 | urb = usb_alloc_urb(0, GFP_ATOMIC); | 351 | USB_DIR_OUT | USB_TYPE_VENDOR | |
374 | if (!urb) | 352 | USB_RECIP_DEVICE, |
375 | return; | 353 | USBCTL_FLUSH_THIS | |
354 | USBCTL_FLUSH_OTHER, | ||
355 | REG_USBCTL, NULL, 0)) | ||
356 | return; | ||
376 | 357 | ||
377 | req = kmalloc(sizeof *req, GFP_ATOMIC); | 358 | netif_dbg(dev, rx_err, dev->net, |
378 | if (!req) { | 359 | "flush net1080; too many framing errors\n"); |
379 | usb_free_urb(urb); | 360 | dev->frame_errors = 0; |
380 | return; | ||
381 | } | ||
382 | |||
383 | req->bRequestType = USB_DIR_OUT | ||
384 | | USB_TYPE_VENDOR | ||
385 | | USB_RECIP_DEVICE; | ||
386 | req->bRequest = REQUEST_REGISTER; | ||
387 | req->wValue = cpu_to_le16(USBCTL_FLUSH_THIS | ||
388 | | USBCTL_FLUSH_OTHER); | ||
389 | req->wIndex = cpu_to_le16(REG_USBCTL); | ||
390 | req->wLength = cpu_to_le16(0); | ||
391 | |||
392 | /* queue an async control request, we don't need | ||
393 | * to do anything when it finishes except clean up. | ||
394 | */ | ||
395 | usb_fill_control_urb(urb, dev->udev, | ||
396 | usb_sndctrlpipe(dev->udev, 0), | ||
397 | (unsigned char *) req, | ||
398 | NULL, 0, | ||
399 | nc_flush_complete, req); | ||
400 | status = usb_submit_urb(urb, GFP_ATOMIC); | ||
401 | if (status) { | ||
402 | kfree(req); | ||
403 | usb_free_urb(urb); | ||
404 | return; | ||
405 | } | ||
406 | |||
407 | netif_dbg(dev, rx_err, dev->net, | ||
408 | "flush net1080; too many framing errors\n"); | ||
409 | dev->frame_errors = 0; | ||
410 | } | ||
411 | } | 361 | } |
412 | 362 | ||
413 | static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | 363 | static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) |
414 | { | 364 | { |
415 | struct nc_header *header; | 365 | struct nc_header *header; |
416 | struct nc_trailer *trailer; | 366 | struct nc_trailer *trailer; |
417 | u16 hdr_len, packet_len; | 367 | u16 hdr_len, packet_len; |
418 | 368 | ||
419 | if (!(skb->len & 0x01)) { | 369 | if (!(skb->len & 0x01)) { |
420 | netdev_dbg(dev->net, "rx framesize %d range %d..%d mtu %d\n", | 370 | netdev_dbg(dev->net, "rx framesize %d range %d..%d mtu %d\n", |
421 | skb->len, dev->net->hard_header_len, dev->hard_mtu, | 371 | skb->len, dev->net->hard_header_len, dev->hard_mtu, |
422 | dev->net->mtu); | 372 | dev->net->mtu); |
423 | dev->net->stats.rx_frame_errors++; | 373 | dev->net->stats.rx_frame_errors++; |
424 | nc_ensure_sync(dev); | 374 | nc_ensure_sync(dev); |
425 | return 0; | 375 | return 0; |
426 | } | 376 | } |
427 | 377 | ||
428 | header = (struct nc_header *) skb->data; | 378 | header = (struct nc_header *) skb->data; |
429 | hdr_len = le16_to_cpup(&header->hdr_len); | 379 | hdr_len = le16_to_cpup(&header->hdr_len); |
430 | packet_len = le16_to_cpup(&header->packet_len); | 380 | packet_len = le16_to_cpup(&header->packet_len); |
431 | if (FRAMED_SIZE(packet_len) > NC_MAX_PACKET) { | 381 | if (FRAMED_SIZE(packet_len) > NC_MAX_PACKET) { |
432 | dev->net->stats.rx_frame_errors++; | 382 | dev->net->stats.rx_frame_errors++; |
433 | netdev_dbg(dev->net, "packet too big, %d\n", packet_len); | 383 | netdev_dbg(dev->net, "packet too big, %d\n", packet_len); |
434 | nc_ensure_sync(dev); | 384 | nc_ensure_sync(dev); |
435 | return 0; | 385 | return 0; |
436 | } else if (hdr_len < MIN_HEADER) { | 386 | } else if (hdr_len < MIN_HEADER) { |
437 | dev->net->stats.rx_frame_errors++; | 387 | dev->net->stats.rx_frame_errors++; |
438 | netdev_dbg(dev->net, "header too short, %d\n", hdr_len); | 388 | netdev_dbg(dev->net, "header too short, %d\n", hdr_len); |
439 | nc_ensure_sync(dev); | 389 | nc_ensure_sync(dev); |
440 | return 0; | 390 | return 0; |
441 | } else if (hdr_len > MIN_HEADER) { | 391 | } else if (hdr_len > MIN_HEADER) { |
442 | // out of band data for us? | 392 | // out of band data for us? |
443 | netdev_dbg(dev->net, "header OOB, %d bytes\n", hdr_len - MIN_HEADER); | 393 | netdev_dbg(dev->net, "header OOB, %d bytes\n", hdr_len - MIN_HEADER); |
444 | nc_ensure_sync(dev); | 394 | nc_ensure_sync(dev); |
445 | // switch (vendor/product ids) { ... } | 395 | // switch (vendor/product ids) { ... } |
446 | } | 396 | } |
447 | skb_pull(skb, hdr_len); | 397 | skb_pull(skb, hdr_len); |
448 | 398 | ||
449 | trailer = (struct nc_trailer *) | 399 | trailer = (struct nc_trailer *) |
450 | (skb->data + skb->len - sizeof *trailer); | 400 | (skb->data + skb->len - sizeof *trailer); |
451 | skb_trim(skb, skb->len - sizeof *trailer); | 401 | skb_trim(skb, skb->len - sizeof *trailer); |
452 | 402 | ||
453 | if ((packet_len & 0x01) == 0) { | 403 | if ((packet_len & 0x01) == 0) { |
454 | if (skb->data [packet_len] != PAD_BYTE) { | 404 | if (skb->data [packet_len] != PAD_BYTE) { |
455 | dev->net->stats.rx_frame_errors++; | 405 | dev->net->stats.rx_frame_errors++; |
456 | netdev_dbg(dev->net, "bad pad\n"); | 406 | netdev_dbg(dev->net, "bad pad\n"); |
457 | return 0; | 407 | return 0; |
458 | } | 408 | } |
459 | skb_trim(skb, skb->len - 1); | 409 | skb_trim(skb, skb->len - 1); |
460 | } | 410 | } |
461 | if (skb->len != packet_len) { | 411 | if (skb->len != packet_len) { |
462 | dev->net->stats.rx_frame_errors++; | 412 | dev->net->stats.rx_frame_errors++; |
463 | netdev_dbg(dev->net, "bad packet len %d (expected %d)\n", | 413 | netdev_dbg(dev->net, "bad packet len %d (expected %d)\n", |
464 | skb->len, packet_len); | 414 | skb->len, packet_len); |
465 | nc_ensure_sync(dev); | 415 | nc_ensure_sync(dev); |
466 | return 0; | 416 | return 0; |
467 | } | 417 | } |
468 | if (header->packet_id != get_unaligned(&trailer->packet_id)) { | 418 | if (header->packet_id != get_unaligned(&trailer->packet_id)) { |
469 | dev->net->stats.rx_fifo_errors++; | 419 | dev->net->stats.rx_fifo_errors++; |
470 | netdev_dbg(dev->net, "(2+ dropped) rx packet_id mismatch 0x%x 0x%x\n", | 420 | netdev_dbg(dev->net, "(2+ dropped) rx packet_id mismatch 0x%x 0x%x\n", |
471 | le16_to_cpu(header->packet_id), | 421 | le16_to_cpu(header->packet_id), |
472 | le16_to_cpu(trailer->packet_id)); | 422 | le16_to_cpu(trailer->packet_id)); |
473 | return 0; | 423 | return 0; |
474 | } | 424 | } |
475 | #if 0 | 425 | #if 0 |
476 | netdev_dbg(dev->net, "frame <rx h %d p %d id %d\n", header->hdr_len, | 426 | netdev_dbg(dev->net, "frame <rx h %d p %d id %d\n", header->hdr_len, |
477 | header->packet_len, header->packet_id); | 427 | header->packet_len, header->packet_id); |
478 | #endif | 428 | #endif |
479 | dev->frame_errors = 0; | 429 | dev->frame_errors = 0; |
480 | return 1; | 430 | return 1; |
481 | } | 431 | } |
482 | 432 | ||
483 | static struct sk_buff * | 433 | static struct sk_buff * |
484 | net1080_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | 434 | net1080_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) |
485 | { | 435 | { |
486 | struct sk_buff *skb2; | 436 | struct sk_buff *skb2; |
487 | struct nc_header *header = NULL; | 437 | struct nc_header *header = NULL; |
488 | struct nc_trailer *trailer = NULL; | 438 | struct nc_trailer *trailer = NULL; |
489 | int padlen = sizeof (struct nc_trailer); | 439 | int padlen = sizeof (struct nc_trailer); |
490 | int len = skb->len; | 440 | int len = skb->len; |
491 | 441 | ||
492 | if (!((len + padlen + sizeof (struct nc_header)) & 0x01)) | 442 | if (!((len + padlen + sizeof (struct nc_header)) & 0x01)) |
493 | padlen++; | 443 | padlen++; |
494 | if (!skb_cloned(skb)) { | 444 | if (!skb_cloned(skb)) { |
495 | int headroom = skb_headroom(skb); | 445 | int headroom = skb_headroom(skb); |
496 | int tailroom = skb_tailroom(skb); | 446 | int tailroom = skb_tailroom(skb); |
497 | 447 | ||
498 | if (padlen <= tailroom && | 448 | if (padlen <= tailroom && |
499 | sizeof(struct nc_header) <= headroom) | 449 | sizeof(struct nc_header) <= headroom) |
500 | /* There's enough head and tail room */ | 450 | /* There's enough head and tail room */ |
501 | goto encapsulate; | 451 | goto encapsulate; |
502 | 452 | ||
503 | if ((sizeof (struct nc_header) + padlen) < | 453 | if ((sizeof (struct nc_header) + padlen) < |
504 | (headroom + tailroom)) { | 454 | (headroom + tailroom)) { |
505 | /* There's enough total room, so just readjust */ | 455 | /* There's enough total room, so just readjust */ |
506 | skb->data = memmove(skb->head | 456 | skb->data = memmove(skb->head |
507 | + sizeof (struct nc_header), | 457 | + sizeof (struct nc_header), |
508 | skb->data, skb->len); | 458 | skb->data, skb->len); |
509 | skb_set_tail_pointer(skb, len); | 459 | skb_set_tail_pointer(skb, len); |
510 | goto encapsulate; | 460 | goto encapsulate; |
511 | } | 461 | } |
512 | } | 462 | } |
513 | 463 | ||
514 | /* Create a new skb to use with the correct size */ | 464 | /* Create a new skb to use with the correct size */ |
515 | skb2 = skb_copy_expand(skb, | 465 | skb2 = skb_copy_expand(skb, |
516 | sizeof (struct nc_header), | 466 | sizeof (struct nc_header), |
517 | padlen, | 467 | padlen, |
518 | flags); | 468 | flags); |
519 | dev_kfree_skb_any(skb); | 469 | dev_kfree_skb_any(skb); |
520 | if (!skb2) | 470 | if (!skb2) |
521 | return skb2; | 471 | return skb2; |
522 | skb = skb2; | 472 | skb = skb2; |
523 | 473 | ||
524 | encapsulate: | 474 | encapsulate: |
525 | /* header first */ | 475 | /* header first */ |
526 | header = (struct nc_header *) skb_push(skb, sizeof *header); | 476 | header = (struct nc_header *) skb_push(skb, sizeof *header); |
527 | header->hdr_len = cpu_to_le16(sizeof (*header)); | 477 | header->hdr_len = cpu_to_le16(sizeof (*header)); |
528 | header->packet_len = cpu_to_le16(len); | 478 | header->packet_len = cpu_to_le16(len); |
529 | header->packet_id = cpu_to_le16((u16)dev->xid++); | 479 | header->packet_id = cpu_to_le16((u16)dev->xid++); |
530 | 480 | ||
531 | /* maybe pad; then trailer */ | 481 | /* maybe pad; then trailer */ |
532 | if (!((skb->len + sizeof *trailer) & 0x01)) | 482 | if (!((skb->len + sizeof *trailer) & 0x01)) |
533 | *skb_put(skb, 1) = PAD_BYTE; | 483 | *skb_put(skb, 1) = PAD_BYTE; |
534 | trailer = (struct nc_trailer *) skb_put(skb, sizeof *trailer); | 484 | trailer = (struct nc_trailer *) skb_put(skb, sizeof *trailer); |
535 | put_unaligned(header->packet_id, &trailer->packet_id); | 485 | put_unaligned(header->packet_id, &trailer->packet_id); |
536 | #if 0 | 486 | #if 0 |
537 | netdev_dbg(dev->net, "frame >tx h %d p %d id %d\n", | 487 | netdev_dbg(dev->net, "frame >tx h %d p %d id %d\n", |
538 | header->hdr_len, header->packet_len, | 488 | header->hdr_len, header->packet_len, |
539 | header->packet_id); | 489 | header->packet_id); |
540 | #endif | 490 | #endif |
541 | return skb; | 491 | return skb; |
542 | } | 492 | } |
543 | 493 | ||
544 | static int net1080_bind(struct usbnet *dev, struct usb_interface *intf) | 494 | static int net1080_bind(struct usbnet *dev, struct usb_interface *intf) |
545 | { | 495 | { |
546 | unsigned extra = sizeof (struct nc_header) | 496 | unsigned extra = sizeof (struct nc_header) |
547 | + 1 | 497 | + 1 |
548 | + sizeof (struct nc_trailer); | 498 | + sizeof (struct nc_trailer); |
549 | 499 | ||
550 | dev->net->hard_header_len += extra; | 500 | dev->net->hard_header_len += extra; |
551 | dev->rx_urb_size = dev->net->hard_header_len + dev->net->mtu; | 501 | dev->rx_urb_size = dev->net->hard_header_len + dev->net->mtu; |
552 | dev->hard_mtu = NC_MAX_PACKET; | 502 | dev->hard_mtu = NC_MAX_PACKET; |
553 | return usbnet_get_endpoints (dev, intf); | 503 | return usbnet_get_endpoints (dev, intf); |
554 | } | 504 | } |
555 | 505 | ||
556 | static const struct driver_info net1080_info = { | 506 | static const struct driver_info net1080_info = { |
557 | .description = "NetChip TurboCONNECT", | 507 | .description = "NetChip TurboCONNECT", |
558 | .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_NC, | 508 | .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_NC, |
559 | .bind = net1080_bind, | 509 | .bind = net1080_bind, |
560 | .reset = net1080_reset, | 510 | .reset = net1080_reset, |
561 | .check_connect = net1080_check_connect, | 511 | .check_connect = net1080_check_connect, |
562 | .rx_fixup = net1080_rx_fixup, | 512 | .rx_fixup = net1080_rx_fixup, |
563 | .tx_fixup = net1080_tx_fixup, | 513 | .tx_fixup = net1080_tx_fixup, |
564 | }; | 514 | }; |
565 | 515 | ||
566 | static const struct usb_device_id products [] = { | 516 | static const struct usb_device_id products [] = { |
567 | { | 517 | { |
568 | USB_DEVICE(0x0525, 0x1080), // NetChip ref design | 518 | USB_DEVICE(0x0525, 0x1080), // NetChip ref design |
569 | .driver_info = (unsigned long) &net1080_info, | 519 | .driver_info = (unsigned long) &net1080_info, |
570 | }, { | 520 | }, { |
571 | USB_DEVICE(0x06D0, 0x0622), // Laplink Gold | 521 | USB_DEVICE(0x06D0, 0x0622), // Laplink Gold |
572 | .driver_info = (unsigned long) &net1080_info, | 522 | .driver_info = (unsigned long) &net1080_info, |
573 | }, | 523 | }, |
574 | { }, // END | 524 | { }, // END |
575 | }; | 525 | }; |
576 | MODULE_DEVICE_TABLE(usb, products); | 526 | MODULE_DEVICE_TABLE(usb, products); |
577 | 527 | ||
578 | static struct usb_driver net1080_driver = { | 528 | static struct usb_driver net1080_driver = { |
579 | .name = "net1080", | 529 | .name = "net1080", |
580 | .id_table = products, | 530 | .id_table = products, |
581 | .probe = usbnet_probe, | 531 | .probe = usbnet_probe, |
582 | .disconnect = usbnet_disconnect, | 532 | .disconnect = usbnet_disconnect, |
583 | .suspend = usbnet_suspend, | 533 | .suspend = usbnet_suspend, |
584 | .resume = usbnet_resume, | 534 | .resume = usbnet_resume, |
585 | .disable_hub_initiated_lpm = 1, | 535 | .disable_hub_initiated_lpm = 1, |
586 | }; | 536 | }; |
587 | 537 | ||
588 | module_usb_driver(net1080_driver); | 538 | module_usb_driver(net1080_driver); |
589 | 539 | ||
590 | MODULE_AUTHOR("David Brownell"); | 540 | MODULE_AUTHOR("David Brownell"); |