Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: (32 commits)
ucc_geth: Fix oops when using fixed-link support
dm9000: locking bugfix
net: update dnet.c for bus_id removal
dnet: DNET should depend on HAS_IOMEM
dca: add missing copyright/license headers
nl80211: Check that function pointer != NULL before using it
sungem: missing net_device_ops
be2net: fix to restore vlan ids into BE2 during a IF DOWN->UP cycle
be2net: replenish when posting to rx-queue is starved in out of mem conditions
bas_gigaset: correctly allocate USB interrupt transfer buffer
smsc911x: reset last known duplex and carrier on open
sh_eth: Fix mistake of the address of SH7763
sh_eth: Change handling of IRQ
netns: oops in ip[6]_frag_reasm incrementing stats
net: kfree(napi->skb) => kfree_skb
net: fix sctp breakage
ipv6: fix display of local and remote sit endpoints
net: Document /proc/sys/net/core/netdev_budget
tulip: fix crash on iface up with shirq debug
virtio_net: Make virtio_net support carrier detection
...

+314 -121
+7
Documentation/filesystems/proc.txt
··· 1478 1478 this should be enabled, but if the problem persists the messages can be 1479 1479 disabled. 1480 1480 1481 + netdev_budget 1482 + ------------- 1483 + 1484 + Maximum number of packets taken from all interfaces in one polling cycle (NAPI 1485 + poll). In one polling cycle interfaces which are registered to polling are 1486 + probed in a round-robin manner. The limit of packets in one such probe can be 1487 + set per-device via sysfs class/net/<device>/weight . 1481 1488 1482 1489 netdev_max_backlog 1483 1490 ------------------
+21
drivers/dca/dca-sysfs.c
··· 1 + /* 2 + * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the Free 6 + * Software Foundation; either version 2 of the License, or (at your option) 7 + * any later version. 8 + * 9 + * This program is distributed in the hope that it will be useful, but WITHOUT 10 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 + * more details. 13 + * 14 + * You should have received a copy of the GNU General Public License along with 15 + * this program; if not, write to the Free Software Foundation, Inc., 59 16 + * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 + * 18 + * The full GNU General Public License is included in this distribution in the 19 + * file called COPYING. 20 + */ 21 + 1 22 #include <linux/kernel.h> 2 23 #include <linux/spinlock.h> 3 24 #include <linux/device.h>
+13 -3
drivers/isdn/gigaset/bas-gigaset.c
··· 46 46 /* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */ 47 47 #define IF_WRITEBUF 264 48 48 49 + /* interrupt pipe message size according to ibid. ch. 2.2 */ 50 + #define IP_MSGSIZE 3 51 + 49 52 /* Values for the Gigaset 307x */ 50 53 #define USB_GIGA_VENDOR_ID 0x0681 51 54 #define USB_3070_PRODUCT_ID 0x0001 ··· 113 110 unsigned char *rcvbuf; /* AT reply receive buffer */ 114 111 115 112 struct urb *urb_int_in; /* URB for interrupt pipe */ 116 - unsigned char int_in_buf[3]; 113 + unsigned char *int_in_buf; 117 114 118 115 spinlock_t lock; /* locks all following */ 119 116 int basstate; /* bitmap (BS_*) */ ··· 660 657 } 661 658 662 659 /* drop incomplete packets even if the missing bytes wouldn't matter */ 663 - if (unlikely(urb->actual_length < 3)) { 660 + if (unlikely(urb->actual_length < IP_MSGSIZE)) { 664 661 dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n", 665 662 urb->actual_length); 666 663 goto resubmit; ··· 2130 2127 static void gigaset_freecshw(struct cardstate *cs) 2131 2128 { 2132 2129 /* timers, URBs and rcvbuf are disposed of in disconnect */ 2130 + kfree(cs->hw.bas->int_in_buf); 2133 2131 kfree(cs->hw.bas); 2134 2132 cs->hw.bas = NULL; 2135 2133 } ··· 2141 2137 2142 2138 cs->hw.bas = ucs = kmalloc(sizeof *ucs, GFP_KERNEL); 2143 2139 if (!ucs) { 2140 + pr_err("out of memory\n"); 2141 + return 0; 2142 + } 2143 + ucs->int_in_buf = kmalloc(IP_MSGSIZE, GFP_KERNEL); 2144 + if (!ucs->int_in_buf) { 2145 + kfree(ucs); 2144 2146 pr_err("out of memory\n"); 2145 2147 return 0; 2146 2148 } ··· 2302 2292 usb_fill_int_urb(ucs->urb_int_in, udev, 2303 2293 usb_rcvintpipe(udev, 2304 2294 (endpoint->bEndpointAddress) & 0x0f), 2305 - ucs->int_in_buf, 3, read_int_callback, cs, 2295 + ucs->int_in_buf, IP_MSGSIZE, read_int_callback, cs, 2306 2296 endpoint->bInterval); 2307 2297 if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) { 2308 2298 dev_err(cs->dev, "could not submit interrupt URB: %s\n",
+1 -1
drivers/net/Kconfig
··· 1042 1042 1043 1043 config DNET 1044 1044 tristate "Dave ethernet support (DNET)" 1045 - depends on NET_ETHERNET 1045 + depends on NET_ETHERNET && HAS_IOMEM 1046 1046 select PHYLIB 1047 1047 help 1048 1048 The Dave ethernet interface (DNET) is found on Qong Board FPGA.
+1
drivers/net/benet/be.h
··· 194 194 struct be_eq_obj rx_eq; 195 195 struct be_rx_obj rx_obj; 196 196 u32 big_page_size; /* Compounded page size shared by rx wrbs */ 197 + bool rx_post_starved; /* Zero rx frags have been posted to BE */ 197 198 198 199 struct vlan_group *vlan_grp; 199 200 u16 num_vlans;
+34 -26
drivers/net/benet/be_main.c
··· 273 273 rx_eq->cur_eqd = eqd; 274 274 } 275 275 276 - static void be_worker(struct work_struct *work) 277 - { 278 - struct be_adapter *adapter = 279 - container_of(work, struct be_adapter, work.work); 280 - int status; 281 - 282 - /* Check link */ 283 - be_link_status_update(adapter); 284 - 285 - /* Get Stats */ 286 - status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd); 287 - if (!status) 288 - netdev_stats_update(adapter); 289 - 290 - /* Set EQ delay */ 291 - be_rx_eqd_update(adapter); 292 - 293 - schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); 294 - } 295 - 296 276 static struct net_device_stats *be_get_stats(struct net_device *dev) 297 277 { 298 278 struct be_adapter *adapter = netdev_priv(dev); ··· 473 493 * program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured, 474 494 * set the BE in promiscuous VLAN mode. 475 495 */ 476 - static void be_vids_config(struct net_device *netdev) 496 + static void be_vid_config(struct net_device *netdev) 477 497 { 478 498 struct be_adapter *adapter = netdev_priv(netdev); 479 499 u16 vtag[BE_NUM_VLANS_SUPPORTED]; ··· 516 536 adapter->num_vlans++; 517 537 adapter->vlan_tag[vid] = 1; 518 538 519 - be_vids_config(netdev); 539 + be_vid_config(netdev); 520 540 } 521 541 522 542 static void be_vlan_rem_vid(struct net_device *netdev, u16 vid) ··· 527 547 adapter->vlan_tag[vid] = 0; 528 548 529 549 vlan_group_set_device(adapter->vlan_grp, vid, NULL); 530 - be_vids_config(netdev); 550 + be_vid_config(netdev); 531 551 } 532 552 533 553 static void be_set_multicast_filter(struct net_device *netdev) ··· 880 900 page_info->last_page_user = true; 881 901 882 902 if (posted) { 883 - be_rxq_notify(&adapter->ctrl, rxq->id, posted); 884 903 atomic_add(posted, &rxq->used); 904 + be_rxq_notify(&adapter->ctrl, rxq->id, posted); 905 + } else if (atomic_read(&rxq->used) == 0) { 906 + /* Let be_worker replenish when memory is available */ 907 + adapter->rx_post_starved = true; 885 908 } 886 909 887 910 return; ··· 1288 1305 return 1; 1289 1306 } 1290 1307 1308 + static void be_worker(struct work_struct *work) 1309 + { 1310 + struct be_adapter *adapter = 1311 + container_of(work, struct be_adapter, work.work); 1312 + int status; 1313 + 1314 + /* Check link */ 1315 + be_link_status_update(adapter); 1316 + 1317 + /* Get Stats */ 1318 + status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd); 1319 + if (!status) 1320 + netdev_stats_update(adapter); 1321 + 1322 + /* Set EQ delay */ 1323 + be_rx_eqd_update(adapter); 1324 + 1325 + if (adapter->rx_post_starved) { 1326 + adapter->rx_post_starved = false; 1327 + be_post_rx_frags(adapter); 1328 + } 1329 + 1330 + schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); 1331 + } 1332 + 1291 1333 static void be_msix_enable(struct be_adapter *adapter) 1292 1334 { 1293 1335 int i, status; ··· 1429 1421 &adapter->pmac_id); 1430 1422 if (status != 0) 1431 1423 goto do_none; 1424 + 1425 + be_vid_config(netdev); 1432 1426 1433 1427 status = be_cmd_set_flow_control(ctrl, true, true); 1434 1428 if (status != 0) ··· 1865 1855 1866 1856 pci_set_power_state(pdev, 0); 1867 1857 pci_restore_state(pdev); 1868 - 1869 - be_vids_config(netdev); 1870 1858 1871 1859 if (netif_running(netdev)) { 1872 1860 rtnl_lock();
+6 -6
drivers/net/bnx2.c
··· 57 57 58 58 #define DRV_MODULE_NAME "bnx2" 59 59 #define PFX DRV_MODULE_NAME ": " 60 - #define DRV_MODULE_VERSION "1.9.2" 61 - #define DRV_MODULE_RELDATE "Feb 11, 2009" 60 + #define DRV_MODULE_VERSION "1.9.3" 61 + #define DRV_MODULE_RELDATE "March 17, 2009" 62 62 63 63 #define RUN_AT(x) (jiffies + (x)) 64 64 ··· 5843 5843 for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) { 5844 5844 msix_ent[i].entry = i; 5845 5845 msix_ent[i].vector = 0; 5846 - 5847 - snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i); 5848 - bp->irq_tbl[i].handler = bnx2_msi_1shot; 5849 5846 } 5850 5847 5851 5848 rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC); ··· 5851 5854 5852 5855 bp->irq_nvecs = msix_vecs; 5853 5856 bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI; 5854 - for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) 5857 + for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) { 5855 5858 bp->irq_tbl[i].vector = msix_ent[i].vector; 5859 + snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i); 5860 + bp->irq_tbl[i].handler = bnx2_msi_1shot; 5861 + } 5856 5862 } 5857 5863 5858 5864 static void
+20 -5
drivers/net/bonding/bond_main.c
··· 3537 3537 } 3538 3538 break; 3539 3539 case NETDEV_CHANGE: 3540 - /* 3541 - * TODO: is this what we get if somebody 3542 - * sets up a hierarchical bond, then rmmod's 3543 - * one of the slave bonding devices? 3544 - */ 3540 + if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) { 3541 + struct slave *slave; 3542 + 3543 + slave = bond_get_slave_by_dev(bond, slave_dev); 3544 + if (slave) { 3545 + u16 old_speed = slave->speed; 3546 + u16 old_duplex = slave->duplex; 3547 + 3548 + bond_update_speed_duplex(slave); 3549 + 3550 + if (bond_is_lb(bond)) 3551 + break; 3552 + 3553 + if (old_speed != slave->speed) 3554 + bond_3ad_adapter_speed_changed(slave); 3555 + if (old_duplex != slave->duplex) 3556 + bond_3ad_adapter_duplex_changed(slave); 3557 + } 3558 + } 3559 + 3545 3560 break; 3546 3561 case NETDEV_DOWN: 3547 3562 /*
+4 -2
drivers/net/dm9000.c
··· 930 930 struct net_device *dev = dev_id; 931 931 board_info_t *db = netdev_priv(dev); 932 932 int int_status; 933 + unsigned long flags; 933 934 u8 reg_save; 934 935 935 936 dm9000_dbg(db, 3, "entering %s\n", __func__); 936 937 937 938 /* A real interrupt coming */ 938 939 939 - spin_lock(&db->lock); 940 + /* holders of db->lock must always block IRQs */ 941 + spin_lock_irqsave(&db->lock, flags); 940 942 941 943 /* Save previous register address */ 942 944 reg_save = readb(db->io_addr); ··· 974 972 /* Restore previous register address */ 975 973 writeb(reg_save, db->io_addr); 976 974 977 - spin_unlock(&db->lock); 975 + spin_unlock_irqrestore(&db->lock, flags); 978 976 979 977 return IRQ_HANDLED; 980 978 }
+3 -3
drivers/net/dnet.c
··· 280 280 281 281 /* attach the mac to the phy */ 282 282 if (bp->capabilities & DNET_HAS_RMII) { 283 - phydev = phy_connect(dev, phydev->dev.bus_id, 283 + phydev = phy_connect(dev, dev_name(&phydev->dev), 284 284 &dnet_handle_link_change, 0, 285 285 PHY_INTERFACE_MODE_RMII); 286 286 } else { 287 - phydev = phy_connect(dev, phydev->dev.bus_id, 287 + phydev = phy_connect(dev, dev_name(&phydev->dev), 288 288 &dnet_handle_link_change, 0, 289 289 PHY_INTERFACE_MODE_MII); 290 290 } ··· 927 927 phydev = bp->phy_dev; 928 928 dev_info(&pdev->dev, "attached PHY driver [%s] " 929 929 "(mii_bus:phy_addr=%s, irq=%d)\n", 930 - phydev->drv->name, phydev->dev.bus_id, phydev->irq); 930 + phydev->drv->name, dev_name(&phydev->dev), phydev->irq); 931 931 932 932 return 0; 933 933
+17 -3
drivers/net/sh_eth.c
··· 687 687 { 688 688 struct net_device *ndev = netdev; 689 689 struct sh_eth_private *mdp = netdev_priv(ndev); 690 + irqreturn_t ret = IRQ_NONE; 690 691 u32 ioaddr, boguscnt = RX_RING_SIZE; 691 692 u32 intr_status = 0; 692 693 ··· 697 696 /* Get interrpt stat */ 698 697 intr_status = ctrl_inl(ioaddr + EESR); 699 698 /* Clear interrupt */ 700 - ctrl_outl(intr_status, ioaddr + EESR); 699 + if (intr_status & (EESR_FRC | EESR_RMAF | EESR_RRF | 700 + EESR_RTLF | EESR_RTSF | EESR_PRE | EESR_CERF | 701 + TX_CHECK | EESR_ERR_CHECK)) { 702 + ctrl_outl(intr_status, ioaddr + EESR); 703 + ret = IRQ_HANDLED; 704 + } else 705 + goto other_irq; 701 706 702 707 if (intr_status & (EESR_FRC | /* Frame recv*/ 703 708 EESR_RMAF | /* Multi cast address recv*/ ··· 730 723 ndev->name, intr_status); 731 724 } 732 725 726 + other_irq: 733 727 spin_unlock(&mdp->lock); 734 728 735 - return IRQ_HANDLED; 729 + return ret; 736 730 } 737 731 738 732 static void sh_eth_timer(unsigned long data) ··· 852 844 int ret = 0; 853 845 struct sh_eth_private *mdp = netdev_priv(ndev); 854 846 855 - ret = request_irq(ndev->irq, &sh_eth_interrupt, 0, ndev->name, ndev); 847 + ret = request_irq(ndev->irq, &sh_eth_interrupt, 848 + #if defined(CONFIG_CPU_SUBTYPE_SH7763) || defined(CONFIG_CPU_SUBTYPE_SH7764) 849 + IRQF_SHARED, 850 + #else 851 + 0, 852 + #endif 853 + ndev->name, ndev); 856 854 if (ret) { 857 855 printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME); 858 856 return ret;
+2 -2
drivers/net/sh_eth.h
··· 43 43 44 44 #define SH7763_SKB_ALIGN 32 45 45 /* Chip Base Address */ 46 - # define SH_TSU_ADDR 0xFFE01800 47 - # define ARSTR 0xFFE01800 46 + # define SH_TSU_ADDR 0xFEE01800 47 + # define ARSTR SH_TSU_ADDR 48 48 49 49 /* Chip Registers */ 50 50 /* E-DMAC */
+4
drivers/net/smsc911x.c
··· 1225 1225 dev_info(&dev->dev, "SMSC911x/921x identified at %#08lx, IRQ: %d\n", 1226 1226 (unsigned long)pdata->ioaddr, dev->irq); 1227 1227 1228 + /* Reset the last known duplex and carrier */ 1229 + pdata->last_duplex = -1; 1230 + pdata->last_carrier = -1; 1231 + 1228 1232 /* Bring the PHY up */ 1229 1233 phy_start(pdata->phy_dev); 1230 1234
+4 -5
drivers/net/sungem.c
··· 2998 2998 .ndo_do_ioctl = gem_ioctl, 2999 2999 .ndo_tx_timeout = gem_tx_timeout, 3000 3000 .ndo_change_mtu = gem_change_mtu, 3001 - .ndo_set_mac_address = eth_mac_addr, 3002 3001 .ndo_validate_addr = eth_validate_addr, 3002 + .ndo_set_mac_address = gem_set_mac_address, 3003 + #ifdef CONFIG_NET_POLL_CONTROLLER 3004 + .ndo_poll_controller = gem_poll_controller, 3005 + #endif 3003 3006 }; 3004 3007 3005 3008 static int __devinit gem_init_one(struct pci_dev *pdev, ··· 3164 3161 dev->watchdog_timeo = 5 * HZ; 3165 3162 dev->irq = pdev->irq; 3166 3163 dev->dma = 0; 3167 - dev->set_mac_address = gem_set_mac_address; 3168 - #ifdef CONFIG_NET_POLL_CONTROLLER 3169 - dev->poll_controller = gem_poll_controller; 3170 - #endif 3171 3164 3172 3165 /* Set that now, in case PM kicks in now */ 3173 3166 pci_set_drvdata(pdev, dev);
+29 -16
drivers/net/tulip/tulip_core.c
··· 255 255 256 256 static void tulip_tx_timeout(struct net_device *dev); 257 257 static void tulip_init_ring(struct net_device *dev); 258 + static void tulip_free_ring(struct net_device *dev); 258 259 static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev); 259 260 static int tulip_open(struct net_device *dev); 260 261 static int tulip_close(struct net_device *dev); ··· 503 502 { 504 503 int retval; 505 504 506 - if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) 507 - return retval; 508 - 509 505 tulip_init_ring (dev); 506 + 507 + retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev); 508 + if (retval) 509 + goto free_ring; 510 510 511 511 tulip_up (dev); 512 512 513 513 netif_start_queue (dev); 514 514 515 515 return 0; 516 + 517 + free_ring: 518 + tulip_free_ring (dev); 519 + return retval; 516 520 } 517 521 518 522 ··· 774 768 tulip_set_power_state (tp, 0, 1); 775 769 } 776 770 777 - 778 - static int tulip_close (struct net_device *dev) 771 + static void tulip_free_ring (struct net_device *dev) 779 772 { 780 773 struct tulip_private *tp = netdev_priv(dev); 781 - void __iomem *ioaddr = tp->base_addr; 782 774 int i; 783 - 784 - netif_stop_queue (dev); 785 - 786 - tulip_down (dev); 787 - 788 - if (tulip_debug > 1) 789 - printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", 790 - dev->name, ioread32 (ioaddr + CSR5)); 791 - 792 - free_irq (dev->irq, dev); 793 775 794 776 /* Free all the skbuffs in the Rx queue. */ 795 777 for (i = 0; i < RX_RING_SIZE; i++) { ··· 797 803 dev_kfree_skb (skb); 798 804 } 799 805 } 806 + 800 807 for (i = 0; i < TX_RING_SIZE; i++) { 801 808 struct sk_buff *skb = tp->tx_buffers[i].skb; 802 809 ··· 809 814 tp->tx_buffers[i].skb = NULL; 810 815 tp->tx_buffers[i].mapping = 0; 811 816 } 817 + } 818 + 819 + static int tulip_close (struct net_device *dev) 820 + { 821 + struct tulip_private *tp = netdev_priv(dev); 822 + void __iomem *ioaddr = tp->base_addr; 823 + 824 + netif_stop_queue (dev); 825 + 826 + tulip_down (dev); 827 + 828 + if (tulip_debug > 1) 829 + printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", 830 + dev->name, ioread32 (ioaddr + CSR5)); 831 + 832 + free_irq (dev->irq, dev); 833 + 834 + tulip_free_ring (dev); 812 835 813 836 return 0; 814 837 }
+10 -24
drivers/net/ucc_geth.c
··· 1536 1536 static int init_phy(struct net_device *dev) 1537 1537 { 1538 1538 struct ucc_geth_private *priv = netdev_priv(dev); 1539 - struct device_node *np = priv->node; 1540 - struct device_node *phy, *mdio; 1541 - const phandle *ph; 1542 - char bus_name[MII_BUS_ID_SIZE]; 1543 - const unsigned int *id; 1539 + struct ucc_geth_info *ug_info = priv->ug_info; 1544 1540 struct phy_device *phydev; 1545 - char phy_id[BUS_ID_SIZE]; 1546 1541 1547 1542 priv->oldlink = 0; 1548 1543 priv->oldspeed = 0; 1549 1544 priv->oldduplex = -1; 1550 1545 1551 - ph = of_get_property(np, "phy-handle", NULL); 1552 - phy = of_find_node_by_phandle(*ph); 1553 - mdio = of_get_parent(phy); 1554 - 1555 - id = of_get_property(phy, "reg", NULL); 1556 - 1557 - of_node_put(phy); 1558 - of_node_put(mdio); 1559 - 1560 - uec_mdio_bus_name(bus_name, mdio); 1561 - snprintf(phy_id, sizeof(phy_id), "%s:%02x", 1562 - bus_name, *id); 1563 - 1564 - phydev = phy_connect(dev, phy_id, &adjust_link, 0, priv->phy_interface); 1546 + phydev = phy_connect(dev, ug_info->phy_bus_id, &adjust_link, 0, 1547 + priv->phy_interface); 1565 1548 1566 1549 if (IS_ERR(phydev)) { 1567 1550 printk("%s: Could not attach to PHY\n", dev->name); ··· 3612 3629 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); 3613 3630 fixed_link = of_get_property(np, "fixed-link", NULL); 3614 3631 if (fixed_link) { 3615 - snprintf(ug_info->mdio_bus, MII_BUS_ID_SIZE, "0"); 3616 - ug_info->phy_address = fixed_link[0]; 3632 + snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id), 3633 + PHY_ID_FMT, "0", fixed_link[0]); 3617 3634 phy = NULL; 3618 3635 } else { 3636 + char bus_name[MII_BUS_ID_SIZE]; 3637 + 3619 3638 ph = of_get_property(np, "phy-handle", NULL); 3620 3639 phy = of_find_node_by_phandle(*ph); 3621 3640 ··· 3628 3643 prop = of_get_property(phy, "reg", NULL); 3629 3644 if (prop == NULL) 3630 3645 return -1; 3631 - ug_info->phy_address = *prop; 3632 3646 3633 3647 /* Set the bus id */ 3634 3648 mdio = of_get_parent(phy); ··· 3641 3657 if (err) 3642 3658 return -1; 3643 3659 3644 - snprintf(ug_info->mdio_bus, MII_BUS_ID_SIZE, "%x", res.start); 3660 + uec_mdio_bus_name(bus_name, mdio); 3661 + snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id), 3662 + "%s:%02x", bus_name, *prop); 3645 3663 } 3646 3664 3647 3665 /* get the phy interface type, or default to MII */
+1 -2
drivers/net/ucc_geth.h
··· 1091 1091 u32 eventRegMask; 1092 1092 u16 pausePeriod; 1093 1093 u16 extensionField; 1094 - u8 phy_address; 1095 - char mdio_bus[MII_BUS_ID_SIZE]; 1094 + char phy_bus_id[BUS_ID_SIZE]; 1096 1095 u8 weightfactor[NUM_TX_QUEUES]; 1097 1096 u8 interruptcoalescingmaxvalue[NUM_RX_QUEUES]; 1098 1097 u8 l2qt[UCC_GETH_VLAN_PRIORITY_MAX];
+3
drivers/net/virtio_net.c
··· 612 612 .set_tx_csum = virtnet_set_tx_csum, 613 613 .set_sg = ethtool_op_set_sg, 614 614 .set_tso = ethtool_op_set_tso, 615 + .get_link = ethtool_op_get_link, 615 616 }; 616 617 617 618 #define MIN_MTU 68 ··· 739 738 err = -ENOMEM; 740 739 goto unregister; 741 740 } 741 + 742 + netif_carrier_on(dev); 742 743 743 744 pr_debug("virtnet: registered device %s\n", dev->name); 744 745 return 0;
+2 -2
drivers/net/wireless/ath9k/ath9k.h
··· 587 587 u8 iso[3]; 588 588 }; 589 589 590 - #define REG_WRITE(_ah, _reg, _val) iowrite32(_val, _ah->ah_sh + _reg) 591 - #define REG_READ(_ah, _reg) ioread32(_ah->ah_sh + _reg) 590 + #define REG_WRITE(_ah, _reg, _val) ath9k_iowrite32((_ah), (_reg), (_val)) 591 + #define REG_READ(_ah, _reg) ath9k_ioread32((_ah), (_reg)) 592 592 593 593 #define SM(_v, _f) (((_v) << _f##_S) & _f) 594 594 #define MS(_v, _f) (((_v) & _f) >> _f##_S)
+33
drivers/net/wireless/ath9k/core.h
··· 701 701 struct ath_hal *sc_ah; 702 702 void __iomem *mem; 703 703 spinlock_t sc_resetlock; 704 + spinlock_t sc_serial_rw; 704 705 struct mutex mutex; 705 706 706 707 u8 sc_curbssid[ETH_ALEN]; ··· 751 750 int ath_get_hal_qnum(u16 queue, struct ath_softc *sc); 752 751 int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc); 753 752 int ath_cabq_update(struct ath_softc *); 753 + 754 + /* 755 + * Read and write, they both share the same lock. We do this to serialize 756 + * reads and writes on Atheros 802.11n PCI devices only. This is required 757 + * as the FIFO on these devices can only accept sanely 2 requests. After 758 + * that the device goes bananas. Serializing the reads/writes prevents this 759 + * from happening. 760 + */ 761 + 762 + static inline void ath9k_iowrite32(struct ath_hal *ah, u32 reg_offset, u32 val) 763 + { 764 + if (ah->ah_config.serialize_regmode == SER_REG_MODE_ON) { 765 + unsigned long flags; 766 + spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags); 767 + iowrite32(val, ah->ah_sc->mem + reg_offset); 768 + spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags); 769 + } else 770 + iowrite32(val, ah->ah_sc->mem + reg_offset); 771 + } 772 + 773 + static inline unsigned int ath9k_ioread32(struct ath_hal *ah, u32 reg_offset) 774 + { 775 + u32 val; 776 + if (ah->ah_config.serialize_regmode == SER_REG_MODE_ON) { 777 + unsigned long flags; 778 + spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags); 779 + val = ioread32(ah->ah_sc->mem + reg_offset); 780 + spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags); 781 + } else 782 + val = ioread32(ah->ah_sc->mem + reg_offset); 783 + return val; 784 + } 754 785 755 786 #endif /* CORE_H */
+21 -1
drivers/net/wireless/ath9k/hw.c
··· 437 437 } 438 438 439 439 ah->ah_config.intr_mitigation = 1; 440 + 441 + /* 442 + * We need this for PCI devices only (Cardbus, PCI, miniPCI) 443 + * _and_ if on non-uniprocessor systems (Multiprocessor/HT). 444 + * This means we use it for all AR5416 devices, and the few 445 + * minor PCI AR9280 devices out there. 446 + * 447 + * Serialization is required because these devices do not handle 448 + * well the case of two concurrent reads/writes due to the latency 449 + * involved. During one read/write another read/write can be issued 450 + * on another CPU while the previous read/write may still be working 451 + * on our hardware, if we hit this case the hardware poops in a loop. 452 + * We prevent this by serializing reads and writes. 453 + * 454 + * This issue is not present on PCI-Express devices or pre-AR5416 455 + * devices (legacy, 802.11abg). 456 + */ 457 + if (num_possible_cpus() > 1) 458 + ah->ah_config.serialize_regmode = SER_REG_MODE_AUTO; 440 459 } 441 460 442 461 static struct ath_hal_5416 *ath9k_hw_newstate(u16 devid, ··· 687 668 } 688 669 689 670 if (ah->ah_config.serialize_regmode == SER_REG_MODE_AUTO) { 690 - if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) { 671 + if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI || 672 + (AR_SREV_9280(ah) && !ah->ah_isPciExpress)) { 691 673 ah->ah_config.serialize_regmode = 692 674 SER_REG_MODE_ON; 693 675 } else {
+1
drivers/net/wireless/ath9k/main.c
··· 1336 1336 printk(KERN_ERR "Unable to create debugfs files\n"); 1337 1337 1338 1338 spin_lock_init(&sc->sc_resetlock); 1339 + spin_lock_init(&sc->sc_serial_rw); 1339 1340 mutex_init(&sc->mutex); 1340 1341 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); 1341 1342 tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
+6 -2
drivers/net/wireless/zd1211rw/zd_mac.c
··· 575 575 576 576 r = fill_ctrlset(mac, skb); 577 577 if (r) 578 - return r; 578 + goto fail; 579 579 580 580 info->rate_driver_data[0] = hw; 581 581 582 582 r = zd_usb_tx(&mac->chip.usb, skb); 583 583 if (r) 584 - return r; 584 + goto fail; 585 + return 0; 586 + 587 + fail: 588 + dev_kfree_skb(skb); 585 589 return 0; 586 590 } 587 591
+20
include/linux/dca.h
··· 1 + /* 2 + * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the Free 6 + * Software Foundation; either version 2 of the License, or (at your option) 7 + * any later version. 8 + * 9 + * This program is distributed in the hope that it will be useful, but WITHOUT 10 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 + * more details. 13 + * 14 + * You should have received a copy of the GNU General Public License along with 15 + * this program; if not, write to the Free Software Foundation, Inc., 59 16 + * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 + * 18 + * The full GNU General Public License is included in this distribution in the 19 + * file called COPYING. 20 + */ 1 21 #ifndef DCA_H 2 22 #define DCA_H 3 23 /* DCA Provider API */
+2 -1
include/net/netfilter/nf_conntrack_core.h
··· 62 62 if (ct && ct != &nf_conntrack_untracked) { 63 63 if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) 64 64 ret = __nf_conntrack_confirm(skb); 65 - nf_ct_deliver_cached_events(ct); 65 + if (likely(ret == NF_ACCEPT)) 66 + nf_ct_deliver_cached_events(ct); 66 67 } 67 68 return ret; 68 69 }
+4 -3
net/core/dev.c
··· 2588 2588 local_irq_disable(); 2589 2589 skb = __skb_dequeue(&queue->input_pkt_queue); 2590 2590 if (!skb) { 2591 - __napi_complete(napi); 2592 2591 local_irq_enable(); 2593 - break; 2592 + napi_complete(napi); 2593 + goto out; 2594 2594 } 2595 2595 local_irq_enable(); 2596 2596 ··· 2599 2599 2600 2600 napi_gro_flush(napi); 2601 2601 2602 + out: 2602 2603 return work; 2603 2604 } 2604 2605 ··· 2672 2671 struct sk_buff *skb, *next; 2673 2672 2674 2673 list_del_init(&napi->dev_list); 2675 - kfree(napi->skb); 2674 + kfree_skb(napi->skb); 2676 2675 2677 2676 for (skb = napi->gro_list; skb; skb = next) { 2678 2677 next = skb->next;
+2 -1
net/ipv4/ip_fragment.c
··· 463 463 static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, 464 464 struct net_device *dev) 465 465 { 466 + struct net *net = container_of(qp->q.net, struct net, ipv4.frags); 466 467 struct iphdr *iph; 467 468 struct sk_buff *fp, *head = qp->q.fragments; 468 469 int len; ··· 549 548 iph = ip_hdr(head); 550 549 iph->frag_off = 0; 551 550 iph->tot_len = htons(len); 552 - IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMOKS); 551 + IP_INC_STATS_BH(net, IPSTATS_MIB_REASMOKS); 553 552 qp->q.fragments = NULL; 554 553 return 0; 555 554
+4 -4
net/ipv6/netfilter/nf_conntrack_reasm.c
··· 528 528 if (!ipv6_ext_hdr(nexthdr)) { 529 529 return -1; 530 530 } 531 - if (len < (int)sizeof(struct ipv6_opt_hdr)) { 532 - pr_debug("too short\n"); 533 - return -1; 534 - } 535 531 if (nexthdr == NEXTHDR_NONE) { 536 532 pr_debug("next header is none\n"); 533 + return -1; 534 + } 535 + if (len < (int)sizeof(struct ipv6_opt_hdr)) { 536 + pr_debug("too short\n"); 537 537 return -1; 538 538 } 539 539 if (skb_copy_bits(skb, start, &hdr, sizeof(hdr)))
+3 -4
net/ipv6/reassembly.c
··· 452 452 static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, 453 453 struct net_device *dev) 454 454 { 455 + struct net *net = container_of(fq->q.net, struct net, ipv6.frags); 455 456 struct sk_buff *fp, *head = fq->q.fragments; 456 457 int payload_len; 457 458 unsigned int nhoff; ··· 552 551 head->csum); 553 552 554 553 rcu_read_lock(); 555 - IP6_INC_STATS_BH(dev_net(dev), 556 - __in6_dev_get(dev), IPSTATS_MIB_REASMOKS); 554 + IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMOKS); 557 555 rcu_read_unlock(); 558 556 fq->q.fragments = NULL; 559 557 return 1; ··· 566 566 printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n"); 567 567 out_fail: 568 568 rcu_read_lock(); 569 - IP6_INC_STATS_BH(dev_net(dev), 570 - __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS); 569 + IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS); 571 570 rcu_read_unlock(); 572 571 return -1; 573 572 }
+1 -1
net/ipv6/sit.c
··· 188 188 } 189 189 190 190 nt = netdev_priv(dev); 191 - ipip6_tunnel_init(dev); 192 191 193 192 nt->parms = *parms; 193 + ipip6_tunnel_init(dev); 194 194 195 195 if (parms->i_flags & SIT_ISATAP) 196 196 dev->priv_flags |= IFF_ISATAP;
+2
net/mac80211/tx.c
··· 752 752 skb_copy_queue_mapping(frag, first); 753 753 754 754 frag->do_not_encrypt = first->do_not_encrypt; 755 + frag->dev = first->dev; 756 + frag->iif = first->iif; 755 757 756 758 pos += copylen; 757 759 left -= copylen;
+1 -1
net/netfilter/nf_conntrack_core.c
··· 726 726 NF_CT_ASSERT(skb->nfct); 727 727 728 728 ret = l4proto->packet(ct, skb, dataoff, ctinfo, pf, hooknum); 729 - if (ret < 0) { 729 + if (ret <= 0) { 730 730 /* Invalid: inverse of the return code tells 731 731 * the netfilter core what to do */ 732 732 pr_debug("nf_conntrack_in: Can't track with proto module\n");
+1
net/netfilter/nf_conntrack_netlink.c
··· 1780 1780 goto out; 1781 1781 } 1782 1782 1783 + exp->class = 0; 1783 1784 exp->expectfn = NULL; 1784 1785 exp->flags = 0; 1785 1786 exp->master = ct;
+2 -2
net/netfilter/nf_conntrack_proto_tcp.c
··· 859 859 */ 860 860 if (nf_ct_kill(ct)) 861 861 return -NF_REPEAT; 862 - return -NF_DROP; 862 + return NF_DROP; 863 863 } 864 864 /* Fall through */ 865 865 case TCP_CONNTRACK_IGNORE: ··· 892 892 nf_log_packet(pf, 0, skb, NULL, NULL, NULL, 893 893 "nf_ct_tcp: killing out of sync session "); 894 894 nf_ct_kill(ct); 895 - return -NF_DROP; 895 + return NF_DROP; 896 896 } 897 897 ct->proto.tcp.last_index = index; 898 898 ct->proto.tcp.last_dir = dir;
+2 -1
net/sctp/endpointola.c
··· 111 111 if (sctp_addip_enable) { 112 112 auth_chunks->chunks[0] = SCTP_CID_ASCONF; 113 113 auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK; 114 - auth_chunks->param_hdr.length += htons(2); 114 + auth_chunks->param_hdr.length = 115 + htons(sizeof(sctp_paramhdr_t) + 2); 115 116 } 116 117 } 117 118
+10
net/wireless/Kconfig
··· 102 102 103 103 config LIB80211_CRYPT_TKIP 104 104 tristate 105 + 106 + config LIB80211_DEBUG 107 + bool "lib80211 debugging messages" 108 + depends on LIB80211 109 + default n 110 + ---help--- 111 + You can enable this if you want verbose debugging messages 112 + from lib80211. 113 + 114 + If unsure, say N.
+2
net/wireless/lib80211_crypt_ccmp.c
··· 337 337 pos += 8; 338 338 339 339 if (ccmp_replay_check(pn, key->rx_pn)) { 340 + #ifdef CONFIG_LIB80211_DEBUG 340 341 if (net_ratelimit()) { 341 342 printk(KERN_DEBUG "CCMP: replay detected: STA=%pM " 342 343 "previous PN %02x%02x%02x%02x%02x%02x " ··· 347 346 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5], 348 347 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]); 349 348 } 349 + #endif 350 350 key->dot11RSNAStatsCCMPReplays++; 351 351 return -4; 352 352 }
+4
net/wireless/lib80211_crypt_tkip.c
··· 465 465 pos += 8; 466 466 467 467 if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) { 468 + #ifdef CONFIG_LIB80211_DEBUG 468 469 if (net_ratelimit()) { 469 470 printk(KERN_DEBUG "TKIP: replay detected: STA=%pM" 470 471 " previous TSC %08x%04x received TSC " 471 472 "%08x%04x\n", hdr->addr2, 472 473 tkey->rx_iv32, tkey->rx_iv16, iv32, iv16); 473 474 } 475 + #endif 474 476 tkey->dot11RSNAStatsTKIPReplays++; 475 477 return -4; 476 478 } ··· 507 505 * it needs to be recalculated for the next packet. */ 508 506 tkey->rx_phase1_done = 0; 509 507 } 508 + #ifdef CONFIG_LIB80211_DEBUG 510 509 if (net_ratelimit()) { 511 510 printk(KERN_DEBUG "TKIP: ICV error detected: STA=" 512 511 "%pM\n", hdr->addr2); 513 512 } 513 + #endif 514 514 tkey->dot11RSNAStatsTKIPICVErrors++; 515 515 return -5; 516 516 }
+11
net/wireless/nl80211.c
··· 1908 1908 if (err) 1909 1909 return err; 1910 1910 1911 + if (!drv->ops->get_mesh_params) { 1912 + err = -EOPNOTSUPP; 1913 + goto out; 1914 + } 1915 + 1911 1916 /* Get the mesh params */ 1912 1917 rtnl_lock(); 1913 1918 err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params); ··· 2022 2017 if (err) 2023 2018 return err; 2024 2019 2020 + if (!drv->ops->set_mesh_params) { 2021 + err = -EOPNOTSUPP; 2022 + goto out; 2023 + } 2024 + 2025 2025 /* This makes sure that there aren't more than 32 mesh config 2026 2026 * parameters (otherwise our bitfield scheme would not work.) */ 2027 2027 BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32); ··· 2071 2061 err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask); 2072 2062 rtnl_unlock(); 2073 2063 2064 + out: 2074 2065 /* cleanup */ 2075 2066 cfg80211_put_dev(drv); 2076 2067 dev_put(dev);