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: (45 commits)
cnic: Fix ISCSI_KEVENT_IF_DOWN message handling.
net: irda: init spinlock after memcpy
ixgbe: fix for 82599 errata marking UDP checksum errors
r8169: WakeOnLan fix for the 8168
netxen: reset ring consumer during cleanup
net/bridge: use kobject_put to release kobject in br_add_if error path
smc91x.h: add config for Nomadik evaluation kit
NET: ROSE: Don't use static buffer.
eepro: Read buffer overflow
tokenring: Read buffer overflow
at1700: Read buffer overflow
fealnx: Write outside array bounds
ixgbe: remove unnecessary call to device_init_wakeup
ixgbe: Don't priority tag control frames in DCB mode
ixgbe: Enable FCoE offload when DCB is enabled for 82599
net: Rework mdio-ofgpio driver to use of_mdio infrastructure
register at91_ether using platform_driver_probe
skge: Enable WoL by default if supported
net: KS8851 needs to depend on MII
be2net: Bug fix in the non-lro path. Size of received packet was not updated in statistics properly.
...

+338 -176
+1
drivers/net/Kconfig
··· 1732 1732 config KS8851 1733 1733 tristate "Micrel KS8851 SPI" 1734 1734 depends on SPI 1735 + select MII 1735 1736 help 1736 1737 SPI driver for Micrel KS8851 SPI attached network chip. 1737 1738
+1 -2
drivers/net/arm/at91_ether.c
··· 1228 1228 #endif 1229 1229 1230 1230 static struct platform_driver at91ether_driver = { 1231 - .probe = at91ether_probe, 1232 1231 .remove = __devexit_p(at91ether_remove), 1233 1232 .suspend = at91ether_suspend, 1234 1233 .resume = at91ether_resume, ··· 1239 1240 1240 1241 static int __init at91ether_init(void) 1241 1242 { 1242 - return platform_driver_register(&at91ether_driver); 1243 + return platform_driver_probe(&at91ether_driver, at91ether_probe); 1243 1244 } 1244 1245 1245 1246 static void __exit at91ether_exit(void)
+1 -1
drivers/net/at1700.c
··· 318 318 pos3 = mca_read_stored_pos( slot, 3 ); 319 319 pos4 = mca_read_stored_pos( slot, 4 ); 320 320 321 - for (l_i = 0; l_i < 0x09; l_i++) 321 + for (l_i = 0; l_i < 8; l_i++) 322 322 if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i]) 323 323 break; 324 324 ioaddr = at1700_mca_probe_list[l_i];
+4 -4
drivers/net/benet/be_main.c
··· 667 667 struct be_queue_info *rxq = &adapter->rx_obj.q; 668 668 struct be_rx_page_info *page_info; 669 669 u16 rxq_idx, i, num_rcvd, j; 670 - u32 pktsize, hdr_len, curr_frag_len; 670 + u32 pktsize, hdr_len, curr_frag_len, size; 671 671 u8 *start; 672 672 673 673 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); ··· 708 708 } 709 709 710 710 /* More frags present for this completion */ 711 - pktsize -= curr_frag_len; /* account for above copied frag */ 711 + size = pktsize; 712 712 for (i = 1, j = 0; i < num_rcvd; i++) { 713 + size -= curr_frag_len; 713 714 index_inc(&rxq_idx, rxq->len); 714 715 page_info = get_rx_page_info(adapter, rxq_idx); 715 716 716 - curr_frag_len = min(pktsize, rx_frag_size); 717 + curr_frag_len = min(size, rx_frag_size); 717 718 718 719 /* Coalesce all frags from the same physical page in one slot */ 719 720 if (page_info->page_offset == 0) { ··· 732 731 skb_shinfo(skb)->frags[j].size += curr_frag_len; 733 732 skb->len += curr_frag_len; 734 733 skb->data_len += curr_frag_len; 735 - pktsize -= curr_frag_len; 736 734 737 735 memset(page_info, 0, sizeof(*page_info)); 738 736 }
+21 -2
drivers/net/cnic.c
··· 227 227 } 228 228 229 229 rcu_read_lock(); 230 - ulp_ops = rcu_dereference(cp->ulp_ops[CNIC_ULP_ISCSI]); 230 + ulp_ops = rcu_dereference(cnic_ulp_tbl[CNIC_ULP_ISCSI]); 231 231 if (ulp_ops) 232 232 ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len); 233 233 rcu_read_unlock(); ··· 319 319 return 0; 320 320 } 321 321 322 + static void cnic_uio_stop(void) 323 + { 324 + struct cnic_dev *dev; 325 + 326 + read_lock(&cnic_dev_lock); 327 + list_for_each_entry(dev, &cnic_dev_list, list) { 328 + struct cnic_local *cp = dev->cnic_priv; 329 + 330 + if (cp->cnic_uinfo) 331 + cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); 332 + } 333 + read_unlock(&cnic_dev_lock); 334 + } 335 + 322 336 int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) 323 337 { 324 338 struct cnic_dev *dev; ··· 403 389 } 404 390 } 405 391 read_unlock(&cnic_dev_lock); 392 + 393 + if (ulp_type == CNIC_ULP_ISCSI) 394 + cnic_uio_stop(); 406 395 407 396 rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL); 408 397 ··· 649 632 int i = 0; 650 633 651 634 if (cp->cnic_uinfo) { 652 - cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); 653 635 while (cp->uio_dev != -1 && i < 15) { 654 636 msleep(100); 655 637 i++; ··· 1072 1056 { 1073 1057 struct cnic_local *cp = dev->cnic_priv; 1074 1058 int if_type; 1059 + 1060 + if (cp->cnic_uinfo) 1061 + cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); 1075 1062 1076 1063 rcu_read_lock(); 1077 1064 for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) {
+1 -1
drivers/net/eepro.c
··· 1784 1784 printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n"); 1785 1785 } 1786 1786 1787 - for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) { 1787 + for (i = 0; i < MAX_EEPRO && io[i] != -1; i++) { 1788 1788 dev = alloc_etherdev(sizeof(struct eepro_local)); 1789 1789 if (!dev) 1790 1790 break;
+2 -1
drivers/net/fealnx.c
··· 584 584 if (np->flags == HAS_MII_XCVR) { 585 585 int phy, phy_idx = 0; 586 586 587 - for (phy = 1; phy < 32 && phy_idx < 4; phy++) { 587 + for (phy = 1; phy < 32 && phy_idx < ARRAY_SIZE(np->phys); 588 + phy++) { 588 589 int mii_status = mdio_read(dev, phy, 1); 589 590 590 591 if (mii_status != 0xffff && mii_status != 0x0000) {
+10 -10
drivers/net/fs_enet/fs_enet-main.c
··· 754 754 fep->oldlink = 0; 755 755 fep->oldspeed = 0; 756 756 fep->oldduplex = -1; 757 - if(fep->fpi->phy_node) 758 - phydev = of_phy_connect(dev, fep->fpi->phy_node, 759 - &fs_adjust_link, 0, 760 - PHY_INTERFACE_MODE_MII); 761 - else { 762 - printk("No phy bus ID specified in BSP code\n"); 763 - return -EINVAL; 757 + 758 + phydev = of_phy_connect(dev, fep->fpi->phy_node, &fs_adjust_link, 0, 759 + PHY_INTERFACE_MODE_MII); 760 + if (!phydev) { 761 + phydev = of_phy_connect_fixed_link(dev, &fs_adjust_link, 762 + PHY_INTERFACE_MODE_MII); 764 763 } 765 - if (IS_ERR(phydev)) { 766 - printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); 767 - return PTR_ERR(phydev); 764 + if (!phydev) { 765 + dev_err(&dev->dev, "Could not attach to PHY\n"); 766 + return -ENODEV; 768 767 } 769 768 770 769 fep->phydev = phydev; ··· 1004 1005 goto out_free_fpi; 1005 1006 } 1006 1007 1008 + SET_NETDEV_DEV(ndev, &ofdev->dev); 1007 1009 dev_set_drvdata(&ofdev->dev, ndev); 1008 1010 1009 1011 fep = netdev_priv(ndev);
+8 -16
drivers/net/gianfar.c
··· 264 264 priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET; 265 265 266 266 priv->phy_node = of_parse_phandle(np, "phy-handle", 0); 267 - if (!priv->phy_node) { 268 - u32 *fixed_link; 269 - 270 - fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL); 271 - if (!fixed_link) { 272 - err = -ENODEV; 273 - goto err_out; 274 - } 275 - } 276 267 277 268 /* Find the TBI PHY. If it's not there, we don't support SGMII */ 278 269 priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0); ··· 650 659 651 660 interface = gfar_get_interface(dev); 652 661 653 - if (priv->phy_node) { 654 - priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 655 - 0, interface); 656 - if (!priv->phydev) { 657 - dev_err(&dev->dev, "error: Could not attach to PHY\n"); 658 - return -ENODEV; 659 - } 662 + priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 0, 663 + interface); 664 + if (!priv->phydev) 665 + priv->phydev = of_phy_connect_fixed_link(dev, &adjust_link, 666 + interface); 667 + if (!priv->phydev) { 668 + dev_err(&dev->dev, "could not attach to PHY\n"); 669 + return -ENODEV; 660 670 } 661 671 662 672 if (interface == PHY_INTERFACE_MODE_SGMII)
+1
drivers/net/ixgbe/ixgbe.h
··· 327 327 #define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25) 328 328 #define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26) 329 329 #define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27) 330 + #define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 28) 330 331 #define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29) 331 332 332 333 u32 flags2;
+24
drivers/net/ixgbe/ixgbe_dcb_nl.c
··· 139 139 adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; 140 140 } 141 141 adapter->flags |= IXGBE_FLAG_DCB_ENABLED; 142 + #ifdef IXGBE_FCOE 143 + /* Turn on FCoE offload */ 144 + if ((adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) && 145 + (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))) { 146 + adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; 147 + adapter->ring_feature[RING_F_FCOE].indices = 148 + IXGBE_FCRETA_SIZE; 149 + netdev->features |= NETIF_F_FCOE_CRC; 150 + netdev->features |= NETIF_F_FSO; 151 + netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; 152 + } 153 + #endif /* IXGBE_FCOE */ 142 154 ixgbe_init_interrupt_scheme(adapter); 143 155 if (netif_running(netdev)) 144 156 netdev->netdev_ops->ndo_open(netdev); ··· 168 156 adapter->flags |= IXGBE_FLAG_RSS_ENABLED; 169 157 if (adapter->hw.mac.type == ixgbe_mac_82599EB) 170 158 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; 159 + 160 + #ifdef IXGBE_FCOE 161 + /* Turn off FCoE offload */ 162 + if (adapter->flags & (IXGBE_FLAG_FCOE_CAPABLE | 163 + IXGBE_FLAG_FCOE_ENABLED)) { 164 + adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; 165 + adapter->ring_feature[RING_F_FCOE].indices = 0; 166 + netdev->features &= ~NETIF_F_FCOE_CRC; 167 + netdev->features &= ~NETIF_F_FSO; 168 + netdev->fcoe_ddp_xid = 0; 169 + } 170 + #endif /* IXGBE_FCOE */ 171 171 ixgbe_init_interrupt_scheme(adapter); 172 172 if (netif_running(netdev)) 173 173 netdev->netdev_ops->ndo_open(netdev);
+33 -19
drivers/net/ixgbe/ixgbe_main.c
··· 34 34 #include <linux/in.h> 35 35 #include <linux/ip.h> 36 36 #include <linux/tcp.h> 37 + #include <linux/pkt_sched.h> 37 38 #include <linux/ipv6.h> 38 39 #include <net/checksum.h> 39 40 #include <net/ip6_checksum.h> ··· 511 510 * @skb: skb currently being received and modified 512 511 **/ 513 512 static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, 514 - u32 status_err, struct sk_buff *skb) 513 + union ixgbe_adv_rx_desc *rx_desc, 514 + struct sk_buff *skb) 515 515 { 516 + u32 status_err = le32_to_cpu(rx_desc->wb.upper.status_error); 517 + 516 518 skb->ip_summed = CHECKSUM_NONE; 517 519 518 520 /* Rx csum disabled */ ··· 533 529 return; 534 530 535 531 if (status_err & IXGBE_RXDADV_ERR_TCPE) { 532 + u16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info; 533 + 534 + /* 535 + * 82599 errata, UDP frames with a 0 checksum can be marked as 536 + * checksum errors. 537 + */ 538 + if ((pkt_info & IXGBE_RXDADV_PKTTYPE_UDP) && 539 + (adapter->hw.mac.type == ixgbe_mac_82599EB)) 540 + return; 541 + 536 542 adapter->hw_csum_rx_error++; 537 543 return; 538 544 } ··· 816 802 goto next_desc; 817 803 } 818 804 819 - ixgbe_rx_checksum(adapter, staterr, skb); 805 + ixgbe_rx_checksum(adapter, rx_desc, skb); 820 806 821 807 /* probably a little skewed due to removing CRC */ 822 808 total_rx_bytes += skb->len; ··· 3820 3806 adapter->atr_sample_rate = 20; 3821 3807 adapter->fdir_pballoc = 0; 3822 3808 #ifdef IXGBE_FCOE 3823 - adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; 3824 - adapter->ring_feature[RING_F_FCOE].indices = IXGBE_FCRETA_SIZE; 3809 + adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE; 3810 + adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; 3811 + adapter->ring_feature[RING_F_FCOE].indices = 0; 3825 3812 #endif /* IXGBE_FCOE */ 3826 3813 } 3827 3814 ··· 5140 5125 int count = 0; 5141 5126 unsigned int f; 5142 5127 5143 - r_idx = skb->queue_mapping; 5144 - tx_ring = &adapter->tx_ring[r_idx]; 5145 - 5146 5128 if (adapter->vlgrp && vlan_tx_tag_present(skb)) { 5147 5129 tx_flags |= vlan_tx_tag_get(skb); 5148 5130 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { ··· 5149 5137 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5150 5138 tx_flags |= IXGBE_TX_FLAGS_VLAN; 5151 5139 } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 5152 - tx_flags |= (skb->queue_mapping << 13); 5153 - tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5154 - tx_flags |= IXGBE_TX_FLAGS_VLAN; 5140 + if (skb->priority != TC_PRIO_CONTROL) { 5141 + tx_flags |= (skb->queue_mapping << 13); 5142 + tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5143 + tx_flags |= IXGBE_TX_FLAGS_VLAN; 5144 + } else { 5145 + skb->queue_mapping = 5146 + adapter->ring_feature[RING_F_DCB].indices-1; 5147 + } 5155 5148 } 5149 + 5150 + r_idx = skb->queue_mapping; 5151 + tx_ring = &adapter->tx_ring[r_idx]; 5156 5152 5157 5153 if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && 5158 5154 (skb->protocol == htons(ETH_P_FCOE))) ··· 5600 5580 #endif 5601 5581 5602 5582 #ifdef IXGBE_FCOE 5603 - if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { 5583 + if (adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) { 5604 5584 if (hw->mac.ops.get_device_caps) { 5605 5585 hw->mac.ops.get_device_caps(hw, &device_caps); 5606 - if (!(device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)) { 5607 - netdev->features |= NETIF_F_FCOE_CRC; 5608 - netdev->features |= NETIF_F_FSO; 5609 - netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; 5610 - } else { 5611 - adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; 5612 - } 5586 + if (device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS) 5587 + adapter->flags &= ~IXGBE_FLAG_FCOE_CAPABLE; 5613 5588 } 5614 5589 } 5615 5590 #endif /* IXGBE_FCOE */ ··· 5653 5638 adapter->wol = 0; 5654 5639 break; 5655 5640 } 5656 - device_init_wakeup(&adapter->pdev->dev, true); 5657 5641 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 5658 5642 5659 5643 /* pick up the PCI bus settings for reporting later */
+7
drivers/net/netxen/netxen_nic_init.c
··· 184 184 kfree(recv_ctx->rds_rings); 185 185 186 186 skip_rds: 187 + if (recv_ctx->sds_rings == NULL) 188 + goto skip_sds; 189 + 190 + for(ring = 0; ring < adapter->max_sds_rings; ring++) 191 + recv_ctx->sds_rings[ring].consumer = 0; 192 + 193 + skip_sds: 187 194 if (adapter->tx_ring == NULL) 188 195 return; 189 196
+38 -43
drivers/net/phy/mdio-gpio.c
··· 30 30 31 31 #ifdef CONFIG_OF_GPIO 32 32 #include <linux/of_gpio.h> 33 + #include <linux/of_mdio.h> 33 34 #include <linux/of_platform.h> 34 35 #endif 35 36 ··· 82 81 .get_mdio_data = mdio_get, 83 82 }; 84 83 85 - static int __devinit mdio_gpio_bus_init(struct device *dev, 84 + static struct mii_bus * __devinit mdio_gpio_bus_init(struct device *dev, 86 85 struct mdio_gpio_platform_data *pdata, 87 86 int bus_id) 88 87 { 89 88 struct mii_bus *new_bus; 90 89 struct mdio_gpio_info *bitbang; 91 - int ret = -ENOMEM; 92 90 int i; 93 91 94 92 bitbang = kzalloc(sizeof(*bitbang), GFP_KERNEL); ··· 103 103 goto out_free_bitbang; 104 104 105 105 new_bus->name = "GPIO Bitbanged MDIO", 106 - 107 - ret = -ENODEV; 108 106 109 107 new_bus->phy_mask = pdata->phy_mask; 110 108 new_bus->irq = pdata->irqs; ··· 127 129 128 130 dev_set_drvdata(dev, new_bus); 129 131 130 - ret = mdiobus_register(new_bus); 131 - if (ret) 132 - goto out_free_all; 132 + return new_bus; 133 133 134 - return 0; 135 - 136 - out_free_all: 137 - dev_set_drvdata(dev, NULL); 138 - gpio_free(bitbang->mdio); 139 134 out_free_mdc: 140 135 gpio_free(bitbang->mdc); 141 136 out_free_bus: ··· 136 145 out_free_bitbang: 137 146 kfree(bitbang); 138 147 out: 139 - return ret; 148 + return NULL; 149 + } 150 + 151 + static void __devinit mdio_gpio_bus_deinit(struct device *dev) 152 + { 153 + struct mii_bus *bus = dev_get_drvdata(dev); 154 + struct mdio_gpio_info *bitbang = bus->priv; 155 + 156 + dev_set_drvdata(dev, NULL); 157 + gpio_free(bitbang->mdio); 158 + gpio_free(bitbang->mdc); 159 + free_mdio_bitbang(bus); 160 + kfree(bitbang); 140 161 } 141 162 142 163 static void __devexit mdio_gpio_bus_destroy(struct device *dev) 143 164 { 144 165 struct mii_bus *bus = dev_get_drvdata(dev); 145 - struct mdio_gpio_info *bitbang = bus->priv; 146 166 147 167 mdiobus_unregister(bus); 148 - free_mdio_bitbang(bus); 149 - dev_set_drvdata(dev, NULL); 150 - gpio_free(bitbang->mdc); 151 - gpio_free(bitbang->mdio); 152 - kfree(bitbang); 168 + mdio_gpio_bus_deinit(dev); 153 169 } 154 170 155 171 static int __devinit mdio_gpio_probe(struct platform_device *pdev) 156 172 { 157 173 struct mdio_gpio_platform_data *pdata = pdev->dev.platform_data; 174 + struct mii_bus *new_bus; 175 + int ret; 158 176 159 177 if (!pdata) 160 178 return -ENODEV; 161 179 162 - return mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id); 180 + new_bus = mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id); 181 + if (!new_bus) 182 + return -ENODEV; 183 + 184 + ret = mdiobus_register(new_bus); 185 + if (ret) 186 + mdio_gpio_bus_deinit(&pdev->dev); 187 + 188 + return ret; 163 189 } 164 190 165 191 static int __devexit mdio_gpio_remove(struct platform_device *pdev) ··· 187 179 } 188 180 189 181 #ifdef CONFIG_OF_GPIO 190 - static void __devinit add_phy(struct mdio_gpio_platform_data *pdata, 191 - struct device_node *np) 192 - { 193 - const u32 *data; 194 - int len, id, irq; 195 - 196 - data = of_get_property(np, "reg", &len); 197 - if (!data || len != 4) 198 - return; 199 - 200 - id = *data; 201 - pdata->phy_mask &= ~(1 << id); 202 - 203 - irq = of_irq_to_resource(np, 0, NULL); 204 - if (irq) 205 - pdata->irqs[id] = irq; 206 - } 207 182 208 183 static int __devinit mdio_ofgpio_probe(struct of_device *ofdev, 209 184 const struct of_device_id *match) 210 185 { 211 - struct device_node *np = NULL; 212 186 struct mdio_gpio_platform_data *pdata; 187 + struct mii_bus *new_bus; 213 188 int ret; 214 189 215 190 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); ··· 206 215 207 216 ret = of_get_gpio(ofdev->node, 1); 208 217 if (ret < 0) 209 - goto out_free; 218 + goto out_free; 210 219 pdata->mdio = ret; 211 220 212 - while ((np = of_get_next_child(ofdev->node, np))) 213 - if (!strcmp(np->type, "ethernet-phy")) 214 - add_phy(pdata, np); 221 + new_bus = mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc); 222 + if (!new_bus) 223 + return -ENODEV; 215 224 216 - return mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc); 225 + ret = of_mdiobus_register(new_bus, ofdev->node); 226 + if (ret) 227 + mdio_gpio_bus_deinit(&ofdev->dev); 228 + 229 + return ret; 217 230 218 231 out_free: 219 232 kfree(pdata);
+11 -2
drivers/net/r8169.c
··· 2060 2060 } 2061 2061 } 2062 2062 2063 - pci_set_master(pdev); 2064 - 2065 2063 /* ioremap MMIO region */ 2066 2064 ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE); 2067 2065 if (!ioaddr) { ··· 2086 2088 } 2087 2089 2088 2090 RTL_W16(IntrStatus, 0xffff); 2091 + 2092 + pci_set_master(pdev); 2089 2093 2090 2094 /* Identify chip attached to board */ 2091 2095 rtl8169_get_mac_version(tp, ioaddr); ··· 3874 3874 spin_unlock_irq(&tp->lock); 3875 3875 3876 3876 if (system_state == SYSTEM_POWER_OFF) { 3877 + /* WoL fails with some 8168 when the receiver is disabled. */ 3878 + if (tp->features & RTL_FEATURE_WOL) { 3879 + pci_clear_master(pdev); 3880 + 3881 + RTL_W8(ChipCmd, CmdRxEnb); 3882 + /* PCI commit */ 3883 + RTL_R8(ChipCmd); 3884 + } 3885 + 3877 3886 pci_wake_from_d3(pdev, true); 3878 3887 pci_set_power_state(pdev, PCI_D3hot); 3879 3888 }
+3 -1
drivers/net/skge.c
··· 3854 3854 skge->speed = -1; 3855 3855 skge->advertising = skge_supported_modes(hw); 3856 3856 3857 - if (device_may_wakeup(&hw->pdev->dev)) 3857 + if (device_can_wakeup(&hw->pdev->dev)) { 3858 3858 skge->wol = wol_supported(hw) & WAKE_MAGIC; 3859 + device_set_wakeup_enable(&hw->pdev->dev, skge->wol); 3860 + } 3859 3861 3860 3862 hw->dev[port] = dev; 3861 3863
+2 -1
drivers/net/smc91x.h
··· 186 186 #define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) 187 187 #define SMC_IRQ_FLAGS (-1) /* from resource */ 188 188 189 - #elif defined(CONFIG_MACH_LOGICPD_PXA270) 189 + #elif defined(CONFIG_MACH_LOGICPD_PXA270) \ 190 + || defined(CONFIG_MACH_NOMADIK_8815NHK) 190 191 191 192 #define SMC_CAN_USE_8BIT 0 192 193 #define SMC_CAN_USE_16BIT 1
+1 -1
drivers/net/tokenring/ibmtr.c
··· 1912 1912 1913 1913 find_turbo_adapters(io); 1914 1914 1915 - for (i = 0; io[i] && (i < IBMTR_MAX_ADAPTERS); i++) { 1915 + for (i = 0; i < IBMTR_MAX_ADAPTERS && io[i]; i++) { 1916 1916 struct net_device *dev; 1917 1917 irq[i] = 0; 1918 1918 mem[i] = 0;
+7 -16
drivers/net/ucc_geth.c
··· 1590 1590 priv->oldspeed = 0; 1591 1591 priv->oldduplex = -1; 1592 1592 1593 - if (!ug_info->phy_node) 1594 - return 0; 1595 - 1596 1593 phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0, 1597 1594 priv->phy_interface); 1595 + if (!phydev) 1596 + phydev = of_phy_connect_fixed_link(dev, &adjust_link, 1597 + priv->phy_interface); 1598 1598 if (!phydev) { 1599 - printk("%s: Could not attach to PHY\n", dev->name); 1599 + dev_err(&dev->dev, "Could not attach to PHY\n"); 1600 1600 return -ENODEV; 1601 1601 } 1602 1602 ··· 3608 3608 struct ucc_geth_private *ugeth = NULL; 3609 3609 struct ucc_geth_info *ug_info; 3610 3610 struct resource res; 3611 - struct device_node *phy; 3612 3611 int err, ucc_num, max_speed = 0; 3613 - const u32 *fixed_link; 3614 3612 const unsigned int *prop; 3615 3613 const char *sprop; 3616 3614 const void *mac_addr; ··· 3706 3708 3707 3709 ug_info->uf_info.regs = res.start; 3708 3710 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); 3709 - fixed_link = of_get_property(np, "fixed-link", NULL); 3710 - if (fixed_link) { 3711 - phy = NULL; 3712 - } else { 3713 - phy = of_parse_phandle(np, "phy-handle", 0); 3714 - if (phy == NULL) 3715 - return -ENODEV; 3716 - } 3717 - ug_info->phy_node = phy; 3711 + 3712 + ug_info->phy_node = of_parse_phandle(np, "phy-handle", 0); 3718 3713 3719 3714 /* Find the TBI PHY node. If it's not there, we don't support SGMII */ 3720 3715 ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0); ··· 3716 3725 prop = of_get_property(np, "phy-connection-type", NULL); 3717 3726 if (!prop) { 3718 3727 /* handle interface property present in old trees */ 3719 - prop = of_get_property(phy, "interface", NULL); 3728 + prop = of_get_property(ug_info->phy_node, "interface", NULL); 3720 3729 if (prop != NULL) { 3721 3730 phy_interface = enet_to_phy_interface[*prop]; 3722 3731 max_speed = enet_to_speed[*prop];
+3
drivers/net/wireless/ath/ath5k/base.c
··· 2970 2970 if (modparam_nohwcrypt) 2971 2971 return -EOPNOTSUPP; 2972 2972 2973 + if (sc->opmode == NL80211_IFTYPE_AP) 2974 + return -EOPNOTSUPP; 2975 + 2973 2976 switch (key->alg) { 2974 2977 case ALG_WEP: 2975 2978 case ALG_TKIP:
+12
drivers/net/wireless/ath/ath9k/ani.c
··· 478 478 "Reset ANI state opmode %u\n", ah->opmode); 479 479 ah->stats.ast_ani_reset++; 480 480 481 + if (ah->opmode == NL80211_IFTYPE_AP) { 482 + /* 483 + * ath9k_hw_ani_control() will only process items set on 484 + * ah->ani_function 485 + */ 486 + if (IS_CHAN_2GHZ(chan)) 487 + ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL | 488 + ATH9K_ANI_FIRSTEP_LEVEL); 489 + else 490 + ah->ani_function = 0; 491 + } 492 + 481 493 ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0); 482 494 ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0); 483 495 ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
+17
drivers/net/wireless/ath/regd.c
··· 474 474 return 0; 475 475 } 476 476 477 + /* 478 + * Some users have reported their EEPROM programmed with 479 + * 0x8000 set, this is not a supported regulatory domain 480 + * but since we have more than one user with it we need 481 + * a solution for them. We default to 0x64, which is the 482 + * default Atheros world regulatory domain. 483 + */ 484 + static void ath_regd_sanitize(struct ath_regulatory *reg) 485 + { 486 + if (reg->current_rd != COUNTRY_ERD_FLAG) 487 + return; 488 + printk(KERN_DEBUG "ath: EEPROM regdomain sanitized\n"); 489 + reg->current_rd = 0x64; 490 + } 491 + 477 492 int 478 493 ath_regd_init(struct ath_regulatory *reg, 479 494 struct wiphy *wiphy, ··· 500 485 501 486 if (!reg) 502 487 return -EINVAL; 488 + 489 + ath_regd_sanitize(reg); 503 490 504 491 printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd); 505 492
+1 -3
drivers/net/wireless/iwlwifi/iwl-agn.c
··· 2675 2675 struct device_attribute *attr, char *buf) 2676 2676 { 2677 2677 struct iwl_priv *priv = dev_get_drvdata(d); 2678 - int mode = priv->power_data.user_power_setting; 2679 2678 int level = priv->power_data.power_mode; 2680 2679 char *p = buf; 2681 2680 2682 - p += sprintf(p, "INDEX:%d\t", level); 2683 - p += sprintf(p, "USER:%d\n", mode); 2681 + p += sprintf(p, "%d\n", level); 2684 2682 return p - buf + 1; 2685 2683 } 2686 2684
+2 -1
drivers/net/wireless/iwlwifi/iwl-tx.c
··· 872 872 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len); 873 873 874 874 /* Set up entry for this TFD in Tx byte-count array */ 875 - priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, 875 + if (info->flags & IEEE80211_TX_CTL_AMPDU) 876 + priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, 876 877 le16_to_cpu(tx_cmd->len)); 877 878 878 879 pci_dma_sync_single_for_device(priv->pci_dev, txcmd_phys,
+1 -3
drivers/net/wireless/iwlwifi/iwl3945-base.c
··· 3643 3643 struct device_attribute *attr, char *buf) 3644 3644 { 3645 3645 struct iwl_priv *priv = dev_get_drvdata(d); 3646 - int mode = priv->power_data.user_power_setting; 3647 3646 int level = priv->power_data.power_mode; 3648 3647 char *p = buf; 3649 3648 3650 - p += sprintf(p, "INDEX:%d\t", level); 3651 - p += sprintf(p, "USER:%d\n", mode); 3649 + p += sprintf(p, "%d\n", level); 3652 3650 return p - buf + 1; 3653 3651 } 3654 3652
+1 -1
drivers/net/wireless/iwmc3200wifi/netdev.c
··· 151 151 return; 152 152 153 153 free_netdev(iwm_to_ndev(iwm)); 154 - iwm_wdev_free(iwm); 155 154 iwm_priv_deinit(iwm); 155 + iwm_wdev_free(iwm); 156 156 } 157 157 158 158 int iwm_if_add(struct iwm_priv *iwm)
+7 -1
drivers/net/wireless/libertas/cmd.c
··· 135 135 /* Clamp region code to 8-bit since FW spec indicates that it should 136 136 * only ever be 8-bit, even though the field size is 16-bit. Some firmware 137 137 * returns non-zero high 8 bits here. 138 + * 139 + * Firmware version 4.0.102 used in CF8381 has region code shifted. We 140 + * need to check for this problem and handle it properly. 138 141 */ 139 - priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF; 142 + if (MRVL_FW_MAJOR_REV(priv->fwrelease) == MRVL_FW_V4) 143 + priv->regioncode = (le16_to_cpu(cmd.regioncode) >> 8) & 0xFF; 144 + else 145 + priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF; 140 146 141 147 for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { 142 148 /* use the region code to search for the index */
+2
drivers/net/wireless/libertas/defs.h
··· 234 234 /** Mesh enable bit in FW capability */ 235 235 #define MESH_CAPINFO_ENABLE_MASK (1<<16) 236 236 237 + /** FW definition from Marvell v4 */ 238 + #define MRVL_FW_V4 (0x04) 237 239 /** FW definition from Marvell v5 */ 238 240 #define MRVL_FW_V5 (0x05) 239 241 /** FW definition from Marvell v10 */
+3 -3
drivers/net/wireless/mac80211_hwsim.c
··· 709 709 static void mac80211_hwsim_free(void) 710 710 { 711 711 struct list_head tmplist, *i, *tmp; 712 - struct mac80211_hwsim_data *data; 712 + struct mac80211_hwsim_data *data, *tmpdata; 713 713 714 714 INIT_LIST_HEAD(&tmplist); 715 715 ··· 718 718 list_move(i, &tmplist); 719 719 spin_unlock_bh(&hwsim_radio_lock); 720 720 721 - list_for_each_entry(data, &tmplist, list) { 721 + list_for_each_entry_safe(data, tmpdata, &tmplist, list) { 722 722 debugfs_remove(data->debugfs_group); 723 723 debugfs_remove(data->debugfs_ps); 724 724 debugfs_remove(data->debugfs); ··· 1167 1167 { 1168 1168 printk(KERN_DEBUG "mac80211_hwsim: unregister radios\n"); 1169 1169 1170 - unregister_netdev(hwsim_mon); 1171 1170 mac80211_hwsim_free(); 1171 + unregister_netdev(hwsim_mon); 1172 1172 } 1173 1173 1174 1174
+1 -1
drivers/net/wireless/p54/p54spi.c
··· 635 635 636 636 hw = p54_init_common(sizeof(*priv)); 637 637 if (!hw) { 638 - dev_err(&priv->spi->dev, "could not alloc ieee80211_hw"); 638 + dev_err(&spi->dev, "could not alloc ieee80211_hw"); 639 639 return -ENOMEM; 640 640 } 641 641
+3 -1
drivers/net/wireless/rt2x00/rt2500usb.c
··· 1550 1550 rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg); 1551 1551 rt2x00_set_chip(rt2x00dev, RT2570, value, reg); 1552 1552 1553 - if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0)) { 1553 + if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0) || 1554 + rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) { 1555 + 1554 1556 ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); 1555 1557 return -ENODEV; 1556 1558 }
+2 -1
drivers/net/wireless/rtl818x/rtl8187_leds.c
··· 208 208 { 209 209 struct rtl8187_priv *priv = dev->priv; 210 210 211 - rtl8187_unregister_led(&priv->led_tx); 212 211 /* turn the LED off before exiting */ 213 212 queue_delayed_work(dev->workqueue, &priv->led_off, 0); 214 213 cancel_delayed_work_sync(&priv->led_off); 214 + cancel_delayed_work_sync(&priv->led_on); 215 215 rtl8187_unregister_led(&priv->led_rx); 216 + rtl8187_unregister_led(&priv->led_tx); 216 217 } 217 218 #endif /* def CONFIG_RTL8187_LED */ 218 219
+42
drivers/of/of_mdio.c
··· 9 9 * out of the OpenFirmware device tree and using it to populate an mii_bus. 10 10 */ 11 11 12 + #include <linux/kernel.h> 13 + #include <linux/device.h> 14 + #include <linux/netdevice.h> 15 + #include <linux/err.h> 12 16 #include <linux/phy.h> 13 17 #include <linux/of.h> 14 18 #include <linux/of_mdio.h> ··· 141 137 return phy_connect_direct(dev, phy, hndlr, flags, iface) ? NULL : phy; 142 138 } 143 139 EXPORT_SYMBOL(of_phy_connect); 140 + 141 + /** 142 + * of_phy_connect_fixed_link - Parse fixed-link property and return a dummy phy 143 + * @dev: pointer to net_device claiming the phy 144 + * @hndlr: Link state callback for the network device 145 + * @iface: PHY data interface type 146 + * 147 + * This function is a temporary stop-gap and will be removed soon. It is 148 + * only to support the fs_enet, ucc_geth and gianfar Ethernet drivers. Do 149 + * not call this function from new drivers. 150 + */ 151 + struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 152 + void (*hndlr)(struct net_device *), 153 + phy_interface_t iface) 154 + { 155 + struct device_node *net_np; 156 + char bus_id[MII_BUS_ID_SIZE + 3]; 157 + struct phy_device *phy; 158 + const u32 *phy_id; 159 + int sz; 160 + 161 + if (!dev->dev.parent) 162 + return NULL; 163 + 164 + net_np = dev_archdata_get_node(&dev->dev.parent->archdata); 165 + if (!net_np) 166 + return NULL; 167 + 168 + phy_id = of_get_property(net_np, "fixed-link", &sz); 169 + if (!phy_id || sz < sizeof(*phy_id)) 170 + return NULL; 171 + 172 + sprintf(bus_id, PHY_ID_FMT, "0", phy_id[0]); 173 + 174 + phy = phy_connect(dev, bus_id, hndlr, 0, iface); 175 + return IS_ERR(phy) ? NULL : phy; 176 + } 177 + EXPORT_SYMBOL(of_phy_connect_fixed_link);
+1 -1
drivers/platform/x86/acer-wmi.c
··· 973 973 { 974 974 acpi_status status; 975 975 u32 cap = (unsigned long)data; 976 - status = set_u32(!!blocked, cap); 976 + status = set_u32(!blocked, cap); 977 977 if (ACPI_FAILURE(status)) 978 978 return -ENODEV; 979 979 return 0;
+3
include/linux/of_mdio.h
··· 18 18 struct device_node *phy_np, 19 19 void (*hndlr)(struct net_device *), 20 20 u32 flags, phy_interface_t iface); 21 + extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 22 + void (*hndlr)(struct net_device *), 23 + phy_interface_t iface); 21 24 22 25 #endif /* __LINUX_OF_MDIO_H */
+1 -1
include/linux/rfkill.h
··· 224 224 * should be blocked) so that drivers need not keep track of the soft 225 225 * block state -- which they might not be able to. 226 226 */ 227 - bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); 227 + bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); 228 228 229 229 /** 230 230 * rfkill_set_sw_state - Set the internal rfkill software block state
+1 -1
include/net/rose.h
··· 156 156 extern int sysctl_rose_window_size; 157 157 extern int rosecmp(rose_address *, rose_address *); 158 158 extern int rosecmpm(rose_address *, rose_address *, unsigned short); 159 - extern const char *rose2asc(const rose_address *); 159 + extern char *rose2asc(char *buf, const rose_address *); 160 160 extern struct sock *rose_find_socket(unsigned int, struct rose_neigh *); 161 161 extern void rose_kill_by_neigh(struct rose_neigh *); 162 162 extern unsigned int rose_new_lci(struct rose_neigh *);
+1 -1
net/bridge/br_if.c
··· 424 424 err2: 425 425 br_fdb_delete_by_port(br, p, 1); 426 426 err1: 427 - kobject_del(&p->kobj); 427 + kobject_put(&p->kobj); 428 428 err0: 429 429 dev_set_promiscuity(dev, -1); 430 430 put_back:
+1
net/irda/irttp.c
··· 1453 1453 } 1454 1454 /* Dup */ 1455 1455 memcpy(new, orig, sizeof(struct tsap_cb)); 1456 + spin_lock_init(&new->lock); 1456 1457 1457 1458 /* We don't need the old instance any more */ 1458 1459 spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, flags);
+1
net/mac80211/Kconfig
··· 83 83 config MAC80211_MESH 84 84 bool "Enable mac80211 mesh networking (pre-802.11s) support" 85 85 depends on MAC80211 && EXPERIMENTAL 86 + depends on BROKEN 86 87 ---help--- 87 88 This options enables support of Draft 802.11s mesh networking. 88 89 The implementation is based on Draft 1.08 of the Mesh Networking
+8 -3
net/mac80211/mesh_pathtbl.c
··· 175 175 int err = 0; 176 176 u32 hash_idx; 177 177 178 + might_sleep(); 179 + 178 180 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0) 179 181 /* never add ourselves as neighbours */ 180 182 return -ENOTSUPP; ··· 267 265 int err = 0; 268 266 u32 hash_idx; 269 267 268 + might_sleep(); 270 269 271 270 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0) 272 271 /* never add ourselves as neighbours */ ··· 494 491 * @skb: frame to discard 495 492 * @sdata: network subif the frame was to be sent through 496 493 * 497 - * If the frame was beign forwarded from another MP, a PERR frame will be sent 498 - * to the precursor. 494 + * If the frame was being forwarded from another MP, a PERR frame will be sent 495 + * to the precursor. The precursor's address (i.e. the previous hop) was saved 496 + * in addr1 of the frame-to-be-forwarded, and would only be overwritten once 497 + * the destination is successfully resolved. 499 498 * 500 499 * Locking: the function must me called within a rcu_read_lock region 501 500 */ ··· 512 507 u8 *ra, *da; 513 508 514 509 da = hdr->addr3; 515 - ra = hdr->addr2; 510 + ra = hdr->addr1; 516 511 mpath = mesh_path_lookup(da, sdata); 517 512 if (mpath) 518 513 dsn = ++mpath->dsn;
+1 -1
net/mac80211/tx.c
··· 1455 1455 monitor_iface = UNKNOWN_ADDRESS; 1456 1456 1457 1457 len_rthdr = ieee80211_get_radiotap_len(skb->data); 1458 - hdr = (struct ieee80211_hdr *)skb->data + len_rthdr; 1458 + hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr); 1459 1459 hdrlen = ieee80211_hdrlen(hdr->frame_control); 1460 1460 1461 1461 /* check the header is complete in the frame */
+23 -8
net/rfkill/core.c
··· 549 549 swprev = !!(rfkill->state & RFKILL_BLOCK_SW); 550 550 hwprev = !!(rfkill->state & RFKILL_BLOCK_HW); 551 551 __rfkill_set_sw_state(rfkill, sw); 552 + if (hw) 553 + rfkill->state |= RFKILL_BLOCK_HW; 554 + else 555 + rfkill->state &= ~RFKILL_BLOCK_HW; 552 556 553 557 spin_unlock_irqrestore(&rfkill->lock, flags); 554 558 ··· 652 648 struct device_attribute *attr, 653 649 const char *buf, size_t count) 654 650 { 655 - /* 656 - * The intention was that userspace can only take control over 657 - * a given device when/if rfkill-input doesn't control it due 658 - * to user_claim. Since user_claim is currently unsupported, 659 - * we never support changing the state from userspace -- this 660 - * can be implemented again later. 661 - */ 651 + struct rfkill *rfkill = to_rfkill(dev); 652 + unsigned long state; 653 + int err; 662 654 663 - return -EPERM; 655 + if (!capable(CAP_NET_ADMIN)) 656 + return -EPERM; 657 + 658 + err = strict_strtoul(buf, 0, &state); 659 + if (err) 660 + return err; 661 + 662 + if (state != RFKILL_USER_STATE_SOFT_BLOCKED && 663 + state != RFKILL_USER_STATE_UNBLOCKED) 664 + return -EINVAL; 665 + 666 + mutex_lock(&rfkill_global_mutex); 667 + rfkill_set_block(rfkill, state == RFKILL_USER_STATE_SOFT_BLOCKED); 668 + mutex_unlock(&rfkill_global_mutex); 669 + 670 + return err ?: count; 664 671 } 665 672 666 673 static ssize_t rfkill_claim_show(struct device *dev,
+8 -10
net/rose/af_rose.c
··· 92 92 /* 93 93 * Convert a ROSE address into text. 94 94 */ 95 - const char *rose2asc(const rose_address *addr) 95 + char *rose2asc(char *buf, const rose_address *addr) 96 96 { 97 - static char buffer[11]; 98 - 99 97 if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 && 100 98 addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 && 101 99 addr->rose_addr[4] == 0x00) { 102 - strcpy(buffer, "*"); 100 + strcpy(buf, "*"); 103 101 } else { 104 - sprintf(buffer, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF, 102 + sprintf(buf, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF, 105 103 addr->rose_addr[1] & 0xFF, 106 104 addr->rose_addr[2] & 0xFF, 107 105 addr->rose_addr[3] & 0xFF, 108 106 addr->rose_addr[4] & 0xFF); 109 107 } 110 108 111 - return buffer; 109 + return buf; 112 110 } 113 111 114 112 /* ··· 1435 1437 1436 1438 static int rose_info_show(struct seq_file *seq, void *v) 1437 1439 { 1438 - char buf[11]; 1440 + char buf[11], rsbuf[11]; 1439 1441 1440 1442 if (v == SEQ_START_TOKEN) 1441 1443 seq_puts(seq, ··· 1453 1455 devname = dev->name; 1454 1456 1455 1457 seq_printf(seq, "%-10s %-9s ", 1456 - rose2asc(&rose->dest_addr), 1457 - ax2asc(buf, &rose->dest_call)); 1458 + rose2asc(rsbuf, &rose->dest_addr), 1459 + ax2asc(buf, &rose->dest_call)); 1458 1460 1459 1461 if (ax25cmp(&rose->source_call, &null_ax25_address) == 0) 1460 1462 callsign = "??????-?"; ··· 1463 1465 1464 1466 seq_printf(seq, 1465 1467 "%-10s %-9s %-5s %3.3X %05d %d %d %d %d %3lu %3lu %3lu %3lu %3lu %3lu/%03lu %5d %5d %ld\n", 1466 - rose2asc(&rose->source_addr), 1468 + rose2asc(rsbuf, &rose->source_addr), 1467 1469 callsign, 1468 1470 devname, 1469 1471 rose->lci & 0x0FFF,
+12 -11
net/rose/rose_route.c
··· 1104 1104 1105 1105 static int rose_node_show(struct seq_file *seq, void *v) 1106 1106 { 1107 + char rsbuf[11]; 1107 1108 int i; 1108 1109 1109 1110 if (v == SEQ_START_TOKEN) ··· 1113 1112 const struct rose_node *rose_node = v; 1114 1113 /* if (rose_node->loopback) { 1115 1114 seq_printf(seq, "%-10s %04d 1 loopback\n", 1116 - rose2asc(&rose_node->address), 1117 - rose_node->mask); 1115 + rose2asc(rsbuf, &rose_node->address), 1116 + rose_node->mask); 1118 1117 } else { */ 1119 1118 seq_printf(seq, "%-10s %04d %d", 1120 - rose2asc(&rose_node->address), 1121 - rose_node->mask, 1122 - rose_node->count); 1119 + rose2asc(rsbuf, &rose_node->address), 1120 + rose_node->mask, 1121 + rose_node->count); 1123 1122 1124 1123 for (i = 0; i < rose_node->count; i++) 1125 1124 seq_printf(seq, " %05d", ··· 1268 1267 1269 1268 static int rose_route_show(struct seq_file *seq, void *v) 1270 1269 { 1271 - char buf[11]; 1270 + char buf[11], rsbuf[11]; 1272 1271 1273 1272 if (v == SEQ_START_TOKEN) 1274 1273 seq_puts(seq, ··· 1280 1279 seq_printf(seq, 1281 1280 "%3.3X %-10s %-9s %05d ", 1282 1281 rose_route->lci1, 1283 - rose2asc(&rose_route->src_addr), 1282 + rose2asc(rsbuf, &rose_route->src_addr), 1284 1283 ax2asc(buf, &rose_route->src_call), 1285 1284 rose_route->neigh1->number); 1286 1285 else ··· 1290 1289 if (rose_route->neigh2) 1291 1290 seq_printf(seq, 1292 1291 "%3.3X %-10s %-9s %05d\n", 1293 - rose_route->lci2, 1294 - rose2asc(&rose_route->dest_addr), 1295 - ax2asc(buf, &rose_route->dest_call), 1296 - rose_route->neigh2->number); 1292 + rose_route->lci2, 1293 + rose2asc(rsbuf, &rose_route->dest_addr), 1294 + ax2asc(buf, &rose_route->dest_call), 1295 + rose_route->neigh2->number); 1297 1296 else 1298 1297 seq_puts(seq, 1299 1298 "000 * * 00000\n");
+3 -2
net/wireless/nl80211.c
··· 997 997 998 998 if (IS_ERR(hdr)) { 999 999 err = PTR_ERR(hdr); 1000 - goto out; 1000 + goto free_msg; 1001 1001 } 1002 1002 1003 1003 cookie.msg = msg; ··· 1011 1011 &cookie, get_key_callback); 1012 1012 1013 1013 if (err) 1014 - goto out; 1014 + goto free_msg; 1015 1015 1016 1016 if (cookie.error) 1017 1017 goto nla_put_failure; ··· 1022 1022 1023 1023 nla_put_failure: 1024 1024 err = -ENOBUFS; 1025 + free_msg: 1025 1026 nlmsg_free(msg); 1026 1027 out: 1027 1028 cfg80211_put_dev(drv);
+1 -2
net/wireless/scan.c
··· 35 35 else 36 36 nl80211_send_scan_done(wiphy_to_dev(request->wiphy), dev); 37 37 38 - wiphy_to_dev(request->wiphy)->scan_req = NULL; 39 - 40 38 #ifdef CONFIG_WIRELESS_EXT 41 39 if (!aborted) { 42 40 memset(&wrqu, 0, sizeof(wrqu)); ··· 46 48 dev_put(dev); 47 49 48 50 out: 51 + wiphy_to_dev(request->wiphy)->scan_req = NULL; 49 52 kfree(request); 50 53 } 51 54 EXPORT_SYMBOL(cfg80211_scan_done);