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