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: (75 commits)
pppoe.c: Fix kernel panic caused by __pppoe_xmit
WAN: Fix a TX IRQ causing BUG() in PC300 and PCI200SYN drivers.
bnx2x: Advance a version number to 1.60.01-0
bnx2x: Fixed a compilation warning
bnx2x: LSO code was broken on BE platforms
qlge: Fix deadlock when cancelling worker.
net: fix skb_defer_rx_timestamp()
cxgb4vf: Ingress Queue Entry Size needs to be 64 bytes
phy: add the IC+ IP1001 driver
atm: correct sysfs 'device' link creation and parent relationships
MAINTAINERS: remove me from tulip
SCTP: Fix SCTP_SET_PEER_PRIMARY_ADDR to accpet v4mapped address
enic: Bug Fix: Pass napi reference to the isr that services receive queue
ipv6: fix nl group when advertising a new link
connector: add module alias
net: Document the kernel_recvmsg() function
r8169: Fix runtime power management
hso: IP checksuming doesn't work on GE0301 option cards
xfrm: Fix xfrm_state_migrate leak
net: Convert netpoll blocking api in bonding driver to be a counter
...

+569 -353
-1
MAINTAINERS
··· 5932 5933 TULIP NETWORK DRIVERS 5934 M: Grant Grundler <grundler@parisc-linux.org> 5935 - M: Kyle McMartin <kyle@mcmartin.ca> 5936 L: netdev@vger.kernel.org 5937 S: Maintained 5938 F: drivers/net/tulip/
··· 5932 5933 TULIP NETWORK DRIVERS 5934 M: Grant Grundler <grundler@parisc-linux.org> 5935 L: netdev@vger.kernel.org 5936 S: Maintained 5937 F: drivers/net/tulip/
+1 -1
drivers/atm/adummy.c
··· 154 err = -ENOMEM; 155 goto out; 156 } 157 - atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, NULL); 158 if (!atm_dev) { 159 printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n"); 160 err = -ENODEV;
··· 154 err = -ENOMEM; 155 goto out; 156 } 157 + atm_dev = atm_dev_register(DEV_LABEL, NULL, &adummy_ops, -1, NULL); 158 if (!atm_dev) { 159 printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n"); 160 err = -ENODEV;
+2 -1
drivers/atm/ambassador.c
··· 2244 goto out_reset; 2245 } 2246 2247 - dev->atm_dev = atm_dev_register (DEV_LABEL, &amb_ops, -1, NULL); 2248 if (!dev->atm_dev) { 2249 PRINTD (DBG_ERR, "failed to register Madge ATM adapter"); 2250 err = -EINVAL;
··· 2244 goto out_reset; 2245 } 2246 2247 + dev->atm_dev = atm_dev_register (DEV_LABEL, &pci_dev->dev, &amb_ops, -1, 2248 + NULL); 2249 if (!dev->atm_dev) { 2250 PRINTD (DBG_ERR, "failed to register Madge ATM adapter"); 2251 err = -EINVAL;
+1 -1
drivers/atm/atmtcp.c
··· 366 if (!dev_data) 367 return -ENOMEM; 368 369 - dev = atm_dev_register(DEV_LABEL,&atmtcp_v_dev_ops,itf,NULL); 370 if (!dev) { 371 kfree(dev_data); 372 return itf == -1 ? -ENOMEM : -EBUSY;
··· 366 if (!dev_data) 367 return -ENOMEM; 368 369 + dev = atm_dev_register(DEV_LABEL,NULL,&atmtcp_v_dev_ops,itf,NULL); 370 if (!dev) { 371 kfree(dev_data); 372 return itf == -1 ? -ENOMEM : -EBUSY;
+1 -1
drivers/atm/eni.c
··· 2244 &zeroes); 2245 if (!cpu_zeroes) goto out1; 2246 } 2247 - dev = atm_dev_register(DEV_LABEL,&ops,-1,NULL); 2248 if (!dev) goto out2; 2249 pci_set_drvdata(pci_dev, dev); 2250 eni_dev->pci_dev = pci_dev;
··· 2244 &zeroes); 2245 if (!cpu_zeroes) goto out1; 2246 } 2247 + dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &ops, -1, NULL); 2248 if (!dev) goto out2; 2249 pci_set_drvdata(pci_dev, dev); 2250 eni_dev->pci_dev = pci_dev;
+1 -1
drivers/atm/firestream.c
··· 1911 fs_dev, sizeof (struct fs_dev)); 1912 if (!fs_dev) 1913 goto err_out; 1914 - atm_dev = atm_dev_register("fs", &ops, -1, NULL); 1915 if (!atm_dev) 1916 goto err_out_free_fs_dev; 1917
··· 1911 fs_dev, sizeof (struct fs_dev)); 1912 if (!fs_dev) 1913 goto err_out; 1914 + atm_dev = atm_dev_register("fs", &pci_dev->dev, &ops, -1, NULL); 1915 if (!atm_dev) 1916 goto err_out_free_fs_dev; 1917
+7 -7
drivers/atm/fore200e.c
··· 2567 2568 2569 static int __devinit 2570 - fore200e_register(struct fore200e* fore200e) 2571 { 2572 struct atm_dev* atm_dev; 2573 2574 DPRINTK(2, "device %s being registered\n", fore200e->name); 2575 2576 - atm_dev = atm_dev_register(fore200e->bus->proc_name, &fore200e_ops, -1, 2577 - NULL); 2578 if (atm_dev == NULL) { 2579 printk(FORE200E "unable to register device %s\n", fore200e->name); 2580 return -ENODEV; ··· 2594 2595 2596 static int __devinit 2597 - fore200e_init(struct fore200e* fore200e) 2598 { 2599 - if (fore200e_register(fore200e) < 0) 2600 return -ENODEV; 2601 2602 if (fore200e->bus->configure(fore200e) < 0) ··· 2662 2663 sprintf(fore200e->name, "%s-%d", bus->model_name, index); 2664 2665 - err = fore200e_init(fore200e); 2666 if (err < 0) { 2667 fore200e_shutdown(fore200e); 2668 kfree(fore200e); ··· 2740 2741 sprintf(fore200e->name, "%s-%d", bus->model_name, index); 2742 2743 - err = fore200e_init(fore200e); 2744 if (err < 0) { 2745 fore200e_shutdown(fore200e); 2746 goto out_free;
··· 2567 2568 2569 static int __devinit 2570 + fore200e_register(struct fore200e* fore200e, struct device *parent) 2571 { 2572 struct atm_dev* atm_dev; 2573 2574 DPRINTK(2, "device %s being registered\n", fore200e->name); 2575 2576 + atm_dev = atm_dev_register(fore200e->bus->proc_name, parent, &fore200e_ops, 2577 + -1, NULL); 2578 if (atm_dev == NULL) { 2579 printk(FORE200E "unable to register device %s\n", fore200e->name); 2580 return -ENODEV; ··· 2594 2595 2596 static int __devinit 2597 + fore200e_init(struct fore200e* fore200e, struct device *parent) 2598 { 2599 + if (fore200e_register(fore200e, parent) < 0) 2600 return -ENODEV; 2601 2602 if (fore200e->bus->configure(fore200e) < 0) ··· 2662 2663 sprintf(fore200e->name, "%s-%d", bus->model_name, index); 2664 2665 + err = fore200e_init(fore200e, &op->dev); 2666 if (err < 0) { 2667 fore200e_shutdown(fore200e); 2668 kfree(fore200e); ··· 2740 2741 sprintf(fore200e->name, "%s-%d", bus->model_name, index); 2742 2743 + err = fore200e_init(fore200e, &pci_dev->dev); 2744 if (err < 0) { 2745 fore200e_shutdown(fore200e); 2746 goto out_free;
+1 -1
drivers/atm/he.c
··· 366 goto init_one_failure; 367 } 368 369 - atm_dev = atm_dev_register(DEV_LABEL, &he_ops, -1, NULL); 370 if (!atm_dev) { 371 err = -ENODEV; 372 goto init_one_failure;
··· 366 goto init_one_failure; 367 } 368 369 + atm_dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &he_ops, -1, NULL); 370 if (!atm_dev) { 371 err = -ENODEV; 372 goto init_one_failure;
+2 -1
drivers/atm/horizon.c
··· 2733 PRINTD(DBG_INFO, "found Madge ATM adapter (hrz) at: IO %x, IRQ %u, MEM %p", 2734 iobase, irq, membase); 2735 2736 - dev->atm_dev = atm_dev_register(DEV_LABEL, &hrz_ops, -1, NULL); 2737 if (!(dev->atm_dev)) { 2738 PRINTD(DBG_ERR, "failed to register Madge ATM adapter"); 2739 err = -EINVAL;
··· 2733 PRINTD(DBG_INFO, "found Madge ATM adapter (hrz) at: IO %x, IRQ %u, MEM %p", 2734 iobase, irq, membase); 2735 2736 + dev->atm_dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &hrz_ops, -1, 2737 + NULL); 2738 if (!(dev->atm_dev)) { 2739 PRINTD(DBG_ERR, "failed to register Madge ATM adapter"); 2740 err = -EINVAL;
+2 -1
drivers/atm/idt77252.c
··· 3698 goto err_out_iounmap; 3699 } 3700 3701 - dev = atm_dev_register("idt77252", &idt77252_ops, -1, NULL); 3702 if (!dev) { 3703 printk("%s: can't register atm device\n", card->name); 3704 err = -EIO;
··· 3698 goto err_out_iounmap; 3699 } 3700 3701 + dev = atm_dev_register("idt77252", &pcidev->dev, &idt77252_ops, -1, 3702 + NULL); 3703 if (!dev) { 3704 printk("%s: can't register atm device\n", card->name); 3705 err = -EIO;
+1 -1
drivers/atm/iphase.c
··· 3172 ret = -ENODEV; 3173 goto err_out_free_iadev; 3174 } 3175 - dev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); 3176 if (!dev) { 3177 ret = -ENOMEM; 3178 goto err_out_disable_dev;
··· 3172 ret = -ENODEV; 3173 goto err_out_free_iadev; 3174 } 3175 + dev = atm_dev_register(DEV_LABEL, &pdev->dev, &ops, -1, NULL); 3176 if (!dev) { 3177 ret = -ENOMEM; 3178 goto err_out_disable_dev;
+1 -1
drivers/atm/lanai.c
··· 2591 return -ENOMEM; 2592 } 2593 2594 - atmdev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); 2595 if (atmdev == NULL) { 2596 printk(KERN_ERR DEV_LABEL 2597 ": couldn't register atm device!\n");
··· 2591 return -ENOMEM; 2592 } 2593 2594 + atmdev = atm_dev_register(DEV_LABEL, &pci->dev, &ops, -1, NULL); 2595 if (atmdev == NULL) { 2596 printk(KERN_ERR DEV_LABEL 2597 ": couldn't register atm device!\n");
+2 -1
drivers/atm/nicstar.c
··· 771 } 772 773 /* Register device */ 774 - card->atmdev = atm_dev_register("nicstar", &atm_ops, -1, NULL); 775 if (card->atmdev == NULL) { 776 printk("nicstar%d: can't register device.\n", i); 777 error = 17;
··· 771 } 772 773 /* Register device */ 774 + card->atmdev = atm_dev_register("nicstar", &card->pcidev->dev, &atm_ops, 775 + -1, NULL); 776 if (card->atmdev == NULL) { 777 printk("nicstar%d: can't register device.\n", i); 778 error = 17;
+4 -4
drivers/atm/solos-pci.c
··· 166 static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci); 167 static int list_vccs(int vci); 168 static void release_vccs(struct atm_dev *dev); 169 - static int atm_init(struct solos_card *); 170 static void atm_remove(struct solos_card *); 171 static int send_command(struct solos_card *card, int dev, const char *buf, size_t size); 172 static void solos_bh(unsigned long); ··· 1210 if (db_firmware_upgrade) 1211 flash_upgrade(card, 3); 1212 1213 - err = atm_init(card); 1214 if (err) 1215 goto out_free_irq; 1216 ··· 1233 return err; 1234 } 1235 1236 - static int atm_init(struct solos_card *card) 1237 { 1238 int i; 1239 ··· 1244 skb_queue_head_init(&card->tx_queue[i]); 1245 skb_queue_head_init(&card->cli_queue[i]); 1246 1247 - card->atmdev[i] = atm_dev_register("solos-pci", &fpga_ops, -1, NULL); 1248 if (!card->atmdev[i]) { 1249 dev_err(&card->dev->dev, "Could not register ATM device %d\n", i); 1250 atm_remove(card);
··· 166 static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci); 167 static int list_vccs(int vci); 168 static void release_vccs(struct atm_dev *dev); 169 + static int atm_init(struct solos_card *, struct device *); 170 static void atm_remove(struct solos_card *); 171 static int send_command(struct solos_card *card, int dev, const char *buf, size_t size); 172 static void solos_bh(unsigned long); ··· 1210 if (db_firmware_upgrade) 1211 flash_upgrade(card, 3); 1212 1213 + err = atm_init(card, &dev->dev); 1214 if (err) 1215 goto out_free_irq; 1216 ··· 1233 return err; 1234 } 1235 1236 + static int atm_init(struct solos_card *card, struct device *parent) 1237 { 1238 int i; 1239 ··· 1244 skb_queue_head_init(&card->tx_queue[i]); 1245 skb_queue_head_init(&card->cli_queue[i]); 1246 1247 + card->atmdev[i] = atm_dev_register("solos-pci", parent, &fpga_ops, -1, NULL); 1248 if (!card->atmdev[i]) { 1249 dev_err(&card->dev->dev, "Could not register ATM device %d\n", i); 1250 atm_remove(card);
+1 -1
drivers/atm/zatm.c
··· 1597 goto out; 1598 } 1599 1600 - dev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); 1601 if (!dev) 1602 goto out_free; 1603
··· 1597 goto out; 1598 } 1599 1600 + dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &ops, -1, NULL); 1601 if (!dev) 1602 goto out_free; 1603
+4
drivers/bluetooth/ath3k.c
··· 35 static struct usb_device_id ath3k_table[] = { 36 /* Atheros AR3011 */ 37 { USB_DEVICE(0x0CF3, 0x3000) }, 38 { } /* Terminating entry */ 39 }; 40
··· 35 static struct usb_device_id ath3k_table[] = { 36 /* Atheros AR3011 */ 37 { USB_DEVICE(0x0CF3, 0x3000) }, 38 + 39 + /* Atheros AR3011 with sflash firmware*/ 40 + { USB_DEVICE(0x0CF3, 0x3002) }, 41 + 42 { } /* Terminating entry */ 43 }; 44
+9 -3
drivers/bluetooth/btusb.c
··· 99 /* Broadcom BCM2033 without firmware */ 100 { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE }, 101 102 /* Broadcom BCM2035 */ 103 { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, 104 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, ··· 242 243 err = usb_submit_urb(urb, GFP_ATOMIC); 244 if (err < 0) { 245 - BT_ERR("%s urb %p failed to resubmit (%d)", 246 hdev->name, urb, -err); 247 usb_unanchor_urb(urb); 248 } ··· 327 328 err = usb_submit_urb(urb, GFP_ATOMIC); 329 if (err < 0) { 330 - BT_ERR("%s urb %p failed to resubmit (%d)", 331 hdev->name, urb, -err); 332 usb_unanchor_urb(urb); 333 } ··· 417 418 err = usb_submit_urb(urb, GFP_ATOMIC); 419 if (err < 0) { 420 - BT_ERR("%s urb %p failed to resubmit (%d)", 421 hdev->name, urb, -err); 422 usb_unanchor_urb(urb); 423 }
··· 99 /* Broadcom BCM2033 without firmware */ 100 { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE }, 101 102 + /* Atheros 3011 with sflash firmware */ 103 + { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, 104 + 105 /* Broadcom BCM2035 */ 106 { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, 107 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, ··· 239 240 err = usb_submit_urb(urb, GFP_ATOMIC); 241 if (err < 0) { 242 + if (err != -EPERM) 243 + BT_ERR("%s urb %p failed to resubmit (%d)", 244 hdev->name, urb, -err); 245 usb_unanchor_urb(urb); 246 } ··· 323 324 err = usb_submit_urb(urb, GFP_ATOMIC); 325 if (err < 0) { 326 + if (err != -EPERM) 327 + BT_ERR("%s urb %p failed to resubmit (%d)", 328 hdev->name, urb, -err); 329 usb_unanchor_urb(urb); 330 } ··· 412 413 err = usb_submit_urb(urb, GFP_ATOMIC); 414 if (err < 0) { 415 + if (err != -EPERM) 416 + BT_ERR("%s urb %p failed to resubmit (%d)", 417 hdev->name, urb, -err); 418 usb_unanchor_urb(urb); 419 }
+1
drivers/connector/connector.c
··· 36 MODULE_LICENSE("GPL"); 37 MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); 38 MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); 39 40 static struct cn_dev cdev; 41
··· 36 MODULE_LICENSE("GPL"); 37 MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); 38 MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); 39 + MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_CONNECTOR); 40 41 static struct cn_dev cdev; 42
+5 -6
drivers/net/b44.c
··· 381 __b44_set_flow_ctrl(bp, pause_enab); 382 } 383 384 - #ifdef SSB_DRIVER_MIPS 385 - extern char *nvram_get(char *name); 386 static void b44_wap54g10_workaround(struct b44 *bp) 387 { 388 - const char *str; 389 u32 val; 390 int err; 391 ··· 394 * see https://dev.openwrt.org/ticket/146 395 * check and reset bit "isolate" 396 */ 397 - str = nvram_get("boardnum"); 398 - if (!str) 399 return; 400 - if (simple_strtoul(str, NULL, 0) == 2) { 401 err = __b44_readphy(bp, 0, MII_BMCR, &val); 402 if (err) 403 goto error;
··· 381 __b44_set_flow_ctrl(bp, pause_enab); 382 } 383 384 + #ifdef CONFIG_BCM47XX 385 + #include <asm/mach-bcm47xx/nvram.h> 386 static void b44_wap54g10_workaround(struct b44 *bp) 387 { 388 + char buf[20]; 389 u32 val; 390 int err; 391 ··· 394 * see https://dev.openwrt.org/ticket/146 395 * check and reset bit "isolate" 396 */ 397 + if (nvram_getenv("boardnum", buf, sizeof(buf)) < 0) 398 return; 399 + if (simple_strtoul(buf, NULL, 0) == 2) { 400 err = __b44_readphy(bp, 0, MII_BMCR, &val); 401 if (err) 402 goto error;
+1 -1
drivers/net/benet/be_cmds.c
··· 1235 1236 i = 0; 1237 netdev_for_each_mc_addr(ha, netdev) 1238 - memcpy(req->mac[i].byte, ha->addr, ETH_ALEN); 1239 } else { 1240 req->promiscuous = 1; 1241 }
··· 1235 1236 i = 0; 1237 netdev_for_each_mc_addr(ha, netdev) 1238 + memcpy(req->mac[i++].byte, ha->addr, ETH_ALEN); 1239 } else { 1240 req->promiscuous = 1; 1241 }
+2 -2
drivers/net/bnx2x/bnx2x.h
··· 20 * (you will need to reboot afterwards) */ 21 /* #define BNX2X_STOP_ON_ERROR */ 22 23 - #define DRV_MODULE_VERSION "1.60.00-4" 24 - #define DRV_MODULE_RELDATE "2010/11/01" 25 #define BNX2X_BC_VER 0x040200 26 27 #define BNX2X_MULTI_QUEUE
··· 20 * (you will need to reboot afterwards) */ 21 /* #define BNX2X_STOP_ON_ERROR */ 22 23 + #define DRV_MODULE_VERSION "1.60.01-0" 24 + #define DRV_MODULE_RELDATE "2010/11/12" 25 #define BNX2X_BC_VER 0x040200 26 27 #define BNX2X_MULTI_QUEUE
+26 -16
drivers/net/bnx2x/bnx2x_cmn.c
··· 1782 } 1783 #endif 1784 1785 - static inline void bnx2x_set_pbd_gso_e2(struct sk_buff *skb, 1786 - struct eth_tx_parse_bd_e2 *pbd, 1787 - u32 xmit_type) 1788 { 1789 - pbd->parsing_data |= cpu_to_le16(skb_shinfo(skb)->gso_size) << 1790 - ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT; 1791 if ((xmit_type & XMIT_GSO_V6) && 1792 (ipv6_hdr(skb)->nexthdr == NEXTHDR_IPV6)) 1793 - pbd->parsing_data |= ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR; 1794 } 1795 1796 /** ··· 1835 * @return header len 1836 */ 1837 static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb, 1838 - struct eth_tx_parse_bd_e2 *pbd, 1839 - u32 xmit_type) 1840 { 1841 - pbd->parsing_data |= cpu_to_le16(tcp_hdrlen(skb)/4) << 1842 - ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT; 1843 1844 - pbd->parsing_data |= cpu_to_le16(((unsigned char *)tcp_hdr(skb) - 1845 - skb->data) / 2) << 1846 - ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT; 1847 1848 return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data; 1849 } ··· 1912 struct eth_tx_bd *tx_data_bd, *total_pkt_bd = NULL; 1913 struct eth_tx_parse_bd_e1x *pbd_e1x = NULL; 1914 struct eth_tx_parse_bd_e2 *pbd_e2 = NULL; 1915 u16 pkt_prod, bd_prod; 1916 int nbd, fp_index; 1917 dma_addr_t mapping; ··· 2034 memset(pbd_e2, 0, sizeof(struct eth_tx_parse_bd_e2)); 2035 /* Set PBD in checksum offload case */ 2036 if (xmit_type & XMIT_CSUM) 2037 - hlen = bnx2x_set_pbd_csum_e2(bp, 2038 - skb, pbd_e2, xmit_type); 2039 } else { 2040 pbd_e1x = &fp->tx_desc_ring[bd_prod].parse_bd_e1x; 2041 memset(pbd_e1x, 0, sizeof(struct eth_tx_parse_bd_e1x)); ··· 2078 bd_prod = bnx2x_tx_split(bp, fp, tx_buf, &tx_start_bd, 2079 hlen, bd_prod, ++nbd); 2080 if (CHIP_IS_E2(bp)) 2081 - bnx2x_set_pbd_gso_e2(skb, pbd_e2, xmit_type); 2082 else 2083 bnx2x_set_pbd_gso(skb, pbd_e1x, xmit_type); 2084 } 2085 tx_data_bd = (struct eth_tx_bd *)tx_start_bd; 2086 2087 /* Handle fragmented skb */
··· 1782 } 1783 #endif 1784 1785 + static inline void bnx2x_set_pbd_gso_e2(struct sk_buff *skb, u32 *parsing_data, 1786 + u32 xmit_type) 1787 { 1788 + *parsing_data |= (skb_shinfo(skb)->gso_size << 1789 + ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT) & 1790 + ETH_TX_PARSE_BD_E2_LSO_MSS; 1791 if ((xmit_type & XMIT_GSO_V6) && 1792 (ipv6_hdr(skb)->nexthdr == NEXTHDR_IPV6)) 1793 + *parsing_data |= ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR; 1794 } 1795 1796 /** ··· 1835 * @return header len 1836 */ 1837 static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb, 1838 + u32 *parsing_data, u32 xmit_type) 1839 { 1840 + *parsing_data |= ((tcp_hdrlen(skb)/4) << 1841 + ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) & 1842 + ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW; 1843 1844 + *parsing_data |= ((((u8 *)tcp_hdr(skb) - skb->data) / 2) << 1845 + ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) & 1846 + ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W; 1847 1848 return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data; 1849 } ··· 1912 struct eth_tx_bd *tx_data_bd, *total_pkt_bd = NULL; 1913 struct eth_tx_parse_bd_e1x *pbd_e1x = NULL; 1914 struct eth_tx_parse_bd_e2 *pbd_e2 = NULL; 1915 + u32 pbd_e2_parsing_data = 0; 1916 u16 pkt_prod, bd_prod; 1917 int nbd, fp_index; 1918 dma_addr_t mapping; ··· 2033 memset(pbd_e2, 0, sizeof(struct eth_tx_parse_bd_e2)); 2034 /* Set PBD in checksum offload case */ 2035 if (xmit_type & XMIT_CSUM) 2036 + hlen = bnx2x_set_pbd_csum_e2(bp, skb, 2037 + &pbd_e2_parsing_data, 2038 + xmit_type); 2039 } else { 2040 pbd_e1x = &fp->tx_desc_ring[bd_prod].parse_bd_e1x; 2041 memset(pbd_e1x, 0, sizeof(struct eth_tx_parse_bd_e1x)); ··· 2076 bd_prod = bnx2x_tx_split(bp, fp, tx_buf, &tx_start_bd, 2077 hlen, bd_prod, ++nbd); 2078 if (CHIP_IS_E2(bp)) 2079 + bnx2x_set_pbd_gso_e2(skb, &pbd_e2_parsing_data, 2080 + xmit_type); 2081 else 2082 bnx2x_set_pbd_gso(skb, pbd_e1x, xmit_type); 2083 } 2084 + 2085 + /* Set the PBD's parsing_data field if not zero 2086 + * (for the chips newer than 57711). 2087 + */ 2088 + if (pbd_e2_parsing_data) 2089 + pbd_e2->parsing_data = cpu_to_le32(pbd_e2_parsing_data); 2090 + 2091 tx_data_bd = (struct eth_tx_bd *)tx_start_bd; 2092 2093 /* Handle fragmented skb */
+2 -2
drivers/net/bnx2x/bnx2x_init_ops.h
··· 838 /**************************************************************************** 839 * SRC initializations 840 ****************************************************************************/ 841 - 842 /* called during init func stage */ 843 static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2, 844 dma_addr_t t2_mapping, int src_cid_count) ··· 862 U64_HI((u64)t2_mapping + 863 (src_cid_count-1) * sizeof(struct src_ent))); 864 } 865 - 866 #endif /* BNX2X_INIT_OPS_H */
··· 838 /**************************************************************************** 839 * SRC initializations 840 ****************************************************************************/ 841 + #ifdef BCM_CNIC 842 /* called during init func stage */ 843 static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2, 844 dma_addr_t t2_mapping, int src_cid_count) ··· 862 U64_HI((u64)t2_mapping + 863 (src_cid_count-1) * sizeof(struct src_ent))); 864 } 865 + #endif 866 #endif /* BNX2X_INIT_OPS_H */
+6 -13
drivers/net/bonding/bond_main.c
··· 171 /*----------------------------- Global variables ----------------------------*/ 172 173 #ifdef CONFIG_NET_POLL_CONTROLLER 174 - cpumask_var_t netpoll_block_tx; 175 #endif 176 177 static const char * const version = ··· 1576 1577 /* If this is the first slave, then we need to set the master's hardware 1578 * address to be the same as the slave's. */ 1579 - if (bond->slave_cnt == 0) 1580 memcpy(bond->dev->dev_addr, slave_dev->dev_addr, 1581 slave_dev->addr_len); 1582 ··· 5299 if (res) 5300 goto out; 5301 5302 - #ifdef CONFIG_NET_POLL_CONTROLLER 5303 - if (!alloc_cpumask_var(&netpoll_block_tx, GFP_KERNEL)) { 5304 - res = -ENOMEM; 5305 - goto out; 5306 - } 5307 - #endif 5308 - 5309 res = register_pernet_subsys(&bond_net_ops); 5310 if (res) 5311 goto out; ··· 5327 rtnl_link_unregister(&bond_link_ops); 5328 err_link: 5329 unregister_pernet_subsys(&bond_net_ops); 5330 - #ifdef CONFIG_NET_POLL_CONTROLLER 5331 - free_cpumask_var(netpoll_block_tx); 5332 - #endif 5333 goto out; 5334 5335 } ··· 5343 unregister_pernet_subsys(&bond_net_ops); 5344 5345 #ifdef CONFIG_NET_POLL_CONTROLLER 5346 - free_cpumask_var(netpoll_block_tx); 5347 #endif 5348 } 5349
··· 171 /*----------------------------- Global variables ----------------------------*/ 172 173 #ifdef CONFIG_NET_POLL_CONTROLLER 174 + atomic_t netpoll_block_tx = ATOMIC_INIT(0); 175 #endif 176 177 static const char * const version = ··· 1576 1577 /* If this is the first slave, then we need to set the master's hardware 1578 * address to be the same as the slave's. */ 1579 + if (is_zero_ether_addr(bond->dev->dev_addr)) 1580 memcpy(bond->dev->dev_addr, slave_dev->dev_addr, 1581 slave_dev->addr_len); 1582 ··· 5299 if (res) 5300 goto out; 5301 5302 res = register_pernet_subsys(&bond_net_ops); 5303 if (res) 5304 goto out; ··· 5334 rtnl_link_unregister(&bond_link_ops); 5335 err_link: 5336 unregister_pernet_subsys(&bond_net_ops); 5337 goto out; 5338 5339 } ··· 5353 unregister_pernet_subsys(&bond_net_ops); 5354 5355 #ifdef CONFIG_NET_POLL_CONTROLLER 5356 + /* 5357 + * Make sure we don't have an imbalance on our netpoll blocking 5358 + */ 5359 + WARN_ON(atomic_read(&netpoll_block_tx)); 5360 #endif 5361 } 5362
+4 -8
drivers/net/bonding/bonding.h
··· 119 120 121 #ifdef CONFIG_NET_POLL_CONTROLLER 122 - extern cpumask_var_t netpoll_block_tx; 123 124 static inline void block_netpoll_tx(void) 125 { 126 - preempt_disable(); 127 - BUG_ON(cpumask_test_and_set_cpu(smp_processor_id(), 128 - netpoll_block_tx)); 129 } 130 131 static inline void unblock_netpoll_tx(void) 132 { 133 - BUG_ON(!cpumask_test_and_clear_cpu(smp_processor_id(), 134 - netpoll_block_tx)); 135 - preempt_enable(); 136 } 137 138 static inline int is_netpoll_tx_blocked(struct net_device *dev) 139 { 140 if (unlikely(dev->priv_flags & IFF_IN_NETPOLL)) 141 - return cpumask_test_cpu(smp_processor_id(), netpoll_block_tx); 142 return 0; 143 } 144 #else
··· 119 120 121 #ifdef CONFIG_NET_POLL_CONTROLLER 122 + extern atomic_t netpoll_block_tx; 123 124 static inline void block_netpoll_tx(void) 125 { 126 + atomic_inc(&netpoll_block_tx); 127 } 128 129 static inline void unblock_netpoll_tx(void) 130 { 131 + atomic_dec(&netpoll_block_tx); 132 } 133 134 static inline int is_netpoll_tx_blocked(struct net_device *dev) 135 { 136 if (unlikely(dev->priv_flags & IFF_IN_NETPOLL)) 137 + return atomic_read(&netpoll_block_tx); 138 return 0; 139 } 140 #else
+1 -1
drivers/net/caif/caif_shm_u5500.c
··· 5 * License terms: GNU General Public License (GPL) version 2 6 */ 7 8 - #define pr_fmt(fmt) KBUILD_MODNAME ":" __func__ "():" fmt 9 10 #include <linux/version.h> 11 #include <linux/init.h>
··· 5 * License terms: GNU General Public License (GPL) version 2 6 */ 7 8 + #define pr_fmt(fmt) KBUILD_MODNAME ":" fmt 9 10 #include <linux/version.h> 11 #include <linux/init.h>
+1 -1
drivers/net/caif/caif_shmcore.c
··· 6 * License terms: GNU General Public License (GPL) version 2 7 */ 8 9 - #define pr_fmt(fmt) KBUILD_MODNAME ":" __func__ "():" fmt 10 11 #include <linux/spinlock.h> 12 #include <linux/sched.h>
··· 6 * License terms: GNU General Public License (GPL) version 2 7 */ 8 9 + #define pr_fmt(fmt) KBUILD_MODNAME ":" fmt 10 11 #include <linux/spinlock.h> 12 #include <linux/sched.h>
+1 -1
drivers/net/cxgb4/t4_hw.c
··· 2408 if (index < NEXACT_MAC) 2409 ret++; 2410 else if (hash) 2411 - *hash |= (1 << hash_mac_addr(addr[i])); 2412 } 2413 return ret; 2414 }
··· 2408 if (index < NEXACT_MAC) 2409 ret++; 2410 else if (hash) 2411 + *hash |= (1ULL << hash_mac_addr(addr[i])); 2412 } 2413 return ret; 2414 }
+11 -4
drivers/net/cxgb4vf/cxgb4vf_main.c
··· 2269 { 2270 struct sge *s = &adapter->sge; 2271 int q10g, n10g, qidx, pidx, qs; 2272 2273 /* 2274 * We should not be called till we know how many Queue Sets we can ··· 2314 s->ethqsets = qidx; 2315 2316 /* 2317 * Set up default Queue Set parameters ... Start off with the 2318 * shortest interrupt holdoff timer. 2319 */ ··· 2328 struct sge_eth_rxq *rxq = &s->ethrxq[qs]; 2329 struct sge_eth_txq *txq = &s->ethtxq[qs]; 2330 2331 - init_rspq(&rxq->rspq, 0, 0, 1024, L1_CACHE_BYTES); 2332 rxq->fl.size = 72; 2333 txq->q.size = 1024; 2334 } ··· 2337 * The firmware event queue is used for link state changes and 2338 * notifications of TX DMA completions. 2339 */ 2340 - init_rspq(&s->fw_evtq, SGE_TIMER_RSTRT_CNTR, 0, 512, 2341 - L1_CACHE_BYTES); 2342 2343 /* 2344 * The forwarded interrupt queue is used when we're in MSI interrupt ··· 2353 * any time ... 2354 */ 2355 init_rspq(&s->intrq, SGE_TIMER_RSTRT_CNTR, 0, MSIX_ENTRIES + 1, 2356 - L1_CACHE_BYTES); 2357 } 2358 2359 /*
··· 2269 { 2270 struct sge *s = &adapter->sge; 2271 int q10g, n10g, qidx, pidx, qs; 2272 + size_t iqe_size; 2273 2274 /* 2275 * We should not be called till we know how many Queue Sets we can ··· 2313 s->ethqsets = qidx; 2314 2315 /* 2316 + * The Ingress Queue Entry Size for our various Response Queues needs 2317 + * to be big enough to accommodate the largest message we can receive 2318 + * from the chip/firmware; which is 64 bytes ... 2319 + */ 2320 + iqe_size = 64; 2321 + 2322 + /* 2323 * Set up default Queue Set parameters ... Start off with the 2324 * shortest interrupt holdoff timer. 2325 */ ··· 2320 struct sge_eth_rxq *rxq = &s->ethrxq[qs]; 2321 struct sge_eth_txq *txq = &s->ethtxq[qs]; 2322 2323 + init_rspq(&rxq->rspq, 0, 0, 1024, iqe_size); 2324 rxq->fl.size = 72; 2325 txq->q.size = 1024; 2326 } ··· 2329 * The firmware event queue is used for link state changes and 2330 * notifications of TX DMA completions. 2331 */ 2332 + init_rspq(&s->fw_evtq, SGE_TIMER_RSTRT_CNTR, 0, 512, iqe_size); 2333 2334 /* 2335 * The forwarded interrupt queue is used when we're in MSI interrupt ··· 2346 * any time ... 2347 */ 2348 init_rspq(&s->intrq, SGE_TIMER_RSTRT_CNTR, 0, MSIX_ENTRIES + 1, 2349 + iqe_size); 2350 } 2351 2352 /*
+9
drivers/net/ehea/ehea_ethtool.c
··· 261 262 } 263 264 const struct ethtool_ops ehea_ethtool_ops = { 265 .get_settings = ehea_get_settings, 266 .get_drvinfo = ehea_get_drvinfo, ··· 280 .get_ethtool_stats = ehea_get_ethtool_stats, 281 .get_rx_csum = ehea_get_rx_csum, 282 .set_settings = ehea_set_settings, 283 .nway_reset = ehea_nway_reset, /* Restart autonegotiation */ 284 }; 285
··· 261 262 } 263 264 + static int ehea_set_flags(struct net_device *dev, u32 data) 265 + { 266 + return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO 267 + | ETH_FLAG_TXVLAN 268 + | ETH_FLAG_RXVLAN); 269 + } 270 + 271 const struct ethtool_ops ehea_ethtool_ops = { 272 .get_settings = ehea_get_settings, 273 .get_drvinfo = ehea_get_drvinfo, ··· 273 .get_ethtool_stats = ehea_get_ethtool_stats, 274 .get_rx_csum = ehea_get_rx_csum, 275 .set_settings = ehea_set_settings, 276 + .get_flags = ethtool_op_get_flags, 277 + .set_flags = ehea_set_flags, 278 .nway_reset = ehea_nway_reset, /* Restart autonegotiation */ 279 }; 280
+5 -2
drivers/net/ehea/ehea_main.c
··· 683 int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && 684 pr->port->vgrp); 685 686 - if (use_lro) { 687 if (vlan_extracted) 688 lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb, 689 pr->port->vgrp, ··· 787 } 788 cqe = ehea_poll_rq1(qp, &wqe_index); 789 } 790 - if (use_lro) 791 lro_flush_all(&pr->lro_mgr); 792 793 pr->rx_packets += processed; ··· 3277 | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER 3278 | NETIF_F_LLTX; 3279 dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; 3280 3281 INIT_WORK(&port->reset_task, ehea_reset_port); 3282
··· 683 int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && 684 pr->port->vgrp); 685 686 + if (skb->dev->features & NETIF_F_LRO) { 687 if (vlan_extracted) 688 lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb, 689 pr->port->vgrp, ··· 787 } 788 cqe = ehea_poll_rq1(qp, &wqe_index); 789 } 790 + if (dev->features & NETIF_F_LRO) 791 lro_flush_all(&pr->lro_mgr); 792 793 pr->rx_packets += processed; ··· 3277 | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER 3278 | NETIF_F_LLTX; 3279 dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; 3280 + 3281 + if (use_lro) 3282 + dev->features |= NETIF_F_LRO; 3283 3284 INIT_WORK(&port->reset_task, ehea_reset_port); 3285
+2 -1
drivers/net/enic/enic_main.c
··· 1962 case VNIC_DEV_INTR_MODE_MSIX: 1963 for (i = 0; i < enic->rq_count; i++) { 1964 intr = enic_msix_rq_intr(enic, i); 1965 - enic_isr_msix_rq(enic->msix_entry[intr].vector, enic); 1966 } 1967 intr = enic_msix_wq_intr(enic, i); 1968 enic_isr_msix_wq(enic->msix_entry[intr].vector, enic);
··· 1962 case VNIC_DEV_INTR_MODE_MSIX: 1963 for (i = 0; i < enic->rq_count; i++) { 1964 intr = enic_msix_rq_intr(enic, i); 1965 + enic_isr_msix_rq(enic->msix_entry[intr].vector, 1966 + &enic->napi[i]); 1967 } 1968 intr = enic_msix_wq_intr(enic, i); 1969 enic_isr_msix_wq(enic->msix_entry[intr].vector, enic);
+2
drivers/net/ifb.c
··· 104 rcu_read_unlock(); 105 dev_kfree_skb(skb); 106 stats->tx_dropped++; 107 break; 108 } 109 rcu_read_unlock();
··· 104 rcu_read_unlock(); 105 dev_kfree_skb(skb); 106 stats->tx_dropped++; 107 + if (skb_queue_len(&dp->tq) != 0) 108 + goto resched; 109 break; 110 } 111 rcu_read_unlock();
+3
drivers/net/ixgbe/ixgbe_main.c
··· 4771 adapter->rx_ring[i] = NULL; 4772 } 4773 4774 ixgbe_free_q_vectors(adapter); 4775 ixgbe_reset_interrupt_capability(adapter); 4776 }
··· 4771 adapter->rx_ring[i] = NULL; 4772 } 4773 4774 + adapter->num_tx_queues = 0; 4775 + adapter->num_rx_queues = 0; 4776 + 4777 ixgbe_free_q_vectors(adapter); 4778 ixgbe_reset_interrupt_capability(adapter); 4779 }
+1 -1
drivers/net/phy/Kconfig
··· 64 config ICPLUS_PHY 65 tristate "Drivers for ICPlus PHYs" 66 ---help--- 67 - Currently supports the IP175C PHY. 68 69 config REALTEK_PHY 70 tristate "Drivers for Realtek PHYs"
··· 64 config ICPLUS_PHY 65 tristate "Drivers for ICPlus PHYs" 66 ---help--- 67 + Currently supports the IP175C and IP1001 PHYs. 68 69 config REALTEK_PHY 70 tristate "Drivers for Realtek PHYs"
+54 -5
drivers/net/phy/icplus.c
··· 30 #include <asm/irq.h> 31 #include <asm/uaccess.h> 32 33 - MODULE_DESCRIPTION("ICPlus IP175C PHY driver"); 34 MODULE_AUTHOR("Michael Barkowski"); 35 MODULE_LICENSE("GPL"); 36 ··· 89 return 0; 90 } 91 92 static int ip175c_read_status(struct phy_device *phydev) 93 { 94 if (phydev->addr == 4) /* WAN port */ ··· 148 .driver = { .owner = THIS_MODULE,}, 149 }; 150 151 - static int __init ip175c_init(void) 152 { 153 return phy_driver_register(&ip175c_driver); 154 } 155 156 - static void __exit ip175c_exit(void) 157 { 158 phy_driver_unregister(&ip175c_driver); 159 } 160 161 - module_init(ip175c_init); 162 - module_exit(ip175c_exit); 163 164 static struct mdio_device_id __maybe_unused icplus_tbl[] = { 165 { 0x02430d80, 0x0ffffff0 }, 166 { } 167 }; 168
··· 30 #include <asm/irq.h> 31 #include <asm/uaccess.h> 32 33 + MODULE_DESCRIPTION("ICPlus IP175C/IC1001 PHY drivers"); 34 MODULE_AUTHOR("Michael Barkowski"); 35 MODULE_LICENSE("GPL"); 36 ··· 89 return 0; 90 } 91 92 + static int ip1001_config_init(struct phy_device *phydev) 93 + { 94 + int err, value; 95 + 96 + /* Software Reset PHY */ 97 + value = phy_read(phydev, MII_BMCR); 98 + value |= BMCR_RESET; 99 + err = phy_write(phydev, MII_BMCR, value); 100 + if (err < 0) 101 + return err; 102 + 103 + do { 104 + value = phy_read(phydev, MII_BMCR); 105 + } while (value & BMCR_RESET); 106 + 107 + /* Additional delay (2ns) used to adjust RX clock phase 108 + * at GMII/ RGMII interface */ 109 + value = phy_read(phydev, 16); 110 + value |= 0x3; 111 + 112 + err = phy_write(phydev, 16, value); 113 + if (err < 0) 114 + return err; 115 + 116 + return err; 117 + } 118 + 119 static int ip175c_read_status(struct phy_device *phydev) 120 { 121 if (phydev->addr == 4) /* WAN port */ ··· 121 .driver = { .owner = THIS_MODULE,}, 122 }; 123 124 + static struct phy_driver ip1001_driver = { 125 + .phy_id = 0x02430d90, 126 + .name = "ICPlus IP1001", 127 + .phy_id_mask = 0x0ffffff0, 128 + .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | 129 + SUPPORTED_Asym_Pause, 130 + .config_init = &ip1001_config_init, 131 + .config_aneg = &genphy_config_aneg, 132 + .read_status = &genphy_read_status, 133 + .suspend = genphy_suspend, 134 + .resume = genphy_resume, 135 + .driver = { .owner = THIS_MODULE,}, 136 + }; 137 + 138 + static int __init icplus_init(void) 139 { 140 + int ret = 0; 141 + 142 + ret = phy_driver_register(&ip1001_driver); 143 + if (ret < 0) 144 + return -ENODEV; 145 + 146 return phy_driver_register(&ip175c_driver); 147 } 148 149 + static void __exit icplus_exit(void) 150 { 151 + phy_driver_unregister(&ip1001_driver); 152 phy_driver_unregister(&ip175c_driver); 153 } 154 155 + module_init(icplus_init); 156 + module_exit(icplus_exit); 157 158 static struct mdio_device_id __maybe_unused icplus_tbl[] = { 159 { 0x02430d80, 0x0ffffff0 }, 160 + { 0x02430d90, 0x0ffffff0 }, 161 { } 162 }; 163
+1 -1
drivers/net/pppoe.c
··· 948 949 abort: 950 kfree_skb(skb); 951 - return 0; 952 } 953 954 /************************************************************************
··· 948 949 abort: 950 kfree_skb(skb); 951 + return 1; 952 } 953 954 /************************************************************************
+1
drivers/net/qlge/qlge.h
··· 2083 u32 mailbox_in; 2084 u32 mailbox_out; 2085 struct mbox_params idc_mbc; 2086 2087 int tx_ring_size; 2088 int rx_ring_size;
··· 2083 u32 mailbox_in; 2084 u32 mailbox_out; 2085 struct mbox_params idc_mbc; 2086 + struct mutex mpi_mutex; 2087 2088 int tx_ring_size; 2089 int rx_ring_size;
+1
drivers/net/qlge/qlge_main.c
··· 4629 INIT_DELAYED_WORK(&qdev->mpi_idc_work, ql_mpi_idc_work); 4630 INIT_DELAYED_WORK(&qdev->mpi_core_to_log, ql_mpi_core_to_log); 4631 init_completion(&qdev->ide_completion); 4632 4633 if (!cards_found) { 4634 dev_info(&pdev->dev, "%s\n", DRV_STRING);
··· 4629 INIT_DELAYED_WORK(&qdev->mpi_idc_work, ql_mpi_idc_work); 4630 INIT_DELAYED_WORK(&qdev->mpi_core_to_log, ql_mpi_core_to_log); 4631 init_completion(&qdev->ide_completion); 4632 + mutex_init(&qdev->mpi_mutex); 4633 4634 if (!cards_found) { 4635 dev_info(&pdev->dev, "%s\n", DRV_STRING);
+4 -8
drivers/net/qlge/qlge_mpi.c
··· 534 int status; 535 unsigned long count; 536 537 538 /* Begin polled mode for MPI */ 539 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); ··· 604 end: 605 /* End polled mode for MPI */ 606 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); 607 return status; 608 } 609 ··· 1101 static int ql_set_port_cfg(struct ql_adapter *qdev) 1102 { 1103 int status; 1104 - rtnl_lock(); 1105 status = ql_mb_set_port_cfg(qdev); 1106 - rtnl_unlock(); 1107 if (status) 1108 return status; 1109 status = ql_idc_wait(qdev); ··· 1122 container_of(work, struct ql_adapter, mpi_port_cfg_work.work); 1123 int status; 1124 1125 - rtnl_lock(); 1126 status = ql_mb_get_port_cfg(qdev); 1127 - rtnl_unlock(); 1128 if (status) { 1129 netif_err(qdev, drv, qdev->ndev, 1130 "Bug: Failed to get port config data.\n"); ··· 1165 u32 aen; 1166 int timeout; 1167 1168 - rtnl_lock(); 1169 aen = mbcp->mbox_out[1] >> 16; 1170 timeout = (mbcp->mbox_out[1] >> 8) & 0xf; 1171 ··· 1228 } 1229 break; 1230 } 1231 - rtnl_unlock(); 1232 } 1233 1234 void ql_mpi_work(struct work_struct *work) ··· 1238 struct mbox_params *mbcp = &mbc; 1239 int err = 0; 1240 1241 - rtnl_lock(); 1242 /* Begin polled mode for MPI */ 1243 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); 1244 ··· 1255 1256 /* End polled mode for MPI */ 1257 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); 1258 - rtnl_unlock(); 1259 ql_enable_completion_interrupt(qdev, 0); 1260 } 1261
··· 534 int status; 535 unsigned long count; 536 537 + mutex_lock(&qdev->mpi_mutex); 538 539 /* Begin polled mode for MPI */ 540 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); ··· 603 end: 604 /* End polled mode for MPI */ 605 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); 606 + mutex_unlock(&qdev->mpi_mutex); 607 return status; 608 } 609 ··· 1099 static int ql_set_port_cfg(struct ql_adapter *qdev) 1100 { 1101 int status; 1102 status = ql_mb_set_port_cfg(qdev); 1103 if (status) 1104 return status; 1105 status = ql_idc_wait(qdev); ··· 1122 container_of(work, struct ql_adapter, mpi_port_cfg_work.work); 1123 int status; 1124 1125 status = ql_mb_get_port_cfg(qdev); 1126 if (status) { 1127 netif_err(qdev, drv, qdev->ndev, 1128 "Bug: Failed to get port config data.\n"); ··· 1167 u32 aen; 1168 int timeout; 1169 1170 aen = mbcp->mbox_out[1] >> 16; 1171 timeout = (mbcp->mbox_out[1] >> 8) & 0xf; 1172 ··· 1231 } 1232 break; 1233 } 1234 } 1235 1236 void ql_mpi_work(struct work_struct *work) ··· 1242 struct mbox_params *mbcp = &mbc; 1243 int err = 0; 1244 1245 + mutex_lock(&qdev->mpi_mutex); 1246 /* Begin polled mode for MPI */ 1247 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); 1248 ··· 1259 1260 /* End polled mode for MPI */ 1261 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); 1262 + mutex_unlock(&qdev->mpi_mutex); 1263 ql_enable_completion_interrupt(qdev, 0); 1264 } 1265
+16 -10
drivers/net/r8169.c
··· 744 mdio_write(ioaddr, MII_BMCR, val & 0xffff); 745 } 746 747 - static void rtl8169_check_link_status(struct net_device *dev, 748 struct rtl8169_private *tp, 749 - void __iomem *ioaddr) 750 { 751 unsigned long flags; 752 753 spin_lock_irqsave(&tp->lock, flags); 754 if (tp->link_ok(ioaddr)) { 755 /* This is to cancel a scheduled suspend if there's one. */ 756 - pm_request_resume(&tp->pci_dev->dev); 757 netif_carrier_on(dev); 758 netif_info(tp, ifup, dev, "link up\n"); 759 } else { 760 netif_carrier_off(dev); 761 netif_info(tp, ifdown, dev, "link down\n"); 762 - pm_schedule_suspend(&tp->pci_dev->dev, 100); 763 } 764 spin_unlock_irqrestore(&tp->lock, flags); 765 } 766 767 #define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST) ··· 4610 } 4611 4612 if (status & LinkChg) 4613 - rtl8169_check_link_status(dev, tp, ioaddr); 4614 4615 /* We need to see the lastest version of tp->intr_mask to 4616 * avoid ignoring an MSI interrupt and having to wait for ··· 4900 struct net_device *dev = pci_get_drvdata(pdev); 4901 struct rtl8169_private *tp = netdev_priv(dev); 4902 4903 - if (!tp->TxDescArray) 4904 - return 0; 4905 - 4906 - rtl8169_check_link_status(dev, tp, tp->mmio_addr); 4907 - return -EBUSY; 4908 } 4909 4910 static const struct dev_pm_ops rtl8169_pm_ops = {
··· 744 mdio_write(ioaddr, MII_BMCR, val & 0xffff); 745 } 746 747 + static void __rtl8169_check_link_status(struct net_device *dev, 748 struct rtl8169_private *tp, 749 + void __iomem *ioaddr, 750 + bool pm) 751 { 752 unsigned long flags; 753 754 spin_lock_irqsave(&tp->lock, flags); 755 if (tp->link_ok(ioaddr)) { 756 /* This is to cancel a scheduled suspend if there's one. */ 757 + if (pm) 758 + pm_request_resume(&tp->pci_dev->dev); 759 netif_carrier_on(dev); 760 netif_info(tp, ifup, dev, "link up\n"); 761 } else { 762 netif_carrier_off(dev); 763 netif_info(tp, ifdown, dev, "link down\n"); 764 + if (pm) 765 + pm_schedule_suspend(&tp->pci_dev->dev, 100); 766 } 767 spin_unlock_irqrestore(&tp->lock, flags); 768 + } 769 + 770 + static void rtl8169_check_link_status(struct net_device *dev, 771 + struct rtl8169_private *tp, 772 + void __iomem *ioaddr) 773 + { 774 + __rtl8169_check_link_status(dev, tp, ioaddr, false); 775 } 776 777 #define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST) ··· 4600 } 4601 4602 if (status & LinkChg) 4603 + __rtl8169_check_link_status(dev, tp, ioaddr, true); 4604 4605 /* We need to see the lastest version of tp->intr_mask to 4606 * avoid ignoring an MSI interrupt and having to wait for ··· 4890 struct net_device *dev = pci_get_drvdata(pdev); 4891 struct rtl8169_private *tp = netdev_priv(dev); 4892 4893 + return tp->TxDescArray ? -EBUSY : 0; 4894 } 4895 4896 static const struct dev_pm_ops rtl8169_pm_ops = {
+29 -14
drivers/net/sfc/efx.c
··· 197 198 static void efx_remove_channels(struct efx_nic *efx); 199 static void efx_remove_port(struct efx_nic *efx); 200 static void efx_fini_napi(struct efx_nic *efx); 201 static void efx_fini_struct(struct efx_nic *efx); 202 static void efx_start_all(struct efx_nic *efx); 203 static void efx_stop_all(struct efx_nic *efx); ··· 337 338 /* Disable interrupts and wait for ISRs to complete */ 339 efx_nic_disable_interrupts(efx); 340 - if (efx->legacy_irq) 341 synchronize_irq(efx->legacy_irq); 342 if (channel->irq) 343 synchronize_irq(channel->irq); 344 ··· 355 efx_channel_processed(channel); 356 357 napi_enable(&channel->napi_str); 358 efx_nic_enable_interrupts(efx); 359 } 360 ··· 432 433 *channel = *old_channel; 434 435 memset(&channel->eventq, 0, sizeof(channel->eventq)); 436 437 rx_queue = &channel->rx_queue; ··· 743 if (rc) 744 goto rollback; 745 746 /* Destroy old channels */ 747 - for (i = 0; i < efx->n_channels; i++) 748 efx_remove_channel(other_channel[i]); 749 out: 750 /* Free unused channel structures */ 751 for (i = 0; i < efx->n_channels; i++) ··· 1411 efx_start_channel(channel); 1412 } 1413 1414 efx_nic_enable_interrupts(efx); 1415 1416 /* Switch to event based MCDI completions after enabling interrupts. ··· 1473 1474 /* Disable interrupts and wait for ISR to complete */ 1475 efx_nic_disable_interrupts(efx); 1476 - if (efx->legacy_irq) 1477 synchronize_irq(efx->legacy_irq); 1478 efx_for_each_channel(channel, efx) { 1479 if (channel->irq) 1480 synchronize_irq(channel->irq); ··· 1608 * 1609 **************************************************************************/ 1610 1611 - static int efx_init_napi(struct efx_nic *efx) 1612 { 1613 struct efx_channel *channel; 1614 ··· 1617 netif_napi_add(channel->napi_dev, &channel->napi_str, 1618 efx_poll, napi_weight); 1619 } 1620 - return 0; 1621 } 1622 1623 static void efx_fini_napi(struct efx_nic *efx) 1624 { 1625 struct efx_channel *channel; 1626 1627 - efx_for_each_channel(channel, efx) { 1628 - if (channel->napi_dev) 1629 - netif_napi_del(&channel->napi_str); 1630 - channel->napi_dev = NULL; 1631 - } 1632 } 1633 1634 /************************************************************************** ··· 2353 if (rc) 2354 goto fail1; 2355 2356 - rc = efx_init_napi(efx); 2357 - if (rc) 2358 - goto fail2; 2359 2360 rc = efx->type->init(efx); 2361 if (rc) { ··· 2384 efx->type->fini(efx); 2385 fail3: 2386 efx_fini_napi(efx); 2387 - fail2: 2388 efx_remove_all(efx); 2389 fail1: 2390 return rc;
··· 197 198 static void efx_remove_channels(struct efx_nic *efx); 199 static void efx_remove_port(struct efx_nic *efx); 200 + static void efx_init_napi(struct efx_nic *efx); 201 static void efx_fini_napi(struct efx_nic *efx); 202 + static void efx_fini_napi_channel(struct efx_channel *channel); 203 static void efx_fini_struct(struct efx_nic *efx); 204 static void efx_start_all(struct efx_nic *efx); 205 static void efx_stop_all(struct efx_nic *efx); ··· 335 336 /* Disable interrupts and wait for ISRs to complete */ 337 efx_nic_disable_interrupts(efx); 338 + if (efx->legacy_irq) { 339 synchronize_irq(efx->legacy_irq); 340 + efx->legacy_irq_enabled = false; 341 + } 342 if (channel->irq) 343 synchronize_irq(channel->irq); 344 ··· 351 efx_channel_processed(channel); 352 353 napi_enable(&channel->napi_str); 354 + if (efx->legacy_irq) 355 + efx->legacy_irq_enabled = true; 356 efx_nic_enable_interrupts(efx); 357 } 358 ··· 426 427 *channel = *old_channel; 428 429 + channel->napi_dev = NULL; 430 memset(&channel->eventq, 0, sizeof(channel->eventq)); 431 432 rx_queue = &channel->rx_queue; ··· 736 if (rc) 737 goto rollback; 738 739 + efx_init_napi(efx); 740 + 741 /* Destroy old channels */ 742 + for (i = 0; i < efx->n_channels; i++) { 743 + efx_fini_napi_channel(other_channel[i]); 744 efx_remove_channel(other_channel[i]); 745 + } 746 out: 747 /* Free unused channel structures */ 748 for (i = 0; i < efx->n_channels; i++) ··· 1400 efx_start_channel(channel); 1401 } 1402 1403 + if (efx->legacy_irq) 1404 + efx->legacy_irq_enabled = true; 1405 efx_nic_enable_interrupts(efx); 1406 1407 /* Switch to event based MCDI completions after enabling interrupts. ··· 1460 1461 /* Disable interrupts and wait for ISR to complete */ 1462 efx_nic_disable_interrupts(efx); 1463 + if (efx->legacy_irq) { 1464 synchronize_irq(efx->legacy_irq); 1465 + efx->legacy_irq_enabled = false; 1466 + } 1467 efx_for_each_channel(channel, efx) { 1468 if (channel->irq) 1469 synchronize_irq(channel->irq); ··· 1593 * 1594 **************************************************************************/ 1595 1596 + static void efx_init_napi(struct efx_nic *efx) 1597 { 1598 struct efx_channel *channel; 1599 ··· 1602 netif_napi_add(channel->napi_dev, &channel->napi_str, 1603 efx_poll, napi_weight); 1604 } 1605 + } 1606 + 1607 + static void efx_fini_napi_channel(struct efx_channel *channel) 1608 + { 1609 + if (channel->napi_dev) 1610 + netif_napi_del(&channel->napi_str); 1611 + channel->napi_dev = NULL; 1612 } 1613 1614 static void efx_fini_napi(struct efx_nic *efx) 1615 { 1616 struct efx_channel *channel; 1617 1618 + efx_for_each_channel(channel, efx) 1619 + efx_fini_napi_channel(channel); 1620 } 1621 1622 /************************************************************************** ··· 2335 if (rc) 2336 goto fail1; 2337 2338 + efx_init_napi(efx); 2339 2340 rc = efx->type->init(efx); 2341 if (rc) { ··· 2368 efx->type->fini(efx); 2369 fail3: 2370 efx_fini_napi(efx); 2371 efx_remove_all(efx); 2372 fail1: 2373 return rc;
+2
drivers/net/sfc/net_driver.h
··· 621 * @pci_dev: The PCI device 622 * @type: Controller type attributes 623 * @legacy_irq: IRQ number 624 * @workqueue: Workqueue for port reconfigures and the HW monitor. 625 * Work items do not hold and must not acquire RTNL. 626 * @workqueue_name: Name of workqueue ··· 710 struct pci_dev *pci_dev; 711 const struct efx_nic_type *type; 712 int legacy_irq; 713 struct workqueue_struct *workqueue; 714 char workqueue_name[16]; 715 struct work_struct reset_work;
··· 621 * @pci_dev: The PCI device 622 * @type: Controller type attributes 623 * @legacy_irq: IRQ number 624 + * @legacy_irq_enabled: Are IRQs enabled on NIC (INT_EN_KER register)? 625 * @workqueue: Workqueue for port reconfigures and the HW monitor. 626 * Work items do not hold and must not acquire RTNL. 627 * @workqueue_name: Name of workqueue ··· 709 struct pci_dev *pci_dev; 710 const struct efx_nic_type *type; 711 int legacy_irq; 712 + bool legacy_irq_enabled; 713 struct workqueue_struct *workqueue; 714 char workqueue_name[16]; 715 struct work_struct reset_work;
+6
drivers/net/sfc/nic.c
··· 1418 u32 queues; 1419 int syserr; 1420 1421 /* Read the ISR which also ACKs the interrupts */ 1422 efx_readd(efx, &reg, FR_BZ_INT_ISR0); 1423 queues = EFX_EXTRACT_DWORD(reg, 0, 31);
··· 1418 u32 queues; 1419 int syserr; 1420 1421 + /* Could this be ours? If interrupts are disabled then the 1422 + * channel state may not be valid. 1423 + */ 1424 + if (!efx->legacy_irq_enabled) 1425 + return result; 1426 + 1427 /* Read the ISR which also ACKs the interrupts */ 1428 efx_readd(efx, &reg, FR_BZ_INT_ISR0); 1429 queues = EFX_EXTRACT_DWORD(reg, 0, 31);
+2 -2
drivers/net/stmmac/stmmac_main.c
··· 1509 pr_warning("\tno valid MAC address;" 1510 "please, use ifconfig or nwhwconfig!\n"); 1511 1512 ret = register_netdev(dev); 1513 if (ret) { 1514 pr_err("%s: ERROR %i registering the device\n", ··· 1521 DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n", 1522 dev->name, (dev->features & NETIF_F_SG) ? "on" : "off", 1523 (dev->features & NETIF_F_HW_CSUM) ? "on" : "off"); 1524 - 1525 - spin_lock_init(&priv->lock); 1526 1527 return ret; 1528 }
··· 1509 pr_warning("\tno valid MAC address;" 1510 "please, use ifconfig or nwhwconfig!\n"); 1511 1512 + spin_lock_init(&priv->lock); 1513 + 1514 ret = register_netdev(dev); 1515 if (ret) { 1516 pr_err("%s: ERROR %i registering the device\n", ··· 1519 DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n", 1520 dev->name, (dev->features & NETIF_F_SG) ? "on" : "off", 1521 (dev->features & NETIF_F_HW_CSUM) ? "on" : "off"); 1522 1523 return ret; 1524 }
+3 -3
drivers/net/tulip/dmfe.c
··· 688 689 DMFE_DBUG(0, "dmfe_start_xmit", 0); 690 691 - /* Resource flag check */ 692 - netif_stop_queue(dev); 693 - 694 /* Too large packet check */ 695 if (skb->len > MAX_PACKET_SIZE) { 696 pr_err("big packet = %d\n", (u16)skb->len); 697 dev_kfree_skb(skb); 698 return NETDEV_TX_OK; 699 } 700 701 spin_lock_irqsave(&db->lock, flags); 702
··· 688 689 DMFE_DBUG(0, "dmfe_start_xmit", 0); 690 691 /* Too large packet check */ 692 if (skb->len > MAX_PACKET_SIZE) { 693 pr_err("big packet = %d\n", (u16)skb->len); 694 dev_kfree_skb(skb); 695 return NETDEV_TX_OK; 696 } 697 + 698 + /* Resource flag check */ 699 + netif_stop_queue(dev); 700 701 spin_lock_irqsave(&db->lock, flags); 702
-4
drivers/net/usb/hso.c
··· 958 /* Packet is complete. Inject into stack. */ 959 /* We have IP packet here */ 960 odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP); 961 - /* don't check it */ 962 - odev->skb_rx_buf->ip_summed = 963 - CHECKSUM_UNNECESSARY; 964 - 965 skb_reset_mac_header(odev->skb_rx_buf); 966 967 /* Ship it off to the kernel */
··· 958 /* Packet is complete. Inject into stack. */ 959 /* We have IP packet here */ 960 odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP); 961 skb_reset_mac_header(odev->skb_rx_buf); 962 963 /* Ship it off to the kernel */
+4 -1
drivers/net/wan/hd64572.c
··· 293 struct net_device *dev = port->netdev; 294 card_t* card = port->card; 295 u8 stat; 296 297 spin_lock(&port->lock); 298 ··· 317 dev->stats.tx_bytes += readw(&desc->len); 318 } 319 writeb(0, &desc->stat); /* Free descriptor */ 320 port->txlast = (port->txlast + 1) % card->tx_ring_buffers; 321 } 322 323 - netif_wake_queue(dev); 324 spin_unlock(&port->lock); 325 } 326
··· 293 struct net_device *dev = port->netdev; 294 card_t* card = port->card; 295 u8 stat; 296 + unsigned count = 0; 297 298 spin_lock(&port->lock); 299 ··· 316 dev->stats.tx_bytes += readw(&desc->len); 317 } 318 writeb(0, &desc->stat); /* Free descriptor */ 319 + count++; 320 port->txlast = (port->txlast + 1) % card->tx_ring_buffers; 321 } 322 323 + if (count) 324 + netif_wake_queue(dev); 325 spin_unlock(&port->lock); 326 } 327
+8 -5
drivers/net/wireless/ath/ath5k/base.c
··· 1917 sc->bmisscount = 0; 1918 } 1919 1920 - if (sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) { 1921 u64 tsf = ath5k_hw_get_tsf64(ah); 1922 u32 tsftu = TSF_TO_TU(tsf); 1923 int slot = ((tsftu % sc->bintval) * ATH_BCBUF) / sc->bintval; ··· 1950 /* NB: hw still stops DMA, so proceed */ 1951 } 1952 1953 - /* refresh the beacon for AP mode */ 1954 - if (sc->opmode == NL80211_IFTYPE_AP) 1955 ath5k_beacon_update(sc->hw, vif); 1956 1957 ath5k_hw_set_txdp(ah, sc->bhalq, bf->daddr); ··· 2853 2854 /* Assign the vap/adhoc to a beacon xmit slot. */ 2855 if ((avf->opmode == NL80211_IFTYPE_AP) || 2856 - (avf->opmode == NL80211_IFTYPE_ADHOC)) { 2857 int slot; 2858 2859 WARN_ON(list_empty(&sc->bcbuf)); ··· 2873 sc->bslot[avf->bslot] = vif; 2874 if (avf->opmode == NL80211_IFTYPE_AP) 2875 sc->num_ap_vifs++; 2876 - else 2877 sc->num_adhoc_vifs++; 2878 } 2879
··· 1917 sc->bmisscount = 0; 1918 } 1919 1920 + if ((sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) || 1921 + sc->opmode == NL80211_IFTYPE_MESH_POINT) { 1922 u64 tsf = ath5k_hw_get_tsf64(ah); 1923 u32 tsftu = TSF_TO_TU(tsf); 1924 int slot = ((tsftu % sc->bintval) * ATH_BCBUF) / sc->bintval; ··· 1949 /* NB: hw still stops DMA, so proceed */ 1950 } 1951 1952 + /* refresh the beacon for AP or MESH mode */ 1953 + if (sc->opmode == NL80211_IFTYPE_AP || 1954 + sc->opmode == NL80211_IFTYPE_MESH_POINT) 1955 ath5k_beacon_update(sc->hw, vif); 1956 1957 ath5k_hw_set_txdp(ah, sc->bhalq, bf->daddr); ··· 2851 2852 /* Assign the vap/adhoc to a beacon xmit slot. */ 2853 if ((avf->opmode == NL80211_IFTYPE_AP) || 2854 + (avf->opmode == NL80211_IFTYPE_ADHOC) || 2855 + (avf->opmode == NL80211_IFTYPE_MESH_POINT)) { 2856 int slot; 2857 2858 WARN_ON(list_empty(&sc->bcbuf)); ··· 2870 sc->bslot[avf->bslot] = vif; 2871 if (avf->opmode == NL80211_IFTYPE_AP) 2872 sc->num_ap_vifs++; 2873 + else if (avf->opmode == NL80211_IFTYPE_ADHOC) 2874 sc->num_adhoc_vifs++; 2875 } 2876
+38 -35
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
··· 55 #define SUB_NUM_CTL_MODES_AT_5G_40 2 /* excluding HT40, EXT-OFDM */ 56 #define SUB_NUM_CTL_MODES_AT_2G_40 3 /* excluding HT40, EXT-OFDM, EXT-CCK */ 57 58 static const struct ar9300_eeprom ar9300_default = { 59 .eepromVersion = 2, 60 .templateVersion = 2, ··· 292 } 293 }, 294 .ctlPowerData_2G = { 295 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, 296 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, 297 - { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } }, 298 299 - { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } }, 300 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, 301 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, 302 303 - { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } }, 304 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, 305 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, 306 307 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, 308 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } }, 309 }, 310 .modalHeader5G = { 311 /* 4 idle,t1,t2,b (4 bits per setting) */ ··· 571 .ctlPowerData_5G = { 572 { 573 { 574 - {60, 1}, {60, 1}, {60, 1}, {60, 1}, 575 - {60, 1}, {60, 1}, {60, 1}, {60, 0}, 576 } 577 }, 578 { 579 { 580 - {60, 1}, {60, 1}, {60, 1}, {60, 1}, 581 - {60, 1}, {60, 1}, {60, 1}, {60, 0}, 582 } 583 }, 584 { 585 { 586 - {60, 0}, {60, 1}, {60, 0}, {60, 1}, 587 - {60, 1}, {60, 1}, {60, 1}, {60, 1}, 588 } 589 }, 590 { 591 { 592 - {60, 0}, {60, 1}, {60, 1}, {60, 0}, 593 - {60, 1}, {60, 0}, {60, 0}, {60, 0}, 594 } 595 }, 596 { 597 { 598 - {60, 1}, {60, 1}, {60, 1}, {60, 0}, 599 - {60, 0}, {60, 0}, {60, 0}, {60, 0}, 600 } 601 }, 602 { 603 { 604 - {60, 1}, {60, 1}, {60, 1}, {60, 1}, 605 - {60, 1}, {60, 0}, {60, 0}, {60, 0}, 606 } 607 }, 608 { 609 { 610 - {60, 1}, {60, 1}, {60, 1}, {60, 1}, 611 - {60, 1}, {60, 1}, {60, 1}, {60, 1}, 612 } 613 }, 614 { 615 { 616 - {60, 1}, {60, 1}, {60, 0}, {60, 1}, 617 - {60, 1}, {60, 1}, {60, 1}, {60, 0}, 618 } 619 }, 620 { 621 { 622 - {60, 1}, {60, 0}, {60, 1}, {60, 1}, 623 - {60, 1}, {60, 1}, {60, 0}, {60, 1}, 624 } 625 }, 626 } ··· 1830 struct cal_ctl_data_5g *ctl_5g = eep->ctlPowerData_5G; 1831 1832 if (is2GHz) 1833 - return ctl_2g[idx].ctlEdges[edge].tPower; 1834 else 1835 - return ctl_5g[idx].ctlEdges[edge].tPower; 1836 } 1837 1838 static u16 ar9003_hw_get_indirect_edge_power(struct ar9300_eeprom *eep, ··· 1850 1851 if (is2GHz) { 1852 if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 1) < freq && 1853 - ctl_2g[idx].ctlEdges[edge - 1].flag) 1854 - return ctl_2g[idx].ctlEdges[edge - 1].tPower; 1855 } else { 1856 if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 0) < freq && 1857 - ctl_5g[idx].ctlEdges[edge - 1].flag) 1858 - return ctl_5g[idx].ctlEdges[edge - 1].tPower; 1859 } 1860 1861 return AR9300_MAX_RATE_POWER;
··· 55 #define SUB_NUM_CTL_MODES_AT_5G_40 2 /* excluding HT40, EXT-OFDM */ 56 #define SUB_NUM_CTL_MODES_AT_2G_40 3 /* excluding HT40, EXT-OFDM, EXT-CCK */ 57 58 + #define CTL(_tpower, _flag) ((_tpower) | ((_flag) << 6)) 59 + 60 static const struct ar9300_eeprom ar9300_default = { 61 .eepromVersion = 2, 62 .templateVersion = 2, ··· 290 } 291 }, 292 .ctlPowerData_2G = { 293 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 294 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 295 + { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } }, 296 297 + { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } }, 298 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 299 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 300 301 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0) } }, 302 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 303 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 304 305 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 306 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } }, 307 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } }, 308 }, 309 .modalHeader5G = { 310 /* 4 idle,t1,t2,b (4 bits per setting) */ ··· 568 .ctlPowerData_5G = { 569 { 570 { 571 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), 572 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), 573 } 574 }, 575 { 576 { 577 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), 578 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), 579 } 580 }, 581 { 582 { 583 + CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 1), 584 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), 585 } 586 }, 587 { 588 { 589 + CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0), 590 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0), 591 } 592 }, 593 { 594 { 595 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), 596 + CTL(60, 0), CTL(60, 0), CTL(60, 0), CTL(60, 0), 597 } 598 }, 599 { 600 { 601 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), 602 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0), 603 } 604 }, 605 { 606 { 607 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), 608 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), 609 } 610 }, 611 { 612 { 613 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1), 614 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), 615 } 616 }, 617 { 618 { 619 + CTL(60, 1), CTL(60, 0), CTL(60, 1), CTL(60, 1), 620 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1), 621 } 622 }, 623 } ··· 1827 struct cal_ctl_data_5g *ctl_5g = eep->ctlPowerData_5G; 1828 1829 if (is2GHz) 1830 + return CTL_EDGE_TPOWER(ctl_2g[idx].ctlEdges[edge]); 1831 else 1832 + return CTL_EDGE_TPOWER(ctl_5g[idx].ctlEdges[edge]); 1833 } 1834 1835 static u16 ar9003_hw_get_indirect_edge_power(struct ar9300_eeprom *eep, ··· 1847 1848 if (is2GHz) { 1849 if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 1) < freq && 1850 + CTL_EDGE_FLAGS(ctl_2g[idx].ctlEdges[edge - 1])) 1851 + return CTL_EDGE_TPOWER(ctl_2g[idx].ctlEdges[edge - 1]); 1852 } else { 1853 if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 0) < freq && 1854 + CTL_EDGE_FLAGS(ctl_5g[idx].ctlEdges[edge - 1])) 1855 + return CTL_EDGE_TPOWER(ctl_5g[idx].ctlEdges[edge - 1]); 1856 } 1857 1858 return AR9300_MAX_RATE_POWER;
+2 -7
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
··· 261 u8 tPow2x[14]; 262 } __packed; 263 264 - struct cal_ctl_edge_pwr { 265 - u8 tPower:6, 266 - flag:2; 267 - } __packed; 268 - 269 struct cal_ctl_data_2g { 270 - struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_2G]; 271 } __packed; 272 273 struct cal_ctl_data_5g { 274 - struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_5G]; 275 } __packed; 276 277 struct ar9300_eeprom {
··· 261 u8 tPow2x[14]; 262 } __packed; 263 264 struct cal_ctl_data_2g { 265 + u8 ctlEdges[AR9300_NUM_BAND_EDGES_2G]; 266 } __packed; 267 268 struct cal_ctl_data_5g { 269 + u8 ctlEdges[AR9300_NUM_BAND_EDGES_5G]; 270 } __packed; 271 272 struct ar9300_eeprom {
+4 -2
drivers/net/wireless/ath/ath9k/ath9k.h
··· 21 #include <linux/device.h> 22 #include <linux/leds.h> 23 #include <linux/completion.h> 24 25 #include "debug.h" 26 #include "common.h" ··· 329 struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype); 330 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq); 331 int ath_tx_setup(struct ath_softc *sc, int haltype); 332 - void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx); 333 void ath_draintxq(struct ath_softc *sc, 334 struct ath_txq *txq, bool retry_tx); 335 void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an); ··· 647 struct ath_descdma txsdma; 648 649 struct ath_ant_comb ant_comb; 650 }; 651 652 struct ath_wiphy { ··· 678 } 679 680 extern struct ieee80211_ops ath9k_ops; 681 - extern struct pm_qos_request_list ath9k_pm_qos_req; 682 extern int modparam_nohwcrypt; 683 extern int led_blink; 684
··· 21 #include <linux/device.h> 22 #include <linux/leds.h> 23 #include <linux/completion.h> 24 + #include <linux/pm_qos_params.h> 25 26 #include "debug.h" 27 #include "common.h" ··· 328 struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype); 329 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq); 330 int ath_tx_setup(struct ath_softc *sc, int haltype); 331 + bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx); 332 void ath_draintxq(struct ath_softc *sc, 333 struct ath_txq *txq, bool retry_tx); 334 void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an); ··· 646 struct ath_descdma txsdma; 647 648 struct ath_ant_comb ant_comb; 649 + 650 + struct pm_qos_request_list pm_qos_req; 651 }; 652 653 struct ath_wiphy { ··· 675 } 676 677 extern struct ieee80211_ops ath9k_ops; 678 extern int modparam_nohwcrypt; 679 extern int led_blink; 680
+3 -3
drivers/net/wireless/ath/ath9k/eeprom.c
··· 240 for (i = 0; (i < num_band_edges) && 241 (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) { 242 if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) { 243 - twiceMaxEdgePower = pRdEdgesPower[i].tPower; 244 break; 245 } else if ((i > 0) && 246 (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, 247 is2GHz))) { 248 if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel, 249 is2GHz) < freq && 250 - pRdEdgesPower[i - 1].flag) { 251 twiceMaxEdgePower = 252 - pRdEdgesPower[i - 1].tPower; 253 } 254 break; 255 }
··· 240 for (i = 0; (i < num_band_edges) && 241 (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) { 242 if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) { 243 + twiceMaxEdgePower = CTL_EDGE_TPOWER(pRdEdgesPower[i].ctl); 244 break; 245 } else if ((i > 0) && 246 (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, 247 is2GHz))) { 248 if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel, 249 is2GHz) < freq && 250 + CTL_EDGE_FLAGS(pRdEdgesPower[i - 1].ctl)) { 251 twiceMaxEdgePower = 252 + CTL_EDGE_TPOWER(pRdEdgesPower[i - 1].ctl); 253 } 254 break; 255 }
+14 -13
drivers/net/wireless/ath/ath9k/eeprom.h
··· 233 234 #define AR9287_CHECKSUM_LOCATION (AR9287_EEP_START_LOC + 1) 235 236 enum eeprom_param { 237 EEP_NFTHRESH_5, 238 EEP_NFTHRESH_2, ··· 390 u8 xatten2Margin[AR5416_MAX_CHAINS]; 391 u8 ob_ch1; 392 u8 db_ch1; 393 - u8 useAnt1:1, 394 - force_xpaon:1, 395 - local_bias:1, 396 - femBandSelectUsed:1, xlnabufin:1, xlnaisel:2, xlnabufmode:1; 397 u8 miscBits; 398 u16 xpaBiasLvlFreq[3]; 399 u8 futureModal[6]; ··· 544 u8 tPow2x[8]; 545 } __packed; 546 547 - 548 - #ifdef __BIG_ENDIAN_BITFIELD 549 struct cal_ctl_edges { 550 u8 bChannel; 551 - u8 flag:2, tPower:6; 552 } __packed; 553 - #else 554 - struct cal_ctl_edges { 555 - u8 bChannel; 556 - u8 tPower:6, flag:2; 557 - } __packed; 558 - #endif 559 560 struct cal_data_op_loop_ar9287 { 561 u8 pwrPdg[2][5];
··· 233 234 #define AR9287_CHECKSUM_LOCATION (AR9287_EEP_START_LOC + 1) 235 236 + #define CTL_EDGE_TPOWER(_ctl) ((_ctl) & 0x3f) 237 + #define CTL_EDGE_FLAGS(_ctl) (((_ctl) >> 6) & 0x03) 238 + 239 + #define LNA_CTL_BUF_MODE BIT(0) 240 + #define LNA_CTL_ISEL_LO BIT(1) 241 + #define LNA_CTL_ISEL_HI BIT(2) 242 + #define LNA_CTL_BUF_IN BIT(3) 243 + #define LNA_CTL_FEM_BAND BIT(4) 244 + #define LNA_CTL_LOCAL_BIAS BIT(5) 245 + #define LNA_CTL_FORCE_XPA BIT(6) 246 + #define LNA_CTL_USE_ANT1 BIT(7) 247 + 248 enum eeprom_param { 249 EEP_NFTHRESH_5, 250 EEP_NFTHRESH_2, ··· 378 u8 xatten2Margin[AR5416_MAX_CHAINS]; 379 u8 ob_ch1; 380 u8 db_ch1; 381 + u8 lna_ctl; 382 u8 miscBits; 383 u16 xpaBiasLvlFreq[3]; 384 u8 futureModal[6]; ··· 535 u8 tPow2x[8]; 536 } __packed; 537 538 struct cal_ctl_edges { 539 u8 bChannel; 540 + u8 ctl; 541 } __packed; 542 543 struct cal_data_op_loop_ar9287 { 544 u8 pwrPdg[2][5];
+14 -9
drivers/net/wireless/ath/ath9k/eeprom_def.c
··· 451 ath9k_hw_analog_shift_rmw(ah, AR_AN_TOP2, 452 AR_AN_TOP2_LOCALBIAS, 453 AR_AN_TOP2_LOCALBIAS_S, 454 - pModal->local_bias); 455 REG_RMW_FIELD(ah, AR_PHY_XPA_CFG, AR_PHY_FORCE_XPA_CFG, 456 - pModal->force_xpaon); 457 } 458 459 REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, ··· 1063 case 1: 1064 break; 1065 case 2: 1066 - scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; 1067 break; 1068 case 3: 1069 - scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; 1070 break; 1071 } 1072 - 1073 - scaledPower = max((u16)0, scaledPower); 1074 1075 if (IS_CHAN_2GHZ(chan)) { 1076 numCtlModes = ARRAY_SIZE(ctlModesFor11g) - ··· 1433 1434 num_ant_config = 1; 1435 1436 - if (pBase->version >= 0x0E0D) 1437 - if (pModal->useAnt1) 1438 - num_ant_config += 1; 1439 1440 return num_ant_config; 1441 }
··· 451 ath9k_hw_analog_shift_rmw(ah, AR_AN_TOP2, 452 AR_AN_TOP2_LOCALBIAS, 453 AR_AN_TOP2_LOCALBIAS_S, 454 + !!(pModal->lna_ctl & 455 + LNA_CTL_LOCAL_BIAS)); 456 REG_RMW_FIELD(ah, AR_PHY_XPA_CFG, AR_PHY_FORCE_XPA_CFG, 457 + !!(pModal->lna_ctl & LNA_CTL_FORCE_XPA)); 458 } 459 460 REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, ··· 1062 case 1: 1063 break; 1064 case 2: 1065 + if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN) 1066 + scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; 1067 + else 1068 + scaledPower = 0; 1069 break; 1070 case 3: 1071 + if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN) 1072 + scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; 1073 + else 1074 + scaledPower = 0; 1075 break; 1076 } 1077 1078 if (IS_CHAN_2GHZ(chan)) { 1079 numCtlModes = ARRAY_SIZE(ctlModesFor11g) - ··· 1428 1429 num_ant_config = 1; 1430 1431 + if (pBase->version >= 0x0E0D && 1432 + (pModal->lna_ctl & LNA_CTL_USE_ANT1)) 1433 + num_ant_config += 1; 1434 1435 return num_ant_config; 1436 }
+7
drivers/net/wireless/ath/ath9k/hif_usb.c
··· 1024 struct hif_device_usb *hif_dev = 1025 (struct hif_device_usb *) usb_get_intfdata(interface); 1026 1027 ath9k_hif_usb_dealloc_urbs(hif_dev); 1028 1029 return 0;
··· 1024 struct hif_device_usb *hif_dev = 1025 (struct hif_device_usb *) usb_get_intfdata(interface); 1026 1027 + /* 1028 + * The device has to be set to FULLSLEEP mode in case no 1029 + * interface is up. 1030 + */ 1031 + if (!(hif_dev->flags & HIF_USB_START)) 1032 + ath9k_htc_suspend(hif_dev->htc_handle); 1033 + 1034 ath9k_hif_usb_dealloc_urbs(hif_dev); 1035 1036 return 0;
+3
drivers/net/wireless/ath/ath9k/htc.h
··· 455 void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv); 456 void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv); 457 void ath9k_ps_work(struct work_struct *work); 458 459 void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv); 460 void ath9k_init_leds(struct ath9k_htc_priv *priv); ··· 466 u16 devid, char *product); 467 void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug); 468 #ifdef CONFIG_PM 469 int ath9k_htc_resume(struct htc_target *htc_handle); 470 #endif 471 #ifdef CONFIG_ATH9K_HTC_DEBUGFS
··· 455 void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv); 456 void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv); 457 void ath9k_ps_work(struct work_struct *work); 458 + bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, 459 + enum ath9k_power_mode mode); 460 461 void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv); 462 void ath9k_init_leds(struct ath9k_htc_priv *priv); ··· 464 u16 devid, char *product); 465 void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug); 466 #ifdef CONFIG_PM 467 + void ath9k_htc_suspend(struct htc_target *htc_handle); 468 int ath9k_htc_resume(struct htc_target *htc_handle); 469 #endif 470 #ifdef CONFIG_ATH9K_HTC_DEBUGFS
+6
drivers/net/wireless/ath/ath9k/htc_drv_init.c
··· 891 } 892 893 #ifdef CONFIG_PM 894 int ath9k_htc_resume(struct htc_target *htc_handle) 895 { 896 int ret;
··· 891 } 892 893 #ifdef CONFIG_PM 894 + 895 + void ath9k_htc_suspend(struct htc_target *htc_handle) 896 + { 897 + ath9k_htc_setpower(htc_handle->drv_priv, ATH9K_PM_FULL_SLEEP); 898 + } 899 + 900 int ath9k_htc_resume(struct htc_target *htc_handle) 901 { 902 int ret;
+2 -2
drivers/net/wireless/ath/ath9k/htc_drv_main.c
··· 63 return mode; 64 } 65 66 - static bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, 67 - enum ath9k_power_mode mode) 68 { 69 bool ret; 70
··· 63 return mode; 64 } 65 66 + bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, 67 + enum ath9k_power_mode mode) 68 { 69 bool ret; 70
+2 -1
drivers/net/wireless/ath/ath9k/hw.c
··· 2044 val = REG_READ(ah, AR7010_GPIO_IN); 2045 return (MS(val, AR7010_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) == 0; 2046 } else if (AR_SREV_9300_20_OR_LATER(ah)) 2047 - return MS_REG_READ(AR9300, gpio) != 0; 2048 else if (AR_SREV_9271(ah)) 2049 return MS_REG_READ(AR9271, gpio) != 0; 2050 else if (AR_SREV_9287_11_OR_LATER(ah))
··· 2044 val = REG_READ(ah, AR7010_GPIO_IN); 2045 return (MS(val, AR7010_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) == 0; 2046 } else if (AR_SREV_9300_20_OR_LATER(ah)) 2047 + return (MS(REG_READ(ah, AR_GPIO_IN), AR9300_GPIO_IN_VAL) & 2048 + AR_GPIO_BIT(gpio)) != 0; 2049 else if (AR_SREV_9271(ah)) 2050 return MS_REG_READ(AR9271, gpio) != 0; 2051 else if (AR_SREV_9287_11_OR_LATER(ah))
+4 -5
drivers/net/wireless/ath/ath9k/init.c
··· 15 */ 16 17 #include <linux/slab.h> 18 - #include <linux/pm_qos_params.h> 19 20 #include "ath9k.h" 21 ··· 178 .read = ath9k_ioread32, 179 .write = ath9k_iowrite32, 180 }; 181 - 182 - struct pm_qos_request_list ath9k_pm_qos_req; 183 184 /**************************/ 185 /* Initialization */ ··· 661 hw->flags |= IEEE80211_HW_MFP_CAPABLE; 662 663 hw->wiphy->interface_modes = 664 BIT(NL80211_IFTYPE_AP) | 665 BIT(NL80211_IFTYPE_WDS) | 666 BIT(NL80211_IFTYPE_STATION) | ··· 758 ath_init_leds(sc); 759 ath_start_rfkill_poll(sc); 760 761 - pm_qos_add_request(&ath9k_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, 762 PM_QOS_DEFAULT_VALUE); 763 764 return 0; ··· 829 } 830 831 ieee80211_unregister_hw(hw); 832 - pm_qos_remove_request(&ath9k_pm_qos_req); 833 ath_rx_cleanup(sc); 834 ath_tx_cleanup(sc); 835 ath9k_deinit_softc(sc);
··· 15 */ 16 17 #include <linux/slab.h> 18 19 #include "ath9k.h" 20 ··· 179 .read = ath9k_ioread32, 180 .write = ath9k_iowrite32, 181 }; 182 183 /**************************/ 184 /* Initialization */ ··· 664 hw->flags |= IEEE80211_HW_MFP_CAPABLE; 665 666 hw->wiphy->interface_modes = 667 + BIT(NL80211_IFTYPE_P2P_GO) | 668 + BIT(NL80211_IFTYPE_P2P_CLIENT) | 669 BIT(NL80211_IFTYPE_AP) | 670 BIT(NL80211_IFTYPE_WDS) | 671 BIT(NL80211_IFTYPE_STATION) | ··· 759 ath_init_leds(sc); 760 ath_start_rfkill_poll(sc); 761 762 + pm_qos_add_request(&sc->pm_qos_req, PM_QOS_CPU_DMA_LATENCY, 763 PM_QOS_DEFAULT_VALUE); 764 765 return 0; ··· 830 } 831 832 ieee80211_unregister_hw(hw); 833 + pm_qos_remove_request(&sc->pm_qos_req); 834 ath_rx_cleanup(sc); 835 ath_tx_cleanup(sc); 836 ath9k_deinit_softc(sc);
+1 -2
drivers/net/wireless/ath/ath9k/mac.c
··· 703 rs->rs_phyerr = phyerr; 704 } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr) 705 rs->rs_status |= ATH9K_RXERR_DECRYPT; 706 - else if ((ads.ds_rxstatus8 & AR_MichaelErr) && 707 - rs->rs_keyix != ATH9K_RXKEYIX_INVALID) 708 rs->rs_status |= ATH9K_RXERR_MIC; 709 else if (ads.ds_rxstatus8 & AR_KeyMiss) 710 rs->rs_status |= ATH9K_RXERR_DECRYPT;
··· 703 rs->rs_phyerr = phyerr; 704 } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr) 705 rs->rs_status |= ATH9K_RXERR_DECRYPT; 706 + else if (ads.ds_rxstatus8 & AR_MichaelErr) 707 rs->rs_status |= ATH9K_RXERR_MIC; 708 else if (ads.ds_rxstatus8 & AR_KeyMiss) 709 rs->rs_status |= ATH9K_RXERR_DECRYPT;
+15 -13
drivers/net/wireless/ath/ath9k/main.c
··· 15 */ 16 17 #include <linux/nl80211.h> 18 - #include <linux/pm_qos_params.h> 19 #include "ath9k.h" 20 #include "btcoex.h" 21 ··· 244 * the relevant bits of the h/w. 245 */ 246 ath9k_hw_set_interrupts(ah, 0); 247 - ath_drain_all_txq(sc, false); 248 249 spin_lock_bh(&sc->rx.pcu_lock); 250 251 - stopped = ath_stoprecv(sc); 252 253 /* XXX: do not flush receive queue here. We don't want 254 * to flush data frames already in queue because of ··· 1244 ath9k_btcoex_timer_resume(sc); 1245 } 1246 1247 - pm_qos_update_request(&ath9k_pm_qos_req, 55); 1248 1249 mutex_unlock: 1250 mutex_unlock(&sc->mutex); ··· 1423 1424 sc->sc_flags |= SC_OP_INVALID; 1425 1426 - pm_qos_update_request(&ath9k_pm_qos_req, PM_QOS_DEFAULT_VALUE); 1427 1428 mutex_unlock(&sc->mutex); 1429 ··· 1520 struct ath_softc *sc = aphy->sc; 1521 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1522 struct ath_vif *avp = (void *)vif->drv_priv; 1523 - int i; 1524 1525 ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); 1526 ··· 1533 if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || 1534 (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) || 1535 (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { 1536 ath9k_ps_wakeup(sc); 1537 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); 1538 ath9k_ps_restore(sc); 1539 } 1540 1541 ath_beacon_return(sc, avp); 1542 sc->sc_flags &= ~SC_OP_BEACONS; 1543 1544 - for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) { 1545 - if (sc->beacon.bslot[i] == vif) { 1546 - printk(KERN_DEBUG "%s: vif had allocated beacon " 1547 - "slot\n", __func__); 1548 - sc->beacon.bslot[i] = NULL; 1549 - sc->beacon.bslot_aphy[i] = NULL; 1550 - } 1551 } 1552 1553 sc->nvifs--;
··· 15 */ 16 17 #include <linux/nl80211.h> 18 #include "ath9k.h" 19 #include "btcoex.h" 20 ··· 245 * the relevant bits of the h/w. 246 */ 247 ath9k_hw_set_interrupts(ah, 0); 248 + stopped = ath_drain_all_txq(sc, false); 249 250 spin_lock_bh(&sc->rx.pcu_lock); 251 252 + if (!ath_stoprecv(sc)) 253 + stopped = false; 254 255 /* XXX: do not flush receive queue here. We don't want 256 * to flush data frames already in queue because of ··· 1244 ath9k_btcoex_timer_resume(sc); 1245 } 1246 1247 + pm_qos_update_request(&sc->pm_qos_req, 55); 1248 1249 mutex_unlock: 1250 mutex_unlock(&sc->mutex); ··· 1423 1424 sc->sc_flags |= SC_OP_INVALID; 1425 1426 + pm_qos_update_request(&sc->pm_qos_req, PM_QOS_DEFAULT_VALUE); 1427 1428 mutex_unlock(&sc->mutex); 1429 ··· 1520 struct ath_softc *sc = aphy->sc; 1521 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1522 struct ath_vif *avp = (void *)vif->drv_priv; 1523 1524 ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); 1525 ··· 1534 if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || 1535 (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) || 1536 (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { 1537 + /* Disable SWBA interrupt */ 1538 + sc->sc_ah->imask &= ~ATH9K_INT_SWBA; 1539 ath9k_ps_wakeup(sc); 1540 + ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask); 1541 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); 1542 ath9k_ps_restore(sc); 1543 + tasklet_kill(&sc->bcon_tasklet); 1544 } 1545 1546 ath_beacon_return(sc, avp); 1547 sc->sc_flags &= ~SC_OP_BEACONS; 1548 1549 + if (sc->nbcnvifs) { 1550 + /* Re-enable SWBA interrupt */ 1551 + sc->sc_ah->imask |= ATH9K_INT_SWBA; 1552 + ath9k_ps_wakeup(sc); 1553 + ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask); 1554 + ath9k_ps_restore(sc); 1555 } 1556 1557 sc->nvifs--;
+8 -1
drivers/net/wireless/ath/ath9k/recv.c
··· 838 struct ath_rx_status *rx_stats, 839 bool *decrypt_error) 840 { 841 struct ath_hw *ah = common->ah; 842 __le16 fc; 843 u8 rx_status_len = ah->caps.rx_status_len; ··· 883 if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) { 884 *decrypt_error = true; 885 } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) { 886 /* 887 * The MIC error bit is only valid if the frame 888 * is not a control frame or fragment, and it was 889 * decrypted using a valid TKIP key. 890 */ 891 if (!ieee80211_is_ctl(fc) && 892 !ieee80211_has_morefrags(fc) && 893 !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) && 894 - test_bit(rx_stats->rs_keyix, common->tkip_keymap)) 895 rxs->flag |= RX_FLAG_MMIC_ERROR; 896 else 897 rx_stats->rs_status &= ~ATH9K_RXERR_MIC;
··· 838 struct ath_rx_status *rx_stats, 839 bool *decrypt_error) 840 { 841 + #define is_mc_or_valid_tkip_keyix ((is_mc || \ 842 + (rx_stats->rs_keyix != ATH9K_RXKEYIX_INVALID && \ 843 + test_bit(rx_stats->rs_keyix, common->tkip_keymap)))) 844 + 845 struct ath_hw *ah = common->ah; 846 __le16 fc; 847 u8 rx_status_len = ah->caps.rx_status_len; ··· 879 if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) { 880 *decrypt_error = true; 881 } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) { 882 + bool is_mc; 883 /* 884 * The MIC error bit is only valid if the frame 885 * is not a control frame or fragment, and it was 886 * decrypted using a valid TKIP key. 887 */ 888 + is_mc = !!is_multicast_ether_addr(hdr->addr1); 889 + 890 if (!ieee80211_is_ctl(fc) && 891 !ieee80211_has_morefrags(fc) && 892 !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) && 893 + is_mc_or_valid_tkip_keyix) 894 rxs->flag |= RX_FLAG_MMIC_ERROR; 895 else 896 rx_stats->rs_status &= ~ATH9K_RXERR_MIC;
+4 -2
drivers/net/wireless/ath/ath9k/reg.h
··· 984 #define AR9287_GPIO_IN_VAL_S 11 985 #define AR9271_GPIO_IN_VAL 0xFFFF0000 986 #define AR9271_GPIO_IN_VAL_S 16 987 - #define AR9300_GPIO_IN_VAL 0x0001FFFF 988 - #define AR9300_GPIO_IN_VAL_S 0 989 #define AR7010_GPIO_IN_VAL 0x0000FFFF 990 #define AR7010_GPIO_IN_VAL_S 0 991 992 #define AR_GPIO_OE_OUT (AR_SREV_9300_20_OR_LATER(ah) ? 0x4050 : 0x404c) 993 #define AR_GPIO_OE_OUT_DRV 0x3
··· 984 #define AR9287_GPIO_IN_VAL_S 11 985 #define AR9271_GPIO_IN_VAL 0xFFFF0000 986 #define AR9271_GPIO_IN_VAL_S 16 987 #define AR7010_GPIO_IN_VAL 0x0000FFFF 988 #define AR7010_GPIO_IN_VAL_S 0 989 + 990 + #define AR_GPIO_IN 0x404c 991 + #define AR9300_GPIO_IN_VAL 0x0001FFFF 992 + #define AR9300_GPIO_IN_VAL_S 0 993 994 #define AR_GPIO_OE_OUT (AR_SREV_9300_20_OR_LATER(ah) ? 0x4050 : 0x404c) 995 #define AR_GPIO_OE_OUT_DRV 0x3
+6 -16
drivers/net/wireless/ath/ath9k/xmit.c
··· 1120 } 1121 } 1122 1123 - void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) 1124 { 1125 struct ath_hw *ah = sc->sc_ah; 1126 struct ath_common *common = ath9k_hw_common(sc->sc_ah); ··· 1128 int i, npend = 0; 1129 1130 if (sc->sc_flags & SC_OP_INVALID) 1131 - return; 1132 1133 /* Stop beacon queue */ 1134 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); ··· 1142 } 1143 } 1144 1145 - if (npend) { 1146 - int r; 1147 - 1148 - ath_print(common, ATH_DBG_FATAL, 1149 - "Failed to stop TX DMA. Resetting hardware!\n"); 1150 - 1151 - spin_lock_bh(&sc->sc_resetlock); 1152 - r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false); 1153 - if (r) 1154 - ath_print(common, ATH_DBG_FATAL, 1155 - "Unable to reset hardware; reset status %d\n", 1156 - r); 1157 - spin_unlock_bh(&sc->sc_resetlock); 1158 - } 1159 1160 for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { 1161 if (ATH_TXQ_SETUP(sc, i)) 1162 ath_draintxq(sc, &sc->tx.txq[i], retry_tx); 1163 } 1164 } 1165 1166 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq)
··· 1120 } 1121 } 1122 1123 + bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) 1124 { 1125 struct ath_hw *ah = sc->sc_ah; 1126 struct ath_common *common = ath9k_hw_common(sc->sc_ah); ··· 1128 int i, npend = 0; 1129 1130 if (sc->sc_flags & SC_OP_INVALID) 1131 + return true; 1132 1133 /* Stop beacon queue */ 1134 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); ··· 1142 } 1143 } 1144 1145 + if (npend) 1146 + ath_print(common, ATH_DBG_FATAL, "Failed to stop TX DMA!\n"); 1147 1148 for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { 1149 if (ATH_TXQ_SETUP(sc, i)) 1150 ath_draintxq(sc, &sc->tx.txq[i], retry_tx); 1151 } 1152 + 1153 + return !npend; 1154 } 1155 1156 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq)
+2 -1
drivers/net/wireless/ath/carl9170/fw.c
··· 291 292 if (SUPP(CARL9170FW_WLANTX_CAB)) { 293 ar->hw->wiphy->interface_modes |= 294 - BIT(NL80211_IFTYPE_AP); 295 } 296 } 297
··· 291 292 if (SUPP(CARL9170FW_WLANTX_CAB)) { 293 ar->hw->wiphy->interface_modes |= 294 + BIT(NL80211_IFTYPE_AP) | 295 + BIT(NL80211_IFTYPE_P2P_GO); 296 } 297 } 298
+2 -1
drivers/net/wireless/ath/carl9170/main.c
··· 1631 * supports these modes. The code which will add the 1632 * additional interface_modes is in fw.c. 1633 */ 1634 - hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); 1635 1636 hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS | 1637 IEEE80211_HW_REPORTS_TX_ACK_STATUS |
··· 1631 * supports these modes. The code which will add the 1632 * additional interface_modes is in fw.c. 1633 */ 1634 + hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | 1635 + BIT(NL80211_IFTYPE_P2P_CLIENT); 1636 1637 hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS | 1638 IEEE80211_HW_REPORTS_TX_ACK_STATUS |
+1 -1
drivers/net/wireless/ath/carl9170/tx.c
··· 810 811 mac_tmp = cpu_to_le16(AR9170_TX_MAC_HW_DURATION | 812 AR9170_TX_MAC_BACKOFF); 813 - mac_tmp |= cpu_to_le16((hw_queue << AR9170_TX_MAC_QOS_S) && 814 AR9170_TX_MAC_QOS); 815 816 no_ack = !!(info->flags & IEEE80211_TX_CTL_NO_ACK);
··· 810 811 mac_tmp = cpu_to_le16(AR9170_TX_MAC_HW_DURATION | 812 AR9170_TX_MAC_BACKOFF); 813 + mac_tmp |= cpu_to_le16((hw_queue << AR9170_TX_MAC_QOS_S) & 814 AR9170_TX_MAC_QOS); 815 816 no_ack = !!(info->flags & IEEE80211_TX_CTL_NO_ACK);
-1
drivers/net/wireless/libertas/if_sdio.c
··· 1170 lbs_deb_sdio("call remove card\n"); 1171 lbs_stop_card(card->priv); 1172 lbs_remove_card(card->priv); 1173 - card->priv->surpriseremoved = 1; 1174 1175 flush_workqueue(card->workqueue); 1176 destroy_workqueue(card->workqueue);
··· 1170 lbs_deb_sdio("call remove card\n"); 1171 lbs_stop_card(card->priv); 1172 lbs_remove_card(card->priv); 1173 1174 flush_workqueue(card->workqueue); 1175 destroy_workqueue(card->workqueue);
-1
drivers/net/wireless/libertas/if_spi.c
··· 1055 lbs_stop_card(priv); 1056 lbs_remove_card(priv); /* will call free_netdev */ 1057 1058 - priv->surpriseremoved = 1; 1059 free_irq(spi->irq, card); 1060 if_spi_terminate_spi_thread(card); 1061 if (card->pdata->teardown)
··· 1055 lbs_stop_card(priv); 1056 lbs_remove_card(priv); /* will call free_netdev */ 1057 1058 free_irq(spi->irq, card); 1059 if_spi_terminate_spi_thread(card); 1060 if (card->pdata->teardown)
-2
drivers/net/wireless/libertas/main.c
··· 915 916 lbs_free_adapter(priv); 917 lbs_cfg_free(priv); 918 - 919 - priv->dev = NULL; 920 free_netdev(dev); 921 922 lbs_deb_leave(LBS_DEB_MAIN);
··· 915 916 lbs_free_adapter(priv); 917 lbs_cfg_free(priv); 918 free_netdev(dev); 919 920 lbs_deb_leave(LBS_DEB_MAIN);
+11 -7
drivers/net/wireless/orinoco/main.c
··· 1392 orinoco_add_hostscan_results(priv, buf, len); 1393 1394 kfree(buf); 1395 - } else if (priv->scan_request) { 1396 /* Either abort or complete the scan */ 1397 - cfg80211_scan_done(priv->scan_request, (len < 0)); 1398 - priv->scan_request = NULL; 1399 } 1400 1401 spin_lock_irqsave(&priv->scan_lock, flags); ··· 1683 hermes_write_regn(hw, EVACK, 0xffff); 1684 } 1685 1686 /* firmware will have to reassociate */ 1687 netif_carrier_off(dev); 1688 priv->last_linkstatus = 0xffff; ··· 1763 orinoco_unlock(priv, &flags); 1764 1765 /* Scanning support: Notify scan cancellation */ 1766 - if (priv->scan_request) { 1767 - cfg80211_scan_done(priv->scan_request, 1); 1768 - priv->scan_request = NULL; 1769 - } 1770 1771 if (priv->hard_reset) { 1772 err = (*priv->hard_reset)(priv); ··· 1810 { 1811 struct net_device *dev = priv->ndev; 1812 int err = 0; 1813 1814 err = orinoco_hw_program_rids(priv); 1815
··· 1392 orinoco_add_hostscan_results(priv, buf, len); 1393 1394 kfree(buf); 1395 + } else { 1396 /* Either abort or complete the scan */ 1397 + orinoco_scan_done(priv, (len < 0)); 1398 } 1399 1400 spin_lock_irqsave(&priv->scan_lock, flags); ··· 1684 hermes_write_regn(hw, EVACK, 0xffff); 1685 } 1686 1687 + orinoco_scan_done(priv, true); 1688 + 1689 /* firmware will have to reassociate */ 1690 netif_carrier_off(dev); 1691 priv->last_linkstatus = 0xffff; ··· 1762 orinoco_unlock(priv, &flags); 1763 1764 /* Scanning support: Notify scan cancellation */ 1765 + orinoco_scan_done(priv, true); 1766 1767 if (priv->hard_reset) { 1768 err = (*priv->hard_reset)(priv); ··· 1812 { 1813 struct net_device *dev = priv->ndev; 1814 int err = 0; 1815 + 1816 + /* If we've called commit, we are reconfiguring or bringing the 1817 + * interface up. Maintaining countermeasures across this would 1818 + * be confusing, so note that we've disabled them. The port will 1819 + * be enabled later in orinoco_commit or __orinoco_up. */ 1820 + priv->tkip_cm_active = 0; 1821 1822 err = orinoco_hw_program_rids(priv); 1823
+7 -7
drivers/net/wireless/orinoco/orinoco_cs.c
··· 151 goto failed; 152 } 153 154 - ret = pcmcia_request_irq(link, orinoco_interrupt); 155 - if (ret) 156 - goto failed; 157 - 158 - /* We initialize the hermes structure before completing PCMCIA 159 - * configuration just in case the interrupt handler gets 160 - * called. */ 161 mem = ioport_map(link->resource[0]->start, 162 resource_size(link->resource[0])); 163 if (!mem) 164 goto failed; 165 166 hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); 167 168 ret = pcmcia_enable_device(link); 169 if (ret)
··· 151 goto failed; 152 } 153 154 mem = ioport_map(link->resource[0]->start, 155 resource_size(link->resource[0])); 156 if (!mem) 157 goto failed; 158 159 + /* We initialize the hermes structure before completing PCMCIA 160 + * configuration just in case the interrupt handler gets 161 + * called. */ 162 hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); 163 + 164 + ret = pcmcia_request_irq(link, orinoco_interrupt); 165 + if (ret) 166 + goto failed; 167 168 ret = pcmcia_enable_device(link); 169 if (ret)
+8
drivers/net/wireless/orinoco/scan.c
··· 229 priv->scan_request = NULL; 230 } 231 }
··· 229 priv->scan_request = NULL; 230 } 231 } 232 + 233 + void orinoco_scan_done(struct orinoco_private *priv, bool abort) 234 + { 235 + if (priv->scan_request) { 236 + cfg80211_scan_done(priv->scan_request, abort); 237 + priv->scan_request = NULL; 238 + } 239 + }
+1
drivers/net/wireless/orinoco/scan.h
··· 16 void orinoco_add_hostscan_results(struct orinoco_private *dev, 17 unsigned char *buf, 18 size_t len); 19 20 #endif /* _ORINOCO_SCAN_H_ */
··· 16 void orinoco_add_hostscan_results(struct orinoco_private *dev, 17 unsigned char *buf, 18 size_t len); 19 + void orinoco_scan_done(struct orinoco_private *priv, bool abort); 20 21 #endif /* _ORINOCO_SCAN_H_ */
+7 -7
drivers/net/wireless/orinoco/spectrum_cs.c
··· 214 goto failed; 215 } 216 217 - ret = pcmcia_request_irq(link, orinoco_interrupt); 218 - if (ret) 219 - goto failed; 220 - 221 - /* We initialize the hermes structure before completing PCMCIA 222 - * configuration just in case the interrupt handler gets 223 - * called. */ 224 mem = ioport_map(link->resource[0]->start, 225 resource_size(link->resource[0])); 226 if (!mem) 227 goto failed; 228 229 hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); 230 hw->eeprom_pda = true; 231 232 ret = pcmcia_enable_device(link); 233 if (ret)
··· 214 goto failed; 215 } 216 217 mem = ioport_map(link->resource[0]->start, 218 resource_size(link->resource[0])); 219 if (!mem) 220 goto failed; 221 222 + /* We initialize the hermes structure before completing PCMCIA 223 + * configuration just in case the interrupt handler gets 224 + * called. */ 225 hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); 226 hw->eeprom_pda = true; 227 + 228 + ret = pcmcia_request_irq(link, orinoco_interrupt); 229 + if (ret) 230 + goto failed; 231 232 ret = pcmcia_enable_device(link); 233 if (ret)
+2 -2
drivers/net/wireless/orinoco/wext.c
··· 911 */ 912 if (param->value) { 913 priv->tkip_cm_active = 1; 914 - ret = hermes_enable_port(hw, 0); 915 } else { 916 priv->tkip_cm_active = 0; 917 - ret = hermes_disable_port(hw, 0); 918 } 919 break; 920
··· 911 */ 912 if (param->value) { 913 priv->tkip_cm_active = 1; 914 + ret = hermes_disable_port(hw, 0); 915 } else { 916 priv->tkip_cm_active = 0; 917 + ret = hermes_enable_port(hw, 0); 918 } 919 break; 920
+3 -12
drivers/usb/atm/usbatm.c
··· 951 * condition: callbacks we register can be executed at once, before we have 952 * initialized the struct atm_dev. To protect against this, all callbacks 953 * abort if atm_dev->dev_data is NULL. */ 954 - atm_dev = atm_dev_register(instance->driver_name, &usbatm_atm_devops, -1, NULL); 955 if (!atm_dev) { 956 usb_err(instance, "%s: failed to register ATM device!\n", __func__); 957 return -1; ··· 967 968 /* temp init ATM device, set to 128kbit */ 969 atm_dev->link_rate = 128 * 1000 / 424; 970 - 971 - ret = sysfs_create_link(&atm_dev->class_dev.kobj, 972 - &instance->usb_intf->dev.kobj, "device"); 973 - if (ret) { 974 - atm_err(instance, "%s: sysfs_create_link failed: %d\n", 975 - __func__, ret); 976 - goto fail_sysfs; 977 - } 978 979 if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) { 980 atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret); ··· 986 return 0; 987 988 fail: 989 - sysfs_remove_link(&atm_dev->class_dev.kobj, "device"); 990 - fail_sysfs: 991 instance->atm_dev = NULL; 992 atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */ 993 return ret; ··· 1321 1322 /* ATM finalize */ 1323 if (instance->atm_dev) { 1324 - sysfs_remove_link(&instance->atm_dev->class_dev.kobj, "device"); 1325 atm_dev_deregister(instance->atm_dev); 1326 instance->atm_dev = NULL; 1327 }
··· 951 * condition: callbacks we register can be executed at once, before we have 952 * initialized the struct atm_dev. To protect against this, all callbacks 953 * abort if atm_dev->dev_data is NULL. */ 954 + atm_dev = atm_dev_register(instance->driver_name, 955 + &instance->usb_intf->dev, &usbatm_atm_devops, 956 + -1, NULL); 957 if (!atm_dev) { 958 usb_err(instance, "%s: failed to register ATM device!\n", __func__); 959 return -1; ··· 965 966 /* temp init ATM device, set to 128kbit */ 967 atm_dev->link_rate = 128 * 1000 / 424; 968 969 if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) { 970 atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret); ··· 992 return 0; 993 994 fail: 995 instance->atm_dev = NULL; 996 atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */ 997 return ret; ··· 1329 1330 /* ATM finalize */ 1331 if (instance->atm_dev) { 1332 atm_dev_deregister(instance->atm_dev); 1333 instance->atm_dev = NULL; 1334 }
+2 -1
drivers/vhost/vhost.c
··· 884 int r; 885 if (!write_length) 886 return 0; 887 write_address /= VHOST_PAGE_SIZE; 888 for (;;) { 889 u64 base = (u64)(unsigned long)log_base; ··· 898 if (write_length <= VHOST_PAGE_SIZE) 899 break; 900 write_length -= VHOST_PAGE_SIZE; 901 - write_address += VHOST_PAGE_SIZE; 902 } 903 return r; 904 }
··· 884 int r; 885 if (!write_length) 886 return 0; 887 + write_length += write_address % VHOST_PAGE_SIZE; 888 write_address /= VHOST_PAGE_SIZE; 889 for (;;) { 890 u64 base = (u64)(unsigned long)log_base; ··· 897 if (write_length <= VHOST_PAGE_SIZE) 898 break; 899 write_length -= VHOST_PAGE_SIZE; 900 + write_address += 1; 901 } 902 return r; 903 }
+4 -2
include/linux/atmdev.h
··· 427 428 #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) 429 430 - struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, 431 - int number,unsigned long *flags); /* number == -1: pick first available */ 432 struct atm_dev *atm_dev_lookup(int number); 433 void atm_dev_deregister(struct atm_dev *dev); 434
··· 427 428 #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) 429 430 + struct atm_dev *atm_dev_register(const char *type, struct device *parent, 431 + const struct atmdev_ops *ops, 432 + int number, /* -1 == pick first available */ 433 + unsigned long *flags); 434 struct atm_dev *atm_dev_lookup(int number); 435 void atm_dev_deregister(struct atm_dev *dev); 436
+1
include/linux/snmp.h
··· 230 LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ 231 LINUX_MIB_TCPDEFERACCEPTDROP, 232 LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ 233 __LINUX_MIB_MAX 234 }; 235
··· 230 LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ 231 LINUX_MIB_TCPDEFERACCEPTDROP, 232 LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ 233 + LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */ 234 __LINUX_MIB_MAX 235 }; 236
+3 -1
include/net/sock.h
··· 1155 /* Initialise core socket variables */ 1156 extern void sock_init_data(struct socket *sock, struct sock *sk); 1157 1158 /** 1159 * sk_filter_release - release a socket filter 1160 * @fp: filter to remove ··· 1167 static inline void sk_filter_release(struct sk_filter *fp) 1168 { 1169 if (atomic_dec_and_test(&fp->refcnt)) 1170 - kfree(fp); 1171 } 1172 1173 static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp)
··· 1155 /* Initialise core socket variables */ 1156 extern void sock_init_data(struct socket *sock, struct sock *sk); 1157 1158 + extern void sk_filter_release_rcu(struct rcu_head *rcu); 1159 + 1160 /** 1161 * sk_filter_release - release a socket filter 1162 * @fp: filter to remove ··· 1165 static inline void sk_filter_release(struct sk_filter *fp) 1166 { 1167 if (atomic_dec_and_test(&fp->refcnt)) 1168 + call_rcu_bh(&fp->rcu, sk_filter_release_rcu); 1169 } 1170 1171 static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp)
+2 -1
net/atm/atm_sysfs.c
··· 143 .dev_uevent = atm_uevent, 144 }; 145 146 - int atm_register_sysfs(struct atm_dev *adev) 147 { 148 struct device *cdev = &adev->class_dev; 149 int i, j, err; 150 151 cdev->class = &atm_class; 152 dev_set_drvdata(cdev, adev); 153 154 dev_set_name(cdev, "%s%d", adev->type, adev->number);
··· 143 .dev_uevent = atm_uevent, 144 }; 145 146 + int atm_register_sysfs(struct atm_dev *adev, struct device *parent) 147 { 148 struct device *cdev = &adev->class_dev; 149 int i, j, err; 150 151 cdev->class = &atm_class; 152 + cdev->parent = parent; 153 dev_set_drvdata(cdev, adev); 154 155 dev_set_name(cdev, "%s%d", adev->type, adev->number);
+4 -3
net/atm/resources.c
··· 74 } 75 EXPORT_SYMBOL(atm_dev_lookup); 76 77 - struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, 78 - int number, unsigned long *flags) 79 { 80 struct atm_dev *dev, *inuse; 81 ··· 116 goto out_fail; 117 } 118 119 - if (atm_register_sysfs(dev) < 0) { 120 pr_err("atm_register_sysfs failed for dev %s\n", type); 121 atm_proc_dev_deregister(dev); 122 goto out_fail;
··· 74 } 75 EXPORT_SYMBOL(atm_dev_lookup); 76 77 + struct atm_dev *atm_dev_register(const char *type, struct device *parent, 78 + const struct atmdev_ops *ops, int number, 79 + unsigned long *flags) 80 { 81 struct atm_dev *dev, *inuse; 82 ··· 115 goto out_fail; 116 } 117 118 + if (atm_register_sysfs(dev, parent) < 0) { 119 pr_err("atm_register_sysfs failed for dev %s\n", type); 120 atm_proc_dev_deregister(dev); 121 goto out_fail;
+1 -1
net/atm/resources.h
··· 42 43 #endif /* CONFIG_PROC_FS */ 44 45 - int atm_register_sysfs(struct atm_dev *adev); 46 void atm_unregister_sysfs(struct atm_dev *adev); 47 #endif
··· 42 43 #endif /* CONFIG_PROC_FS */ 44 45 + int atm_register_sysfs(struct atm_dev *adev, struct device *parent); 46 void atm_unregister_sysfs(struct atm_dev *adev); 47 #endif
+3 -3
net/bluetooth/sco.c
··· 882 int lm = 0; 883 884 if (type != SCO_LINK && type != ESCO_LINK) 885 - return 0; 886 887 BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); 888 ··· 908 BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); 909 910 if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) 911 - return 0; 912 913 if (!status) { 914 struct sco_conn *conn; ··· 927 BT_DBG("hcon %p reason %d", hcon, reason); 928 929 if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) 930 - return 0; 931 932 sco_conn_del(hcon, bt_err(reason)); 933
··· 882 int lm = 0; 883 884 if (type != SCO_LINK && type != ESCO_LINK) 885 + return -EINVAL; 886 887 BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); 888 ··· 908 BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); 909 910 if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) 911 + return -EINVAL; 912 913 if (!status) { 914 struct sco_conn *conn; ··· 927 BT_DBG("hcon %p reason %d", hcon, reason); 928 929 if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) 930 + return -EINVAL; 931 932 sco_conn_del(hcon, bt_err(reason)); 933
+6 -13
net/core/filter.c
··· 589 EXPORT_SYMBOL(sk_chk_filter); 590 591 /** 592 - * sk_filter_rcu_release - Release a socket filter by rcu_head 593 * @rcu: rcu_head that contains the sk_filter to free 594 */ 595 - static void sk_filter_rcu_release(struct rcu_head *rcu) 596 { 597 struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); 598 599 - sk_filter_release(fp); 600 } 601 - 602 - static void sk_filter_delayed_uncharge(struct sock *sk, struct sk_filter *fp) 603 - { 604 - unsigned int size = sk_filter_len(fp); 605 - 606 - atomic_sub(size, &sk->sk_omem_alloc); 607 - call_rcu_bh(&fp->rcu, sk_filter_rcu_release); 608 - } 609 610 /** 611 * sk_attach_filter - attach a socket filter ··· 642 rcu_assign_pointer(sk->sk_filter, fp); 643 644 if (old_fp) 645 - sk_filter_delayed_uncharge(sk, old_fp); 646 return 0; 647 } 648 EXPORT_SYMBOL_GPL(sk_attach_filter); ··· 656 sock_owned_by_user(sk)); 657 if (filter) { 658 rcu_assign_pointer(sk->sk_filter, NULL); 659 - sk_filter_delayed_uncharge(sk, filter); 660 ret = 0; 661 } 662 return ret;
··· 589 EXPORT_SYMBOL(sk_chk_filter); 590 591 /** 592 + * sk_filter_release_rcu - Release a socket filter by rcu_head 593 * @rcu: rcu_head that contains the sk_filter to free 594 */ 595 + void sk_filter_release_rcu(struct rcu_head *rcu) 596 { 597 struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); 598 599 + kfree(fp); 600 } 601 + EXPORT_SYMBOL(sk_filter_release_rcu); 602 603 /** 604 * sk_attach_filter - attach a socket filter ··· 649 rcu_assign_pointer(sk->sk_filter, fp); 650 651 if (old_fp) 652 + sk_filter_uncharge(sk, old_fp); 653 return 0; 654 } 655 EXPORT_SYMBOL_GPL(sk_attach_filter); ··· 663 sock_owned_by_user(sk)); 664 if (filter) { 665 rcu_assign_pointer(sk->sk_filter, NULL); 666 + sk_filter_uncharge(sk, filter); 667 ret = 0; 668 } 669 return ret;
+4 -2
net/core/timestamping.c
··· 96 struct phy_device *phydev; 97 unsigned int type; 98 99 - skb_push(skb, ETH_HLEN); 100 101 type = classify(skb); 102 103 - skb_pull(skb, ETH_HLEN); 104 105 switch (type) { 106 case PTP_CLASS_V1_IPV4:
··· 96 struct phy_device *phydev; 97 unsigned int type; 98 99 + if (skb_headroom(skb) < ETH_HLEN) 100 + return false; 101 + __skb_push(skb, ETH_HLEN); 102 103 type = classify(skb); 104 105 + __skb_pull(skb, ETH_HLEN); 106 107 switch (type) { 108 case PTP_CLASS_V1_IPV4:
+9 -3
net/econet/af_econet.c
··· 661 err = 0; 662 switch (cmd) { 663 case SIOCSIFADDR: 664 - if (!capable(CAP_NET_ADMIN)) 665 - return -EPERM; 666 667 edev = dev->ec_ptr; 668 if (edev == NULL) { ··· 851 { 852 struct iphdr *ip = ip_hdr(skb); 853 unsigned char stn = ntohl(ip->saddr) & 0xff; 854 struct sock *sk = NULL; 855 struct sk_buff *newskb; 856 - struct ec_device *edev = skb->dev->ec_ptr; 857 858 if (! edev) 859 goto bad;
··· 661 err = 0; 662 switch (cmd) { 663 case SIOCSIFADDR: 664 + if (!capable(CAP_NET_ADMIN)) { 665 + err = -EPERM; 666 + break; 667 + } 668 669 edev = dev->ec_ptr; 670 if (edev == NULL) { ··· 849 { 850 struct iphdr *ip = ip_hdr(skb); 851 unsigned char stn = ntohl(ip->saddr) & 0xff; 852 + struct dst_entry *dst = skb_dst(skb); 853 + struct ec_device *edev = NULL; 854 struct sock *sk = NULL; 855 struct sk_buff *newskb; 856 + 857 + if (dst) 858 + edev = dst->dev->ec_ptr; 859 860 if (! edev) 861 goto bad;
+1
net/ipv4/proc.c
··· 253 SNMP_MIB_ITEM("TCPMinTTLDrop", LINUX_MIB_TCPMINTTLDROP), 254 SNMP_MIB_ITEM("TCPDeferAcceptDrop", LINUX_MIB_TCPDEFERACCEPTDROP), 255 SNMP_MIB_ITEM("IPReversePathFilter", LINUX_MIB_IPRPFILTER), 256 SNMP_MIB_SENTINEL 257 }; 258
··· 253 SNMP_MIB_ITEM("TCPMinTTLDrop", LINUX_MIB_TCPMINTTLDROP), 254 SNMP_MIB_ITEM("TCPDeferAcceptDrop", LINUX_MIB_TCPDEFERACCEPTDROP), 255 SNMP_MIB_ITEM("IPReversePathFilter", LINUX_MIB_IPRPFILTER), 256 + SNMP_MIB_ITEM("TCPTimeWaitOverflow", LINUX_MIB_TCPTIMEWAITOVERFLOW), 257 SNMP_MIB_SENTINEL 258 }; 259
+1 -1
net/ipv4/tcp_minisocks.c
··· 347 * socket up. We've got bigger problems than 348 * non-graceful socket closings. 349 */ 350 - LIMIT_NETDEBUG(KERN_INFO "TCP: time wait bucket table overflow\n"); 351 } 352 353 tcp_update_metrics(sk);
··· 347 * socket up. We've got bigger problems than 348 * non-graceful socket closings. 349 */ 350 + NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW); 351 } 352 353 tcp_update_metrics(sk);
+23 -19
net/ipv4/tcp_output.c
··· 231 /* when initializing use the value from init_rcv_wnd 232 * rather than the default from above 233 */ 234 - if (init_rcv_wnd && 235 - (*rcv_wnd > init_rcv_wnd * mss)) 236 - *rcv_wnd = init_rcv_wnd * mss; 237 - else if (*rcv_wnd > init_cwnd * mss) 238 - *rcv_wnd = init_cwnd * mss; 239 } 240 241 /* Set the clamp no higher than max representable value */ ··· 385 */ 386 static u8 tcp_cookie_size_check(u8 desired) 387 { 388 - if (desired > 0) { 389 /* previously specified */ 390 return desired; 391 - } 392 - if (sysctl_tcp_cookie_size <= 0) { 393 /* no default specified */ 394 return 0; 395 - } 396 - if (sysctl_tcp_cookie_size <= TCP_COOKIE_MIN) { 397 /* value too small, specify minimum */ 398 return TCP_COOKIE_MIN; 399 - } 400 - if (sysctl_tcp_cookie_size >= TCP_COOKIE_MAX) { 401 /* value too large, specify maximum */ 402 return TCP_COOKIE_MAX; 403 - } 404 - if (0x1 & sysctl_tcp_cookie_size) { 405 /* 8-bit multiple, illegal, fix it */ 406 - return (u8)(sysctl_tcp_cookie_size + 0x1); 407 - } 408 - return (u8)sysctl_tcp_cookie_size; 409 } 410 411 /* Write previously computed TCP options to the packet. ··· 1515 struct tcp_sock *tp = tcp_sk(sk); 1516 const struct inet_connection_sock *icsk = inet_csk(sk); 1517 u32 send_win, cong_win, limit, in_flight; 1518 1519 if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) 1520 goto send_now; ··· 1547 if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) 1548 goto send_now; 1549 1550 - if (sysctl_tcp_tso_win_divisor) { 1551 u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); 1552 1553 /* If at least some fraction of a window is available, 1554 * just use it. 1555 */ 1556 - chunk /= sysctl_tcp_tso_win_divisor; 1557 if (limit >= chunk) 1558 goto send_now; 1559 } else {
··· 231 /* when initializing use the value from init_rcv_wnd 232 * rather than the default from above 233 */ 234 + if (init_rcv_wnd) 235 + *rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss); 236 + else 237 + *rcv_wnd = min(*rcv_wnd, init_cwnd * mss); 238 } 239 240 /* Set the clamp no higher than max representable value */ ··· 386 */ 387 static u8 tcp_cookie_size_check(u8 desired) 388 { 389 + int cookie_size; 390 + 391 + if (desired > 0) 392 /* previously specified */ 393 return desired; 394 + 395 + cookie_size = ACCESS_ONCE(sysctl_tcp_cookie_size); 396 + if (cookie_size <= 0) 397 /* no default specified */ 398 return 0; 399 + 400 + if (cookie_size <= TCP_COOKIE_MIN) 401 /* value too small, specify minimum */ 402 return TCP_COOKIE_MIN; 403 + 404 + if (cookie_size >= TCP_COOKIE_MAX) 405 /* value too large, specify maximum */ 406 return TCP_COOKIE_MAX; 407 + 408 + if (cookie_size & 1) 409 /* 8-bit multiple, illegal, fix it */ 410 + cookie_size++; 411 + 412 + return (u8)cookie_size; 413 } 414 415 /* Write previously computed TCP options to the packet. ··· 1513 struct tcp_sock *tp = tcp_sk(sk); 1514 const struct inet_connection_sock *icsk = inet_csk(sk); 1515 u32 send_win, cong_win, limit, in_flight; 1516 + int win_divisor; 1517 1518 if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) 1519 goto send_now; ··· 1544 if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) 1545 goto send_now; 1546 1547 + win_divisor = ACCESS_ONCE(sysctl_tcp_tso_win_divisor); 1548 + if (win_divisor) { 1549 u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); 1550 1551 /* If at least some fraction of a window is available, 1552 * just use it. 1553 */ 1554 + chunk /= win_divisor; 1555 if (limit >= chunk) 1556 goto send_now; 1557 } else {
+2 -2
net/ipv6/addrconf.c
··· 4021 kfree_skb(skb); 4022 goto errout; 4023 } 4024 - rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); 4025 return; 4026 errout: 4027 if (err < 0) 4028 - rtnl_set_sk_err(net, RTNLGRP_IPV6_IFADDR, err); 4029 } 4030 4031 static inline size_t inet6_prefix_nlmsg_size(void)
··· 4021 kfree_skb(skb); 4022 goto errout; 4023 } 4024 + rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFINFO, NULL, GFP_ATOMIC); 4025 return; 4026 errout: 4027 if (err < 0) 4028 + rtnl_set_sk_err(net, RTNLGRP_IPV6_IFINFO, err); 4029 } 4030 4031 static inline size_t inet6_prefix_nlmsg_size(void)
+7
net/ipv6/ip6_tunnel.c
··· 1175 sizeof (struct ipv6hdr); 1176 1177 dev->mtu = rt->rt6i_dev->mtu - sizeof (struct ipv6hdr); 1178 1179 if (dev->mtu < IPV6_MIN_MTU) 1180 dev->mtu = IPV6_MIN_MTU; ··· 1365 1366 static void ip6_tnl_dev_setup(struct net_device *dev) 1367 { 1368 dev->netdev_ops = &ip6_tnl_netdev_ops; 1369 dev->destructor = ip6_dev_free; 1370 1371 dev->type = ARPHRD_TUNNEL6; 1372 dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); 1373 dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); 1374 dev->flags |= IFF_NOARP; 1375 dev->addr_len = sizeof(struct in6_addr); 1376 dev->features |= NETIF_F_NETNS_LOCAL;
··· 1175 sizeof (struct ipv6hdr); 1176 1177 dev->mtu = rt->rt6i_dev->mtu - sizeof (struct ipv6hdr); 1178 + if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) 1179 + dev->mtu-=8; 1180 1181 if (dev->mtu < IPV6_MIN_MTU) 1182 dev->mtu = IPV6_MIN_MTU; ··· 1363 1364 static void ip6_tnl_dev_setup(struct net_device *dev) 1365 { 1366 + struct ip6_tnl *t; 1367 + 1368 dev->netdev_ops = &ip6_tnl_netdev_ops; 1369 dev->destructor = ip6_dev_free; 1370 1371 dev->type = ARPHRD_TUNNEL6; 1372 dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); 1373 dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); 1374 + t = netdev_priv(dev); 1375 + if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) 1376 + dev->mtu-=8; 1377 dev->flags |= IFF_NOARP; 1378 dev->addr_len = sizeof(struct in6_addr); 1379 dev->features |= NETIF_F_NETNS_LOCAL;
+2 -1
net/ipv6/sit.c
··· 606 return 0; 607 } 608 609 - icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); 610 rcu_read_unlock(); 611 out: 612 kfree_skb(skb); 613 return 0;
··· 606 return 0; 607 } 608 609 + /* no tunnel matched, let upstream know, ipsec may handle it */ 610 rcu_read_unlock(); 611 + return 1; 612 out: 613 kfree_skb(skb); 614 return 0;
+5 -1
net/l2tp/l2tp_ip.c
··· 674 MODULE_AUTHOR("James Chapman <jchapman@katalix.com>"); 675 MODULE_DESCRIPTION("L2TP over IP"); 676 MODULE_VERSION("1.0"); 677 - MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, SOCK_DGRAM, IPPROTO_L2TP);
··· 674 MODULE_AUTHOR("James Chapman <jchapman@katalix.com>"); 675 MODULE_DESCRIPTION("L2TP over IP"); 676 MODULE_VERSION("1.0"); 677 + 678 + /* Use the value of SOCK_DGRAM (2) directory, because __stringify does't like 679 + * enums 680 + */ 681 + MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP);
+3 -2
net/llc/af_llc.c
··· 317 goto out; 318 rc = -ENODEV; 319 rtnl_lock(); 320 if (sk->sk_bound_dev_if) { 321 - llc->dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if); 322 if (llc->dev) { 323 if (!addr->sllc_arphrd) 324 addr->sllc_arphrd = llc->dev->type; ··· 330 !llc_mac_match(addr->sllc_mac, 331 llc->dev->dev_addr)) { 332 rc = -EINVAL; 333 - dev_put(llc->dev); 334 llc->dev = NULL; 335 } 336 } 337 } else 338 llc->dev = dev_getbyhwaddr(&init_net, addr->sllc_arphrd, 339 addr->sllc_mac); 340 rtnl_unlock(); 341 if (!llc->dev) 342 goto out;
··· 317 goto out; 318 rc = -ENODEV; 319 rtnl_lock(); 320 + rcu_read_lock(); 321 if (sk->sk_bound_dev_if) { 322 + llc->dev = dev_get_by_index_rcu(&init_net, sk->sk_bound_dev_if); 323 if (llc->dev) { 324 if (!addr->sllc_arphrd) 325 addr->sllc_arphrd = llc->dev->type; ··· 329 !llc_mac_match(addr->sllc_mac, 330 llc->dev->dev_addr)) { 331 rc = -EINVAL; 332 llc->dev = NULL; 333 } 334 } 335 } else 336 llc->dev = dev_getbyhwaddr(&init_net, addr->sllc_arphrd, 337 addr->sllc_mac); 338 + rcu_read_unlock(); 339 rtnl_unlock(); 340 if (!llc->dev) 341 goto out;
+6
net/mac80211/rx.c
··· 2247 break; 2248 case cpu_to_le16(IEEE80211_STYPE_DEAUTH): 2249 case cpu_to_le16(IEEE80211_STYPE_DISASSOC): 2250 /* process only for station */ 2251 if (sdata->vif.type != NL80211_IFTYPE_STATION) 2252 return RX_DROP_MONITOR; ··· 2745 2746 if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) 2747 return; 2748 } 2749 } 2750 ··· 2785 return; 2786 } 2787 2788 dev_kfree_skb(skb); 2789 } 2790
··· 2247 break; 2248 case cpu_to_le16(IEEE80211_STYPE_DEAUTH): 2249 case cpu_to_le16(IEEE80211_STYPE_DISASSOC): 2250 + if (is_multicast_ether_addr(mgmt->da) && 2251 + !is_broadcast_ether_addr(mgmt->da)) 2252 + return RX_DROP_MONITOR; 2253 + 2254 /* process only for station */ 2255 if (sdata->vif.type != NL80211_IFTYPE_STATION) 2256 return RX_DROP_MONITOR; ··· 2741 2742 if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) 2743 return; 2744 + goto out; 2745 } 2746 } 2747 ··· 2780 return; 2781 } 2782 2783 + out: 2784 dev_kfree_skb(skb); 2785 } 2786
+24 -4
net/mac80211/tx.c
··· 1587 list) { 1588 if (!ieee80211_sdata_running(tmp_sdata)) 1589 continue; 1590 - if (tmp_sdata->vif.type != NL80211_IFTYPE_AP) 1591 continue; 1592 if (compare_ether_addr(tmp_sdata->vif.addr, 1593 hdr->addr2) == 0) { ··· 1737 int nh_pos, h_pos; 1738 struct sta_info *sta = NULL; 1739 u32 sta_flags = 0; 1740 1741 if (unlikely(skb->len < ETH_HLEN)) { 1742 ret = NETDEV_TX_OK; 1743 goto fail; 1744 } 1745 - 1746 - nh_pos = skb_network_header(skb) - skb->data; 1747 - h_pos = skb_transport_header(skb) - skb->data; 1748 1749 /* convert Ethernet header to proper 802.11 header (based on 1750 * operation mode) */ ··· 1916 goto fail; 1917 } 1918 1919 hdr.frame_control = fc; 1920 hdr.duration_id = 0; 1921 hdr.seq_ctrl = 0; ··· 1947 encaps_data = NULL; 1948 encaps_len = 0; 1949 } 1950 1951 skb_pull(skb, skip_header_bytes); 1952 nh_pos -= skip_header_bytes;
··· 1587 list) { 1588 if (!ieee80211_sdata_running(tmp_sdata)) 1589 continue; 1590 + if (tmp_sdata->vif.type == 1591 + NL80211_IFTYPE_MONITOR || 1592 + tmp_sdata->vif.type == 1593 + NL80211_IFTYPE_AP_VLAN || 1594 + tmp_sdata->vif.type == 1595 + NL80211_IFTYPE_WDS) 1596 continue; 1597 if (compare_ether_addr(tmp_sdata->vif.addr, 1598 hdr->addr2) == 0) { ··· 1732 int nh_pos, h_pos; 1733 struct sta_info *sta = NULL; 1734 u32 sta_flags = 0; 1735 + struct sk_buff *tmp_skb; 1736 1737 if (unlikely(skb->len < ETH_HLEN)) { 1738 ret = NETDEV_TX_OK; 1739 goto fail; 1740 } 1741 1742 /* convert Ethernet header to proper 802.11 header (based on 1743 * operation mode) */ ··· 1913 goto fail; 1914 } 1915 1916 + /* 1917 + * If the skb is shared we need to obtain our own copy. 1918 + */ 1919 + if (skb_shared(skb)) { 1920 + tmp_skb = skb; 1921 + skb = skb_copy(skb, GFP_ATOMIC); 1922 + kfree_skb(tmp_skb); 1923 + 1924 + if (!skb) { 1925 + ret = NETDEV_TX_OK; 1926 + goto fail; 1927 + } 1928 + } 1929 + 1930 hdr.frame_control = fc; 1931 hdr.duration_id = 0; 1932 hdr.seq_ctrl = 0; ··· 1930 encaps_data = NULL; 1931 encaps_len = 0; 1932 } 1933 + 1934 + nh_pos = skb_network_header(skb) - skb->data; 1935 + h_pos = skb_transport_header(skb) - skb->data; 1936 1937 skb_pull(skb, skip_header_bytes); 1938 nh_pos -= skip_header_bytes;
+8
net/sctp/socket.c
··· 2932 struct sctp_association *asoc = NULL; 2933 struct sctp_setpeerprim prim; 2934 struct sctp_chunk *chunk; 2935 int err; 2936 2937 sp = sctp_sk(sk); ··· 2959 2960 if (!sctp_state(asoc, ESTABLISHED)) 2961 return -ENOTCONN; 2962 2963 if (!sctp_assoc_lookup_laddr(asoc, (union sctp_addr *)&prim.sspp_addr)) 2964 return -EADDRNOTAVAIL;
··· 2932 struct sctp_association *asoc = NULL; 2933 struct sctp_setpeerprim prim; 2934 struct sctp_chunk *chunk; 2935 + struct sctp_af *af; 2936 int err; 2937 2938 sp = sctp_sk(sk); ··· 2958 2959 if (!sctp_state(asoc, ESTABLISHED)) 2960 return -ENOTCONN; 2961 + 2962 + af = sctp_get_af_specific(prim.sspp_addr.ss_family); 2963 + if (!af) 2964 + return -EINVAL; 2965 + 2966 + if (!af->addr_valid((union sctp_addr *)&prim.sspp_addr, sp, NULL)) 2967 + return -EADDRNOTAVAIL; 2968 2969 if (!sctp_assoc_lookup_laddr(asoc, (union sctp_addr *)&prim.sspp_addr)) 2970 return -EADDRNOTAVAIL;
+15
net/socket.c
··· 732 return ret; 733 } 734 735 int kernel_recvmsg(struct socket *sock, struct msghdr *msg, 736 struct kvec *vec, size_t num, size_t size, int flags) 737 {
··· 732 return ret; 733 } 734 735 + /** 736 + * kernel_recvmsg - Receive a message from a socket (kernel space) 737 + * @sock: The socket to receive the message from 738 + * @msg: Received message 739 + * @vec: Input s/g array for message data 740 + * @num: Size of input s/g array 741 + * @size: Number of bytes to read 742 + * @flags: Message flags (MSG_DONTWAIT, etc...) 743 + * 744 + * On return the msg structure contains the scatter/gather array passed in the 745 + * vec argument. The array is modified so that it consists of the unfilled 746 + * portion of the original array. 747 + * 748 + * The returned value is the total number of bytes received, or an error. 749 + */ 750 int kernel_recvmsg(struct socket *sock, struct msghdr *msg, 751 struct kvec *vec, size_t num, size_t size, int flags) 752 {
+1
net/x25/x25_link.c
··· 394 list_for_each_safe(entry, tmp, &x25_neigh_list) { 395 nb = list_entry(entry, struct x25_neigh, node); 396 __x25_remove_neigh(nb); 397 } 398 write_unlock_bh(&x25_neigh_list_lock); 399 }
··· 394 list_for_each_safe(entry, tmp, &x25_neigh_list) { 395 nb = list_entry(entry, struct x25_neigh, node); 396 __x25_remove_neigh(nb); 397 + dev_put(nb->dev); 398 } 399 write_unlock_bh(&x25_neigh_list_lock); 400 }
+1 -1
net/xfrm/xfrm_state.c
··· 1268 1269 return xc; 1270 error: 1271 - kfree(xc); 1272 return NULL; 1273 } 1274 EXPORT_SYMBOL(xfrm_state_migrate);
··· 1268 1269 return xc; 1270 error: 1271 + xfrm_state_put(xc); 1272 return NULL; 1273 } 1274 EXPORT_SYMBOL(xfrm_state_migrate);