diff options
author | David S. Miller <davem@davemloft.net> | 2010-02-03 22:38:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-03 22:38:22 -0500 |
commit | 9c119ba54c0fcae72881948af3d37b47a2f8e1f9 (patch) | |
tree | 0be51b0bf02ece3bb32955e9d33a3998ecd57250 /drivers | |
parent | a4b97f2054af2e411c414ed4cb5e1d0dbfd24a47 (diff) | |
parent | fdd3d631cddad20ad9d3e1eb7dbf26825a8a121f (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/bluetooth/Kconfig | 13 | ||||
-rw-r--r-- | drivers/bluetooth/Makefile | 1 | ||||
-rw-r--r-- | drivers/bluetooth/ath3k.c | 187 | ||||
-rw-r--r-- | drivers/bluetooth/bluecard_cs.c | 4 | ||||
-rw-r--r-- | drivers/bluetooth/bt3c_cs.c | 4 | ||||
-rw-r--r-- | drivers/bluetooth/btuart_cs.c | 4 | ||||
-rw-r--r-- | drivers/bluetooth/dtl1_cs.c | 4 | ||||
-rw-r--r-- | drivers/connector/connector.c | 175 | ||||
-rw-r--r-- | drivers/net/benet/be_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 7 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 4 | ||||
-rw-r--r-- | drivers/net/sky2.c | 8 | ||||
-rw-r--r-- | drivers/net/usb/cdc_ether.c | 2 |
13 files changed, 226 insertions, 191 deletions
diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 652367aa6546..058fbccf2f52 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig | |||
@@ -195,5 +195,16 @@ config BT_MRVL_SDIO | |||
195 | Say Y here to compile support for Marvell BT-over-SDIO driver | 195 | Say Y here to compile support for Marvell BT-over-SDIO driver |
196 | into the kernel or say M to compile it as module. | 196 | into the kernel or say M to compile it as module. |
197 | 197 | ||
198 | endmenu | 198 | config BT_ATH3K |
199 | tristate "Atheros firmware download driver" | ||
200 | depends on BT_HCIBTUSB | ||
201 | select FW_LOADER | ||
202 | help | ||
203 | Bluetooth firmware download driver. | ||
204 | This driver loads the firmware into the Atheros Bluetooth | ||
205 | chipset. | ||
199 | 206 | ||
207 | Say Y here to compile support for "Atheros firmware download driver" | ||
208 | into the kernel or say M to compile it as module (ath3k). | ||
209 | |||
210 | endmenu | ||
diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile index b3f57d2d4eb0..7e5aed598121 100644 --- a/drivers/bluetooth/Makefile +++ b/drivers/bluetooth/Makefile | |||
@@ -15,6 +15,7 @@ obj-$(CONFIG_BT_HCIBTUART) += btuart_cs.o | |||
15 | obj-$(CONFIG_BT_HCIBTUSB) += btusb.o | 15 | obj-$(CONFIG_BT_HCIBTUSB) += btusb.o |
16 | obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o | 16 | obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o |
17 | 17 | ||
18 | obj-$(CONFIG_BT_ATH3K) += ath3k.o | ||
18 | obj-$(CONFIG_BT_MRVL) += btmrvl.o | 19 | obj-$(CONFIG_BT_MRVL) += btmrvl.o |
19 | obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o | 20 | obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o |
20 | 21 | ||
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c new file mode 100644 index 000000000000..add9485ca5b6 --- /dev/null +++ b/drivers/bluetooth/ath3k.c | |||
@@ -0,0 +1,187 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2008-2009 Atheros Communications Inc. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | |||
21 | #include <linux/module.h> | ||
22 | #include <linux/kernel.h> | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/slab.h> | ||
25 | #include <linux/types.h> | ||
26 | #include <linux/errno.h> | ||
27 | #include <linux/device.h> | ||
28 | #include <linux/firmware.h> | ||
29 | #include <linux/usb.h> | ||
30 | #include <net/bluetooth/bluetooth.h> | ||
31 | |||
32 | #define VERSION "1.0" | ||
33 | |||
34 | |||
35 | static struct usb_device_id ath3k_table[] = { | ||
36 | /* Atheros AR3011 */ | ||
37 | { USB_DEVICE(0x0CF3, 0x3000) }, | ||
38 | { } /* Terminating entry */ | ||
39 | }; | ||
40 | |||
41 | MODULE_DEVICE_TABLE(usb, ath3k_table); | ||
42 | |||
43 | #define USB_REQ_DFU_DNLOAD 1 | ||
44 | #define BULK_SIZE 4096 | ||
45 | |||
46 | struct ath3k_data { | ||
47 | struct usb_device *udev; | ||
48 | u8 *fw_data; | ||
49 | u32 fw_size; | ||
50 | u32 fw_sent; | ||
51 | }; | ||
52 | |||
53 | static int ath3k_load_firmware(struct ath3k_data *data, | ||
54 | unsigned char *firmware, | ||
55 | int count) | ||
56 | { | ||
57 | u8 *send_buf; | ||
58 | int err, pipe, len, size, sent = 0; | ||
59 | |||
60 | BT_DBG("ath3k %p udev %p", data, data->udev); | ||
61 | |||
62 | pipe = usb_sndctrlpipe(data->udev, 0); | ||
63 | |||
64 | if ((usb_control_msg(data->udev, pipe, | ||
65 | USB_REQ_DFU_DNLOAD, | ||
66 | USB_TYPE_VENDOR, 0, 0, | ||
67 | firmware, 20, USB_CTRL_SET_TIMEOUT)) < 0) { | ||
68 | BT_ERR("Can't change to loading configuration err"); | ||
69 | return -EBUSY; | ||
70 | } | ||
71 | sent += 20; | ||
72 | count -= 20; | ||
73 | |||
74 | send_buf = kmalloc(BULK_SIZE, GFP_ATOMIC); | ||
75 | if (!send_buf) { | ||
76 | BT_ERR("Can't allocate memory chunk for firmware"); | ||
77 | return -ENOMEM; | ||
78 | } | ||
79 | |||
80 | while (count) { | ||
81 | size = min_t(uint, count, BULK_SIZE); | ||
82 | pipe = usb_sndbulkpipe(data->udev, 0x02); | ||
83 | memcpy(send_buf, firmware + sent, size); | ||
84 | |||
85 | err = usb_bulk_msg(data->udev, pipe, send_buf, size, | ||
86 | &len, 3000); | ||
87 | |||
88 | if (err || (len != size)) { | ||
89 | BT_ERR("Error in firmware loading err = %d," | ||
90 | "len = %d, size = %d", err, len, size); | ||
91 | goto error; | ||
92 | } | ||
93 | |||
94 | sent += size; | ||
95 | count -= size; | ||
96 | } | ||
97 | |||
98 | kfree(send_buf); | ||
99 | return 0; | ||
100 | |||
101 | error: | ||
102 | kfree(send_buf); | ||
103 | return err; | ||
104 | } | ||
105 | |||
106 | static int ath3k_probe(struct usb_interface *intf, | ||
107 | const struct usb_device_id *id) | ||
108 | { | ||
109 | const struct firmware *firmware; | ||
110 | struct usb_device *udev = interface_to_usbdev(intf); | ||
111 | struct ath3k_data *data; | ||
112 | int size; | ||
113 | |||
114 | BT_DBG("intf %p id %p", intf, id); | ||
115 | |||
116 | if (intf->cur_altsetting->desc.bInterfaceNumber != 0) | ||
117 | return -ENODEV; | ||
118 | |||
119 | data = kzalloc(sizeof(*data), GFP_KERNEL); | ||
120 | if (!data) | ||
121 | return -ENOMEM; | ||
122 | |||
123 | data->udev = udev; | ||
124 | |||
125 | if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) { | ||
126 | kfree(data); | ||
127 | return -EIO; | ||
128 | } | ||
129 | |||
130 | size = max_t(uint, firmware->size, 4096); | ||
131 | data->fw_data = kmalloc(size, GFP_KERNEL); | ||
132 | if (!data->fw_data) { | ||
133 | release_firmware(firmware); | ||
134 | kfree(data); | ||
135 | return -ENOMEM; | ||
136 | } | ||
137 | |||
138 | memcpy(data->fw_data, firmware->data, firmware->size); | ||
139 | data->fw_size = firmware->size; | ||
140 | data->fw_sent = 0; | ||
141 | release_firmware(firmware); | ||
142 | |||
143 | usb_set_intfdata(intf, data); | ||
144 | if (ath3k_load_firmware(data, data->fw_data, data->fw_size)) { | ||
145 | usb_set_intfdata(intf, NULL); | ||
146 | return -EIO; | ||
147 | } | ||
148 | |||
149 | return 0; | ||
150 | } | ||
151 | |||
152 | static void ath3k_disconnect(struct usb_interface *intf) | ||
153 | { | ||
154 | struct ath3k_data *data = usb_get_intfdata(intf); | ||
155 | |||
156 | BT_DBG("ath3k_disconnect intf %p", intf); | ||
157 | |||
158 | kfree(data->fw_data); | ||
159 | kfree(data); | ||
160 | } | ||
161 | |||
162 | static struct usb_driver ath3k_driver = { | ||
163 | .name = "ath3k", | ||
164 | .probe = ath3k_probe, | ||
165 | .disconnect = ath3k_disconnect, | ||
166 | .id_table = ath3k_table, | ||
167 | }; | ||
168 | |||
169 | static int __init ath3k_init(void) | ||
170 | { | ||
171 | BT_INFO("Atheros AR30xx firmware driver ver %s", VERSION); | ||
172 | return usb_register(&ath3k_driver); | ||
173 | } | ||
174 | |||
175 | static void __exit ath3k_exit(void) | ||
176 | { | ||
177 | usb_deregister(&ath3k_driver); | ||
178 | } | ||
179 | |||
180 | module_init(ath3k_init); | ||
181 | module_exit(ath3k_exit); | ||
182 | |||
183 | MODULE_AUTHOR("Atheros Communications"); | ||
184 | MODULE_DESCRIPTION("Atheros AR30xx firmware driver"); | ||
185 | MODULE_VERSION(VERSION); | ||
186 | MODULE_LICENSE("GPL"); | ||
187 | MODULE_FIRMWARE("ath3k-1.fw"); | ||
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index 2acdc605cb4b..c2cf81144715 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
@@ -503,7 +503,9 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst) | |||
503 | unsigned int iobase; | 503 | unsigned int iobase; |
504 | unsigned char reg; | 504 | unsigned char reg; |
505 | 505 | ||
506 | BUG_ON(!info->hdev); | 506 | if (!info || !info->hdev) |
507 | /* our irq handler is shared */ | ||
508 | return IRQ_NONE; | ||
507 | 509 | ||
508 | if (!test_bit(CARD_READY, &(info->hw_state))) | 510 | if (!test_bit(CARD_READY, &(info->hw_state))) |
509 | return IRQ_HANDLED; | 511 | return IRQ_HANDLED; |
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index d814a2755ccb..9f5926aaf57f 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c | |||
@@ -345,7 +345,9 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst) | |||
345 | int iir; | 345 | int iir; |
346 | irqreturn_t r = IRQ_NONE; | 346 | irqreturn_t r = IRQ_NONE; |
347 | 347 | ||
348 | BUG_ON(!info->hdev); | 348 | if (!info || !info->hdev) |
349 | /* our irq handler is shared */ | ||
350 | return IRQ_NONE; | ||
349 | 351 | ||
350 | iobase = info->p_dev->io.BasePort1; | 352 | iobase = info->p_dev->io.BasePort1; |
351 | 353 | ||
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index d339464dc15e..91c523099804 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
@@ -295,7 +295,9 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst) | |||
295 | int iir, lsr; | 295 | int iir, lsr; |
296 | irqreturn_t r = IRQ_NONE; | 296 | irqreturn_t r = IRQ_NONE; |
297 | 297 | ||
298 | BUG_ON(!info->hdev); | 298 | if (!info || !info->hdev) |
299 | /* our irq handler is shared */ | ||
300 | return IRQ_NONE; | ||
299 | 301 | ||
300 | iobase = info->p_dev->io.BasePort1; | 302 | iobase = info->p_dev->io.BasePort1; |
301 | 303 | ||
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index 4f02a6f3c980..697591941e17 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c | |||
@@ -299,7 +299,9 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst) | |||
299 | int iir, lsr; | 299 | int iir, lsr; |
300 | irqreturn_t r = IRQ_NONE; | 300 | irqreturn_t r = IRQ_NONE; |
301 | 301 | ||
302 | BUG_ON(!info->hdev); | 302 | if (!info || !info->hdev) |
303 | /* our irq handler is shared */ | ||
304 | return IRQ_NONE; | ||
303 | 305 | ||
304 | iobase = info->p_dev->io.BasePort1; | 306 | iobase = info->p_dev->io.BasePort1; |
305 | 307 | ||
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index f06024668f99..537c29ac4487 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c | |||
@@ -36,17 +36,6 @@ MODULE_LICENSE("GPL"); | |||
36 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); | 36 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); |
37 | MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); | 37 | MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); |
38 | 38 | ||
39 | static u32 cn_idx = CN_IDX_CONNECTOR; | ||
40 | static u32 cn_val = CN_VAL_CONNECTOR; | ||
41 | |||
42 | module_param(cn_idx, uint, 0); | ||
43 | module_param(cn_val, uint, 0); | ||
44 | MODULE_PARM_DESC(cn_idx, "Connector's main device idx."); | ||
45 | MODULE_PARM_DESC(cn_val, "Connector's main device val."); | ||
46 | |||
47 | static DEFINE_MUTEX(notify_lock); | ||
48 | static LIST_HEAD(notify_list); | ||
49 | |||
50 | static struct cn_dev cdev; | 39 | static struct cn_dev cdev; |
51 | 40 | ||
52 | static int cn_already_initialized; | 41 | static int cn_already_initialized; |
@@ -210,54 +199,6 @@ static void cn_rx_skb(struct sk_buff *__skb) | |||
210 | } | 199 | } |
211 | 200 | ||
212 | /* | 201 | /* |
213 | * Notification routing. | ||
214 | * | ||
215 | * Gets id and checks if there are notification request for it's idx | ||
216 | * and val. If there are such requests notify the listeners with the | ||
217 | * given notify event. | ||
218 | * | ||
219 | */ | ||
220 | static void cn_notify(struct cb_id *id, u32 notify_event) | ||
221 | { | ||
222 | struct cn_ctl_entry *ent; | ||
223 | |||
224 | mutex_lock(¬ify_lock); | ||
225 | list_for_each_entry(ent, ¬ify_list, notify_entry) { | ||
226 | int i; | ||
227 | struct cn_notify_req *req; | ||
228 | struct cn_ctl_msg *ctl = ent->msg; | ||
229 | int idx_found, val_found; | ||
230 | |||
231 | idx_found = val_found = 0; | ||
232 | |||
233 | req = (struct cn_notify_req *)ctl->data; | ||
234 | for (i = 0; i < ctl->idx_notify_num; ++i, ++req) { | ||
235 | if (id->idx >= req->first && | ||
236 | id->idx < req->first + req->range) { | ||
237 | idx_found = 1; | ||
238 | break; | ||
239 | } | ||
240 | } | ||
241 | |||
242 | for (i = 0; i < ctl->val_notify_num; ++i, ++req) { | ||
243 | if (id->val >= req->first && | ||
244 | id->val < req->first + req->range) { | ||
245 | val_found = 1; | ||
246 | break; | ||
247 | } | ||
248 | } | ||
249 | |||
250 | if (idx_found && val_found) { | ||
251 | struct cn_msg m = { .ack = notify_event, }; | ||
252 | |||
253 | memcpy(&m.id, id, sizeof(m.id)); | ||
254 | cn_netlink_send(&m, ctl->group, GFP_KERNEL); | ||
255 | } | ||
256 | } | ||
257 | mutex_unlock(¬ify_lock); | ||
258 | } | ||
259 | |||
260 | /* | ||
261 | * Callback add routing - adds callback with given ID and name. | 202 | * Callback add routing - adds callback with given ID and name. |
262 | * If there is registered callback with the same ID it will not be added. | 203 | * If there is registered callback with the same ID it will not be added. |
263 | * | 204 | * |
@@ -276,8 +217,6 @@ int cn_add_callback(struct cb_id *id, char *name, | |||
276 | if (err) | 217 | if (err) |
277 | return err; | 218 | return err; |
278 | 219 | ||
279 | cn_notify(id, 0); | ||
280 | |||
281 | return 0; | 220 | return 0; |
282 | } | 221 | } |
283 | EXPORT_SYMBOL_GPL(cn_add_callback); | 222 | EXPORT_SYMBOL_GPL(cn_add_callback); |
@@ -295,111 +234,9 @@ void cn_del_callback(struct cb_id *id) | |||
295 | struct cn_dev *dev = &cdev; | 234 | struct cn_dev *dev = &cdev; |
296 | 235 | ||
297 | cn_queue_del_callback(dev->cbdev, id); | 236 | cn_queue_del_callback(dev->cbdev, id); |
298 | cn_notify(id, 1); | ||
299 | } | 237 | } |
300 | EXPORT_SYMBOL_GPL(cn_del_callback); | 238 | EXPORT_SYMBOL_GPL(cn_del_callback); |
301 | 239 | ||
302 | /* | ||
303 | * Checks two connector's control messages to be the same. | ||
304 | * Returns 1 if they are the same or if the first one is corrupted. | ||
305 | */ | ||
306 | static int cn_ctl_msg_equals(struct cn_ctl_msg *m1, struct cn_ctl_msg *m2) | ||
307 | { | ||
308 | int i; | ||
309 | struct cn_notify_req *req1, *req2; | ||
310 | |||
311 | if (m1->idx_notify_num != m2->idx_notify_num) | ||
312 | return 0; | ||
313 | |||
314 | if (m1->val_notify_num != m2->val_notify_num) | ||
315 | return 0; | ||
316 | |||
317 | if (m1->len != m2->len) | ||
318 | return 0; | ||
319 | |||
320 | if ((m1->idx_notify_num + m1->val_notify_num) * sizeof(*req1) != | ||
321 | m1->len) | ||
322 | return 1; | ||
323 | |||
324 | req1 = (struct cn_notify_req *)m1->data; | ||
325 | req2 = (struct cn_notify_req *)m2->data; | ||
326 | |||
327 | for (i = 0; i < m1->idx_notify_num; ++i) { | ||
328 | if (req1->first != req2->first || req1->range != req2->range) | ||
329 | return 0; | ||
330 | req1++; | ||
331 | req2++; | ||
332 | } | ||
333 | |||
334 | for (i = 0; i < m1->val_notify_num; ++i) { | ||
335 | if (req1->first != req2->first || req1->range != req2->range) | ||
336 | return 0; | ||
337 | req1++; | ||
338 | req2++; | ||
339 | } | ||
340 | |||
341 | return 1; | ||
342 | } | ||
343 | |||
344 | /* | ||
345 | * Main connector device's callback. | ||
346 | * | ||
347 | * Used for notification of a request's processing. | ||
348 | */ | ||
349 | static void cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) | ||
350 | { | ||
351 | struct cn_ctl_msg *ctl; | ||
352 | struct cn_ctl_entry *ent; | ||
353 | u32 size; | ||
354 | |||
355 | if (msg->len < sizeof(*ctl)) | ||
356 | return; | ||
357 | |||
358 | ctl = (struct cn_ctl_msg *)msg->data; | ||
359 | |||
360 | size = (sizeof(*ctl) + ((ctl->idx_notify_num + | ||
361 | ctl->val_notify_num) * | ||
362 | sizeof(struct cn_notify_req))); | ||
363 | |||
364 | if (msg->len != size) | ||
365 | return; | ||
366 | |||
367 | if (ctl->len + sizeof(*ctl) != msg->len) | ||
368 | return; | ||
369 | |||
370 | /* | ||
371 | * Remove notification. | ||
372 | */ | ||
373 | if (ctl->group == 0) { | ||
374 | struct cn_ctl_entry *n; | ||
375 | |||
376 | mutex_lock(¬ify_lock); | ||
377 | list_for_each_entry_safe(ent, n, ¬ify_list, notify_entry) { | ||
378 | if (cn_ctl_msg_equals(ent->msg, ctl)) { | ||
379 | list_del(&ent->notify_entry); | ||
380 | kfree(ent); | ||
381 | } | ||
382 | } | ||
383 | mutex_unlock(¬ify_lock); | ||
384 | |||
385 | return; | ||
386 | } | ||
387 | |||
388 | size += sizeof(*ent); | ||
389 | |||
390 | ent = kzalloc(size, GFP_KERNEL); | ||
391 | if (!ent) | ||
392 | return; | ||
393 | |||
394 | ent->msg = (struct cn_ctl_msg *)(ent + 1); | ||
395 | |||
396 | memcpy(ent->msg, ctl, size - sizeof(*ent)); | ||
397 | |||
398 | mutex_lock(¬ify_lock); | ||
399 | list_add(&ent->notify_entry, ¬ify_list); | ||
400 | mutex_unlock(¬ify_lock); | ||
401 | } | ||
402 | |||
403 | static int cn_proc_show(struct seq_file *m, void *v) | 240 | static int cn_proc_show(struct seq_file *m, void *v) |
404 | { | 241 | { |
405 | struct cn_queue_dev *dev = cdev.cbdev; | 242 | struct cn_queue_dev *dev = cdev.cbdev; |
@@ -437,11 +274,8 @@ static const struct file_operations cn_file_ops = { | |||
437 | static int __devinit cn_init(void) | 274 | static int __devinit cn_init(void) |
438 | { | 275 | { |
439 | struct cn_dev *dev = &cdev; | 276 | struct cn_dev *dev = &cdev; |
440 | int err; | ||
441 | 277 | ||
442 | dev->input = cn_rx_skb; | 278 | dev->input = cn_rx_skb; |
443 | dev->id.idx = cn_idx; | ||
444 | dev->id.val = cn_val; | ||
445 | 279 | ||
446 | dev->nls = netlink_kernel_create(&init_net, NETLINK_CONNECTOR, | 280 | dev->nls = netlink_kernel_create(&init_net, NETLINK_CONNECTOR, |
447 | CN_NETLINK_USERS + 0xf, | 281 | CN_NETLINK_USERS + 0xf, |
@@ -457,14 +291,6 @@ static int __devinit cn_init(void) | |||
457 | 291 | ||
458 | cn_already_initialized = 1; | 292 | cn_already_initialized = 1; |
459 | 293 | ||
460 | err = cn_add_callback(&dev->id, "connector", &cn_callback); | ||
461 | if (err) { | ||
462 | cn_already_initialized = 0; | ||
463 | cn_queue_free_dev(dev->cbdev); | ||
464 | netlink_kernel_release(dev->nls); | ||
465 | return -EINVAL; | ||
466 | } | ||
467 | |||
468 | proc_net_fops_create(&init_net, "connector", S_IRUGO, &cn_file_ops); | 294 | proc_net_fops_create(&init_net, "connector", S_IRUGO, &cn_file_ops); |
469 | 295 | ||
470 | return 0; | 296 | return 0; |
@@ -478,7 +304,6 @@ static void __devexit cn_fini(void) | |||
478 | 304 | ||
479 | proc_net_remove(&init_net, "connector"); | 305 | proc_net_remove(&init_net, "connector"); |
480 | 306 | ||
481 | cn_del_callback(&dev->id); | ||
482 | cn_queue_free_dev(dev->cbdev); | 307 | cn_queue_free_dev(dev->cbdev); |
483 | netlink_kernel_release(dev->nls); | 308 | netlink_kernel_release(dev->nls); |
484 | } | 309 | } |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 90c5661b336f..626b76c0ebc7 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -1350,7 +1350,7 @@ static irqreturn_t be_intx(int irq, void *dev) | |||
1350 | int isr; | 1350 | int isr; |
1351 | 1351 | ||
1352 | isr = ioread32(adapter->csr + CEV_ISR0_OFFSET + | 1352 | isr = ioread32(adapter->csr + CEV_ISR0_OFFSET + |
1353 | be_pci_func(adapter) * CEV_ISR_SIZE); | 1353 | (adapter->tx_eq.q.id/ 8) * CEV_ISR_SIZE); |
1354 | if (!isr) | 1354 | if (!isr) |
1355 | return IRQ_NONE; | 1355 | return IRQ_NONE; |
1356 | 1356 | ||
@@ -2168,7 +2168,7 @@ static int be_stats_init(struct be_adapter *adapter) | |||
2168 | cmd->va = pci_alloc_consistent(adapter->pdev, cmd->size, &cmd->dma); | 2168 | cmd->va = pci_alloc_consistent(adapter->pdev, cmd->size, &cmd->dma); |
2169 | if (cmd->va == NULL) | 2169 | if (cmd->va == NULL) |
2170 | return -1; | 2170 | return -1; |
2171 | memset(cmd->va, cmd->size, 0); | 2171 | memset(cmd->va, 0, cmd->size); |
2172 | return 0; | 2172 | return 0; |
2173 | } | 2173 | } |
2174 | 2174 | ||
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 636985224afc..f098816d4199 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -5384,7 +5384,7 @@ dma_error: | |||
5384 | ixgbe_unmap_and_free_tx_resource(adapter, tx_buffer_info); | 5384 | ixgbe_unmap_and_free_tx_resource(adapter, tx_buffer_info); |
5385 | } | 5385 | } |
5386 | 5386 | ||
5387 | return count; | 5387 | return 0; |
5388 | } | 5388 | } |
5389 | 5389 | ||
5390 | static void ixgbe_tx_queue(struct ixgbe_adapter *adapter, | 5390 | static void ixgbe_tx_queue(struct ixgbe_adapter *adapter, |
@@ -5534,8 +5534,11 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
5534 | struct ixgbe_adapter *adapter = netdev_priv(dev); | 5534 | struct ixgbe_adapter *adapter = netdev_priv(dev); |
5535 | int txq = smp_processor_id(); | 5535 | int txq = smp_processor_id(); |
5536 | 5536 | ||
5537 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) | 5537 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) { |
5538 | while (unlikely(txq >= dev->real_num_tx_queues)) | ||
5539 | txq -= dev->real_num_tx_queues; | ||
5538 | return txq; | 5540 | return txq; |
5541 | } | ||
5539 | 5542 | ||
5540 | #ifdef IXGBE_FCOE | 5543 | #ifdef IXGBE_FCOE |
5541 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && | 5544 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 076f826d5a50..08780ef1c1f8 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -1995,7 +1995,7 @@ static void netxen_tx_timeout_task(struct work_struct *work) | |||
1995 | netif_wake_queue(adapter->netdev); | 1995 | netif_wake_queue(adapter->netdev); |
1996 | 1996 | ||
1997 | clear_bit(__NX_RESETTING, &adapter->state); | 1997 | clear_bit(__NX_RESETTING, &adapter->state); |
1998 | 1998 | return; | |
1999 | } else { | 1999 | } else { |
2000 | clear_bit(__NX_RESETTING, &adapter->state); | 2000 | clear_bit(__NX_RESETTING, &adapter->state); |
2001 | if (!netxen_nic_reset_context(adapter)) { | 2001 | if (!netxen_nic_reset_context(adapter)) { |
@@ -2323,7 +2323,9 @@ netxen_detach_work(struct work_struct *work) | |||
2323 | 2323 | ||
2324 | netxen_nic_down(adapter, netdev); | 2324 | netxen_nic_down(adapter, netdev); |
2325 | 2325 | ||
2326 | rtnl_lock(); | ||
2326 | netxen_nic_detach(adapter); | 2327 | netxen_nic_detach(adapter); |
2328 | rtnl_unlock(); | ||
2327 | 2329 | ||
2328 | status = NXRD32(adapter, NETXEN_PEG_HALT_STATUS1); | 2330 | status = NXRD32(adapter, NETXEN_PEG_HALT_STATUS1); |
2329 | 2331 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index fecde669d6ab..a6ddfc1a9cb2 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1025,11 +1025,8 @@ static void sky2_prefetch_init(struct sky2_hw *hw, u32 qaddr, | |||
1025 | static inline struct sky2_tx_le *get_tx_le(struct sky2_port *sky2, u16 *slot) | 1025 | static inline struct sky2_tx_le *get_tx_le(struct sky2_port *sky2, u16 *slot) |
1026 | { | 1026 | { |
1027 | struct sky2_tx_le *le = sky2->tx_le + *slot; | 1027 | struct sky2_tx_le *le = sky2->tx_le + *slot; |
1028 | struct tx_ring_info *re = sky2->tx_ring + *slot; | ||
1029 | 1028 | ||
1030 | *slot = RING_NEXT(*slot, sky2->tx_ring_size); | 1029 | *slot = RING_NEXT(*slot, sky2->tx_ring_size); |
1031 | re->flags = 0; | ||
1032 | re->skb = NULL; | ||
1033 | le->ctrl = 0; | 1030 | le->ctrl = 0; |
1034 | return le; | 1031 | return le; |
1035 | } | 1032 | } |
@@ -1622,8 +1619,7 @@ static unsigned tx_le_req(const struct sk_buff *skb) | |||
1622 | return count; | 1619 | return count; |
1623 | } | 1620 | } |
1624 | 1621 | ||
1625 | static void sky2_tx_unmap(struct pci_dev *pdev, | 1622 | static void sky2_tx_unmap(struct pci_dev *pdev, struct tx_ring_info *re) |
1626 | const struct tx_ring_info *re) | ||
1627 | { | 1623 | { |
1628 | if (re->flags & TX_MAP_SINGLE) | 1624 | if (re->flags & TX_MAP_SINGLE) |
1629 | pci_unmap_single(pdev, pci_unmap_addr(re, mapaddr), | 1625 | pci_unmap_single(pdev, pci_unmap_addr(re, mapaddr), |
@@ -1633,6 +1629,7 @@ static void sky2_tx_unmap(struct pci_dev *pdev, | |||
1633 | pci_unmap_page(pdev, pci_unmap_addr(re, mapaddr), | 1629 | pci_unmap_page(pdev, pci_unmap_addr(re, mapaddr), |
1634 | pci_unmap_len(re, maplen), | 1630 | pci_unmap_len(re, maplen), |
1635 | PCI_DMA_TODEVICE); | 1631 | PCI_DMA_TODEVICE); |
1632 | re->flags = 0; | ||
1636 | } | 1633 | } |
1637 | 1634 | ||
1638 | /* | 1635 | /* |
@@ -1839,6 +1836,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done) | |||
1839 | dev->stats.tx_packets++; | 1836 | dev->stats.tx_packets++; |
1840 | dev->stats.tx_bytes += skb->len; | 1837 | dev->stats.tx_bytes += skb->len; |
1841 | 1838 | ||
1839 | re->skb = NULL; | ||
1842 | dev_kfree_skb_any(skb); | 1840 | dev_kfree_skb_any(skb); |
1843 | 1841 | ||
1844 | sky2->tx_next = RING_NEXT(idx, sky2->tx_ring_size); | 1842 | sky2->tx_next = RING_NEXT(idx, sky2->tx_ring_size); |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 21e183a83b99..4f27f022fbf7 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -419,7 +419,7 @@ static int cdc_manage_power(struct usbnet *dev, int on) | |||
419 | 419 | ||
420 | static const struct driver_info cdc_info = { | 420 | static const struct driver_info cdc_info = { |
421 | .description = "CDC Ethernet Device", | 421 | .description = "CDC Ethernet Device", |
422 | .flags = FLAG_ETHER | FLAG_LINK_INTR, | 422 | .flags = FLAG_ETHER, |
423 | // .check_connect = cdc_check_connect, | 423 | // .check_connect = cdc_check_connect, |
424 | .bind = cdc_bind, | 424 | .bind = cdc_bind, |
425 | .unbind = usbnet_cdc_unbind, | 425 | .unbind = usbnet_cdc_unbind, |