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

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (23 commits)
net: fix tiny output corruption of /proc/net/snmp6
atl2: don't request irq on resume if netif running
ipv6: use seq_release_private for ip6mr.c /proc entries
pkt_sched: fix missing check for packet overrun in qdisc_dump_stab()
smc911x: Fix printf format typo in smc911x driver.
asix: Fix asix-based cards connecting to 10/100Mbs LAN.
mv643xx_eth: fix recycle check bound
mv643xx_eth: fix the order of mdiobus_{unregister, free}() calls
sh: sh_eth: Update to change of mii_bus
TPROXY: supply a struct flowi->flags argument in inet_sk_rebuild_header()
TPROXY: fill struct flowi->flags in udp_sendmsg()
net: ipg.c fix bracing on endian swapping
phylib: Fix auto-negotiation restart avoidance
net: jme.c rxdesc.flags is __le16, other missing endian swaps
phylib: fix phy name example in documentation
net: Do not fire linkwatch events until the device is registered.
phonet: fix compilation with gcc-3.4
ixgbe: fix compilation with gcc-3.4
pktgen: fix multiple queue warning
net: fix ip_mr_init() error path
...

+149 -169
+1 -1
Documentation/networking/phy.txt
··· 96 96 static void adjust_link(struct net_device *dev); 97 97 98 98 Next, you need to know the device name of the PHY connected to this device. 99 - The name will look something like, "phy0:0", where the first number is the 99 + The name will look something like, "0:00", where the first number is the 100 100 bus id, and the second is the PHY's address on that bus. Typically, 101 101 the bus is responsible for making its ID unique. 102 102
+5 -3
drivers/net/atlx/atl2.c
··· 1690 1690 1691 1691 ATL2_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); 1692 1692 1693 - err = atl2_request_irq(adapter); 1694 - if (netif_running(netdev) && err) 1695 - return err; 1693 + if (netif_running(netdev)) { 1694 + err = atl2_request_irq(adapter); 1695 + if (err) 1696 + return err; 1697 + } 1696 1698 1697 1699 atl2_reset_hw(&adapter->hw); 1698 1700
+4 -4
drivers/net/ipg.c
··· 1112 1112 struct ipg_rx *rxfd = sp->rxd + entry; 1113 1113 1114 1114 pci_unmap_single(sp->pdev, 1115 - le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), 1115 + le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, 1116 1116 sp->rx_buf_sz, PCI_DMA_FROMDEVICE); 1117 1117 dev_kfree_skb_irq(sp->rx_buff[entry]); 1118 1118 sp->rx_buff[entry] = NULL; ··· 1179 1179 */ 1180 1180 if (sp->rx_buff[entry]) { 1181 1181 pci_unmap_single(sp->pdev, 1182 - le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), 1182 + le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, 1183 1183 sp->rx_buf_sz, PCI_DMA_FROMDEVICE); 1184 1184 1185 1185 dev_kfree_skb_irq(sp->rx_buff[entry]); ··· 1246 1246 if (jumbo->found_start) 1247 1247 dev_kfree_skb_irq(jumbo->skb); 1248 1248 1249 - pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), 1249 + pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, 1250 1250 sp->rx_buf_sz, PCI_DMA_FROMDEVICE); 1251 1251 1252 1252 skb_put(skb, sp->rxfrag_size); ··· 1349 1349 unsigned int entry = curr % IPG_RFDLIST_LENGTH; 1350 1350 struct ipg_rx *rxfd = sp->rxd + entry; 1351 1351 1352 - if (!(rxfd->rfs & le64_to_cpu(IPG_RFS_RFDDONE))) 1352 + if (!(rxfd->rfs & cpu_to_le64(IPG_RFS_RFDDONE))) 1353 1353 break; 1354 1354 1355 1355 switch (ipg_nic_rx_check_frame_type(dev)) {
+28 -30
drivers/net/ixgbe/ixgbe_main.c
··· 1287 1287 return; 1288 1288 } 1289 1289 1290 - static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter); 1290 + /** 1291 + * ixgbe_irq_disable - Mask off interrupt generation on the NIC 1292 + * @adapter: board private structure 1293 + **/ 1294 + static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter) 1295 + { 1296 + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0); 1297 + IXGBE_WRITE_FLUSH(&adapter->hw); 1298 + if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { 1299 + int i; 1300 + for (i = 0; i < adapter->num_msix_vectors; i++) 1301 + synchronize_irq(adapter->msix_entries[i].vector); 1302 + } else { 1303 + synchronize_irq(adapter->pdev->irq); 1304 + } 1305 + } 1306 + 1307 + /** 1308 + * ixgbe_irq_enable - Enable default interrupt generation settings 1309 + * @adapter: board private structure 1310 + **/ 1311 + static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter) 1312 + { 1313 + u32 mask; 1314 + mask = IXGBE_EIMS_ENABLE_MASK; 1315 + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask); 1316 + IXGBE_WRITE_FLUSH(&adapter->hw); 1317 + } 1291 1318 1292 1319 /** 1293 1320 * ixgbe_intr - legacy mode Interrupt Handler ··· 1418 1391 } else { 1419 1392 free_irq(adapter->pdev->irq, netdev); 1420 1393 } 1421 - } 1422 - 1423 - /** 1424 - * ixgbe_irq_disable - Mask off interrupt generation on the NIC 1425 - * @adapter: board private structure 1426 - **/ 1427 - static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter) 1428 - { 1429 - IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0); 1430 - IXGBE_WRITE_FLUSH(&adapter->hw); 1431 - if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { 1432 - int i; 1433 - for (i = 0; i < adapter->num_msix_vectors; i++) 1434 - synchronize_irq(adapter->msix_entries[i].vector); 1435 - } else { 1436 - synchronize_irq(adapter->pdev->irq); 1437 - } 1438 - } 1439 - 1440 - /** 1441 - * ixgbe_irq_enable - Enable default interrupt generation settings 1442 - * @adapter: board private structure 1443 - **/ 1444 - static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter) 1445 - { 1446 - u32 mask; 1447 - mask = IXGBE_EIMS_ENABLE_MASK; 1448 - IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask); 1449 - IXGBE_WRITE_FLUSH(&adapter->hw); 1450 1394 } 1451 1395 1452 1396 /**
+10 -11
drivers/net/jme.c
··· 912 912 skb_put(skb, framesize); 913 913 skb->protocol = eth_type_trans(skb, jme->dev); 914 914 915 - if (jme_rxsum_ok(jme, rxdesc->descwb.flags)) 915 + if (jme_rxsum_ok(jme, le16_to_cpu(rxdesc->descwb.flags))) 916 916 skb->ip_summed = CHECKSUM_UNNECESSARY; 917 917 else 918 918 skb->ip_summed = CHECKSUM_NONE; 919 919 920 - if (rxdesc->descwb.flags & RXWBFLAG_TAGON) { 920 + if (rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_TAGON)) { 921 921 if (jme->vlgrp) { 922 922 jme->jme_vlan_rx(skb, jme->vlgrp, 923 - le32_to_cpu(rxdesc->descwb.vlan)); 923 + le16_to_cpu(rxdesc->descwb.vlan)); 924 924 NET_STAT(jme).rx_bytes += 4; 925 925 } 926 926 } else { 927 927 jme->jme_rx(skb); 928 928 } 929 929 930 - if ((le16_to_cpu(rxdesc->descwb.flags) & RXWBFLAG_DEST) == 931 - RXWBFLAG_DEST_MUL) 930 + if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_DEST)) == 931 + cpu_to_le16(RXWBFLAG_DEST_MUL)) 932 932 ++(NET_STAT(jme).multicast); 933 933 934 934 jme->dev->last_rx = jiffies; ··· 961 961 rxdesc = rxring->desc; 962 962 rxdesc += i; 963 963 964 - if ((rxdesc->descwb.flags & RXWBFLAG_OWN) || 964 + if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) || 965 965 !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) 966 966 goto out; 967 967 ··· 1763 1763 } 1764 1764 1765 1765 static int 1766 - jme_tx_tso(struct sk_buff *skb, 1767 - u16 *mss, u8 *flags) 1766 + jme_tx_tso(struct sk_buff *skb, __le16 *mss, u8 *flags) 1768 1767 { 1769 - *mss = skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT; 1768 + *mss = cpu_to_le16(skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT); 1770 1769 if (*mss) { 1771 1770 *flags |= TXFLAG_LSEN; 1772 1771 ··· 1825 1826 } 1826 1827 1827 1828 static inline void 1828 - jme_tx_vlan(struct sk_buff *skb, u16 *vlan, u8 *flags) 1829 + jme_tx_vlan(struct sk_buff *skb, __le16 *vlan, u8 *flags) 1829 1830 { 1830 1831 if (vlan_tx_tag_present(skb)) { 1831 1832 *flags |= TXFLAG_TAGON; 1832 - *vlan = vlan_tx_tag_get(skb); 1833 + *vlan = cpu_to_le16(vlan_tx_tag_get(skb)); 1833 1834 } 1834 1835 } 1835 1836
+3 -2
drivers/net/mv643xx_eth.c
··· 899 899 if (skb != NULL) { 900 900 if (skb_queue_len(&mp->rx_recycle) < 901 901 mp->default_rx_ring_size && 902 - skb_recycle_check(skb, mp->skb_size)) 902 + skb_recycle_check(skb, mp->skb_size + 903 + dma_get_cache_alignment() - 1)) 903 904 __skb_queue_head(&mp->rx_recycle, skb); 904 905 else 905 906 dev_kfree_skb(skb); ··· 2436 2435 struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data; 2437 2436 2438 2437 if (pd == NULL || pd->shared_smi == NULL) { 2439 - mdiobus_free(msp->smi_bus); 2440 2438 mdiobus_unregister(msp->smi_bus); 2439 + mdiobus_free(msp->smi_bus); 2441 2440 } 2442 2441 if (msp->err_interrupt != NO_IRQ) 2443 2442 free_irq(msp->err_interrupt, msp);
+23 -11
drivers/net/phy/phy_device.c
··· 564 564 */ 565 565 int genphy_config_aneg(struct phy_device *phydev) 566 566 { 567 - int result = 0; 567 + int result; 568 568 569 - if (AUTONEG_ENABLE == phydev->autoneg) { 570 - int result = genphy_config_advert(phydev); 569 + if (AUTONEG_ENABLE != phydev->autoneg) 570 + return genphy_setup_forced(phydev); 571 571 572 - if (result < 0) /* error */ 573 - return result; 572 + result = genphy_config_advert(phydev); 574 573 575 - /* Only restart aneg if we are advertising something different 576 - * than we were before. */ 577 - if (result > 0) 578 - result = genphy_restart_aneg(phydev); 579 - } else 580 - result = genphy_setup_forced(phydev); 574 + if (result < 0) /* error */ 575 + return result; 576 + 577 + if (result == 0) { 578 + /* Advertisment hasn't changed, but maybe aneg was never on to 579 + * begin with? Or maybe phy was isolated? */ 580 + int ctl = phy_read(phydev, MII_BMCR); 581 + 582 + if (ctl < 0) 583 + return ctl; 584 + 585 + if (!(ctl & BMCR_ANENABLE) || (ctl & BMCR_ISOLATE)) 586 + result = 1; /* do restart aneg */ 587 + } 588 + 589 + /* Only restart aneg if we are advertising something different 590 + * than we were before. */ 591 + if (result > 0) 592 + result = genphy_restart_aneg(phydev); 581 593 582 594 return result; 583 595 }
+2 -2
drivers/net/sh_eth.c
··· 927 927 struct sh_eth_private *mdp = netdev_priv(ndev); 928 928 struct sh_eth_txdesc *txdesc; 929 929 u32 entry; 930 - int flags; 930 + unsigned long flags; 931 931 932 932 spin_lock_irqsave(&mdp->lock, flags); 933 933 if ((mdp->cur_tx - mdp->dirty_tx) >= (TX_RING_SIZE - 4)) { ··· 1141 1141 /* Hook up MII support for ethtool */ 1142 1142 mdp->mii_bus->name = "sh_mii"; 1143 1143 mdp->mii_bus->parent = &ndev->dev; 1144 - mdp->mii_bus->id[0] = id; 1144 + snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%x", id); 1145 1145 1146 1146 /* PHY IRQ */ 1147 1147 mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
+1 -1
drivers/net/smc911x.c
··· 1813 1813 val = SMC_GET_BYTE_TEST(lp); 1814 1814 DBG(SMC_DEBUG_MISC, "%s: endian probe returned 0x%04x\n", CARDNAME, val); 1815 1815 if (val != 0x87654321) { 1816 - printk(KERN_ERR "Invalid chip endian 0x08%x\n",val); 1816 + printk(KERN_ERR "Invalid chip endian 0x%08x\n",val); 1817 1817 retval = -ENODEV; 1818 1818 goto err_out; 1819 1819 }
+3 -1
drivers/net/usb/asix.c
··· 1102 1102 mode = AX88178_MEDIUM_DEFAULT; 1103 1103 1104 1104 if (ecmd.speed == SPEED_1000) 1105 - mode |= AX_MEDIUM_GM | AX_MEDIUM_ENCK; 1105 + mode |= AX_MEDIUM_GM; 1106 1106 else if (ecmd.speed == SPEED_100) 1107 1107 mode |= AX_MEDIUM_PS; 1108 1108 else 1109 1109 mode &= ~(AX_MEDIUM_PS | AX_MEDIUM_GM); 1110 + 1111 + mode |= AX_MEDIUM_ENCK; 1110 1112 1111 1113 if (ecmd.duplex == DUPLEX_FULL) 1112 1114 mode |= AX_MEDIUM_FD;
+3 -4
drivers/net/wireless/iwlwifi/iwl-agn.c
··· 1384 1384 1385 1385 rxq->queue[i] = NULL; 1386 1386 1387 - pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->dma_addr, 1387 + pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->aligned_dma_addr, 1388 1388 priv->hw_params.rx_buf_size, 1389 1389 PCI_DMA_FROMDEVICE); 1390 1390 pkt = (struct iwl_rx_packet *)rxb->skb->data; ··· 1436 1436 rxb->skb = NULL; 1437 1437 } 1438 1438 1439 - pci_unmap_single(priv->pci_dev, rxb->dma_addr, 1440 - priv->hw_params.rx_buf_size, 1439 + pci_unmap_single(priv->pci_dev, rxb->real_dma_addr, 1440 + priv->hw_params.rx_buf_size + 256, 1441 1441 PCI_DMA_FROMDEVICE); 1442 1442 spin_lock_irqsave(&rxq->lock, flags); 1443 1443 list_add_tail(&rxb->list, &priv->rxq.rx_used); ··· 2341 2341 mutex_lock(&priv->mutex); 2342 2342 iwl_alive_start(priv); 2343 2343 mutex_unlock(&priv->mutex); 2344 - ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); 2345 2344 } 2346 2345 2347 2346 static void iwl4965_bg_rf_kill(struct work_struct *work)
+2 -1
drivers/net/wireless/iwlwifi/iwl-dev.h
··· 89 89 #define DEFAULT_LONG_RETRY_LIMIT 4U 90 90 91 91 struct iwl_rx_mem_buffer { 92 - dma_addr_t dma_addr; 92 + dma_addr_t real_dma_addr; 93 + dma_addr_t aligned_dma_addr; 93 94 struct sk_buff *skb; 94 95 struct list_head list; 95 96 };
+17 -9
drivers/net/wireless/iwlwifi/iwl-rx.c
··· 204 204 list_del(element); 205 205 206 206 /* Point to Rx buffer via next RBD in circular buffer */ 207 - rxq->bd[rxq->write] = iwl_dma_addr2rbd_ptr(priv, rxb->dma_addr); 207 + rxq->bd[rxq->write] = iwl_dma_addr2rbd_ptr(priv, rxb->aligned_dma_addr); 208 208 rxq->queue[rxq->write] = rxb; 209 209 rxq->write = (rxq->write + 1) & RX_QUEUE_MASK; 210 210 rxq->free_count--; ··· 251 251 rxb = list_entry(element, struct iwl_rx_mem_buffer, list); 252 252 253 253 /* Alloc a new receive buffer */ 254 - rxb->skb = alloc_skb(priv->hw_params.rx_buf_size, 254 + rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256, 255 255 __GFP_NOWARN | GFP_ATOMIC); 256 256 if (!rxb->skb) { 257 257 if (net_ratelimit()) ··· 266 266 list_del(element); 267 267 268 268 /* Get physical address of RB/SKB */ 269 - rxb->dma_addr = 270 - pci_map_single(priv->pci_dev, rxb->skb->data, 271 - priv->hw_params.rx_buf_size, PCI_DMA_FROMDEVICE); 269 + rxb->real_dma_addr = pci_map_single( 270 + priv->pci_dev, 271 + rxb->skb->data, 272 + priv->hw_params.rx_buf_size + 256, 273 + PCI_DMA_FROMDEVICE); 274 + /* dma address must be no more than 36 bits */ 275 + BUG_ON(rxb->real_dma_addr & ~DMA_BIT_MASK(36)); 276 + /* and also 256 byte aligned! */ 277 + rxb->aligned_dma_addr = ALIGN(rxb->real_dma_addr, 256); 278 + skb_reserve(rxb->skb, rxb->aligned_dma_addr - rxb->real_dma_addr); 279 + 272 280 list_add_tail(&rxb->list, &rxq->rx_free); 273 281 rxq->free_count++; 274 282 } ··· 308 300 for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { 309 301 if (rxq->pool[i].skb != NULL) { 310 302 pci_unmap_single(priv->pci_dev, 311 - rxq->pool[i].dma_addr, 312 - priv->hw_params.rx_buf_size, 303 + rxq->pool[i].real_dma_addr, 304 + priv->hw_params.rx_buf_size + 256, 313 305 PCI_DMA_FROMDEVICE); 314 306 dev_kfree_skb(rxq->pool[i].skb); 315 307 } ··· 362 354 * to an SKB, so we need to unmap and free potential storage */ 363 355 if (rxq->pool[i].skb != NULL) { 364 356 pci_unmap_single(priv->pci_dev, 365 - rxq->pool[i].dma_addr, 366 - priv->hw_params.rx_buf_size, 357 + rxq->pool[i].real_dma_addr, 358 + priv->hw_params.rx_buf_size + 256, 367 359 PCI_DMA_FROMDEVICE); 368 360 priv->alloc_rxb_skb--; 369 361 dev_kfree_skb(rxq->pool[i].skb);
-1
drivers/net/wireless/iwlwifi/iwl3945-base.c
··· 6012 6012 mutex_lock(&priv->mutex); 6013 6013 iwl3945_alive_start(priv); 6014 6014 mutex_unlock(&priv->mutex); 6015 - ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); 6016 6015 } 6017 6016 6018 6017 static void iwl3945_bg_rf_kill(struct work_struct *work)
+1 -1
drivers/net/wireless/libertas_tf/if_usb.c
··· 331 331 /* Fill the receive configuration URB and initialise the Rx call back */ 332 332 usb_fill_bulk_urb(cardp->rx_urb, cardp->udev, 333 333 usb_rcvbulkpipe(cardp->udev, cardp->ep_in), 334 - (void *) (skb->tail), 334 + skb_tail_pointer(skb), 335 335 MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn, cardp); 336 336 337 337 cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET;
-20
include/net/mac80211.h
··· 74 74 */ 75 75 76 76 /** 77 - * enum ieee80211_notification_type - Low level driver notification 78 - * @IEEE80211_NOTIFY_RE_ASSOC: start the re-association sequence 79 - */ 80 - enum ieee80211_notification_types { 81 - IEEE80211_NOTIFY_RE_ASSOC, 82 - }; 83 - 84 - /** 85 77 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics 86 78 * 87 79 * This structure describes most essential parameters needed ··· 1788 1796 */ 1789 1797 void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, 1790 1798 u16 tid); 1791 - 1792 - /** 1793 - * ieee80211_notify_mac - low level driver notification 1794 - * @hw: pointer as obtained from ieee80211_alloc_hw(). 1795 - * @notif_type: enum ieee80211_notification_types 1796 - * 1797 - * This function must be called by low level driver to inform mac80211 of 1798 - * low level driver status change or force mac80211 to re-assoc for low 1799 - * level driver internal error that require re-assoc. 1800 - */ 1801 - void ieee80211_notify_mac(struct ieee80211_hw *hw, 1802 - enum ieee80211_notification_types notif_type); 1803 1799 1804 1800 /** 1805 1801 * ieee80211_find_sta - find a station
+2 -7
net/core/pktgen.c
··· 1973 1973 1974 1974 /* make sure that we don't pick a non-existing transmit queue */ 1975 1975 ntxq = pkt_dev->odev->real_num_tx_queues; 1976 - if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { 1977 - printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " 1978 - "disabled because CPU count (%d) exceeds number " 1979 - "of tx queues (%d) on %s\n", num_online_cpus(), ntxq, 1980 - pkt_dev->odev->name); 1981 - pkt_dev->flags &= ~F_QUEUE_MAP_CPU; 1982 - } 1976 + 1983 1977 if (ntxq <= pkt_dev->queue_map_min) { 1984 1978 printk(KERN_WARNING "pktgen: WARNING: Requested " 1985 1979 "queue_map_min (zero-based) (%d) exceeds valid range " ··· 2196 2202 } 2197 2203 pkt_dev->cur_queue_map = t; 2198 2204 } 2205 + pkt_dev->cur_queue_map = pkt_dev->cur_queue_map % pkt_dev->odev->real_num_tx_queues; 2199 2206 } 2200 2207 2201 2208 /* Increment/randomize headers according to flags and current values
+1
net/ipv4/af_inet.c
··· 1117 1117 }, 1118 1118 }, 1119 1119 .proto = sk->sk_protocol, 1120 + .flags = inet_sk_flowi_flags(sk), 1120 1121 .uli_u = { 1121 1122 .ports = { 1122 1123 .sport = inet->sport,
+5 -4
net/ipv4/ipmr.c
··· 1945 1945 goto proc_cache_fail; 1946 1946 #endif 1947 1947 return 0; 1948 - reg_notif_fail: 1949 - kmem_cache_destroy(mrt_cachep); 1950 1948 #ifdef CONFIG_PROC_FS 1951 - proc_vif_fail: 1952 - unregister_netdevice_notifier(&ip_mr_notifier); 1953 1949 proc_cache_fail: 1954 1950 proc_net_remove(&init_net, "ip_mr_vif"); 1951 + proc_vif_fail: 1952 + unregister_netdevice_notifier(&ip_mr_notifier); 1955 1953 #endif 1954 + reg_notif_fail: 1955 + del_timer(&ipmr_expire_timer); 1956 + kmem_cache_destroy(mrt_cachep); 1956 1957 return err; 1957 1958 }
+1
net/ipv4/udp.c
··· 633 633 .saddr = saddr, 634 634 .tos = tos } }, 635 635 .proto = sk->sk_protocol, 636 + .flags = inet_sk_flowi_flags(sk), 636 637 .uli_u = { .ports = 637 638 { .sport = inet->sport, 638 639 .dport = dport } } };
+2 -2
net/ipv6/ip6mr.c
··· 224 224 .open = ip6mr_vif_open, 225 225 .read = seq_read, 226 226 .llseek = seq_lseek, 227 - .release = seq_release, 227 + .release = seq_release_private, 228 228 }; 229 229 230 230 static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos) ··· 338 338 .open = ipmr_mfc_open, 339 339 .read = seq_read, 340 340 .llseek = seq_lseek, 341 - .release = seq_release, 341 + .release = seq_release_private, 342 342 }; 343 343 #endif 344 344
+3 -3
net/ipv6/proc.c
··· 132 132 133 133 static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) 134 134 { 135 - static char name[32]; 135 + char name[32]; 136 136 int i; 137 137 138 138 /* print by name -- deprecated items */ ··· 144 144 p = icmp6type2name[icmptype]; 145 145 if (!p) /* don't print un-named types here */ 146 146 continue; 147 - (void) snprintf(name, sizeof(name)-1, "Icmp6%s%s", 147 + snprintf(name, sizeof(name), "Icmp6%s%s", 148 148 i & 0x100 ? "Out" : "In", p); 149 149 seq_printf(seq, "%-32s\t%lu\n", name, 150 150 snmp_fold_field(mib, i)); ··· 157 157 val = snmp_fold_field(mib, i); 158 158 if (!val) 159 159 continue; 160 - (void) snprintf(name, sizeof(name)-1, "Icmp6%sType%u", 160 + snprintf(name, sizeof(name), "Icmp6%sType%u", 161 161 i & 0x100 ? "Out" : "In", i & 0xff); 162 162 seq_printf(seq, "%-32s\t%lu\n", name, val); 163 163 }
-22
net/mac80211/mlme.c
··· 2560 2560 ieee80211_restart_sta_timer(sdata); 2561 2561 rcu_read_unlock(); 2562 2562 } 2563 - 2564 - /* driver notification call */ 2565 - void ieee80211_notify_mac(struct ieee80211_hw *hw, 2566 - enum ieee80211_notification_types notif_type) 2567 - { 2568 - struct ieee80211_local *local = hw_to_local(hw); 2569 - struct ieee80211_sub_if_data *sdata; 2570 - 2571 - switch (notif_type) { 2572 - case IEEE80211_NOTIFY_RE_ASSOC: 2573 - rtnl_lock(); 2574 - list_for_each_entry(sdata, &local->interfaces, list) { 2575 - if (sdata->vif.type != NL80211_IFTYPE_STATION) 2576 - continue; 2577 - 2578 - ieee80211_sta_req_auth(sdata, &sdata->u.sta); 2579 - } 2580 - rtnl_unlock(); 2581 - break; 2582 - } 2583 - } 2584 - EXPORT_SYMBOL(ieee80211_notify_mac);
+24 -28
net/phonet/af_phonet.c
··· 33 33 #include <net/phonet/phonet.h> 34 34 #include <net/phonet/pn_dev.h> 35 35 36 - static struct net_proto_family phonet_proto_family; 37 - static struct phonet_protocol *phonet_proto_get(int protocol); 38 - static inline void phonet_proto_put(struct phonet_protocol *pp); 36 + /* Transport protocol registration */ 37 + static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; 38 + static DEFINE_SPINLOCK(proto_tab_lock); 39 + 40 + static struct phonet_protocol *phonet_proto_get(int protocol) 41 + { 42 + struct phonet_protocol *pp; 43 + 44 + if (protocol >= PHONET_NPROTO) 45 + return NULL; 46 + 47 + spin_lock(&proto_tab_lock); 48 + pp = proto_tab[protocol]; 49 + if (pp && !try_module_get(pp->prot->owner)) 50 + pp = NULL; 51 + spin_unlock(&proto_tab_lock); 52 + 53 + return pp; 54 + } 55 + 56 + static inline void phonet_proto_put(struct phonet_protocol *pp) 57 + { 58 + module_put(pp->prot->owner); 59 + } 39 60 40 61 /* protocol family functions */ 41 62 ··· 396 375 .func = phonet_rcv, 397 376 }; 398 377 399 - /* Transport protocol registration */ 400 - static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; 401 - static DEFINE_SPINLOCK(proto_tab_lock); 402 - 403 378 int __init_or_module phonet_proto_register(int protocol, 404 379 struct phonet_protocol *pp) 405 380 { ··· 428 411 proto_unregister(pp->prot); 429 412 } 430 413 EXPORT_SYMBOL(phonet_proto_unregister); 431 - 432 - static struct phonet_protocol *phonet_proto_get(int protocol) 433 - { 434 - struct phonet_protocol *pp; 435 - 436 - if (protocol >= PHONET_NPROTO) 437 - return NULL; 438 - 439 - spin_lock(&proto_tab_lock); 440 - pp = proto_tab[protocol]; 441 - if (pp && !try_module_get(pp->prot->owner)) 442 - pp = NULL; 443 - spin_unlock(&proto_tab_lock); 444 - 445 - return pp; 446 - } 447 - 448 - static inline void phonet_proto_put(struct phonet_protocol *pp) 449 - { 450 - module_put(pp->prot->owner); 451 - } 452 414 453 415 /* Module registration */ 454 416 static int __init phonet_init(void)
+2
net/sched/sch_api.c
··· 417 417 struct nlattr *nest; 418 418 419 419 nest = nla_nest_start(skb, TCA_STAB); 420 + if (nest == NULL) 421 + goto nla_put_failure; 420 422 NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); 421 423 nla_nest_end(skb, nest); 422 424
+6 -1
net/sched/sch_generic.c
··· 270 270 void netif_carrier_on(struct net_device *dev) 271 271 { 272 272 if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) { 273 + if (dev->reg_state == NETREG_UNINITIALIZED) 274 + return; 273 275 linkwatch_fire_event(dev); 274 276 if (netif_running(dev)) 275 277 __netdev_watchdog_up(dev); ··· 287 285 */ 288 286 void netif_carrier_off(struct net_device *dev) 289 287 { 290 - if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) 288 + if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) { 289 + if (dev->reg_state == NETREG_UNINITIALIZED) 290 + return; 291 291 linkwatch_fire_event(dev); 292 + } 292 293 } 293 294 EXPORT_SYMBOL(netif_carrier_off); 294 295