Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (23 commits)
connector: Delete buggy notification code.
be2net: use eq-id to calculate cev-isr reg offset
Bluetooth: Use the control channel for raw HID reports
Bluetooth: Add DFU driver for Atheros Bluetooth chipset AR3011
Bluetooth: Redo checks in IRQ handler for shared IRQ support
Bluetooth: Fix memory leak in L2CAP
Bluetooth: Remove double free of SKB pointer in L2CAP
cdc_ether: Partially revert "usbnet: Set link down initially ..."
be2net: Fix memset() arg ordering.
bonding: bond_open error return value
ixgbe: if ixgbe_copy_dcb_cfg is going to fail learn about it early
ixgbe: set the correct DCB bit for pg tx settings
igbvf: fix issue w/ mapped_as_page being left set after unmap
drivers/net: ks8851_mll ethernet network driver
be2net: Bug fix to support newer generation of BE ASIC
starfire: clean up properly if firmware loading fails
mac80211: fix NULL pointer dereference when ftrace is enabled
netfilter: ctnetlink: fix expectation mask dump
ipv6: conntrack: Add member of user to nf_ct_frag6_queue structure
ath9k: fix eeprom INI values override for 2GHz-only cards
...

+312 -282
+12 -1
drivers/bluetooth/Kconfig
··· 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. 197 198 - endmenu 199
··· 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. 197 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. 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
+1
drivers/bluetooth/Makefile
··· 15 obj-$(CONFIG_BT_HCIBTUSB) += btusb.o 16 obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o 17 18 obj-$(CONFIG_BT_MRVL) += btmrvl.o 19 obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o 20
··· 15 obj-$(CONFIG_BT_HCIBTUSB) += btusb.o 16 obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o 17 18 + obj-$(CONFIG_BT_ATH3K) += ath3k.o 19 obj-$(CONFIG_BT_MRVL) += btmrvl.o 20 obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o 21
+187
drivers/bluetooth/ath3k.c
···
··· 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");
+3 -1
drivers/bluetooth/bluecard_cs.c
··· 503 unsigned int iobase; 504 unsigned char reg; 505 506 - BUG_ON(!info->hdev); 507 508 if (!test_bit(CARD_READY, &(info->hw_state))) 509 return IRQ_HANDLED;
··· 503 unsigned int iobase; 504 unsigned char reg; 505 506 + if (!info || !info->hdev) 507 + /* our irq handler is shared */ 508 + return IRQ_NONE; 509 510 if (!test_bit(CARD_READY, &(info->hw_state))) 511 return IRQ_HANDLED;
+3 -1
drivers/bluetooth/bt3c_cs.c
··· 345 int iir; 346 irqreturn_t r = IRQ_NONE; 347 348 - BUG_ON(!info->hdev); 349 350 iobase = info->p_dev->io.BasePort1; 351
··· 345 int iir; 346 irqreturn_t r = IRQ_NONE; 347 348 + if (!info || !info->hdev) 349 + /* our irq handler is shared */ 350 + return IRQ_NONE; 351 352 iobase = info->p_dev->io.BasePort1; 353
+3 -1
drivers/bluetooth/btuart_cs.c
··· 295 int iir, lsr; 296 irqreturn_t r = IRQ_NONE; 297 298 - BUG_ON(!info->hdev); 299 300 iobase = info->p_dev->io.BasePort1; 301
··· 295 int iir, lsr; 296 irqreturn_t r = IRQ_NONE; 297 298 + if (!info || !info->hdev) 299 + /* our irq handler is shared */ 300 + return IRQ_NONE; 301 302 iobase = info->p_dev->io.BasePort1; 303
+3 -1
drivers/bluetooth/dtl1_cs.c
··· 299 int iir, lsr; 300 irqreturn_t r = IRQ_NONE; 301 302 - BUG_ON(!info->hdev); 303 304 iobase = info->p_dev->io.BasePort1; 305
··· 299 int iir, lsr; 300 irqreturn_t r = IRQ_NONE; 301 302 + if (!info || !info->hdev) 303 + /* our irq handler is shared */ 304 + return IRQ_NONE; 305 306 iobase = info->p_dev->io.BasePort1; 307
-175
drivers/connector/connector.c
··· 36 MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); 37 MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); 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; 51 52 static int cn_already_initialized; ··· 199 } 200 201 /* 202 - * Notification routing. 203 - * 204 - * Gets id and checks if there are notification request for it's idx 205 - * and val. If there are such requests notify the listeners with the 206 - * given notify event. 207 - * 208 - */ 209 - static void cn_notify(struct cb_id *id, u32 notify_event) 210 - { 211 - struct cn_ctl_entry *ent; 212 - 213 - mutex_lock(&notify_lock); 214 - list_for_each_entry(ent, &notify_list, notify_entry) { 215 - int i; 216 - struct cn_notify_req *req; 217 - struct cn_ctl_msg *ctl = ent->msg; 218 - int idx_found, val_found; 219 - 220 - idx_found = val_found = 0; 221 - 222 - req = (struct cn_notify_req *)ctl->data; 223 - for (i = 0; i < ctl->idx_notify_num; ++i, ++req) { 224 - if (id->idx >= req->first && 225 - id->idx < req->first + req->range) { 226 - idx_found = 1; 227 - break; 228 - } 229 - } 230 - 231 - for (i = 0; i < ctl->val_notify_num; ++i, ++req) { 232 - if (id->val >= req->first && 233 - id->val < req->first + req->range) { 234 - val_found = 1; 235 - break; 236 - } 237 - } 238 - 239 - if (idx_found && val_found) { 240 - struct cn_msg m = { .ack = notify_event, }; 241 - 242 - memcpy(&m.id, id, sizeof(m.id)); 243 - cn_netlink_send(&m, ctl->group, GFP_KERNEL); 244 - } 245 - } 246 - mutex_unlock(&notify_lock); 247 - } 248 - 249 - /* 250 * Callback add routing - adds callback with given ID and name. 251 * If there is registered callback with the same ID it will not be added. 252 * ··· 217 if (err) 218 return err; 219 220 - cn_notify(id, 0); 221 - 222 return 0; 223 } 224 EXPORT_SYMBOL_GPL(cn_add_callback); ··· 234 struct cn_dev *dev = &cdev; 235 236 cn_queue_del_callback(dev->cbdev, id); 237 - cn_notify(id, 1); 238 } 239 EXPORT_SYMBOL_GPL(cn_del_callback); 240 - 241 - /* 242 - * Checks two connector's control messages to be the same. 243 - * Returns 1 if they are the same or if the first one is corrupted. 244 - */ 245 - static int cn_ctl_msg_equals(struct cn_ctl_msg *m1, struct cn_ctl_msg *m2) 246 - { 247 - int i; 248 - struct cn_notify_req *req1, *req2; 249 - 250 - if (m1->idx_notify_num != m2->idx_notify_num) 251 - return 0; 252 - 253 - if (m1->val_notify_num != m2->val_notify_num) 254 - return 0; 255 - 256 - if (m1->len != m2->len) 257 - return 0; 258 - 259 - if ((m1->idx_notify_num + m1->val_notify_num) * sizeof(*req1) != 260 - m1->len) 261 - return 1; 262 - 263 - req1 = (struct cn_notify_req *)m1->data; 264 - req2 = (struct cn_notify_req *)m2->data; 265 - 266 - for (i = 0; i < m1->idx_notify_num; ++i) { 267 - if (req1->first != req2->first || req1->range != req2->range) 268 - return 0; 269 - req1++; 270 - req2++; 271 - } 272 - 273 - for (i = 0; i < m1->val_notify_num; ++i) { 274 - if (req1->first != req2->first || req1->range != req2->range) 275 - return 0; 276 - req1++; 277 - req2++; 278 - } 279 - 280 - return 1; 281 - } 282 - 283 - /* 284 - * Main connector device's callback. 285 - * 286 - * Used for notification of a request's processing. 287 - */ 288 - static void cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) 289 - { 290 - struct cn_ctl_msg *ctl; 291 - struct cn_ctl_entry *ent; 292 - u32 size; 293 - 294 - if (msg->len < sizeof(*ctl)) 295 - return; 296 - 297 - ctl = (struct cn_ctl_msg *)msg->data; 298 - 299 - size = (sizeof(*ctl) + ((ctl->idx_notify_num + 300 - ctl->val_notify_num) * 301 - sizeof(struct cn_notify_req))); 302 - 303 - if (msg->len != size) 304 - return; 305 - 306 - if (ctl->len + sizeof(*ctl) != msg->len) 307 - return; 308 - 309 - /* 310 - * Remove notification. 311 - */ 312 - if (ctl->group == 0) { 313 - struct cn_ctl_entry *n; 314 - 315 - mutex_lock(&notify_lock); 316 - list_for_each_entry_safe(ent, n, &notify_list, notify_entry) { 317 - if (cn_ctl_msg_equals(ent->msg, ctl)) { 318 - list_del(&ent->notify_entry); 319 - kfree(ent); 320 - } 321 - } 322 - mutex_unlock(&notify_lock); 323 - 324 - return; 325 - } 326 - 327 - size += sizeof(*ent); 328 - 329 - ent = kzalloc(size, GFP_KERNEL); 330 - if (!ent) 331 - return; 332 - 333 - ent->msg = (struct cn_ctl_msg *)(ent + 1); 334 - 335 - memcpy(ent->msg, ctl, size - sizeof(*ent)); 336 - 337 - mutex_lock(&notify_lock); 338 - list_add(&ent->notify_entry, &notify_list); 339 - mutex_unlock(&notify_lock); 340 - } 341 342 static int cn_proc_show(struct seq_file *m, void *v) 343 { ··· 274 static int __devinit cn_init(void) 275 { 276 struct cn_dev *dev = &cdev; 277 - int err; 278 279 dev->input = cn_rx_skb; 280 - dev->id.idx = cn_idx; 281 - dev->id.val = cn_val; 282 283 dev->nls = netlink_kernel_create(&init_net, NETLINK_CONNECTOR, 284 CN_NETLINK_USERS + 0xf, ··· 291 292 cn_already_initialized = 1; 293 294 - err = cn_add_callback(&dev->id, "connector", &cn_callback); 295 - if (err) { 296 - cn_already_initialized = 0; 297 - cn_queue_free_dev(dev->cbdev); 298 - netlink_kernel_release(dev->nls); 299 - return -EINVAL; 300 - } 301 - 302 proc_net_fops_create(&init_net, "connector", S_IRUGO, &cn_file_ops); 303 304 return 0; ··· 304 305 proc_net_remove(&init_net, "connector"); 306 307 - cn_del_callback(&dev->id); 308 cn_queue_free_dev(dev->cbdev); 309 netlink_kernel_release(dev->nls); 310 }
··· 36 MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); 37 MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); 38 39 static struct cn_dev cdev; 40 41 static int cn_already_initialized; ··· 210 } 211 212 /* 213 * Callback add routing - adds callback with given ID and name. 214 * If there is registered callback with the same ID it will not be added. 215 * ··· 276 if (err) 277 return err; 278 279 return 0; 280 } 281 EXPORT_SYMBOL_GPL(cn_add_callback); ··· 295 struct cn_dev *dev = &cdev; 296 297 cn_queue_del_callback(dev->cbdev, id); 298 } 299 EXPORT_SYMBOL_GPL(cn_del_callback); 300 301 static int cn_proc_show(struct seq_file *m, void *v) 302 { ··· 437 static int __devinit cn_init(void) 438 { 439 struct cn_dev *dev = &cdev; 440 441 dev->input = cn_rx_skb; 442 443 dev->nls = netlink_kernel_create(&init_net, NETLINK_CONNECTOR, 444 CN_NETLINK_USERS + 0xf, ··· 457 458 cn_already_initialized = 1; 459 460 proc_net_fops_create(&init_net, "connector", S_IRUGO, &cn_file_ops); 461 462 return 0; ··· 478 479 proc_net_remove(&init_net, "connector"); 480 481 cn_queue_free_dev(dev->cbdev); 482 netlink_kernel_release(dev->nls); 483 }
+5
drivers/net/benet/be.h
··· 276 int link_speed; 277 u8 port_type; 278 u8 transceiver; 279 }; 280 281 extern const struct ethtool_ops be_ethtool_ops; 282
··· 276 int link_speed; 277 u8 port_type; 278 u8 transceiver; 279 + u8 generation; /* BladeEngine ASIC generation */ 280 }; 281 + 282 + /* BladeEngine Generation numbers */ 283 + #define BE_GEN2 2 284 + #define BE_GEN3 3 285 286 extern const struct ethtool_ops be_ethtool_ops; 287
+2 -1
drivers/net/benet/be_cmds.h
··· 164 u8 domain; /* dword 0 */ 165 u32 timeout; /* dword 1 */ 166 u32 request_length; /* dword 2 */ 167 - u32 rsvd; /* dword 3 */ 168 }; 169 170 #define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */
··· 164 u8 domain; /* dword 0 */ 165 u32 timeout; /* dword 1 */ 166 u32 request_length; /* dword 2 */ 167 + u8 version; /* dword 3 */ 168 + u8 rsvd[3]; /* dword 3 */ 169 }; 170 171 #define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */
+24 -3
drivers/net/benet/be_main.c
··· 1350 int isr; 1351 1352 isr = ioread32(adapter->csr + CEV_ISR0_OFFSET + 1353 - be_pci_func(adapter) * CEV_ISR_SIZE); 1354 if (!isr) 1355 return IRQ_NONE; 1356 ··· 2051 static int be_map_pci_bars(struct be_adapter *adapter) 2052 { 2053 u8 __iomem *addr; 2054 2055 addr = ioremap_nocache(pci_resource_start(adapter->pdev, 2), 2056 pci_resource_len(adapter->pdev, 2)); ··· 2065 goto pci_map_err; 2066 adapter->db = addr; 2067 2068 - addr = ioremap_nocache(pci_resource_start(adapter->pdev, 1), 2069 - pci_resource_len(adapter->pdev, 1)); 2070 if (addr == NULL) 2071 goto pci_map_err; 2072 adapter->pcicfg = addr; ··· 2168 cmd->va = pci_alloc_consistent(adapter->pdev, cmd->size, &cmd->dma); 2169 if (cmd->va == NULL) 2170 return -1; 2171 return 0; 2172 } 2173 ··· 2247 goto rel_reg; 2248 } 2249 adapter = netdev_priv(netdev); 2250 adapter->pdev = pdev; 2251 pci_set_drvdata(pdev, adapter); 2252 adapter->netdev = netdev;
··· 1350 int isr; 1351 1352 isr = ioread32(adapter->csr + CEV_ISR0_OFFSET + 1353 + (adapter->tx_eq.q.id/ 8) * CEV_ISR_SIZE); 1354 if (!isr) 1355 return IRQ_NONE; 1356 ··· 2051 static int be_map_pci_bars(struct be_adapter *adapter) 2052 { 2053 u8 __iomem *addr; 2054 + int pcicfg_reg; 2055 2056 addr = ioremap_nocache(pci_resource_start(adapter->pdev, 2), 2057 pci_resource_len(adapter->pdev, 2)); ··· 2064 goto pci_map_err; 2065 adapter->db = addr; 2066 2067 + if (adapter->generation == BE_GEN2) 2068 + pcicfg_reg = 1; 2069 + else 2070 + pcicfg_reg = 0; 2071 + 2072 + addr = ioremap_nocache(pci_resource_start(adapter->pdev, pcicfg_reg), 2073 + pci_resource_len(adapter->pdev, pcicfg_reg)); 2074 if (addr == NULL) 2075 goto pci_map_err; 2076 adapter->pcicfg = addr; ··· 2162 cmd->va = pci_alloc_consistent(adapter->pdev, cmd->size, &cmd->dma); 2163 if (cmd->va == NULL) 2164 return -1; 2165 + memset(cmd->va, 0, cmd->size); 2166 return 0; 2167 } 2168 ··· 2240 goto rel_reg; 2241 } 2242 adapter = netdev_priv(netdev); 2243 + 2244 + switch (pdev->device) { 2245 + case BE_DEVICE_ID1: 2246 + case OC_DEVICE_ID1: 2247 + adapter->generation = BE_GEN2; 2248 + break; 2249 + case BE_DEVICE_ID2: 2250 + case OC_DEVICE_ID2: 2251 + adapter->generation = BE_GEN3; 2252 + break; 2253 + default: 2254 + adapter->generation = 0; 2255 + } 2256 + 2257 adapter->pdev = pdev; 2258 pci_set_drvdata(pdev, adapter); 2259 adapter->netdev = netdev;
+1 -1
drivers/net/bonding/bond_main.c
··· 3639 */ 3640 if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB))) { 3641 /* something went wrong - fail the open operation */ 3642 - return -1; 3643 } 3644 3645 INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
··· 3639 */ 3640 if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB))) { 3641 /* something went wrong - fail the open operation */ 3642 + return -ENOMEM; 3643 } 3644 3645 INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
+1
drivers/net/igbvf/netdev.c
··· 2117 /* set time_stamp *before* dma to help avoid a possible race */ 2118 buffer_info->time_stamp = jiffies; 2119 buffer_info->next_to_watch = i; 2120 buffer_info->dma = pci_map_single(pdev, skb->data, len, 2121 PCI_DMA_TODEVICE); 2122 if (pci_dma_mapping_error(pdev, buffer_info->dma))
··· 2117 /* set time_stamp *before* dma to help avoid a possible race */ 2118 buffer_info->time_stamp = jiffies; 2119 buffer_info->next_to_watch = i; 2120 + buffer_info->mapped_as_page = false; 2121 buffer_info->dma = pci_map_single(pdev, skb->data, len, 2122 PCI_DMA_TODEVICE); 2123 if (pci_dma_mapping_error(pdev, buffer_info->dma))
+7 -9
drivers/net/ixgbe/ixgbe_dcb_nl.c
··· 223 224 if (adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] != 225 adapter->dcb_cfg.bw_percentage[0][bwg_id]) { 226 - adapter->dcb_set_bitmap |= BIT_PG_RX; 227 adapter->dcb_set_bitmap |= BIT_RESETLINK; 228 } 229 } ··· 341 if (!adapter->dcb_set_bitmap) 342 return DCB_NO_HW_CHG; 343 344 /* 345 * Only take down the adapter if the configuration change 346 * requires a reset. ··· 363 if (netif_running(netdev)) 364 ixgbe_down(adapter); 365 } 366 - } 367 - 368 - ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg, 369 - adapter->ring_feature[RING_F_DCB].indices); 370 - if (ret) { 371 - if (adapter->dcb_set_bitmap & BIT_RESETLINK) 372 - clear_bit(__IXGBE_RESETTING, &adapter->state); 373 - return DCB_NO_HW_CHG; 374 } 375 376 if (adapter->dcb_cfg.pfc_mode_enable) {
··· 223 224 if (adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] != 225 adapter->dcb_cfg.bw_percentage[0][bwg_id]) { 226 + adapter->dcb_set_bitmap |= BIT_PG_TX; 227 adapter->dcb_set_bitmap |= BIT_RESETLINK; 228 } 229 } ··· 341 if (!adapter->dcb_set_bitmap) 342 return DCB_NO_HW_CHG; 343 344 + ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg, 345 + adapter->ring_feature[RING_F_DCB].indices); 346 + 347 + if (ret) 348 + return DCB_NO_HW_CHG; 349 + 350 /* 351 * Only take down the adapter if the configuration change 352 * requires a reset. ··· 357 if (netif_running(netdev)) 358 ixgbe_down(adapter); 359 } 360 } 361 362 if (adapter->dcb_cfg.pfc_mode_enable) {
+2 -2
drivers/net/ks8851_mll.c
··· 854 855 static irqreturn_t ks_irq(int irq, void *pw) 856 { 857 - struct ks_net *ks = pw; 858 - struct net_device *netdev = ks->netdev; 859 u16 status; 860 861 /*this should be the first in IRQ handler */
··· 854 855 static irqreturn_t ks_irq(int irq, void *pw) 856 { 857 + struct net_device *netdev = pw; 858 + struct ks_net *ks = netdev_priv(netdev); 859 u16 status; 860 861 /*this should be the first in IRQ handler */
+4 -1
drivers/net/starfire.c
··· 1063 if (retval) { 1064 printk(KERN_ERR "starfire: Failed to load firmware \"%s\"\n", 1065 FIRMWARE_RX); 1066 - return retval; 1067 } 1068 if (fw_rx->size % 4) { 1069 printk(KERN_ERR "starfire: bogus length %zu in \"%s\"\n", ··· 1108 release_firmware(fw_tx); 1109 out_rx: 1110 release_firmware(fw_rx); 1111 return retval; 1112 } 1113
··· 1063 if (retval) { 1064 printk(KERN_ERR "starfire: Failed to load firmware \"%s\"\n", 1065 FIRMWARE_RX); 1066 + goto out_init; 1067 } 1068 if (fw_rx->size % 4) { 1069 printk(KERN_ERR "starfire: bogus length %zu in \"%s\"\n", ··· 1108 release_firmware(fw_tx); 1109 out_rx: 1110 release_firmware(fw_rx); 1111 + out_init: 1112 + if (retval) 1113 + netdev_close(dev); 1114 return retval; 1115 } 1116
+1 -1
drivers/net/usb/cdc_ether.c
··· 419 420 static const struct driver_info cdc_info = { 421 .description = "CDC Ethernet Device", 422 - .flags = FLAG_ETHER | FLAG_LINK_INTR, 423 // .check_connect = cdc_check_connect, 424 .bind = cdc_bind, 425 .unbind = usbnet_cdc_unbind,
··· 419 420 static const struct driver_info cdc_info = { 421 .description = "CDC Ethernet Device", 422 + .flags = FLAG_ETHER, 423 // .check_connect = cdc_check_connect, 424 .bind = cdc_bind, 425 .unbind = usbnet_cdc_unbind,
+3 -4
drivers/net/wireless/ath/ath9k/hw.c
··· 855 } 856 } 857 858 - static void ath9k_hw_init_11a_eeprom_fix(struct ath_hw *ah) 859 { 860 u32 i, j; 861 862 - if ((ah->hw_version.devid == AR9280_DEVID_PCI) && 863 - test_bit(ATH9K_MODE_11A, ah->caps.wireless_modes)) { 864 865 /* EEPROM Fixup */ 866 for (i = 0; i < ah->iniModes.ia_rows; i++) { ··· 979 if (r) 980 return r; 981 982 - ath9k_hw_init_11a_eeprom_fix(ah); 983 984 r = ath9k_hw_init_macaddr(ah); 985 if (r) {
··· 855 } 856 } 857 858 + static void ath9k_hw_init_eeprom_fix(struct ath_hw *ah) 859 { 860 u32 i, j; 861 862 + if (ah->hw_version.devid == AR9280_DEVID_PCI) { 863 864 /* EEPROM Fixup */ 865 for (i = 0; i < ah->iniModes.ia_rows; i++) { ··· 980 if (r) 981 return r; 982 983 + ath9k_hw_init_eeprom_fix(ah); 984 985 r = ath9k_hw_init_macaddr(ah); 986 if (r) {
+1 -1
drivers/net/wireless/ath/ath9k/main.c
··· 2655 (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { 2656 ath9k_ps_wakeup(sc); 2657 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); 2658 - ath_beacon_return(sc, avp); 2659 ath9k_ps_restore(sc); 2660 } 2661 2662 sc->sc_flags &= ~SC_OP_BEACONS; 2663 2664 for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) {
··· 2655 (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { 2656 ath9k_ps_wakeup(sc); 2657 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); 2658 ath9k_ps_restore(sc); 2659 } 2660 2661 + ath_beacon_return(sc, avp); 2662 sc->sc_flags &= ~SC_OP_BEACONS; 2663 2664 for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) {
+2 -2
drivers/net/wireless/iwlwifi/iwl-sta.c
··· 297 } 298 EXPORT_SYMBOL(iwl_add_station); 299 300 - static void iwl_sta_ucode_deactivate(struct iwl_priv *priv, const char *addr) 301 { 302 unsigned long flags; 303 u8 sta_id = iwl_find_station(priv, addr); ··· 324 { 325 struct iwl_rem_sta_cmd *rm_sta = 326 (struct iwl_rem_sta_cmd *)cmd->cmd.payload; 327 - const char *addr = rm_sta->addr; 328 329 if (pkt->hdr.flags & IWL_CMD_FAILED_MSK) { 330 IWL_ERR(priv, "Bad return from REPLY_REMOVE_STA (0x%08X)\n",
··· 297 } 298 EXPORT_SYMBOL(iwl_add_station); 299 300 + static void iwl_sta_ucode_deactivate(struct iwl_priv *priv, const u8 *addr) 301 { 302 unsigned long flags; 303 u8 sta_id = iwl_find_station(priv, addr); ··· 324 { 325 struct iwl_rem_sta_cmd *rm_sta = 326 (struct iwl_rem_sta_cmd *)cmd->cmd.payload; 327 + const u8 *addr = rm_sta->addr; 328 329 if (pkt->hdr.flags & IWL_CMD_FAILED_MSK) { 330 IWL_ERR(priv, "Bad return from REPLY_REMOVE_STA (0x%08X)\n",
-32
include/linux/connector.h
··· 24 25 #include <linux/types.h> 26 27 - #define CN_IDX_CONNECTOR 0xffffffff 28 - #define CN_VAL_CONNECTOR 0xffffffff 29 - 30 /* 31 * Process Events connector unique ids -- used for message routing 32 */ ··· 69 70 __u16 len; /* Length of the following data */ 71 __u16 flags; 72 - __u8 data[0]; 73 - }; 74 - 75 - /* 76 - * Notify structure - requests notification about 77 - * registering/unregistering idx/val in range [first, first+range]. 78 - */ 79 - struct cn_notify_req { 80 - __u32 first; 81 - __u32 range; 82 - }; 83 - 84 - /* 85 - * Main notification control message 86 - * *_notify_num - number of appropriate cn_notify_req structures after 87 - * this struct. 88 - * group - notification receiver's idx. 89 - * len - total length of the attached data. 90 - */ 91 - struct cn_ctl_msg { 92 - __u32 idx_notify_num; 93 - __u32 val_notify_num; 94 - __u32 group; 95 - __u32 len; 96 __u8 data[0]; 97 }; 98 ··· 122 struct cn_callback_data data; 123 124 u32 seq, group; 125 - }; 126 - 127 - struct cn_ctl_entry { 128 - struct list_head notify_entry; 129 - struct cn_ctl_msg *msg; 130 }; 131 132 struct cn_dev {
··· 24 25 #include <linux/types.h> 26 27 /* 28 * Process Events connector unique ids -- used for message routing 29 */ ··· 72 73 __u16 len; /* Length of the following data */ 74 __u16 flags; 75 __u8 data[0]; 76 }; 77 ··· 149 struct cn_callback_data data; 150 151 u32 seq, group; 152 }; 153 154 struct cn_dev {
+36 -34
net/bluetooth/hidp/core.c
··· 243 input_sync(dev); 244 } 245 246 static int hidp_queue_report(struct hidp_session *session, 247 unsigned char *data, int size) 248 { ··· 315 316 static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count) 317 { 318 - if (hidp_queue_report(hid->driver_data, data, count)) 319 return -ENOMEM; 320 return count; 321 } ··· 340 { 341 if (session->idle_to > 0) 342 del_timer(&session->timer); 343 - } 344 - 345 - static int __hidp_send_ctrl_message(struct hidp_session *session, 346 - unsigned char hdr, unsigned char *data, int size) 347 - { 348 - struct sk_buff *skb; 349 - 350 - BT_DBG("session %p data %p size %d", session, data, size); 351 - 352 - if (!(skb = alloc_skb(size + 1, GFP_ATOMIC))) { 353 - BT_ERR("Can't allocate memory for new frame"); 354 - return -ENOMEM; 355 - } 356 - 357 - *skb_put(skb, 1) = hdr; 358 - if (data && size > 0) 359 - memcpy(skb_put(skb, size), data, size); 360 - 361 - skb_queue_tail(&session->ctrl_transmit, skb); 362 - 363 - return 0; 364 - } 365 - 366 - static inline int hidp_send_ctrl_message(struct hidp_session *session, 367 - unsigned char hdr, unsigned char *data, int size) 368 - { 369 - int err; 370 - 371 - err = __hidp_send_ctrl_message(session, hdr, data, size); 372 - 373 - hidp_schedule(session); 374 - 375 - return err; 376 } 377 378 static void hidp_process_handshake(struct hidp_session *session,
··· 243 input_sync(dev); 244 } 245 246 + static int __hidp_send_ctrl_message(struct hidp_session *session, 247 + unsigned char hdr, unsigned char *data, int size) 248 + { 249 + struct sk_buff *skb; 250 + 251 + BT_DBG("session %p data %p size %d", session, data, size); 252 + 253 + if (!(skb = alloc_skb(size + 1, GFP_ATOMIC))) { 254 + BT_ERR("Can't allocate memory for new frame"); 255 + return -ENOMEM; 256 + } 257 + 258 + *skb_put(skb, 1) = hdr; 259 + if (data && size > 0) 260 + memcpy(skb_put(skb, size), data, size); 261 + 262 + skb_queue_tail(&session->ctrl_transmit, skb); 263 + 264 + return 0; 265 + } 266 + 267 + static inline int hidp_send_ctrl_message(struct hidp_session *session, 268 + unsigned char hdr, unsigned char *data, int size) 269 + { 270 + int err; 271 + 272 + err = __hidp_send_ctrl_message(session, hdr, data, size); 273 + 274 + hidp_schedule(session); 275 + 276 + return err; 277 + } 278 + 279 static int hidp_queue_report(struct hidp_session *session, 280 unsigned char *data, int size) 281 { ··· 282 283 static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count) 284 { 285 + if (hidp_send_ctrl_message(hid->driver_data, 286 + HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_FEATURE, 287 + data, count)) 288 return -ENOMEM; 289 return count; 290 } ··· 305 { 306 if (session->idle_to > 0) 307 del_timer(&session->timer); 308 } 309 310 static void hidp_process_handshake(struct hidp_session *session,
+6 -8
net/bluetooth/l2cap.c
··· 1368 1369 while ((skb = sk->sk_send_head) && (!l2cap_tx_window_full(sk)) && 1370 !(pi->conn_state & L2CAP_CONN_REMOTE_BUSY)) { 1371 - tx_skb = skb_clone(skb, GFP_ATOMIC); 1372 1373 if (pi->remote_max_tx && 1374 bt_cb(skb)->retries == pi->remote_max_tx) { 1375 l2cap_send_disconn_req(pi->conn, sk); 1376 break; 1377 } 1378 1379 bt_cb(skb)->retries++; 1380 ··· 3519 struct l2cap_pinfo *pi; 3520 u16 control, len; 3521 u8 tx_seq; 3522 - int err; 3523 3524 sk = l2cap_get_chan_by_scid(&conn->chan_list, cid); 3525 if (!sk) { ··· 3570 goto drop; 3571 3572 if (__is_iframe(control)) 3573 - err = l2cap_data_channel_iframe(sk, control, skb); 3574 else 3575 - err = l2cap_data_channel_sframe(sk, control, skb); 3576 3577 - if (!err) 3578 - goto done; 3579 - break; 3580 3581 case L2CAP_MODE_STREAMING: 3582 control = get_unaligned_le16(skb->data); ··· 3600 else 3601 pi->expected_tx_seq = tx_seq + 1; 3602 3603 - err = l2cap_sar_reassembly_sdu(sk, skb, control); 3604 3605 goto done; 3606
··· 1368 1369 while ((skb = sk->sk_send_head) && (!l2cap_tx_window_full(sk)) && 1370 !(pi->conn_state & L2CAP_CONN_REMOTE_BUSY)) { 1371 1372 if (pi->remote_max_tx && 1373 bt_cb(skb)->retries == pi->remote_max_tx) { 1374 l2cap_send_disconn_req(pi->conn, sk); 1375 break; 1376 } 1377 + 1378 + tx_skb = skb_clone(skb, GFP_ATOMIC); 1379 1380 bt_cb(skb)->retries++; 1381 ··· 3518 struct l2cap_pinfo *pi; 3519 u16 control, len; 3520 u8 tx_seq; 3521 3522 sk = l2cap_get_chan_by_scid(&conn->chan_list, cid); 3523 if (!sk) { ··· 3570 goto drop; 3571 3572 if (__is_iframe(control)) 3573 + l2cap_data_channel_iframe(sk, control, skb); 3574 else 3575 + l2cap_data_channel_sframe(sk, control, skb); 3576 3577 + goto done; 3578 3579 case L2CAP_MODE_STREAMING: 3580 control = get_unaligned_le16(skb->data); ··· 3602 else 3603 pi->expected_tx_seq = tx_seq + 1; 3604 3605 + l2cap_sar_reassembly_sdu(sk, skb, control); 3606 3607 goto done; 3608
+1
net/ipv6/netfilter/nf_conntrack_reasm.c
··· 63 struct inet_frag_queue q; 64 65 __be32 id; /* fragment id */ 66 struct in6_addr saddr; 67 struct in6_addr daddr; 68
··· 63 struct inet_frag_queue q; 64 65 __be32 id; /* fragment id */ 66 + u32 user; 67 struct in6_addr saddr; 68 struct in6_addr daddr; 69
+1 -1
net/mac80211/driver-trace.h
··· 680 __entry->ret = ret; 681 __entry->action = action; 682 __entry->tid = tid; 683 - __entry->ssn = *ssn; 684 ), 685 686 TP_printk(
··· 680 __entry->ret = ret; 681 __entry->action = action; 682 __entry->tid = tid; 683 + __entry->ssn = ssn ? *ssn : 0; 684 ), 685 686 TP_printk(
+2 -1
net/netfilter/nf_conntrack_netlink.c
··· 1437 struct nlattr *nest_parms; 1438 1439 memset(&m, 0xFF, sizeof(m)); 1440 - m.src.u.all = mask->src.u.all; 1441 memcpy(&m.src.u3, &mask->src.u3, sizeof(m.src.u3)); 1442 1443 nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK | NLA_F_NESTED); 1444 if (!nest_parms)
··· 1437 struct nlattr *nest_parms; 1438 1439 memset(&m, 0xFF, sizeof(m)); 1440 memcpy(&m.src.u3, &mask->src.u3, sizeof(m.src.u3)); 1441 + m.src.u.all = mask->src.u.all; 1442 + m.dst.protonum = tuple->dst.protonum; 1443 1444 nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK | NLA_F_NESTED); 1445 if (!nest_parms)
+1 -1
net/netfilter/nf_conntrack_sip.c
··· 376 dptr += hdr->len; 377 else if (hdr->cname && limit - dptr >= hdr->clen + 1 && 378 strnicmp(dptr, hdr->cname, hdr->clen) == 0 && 379 - !isalpha(*(dptr + hdr->clen + 1))) 380 dptr += hdr->clen; 381 else 382 continue;
··· 376 dptr += hdr->len; 377 else if (hdr->cname && limit - dptr >= hdr->clen + 1 && 378 strnicmp(dptr, hdr->cname, hdr->clen) == 0 && 379 + !isalpha(*(dptr + hdr->clen))) 380 dptr += hdr->clen; 381 else 382 continue;