aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-09 11:05:12 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-09 11:05:12 -0500
commitfd0b45dfd1858c6b49d06355a460bcf36d654c06 (patch)
tree85386a76355b398b7f452b737af4ab48f116677a
parentfcfd50afb6e94c8cf121ca4e7e3e7166bae7c6aa (diff)
parent1c9b7aa1eb40ab708ef3242f74b9a61487623168 (diff)
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: (36 commits) [ATM]: Check IP header validity in mpc_send_packet [IPV6]: IPV6_MULTICAST_IF setting is ignored on link-local connect() [CONNECTOR]: Don't touch queue dev after decrement of ref count. [SOCK]: Adds a rcu_dereference() in sk_filter [XFRM]: xfrm_algo_clone() allocates too much memory [FORCEDETH]: Fix reversing the MAC address on suspend. [NET]: mcs7830 passes msecs instead of jiffies to usb_control_msg [LRO] Fix lro_mgr->features checks [NET]: Clone the sk_buff 'iif' field in __skb_clone() [IPV4] ROUTE: ip_rt_dump() is unecessary slow [NET]: kaweth was forgotten in msec switchover of usb_start_wait_urb [NET] Intel ethernet drivers: update MAINTAINERS [NET]: Make ->poll() breakout consistent in Intel ethernet drivers. [NET]: Stop polling when napi_disable() is pending. [NET]: Fix drivers to handle napi_disable() disabling interrupts. [NETXEN]: Fix ->poll() done logic. mac80211: return an error when SIWRATE doesn't match any rate ssb: Fix probing of PCI cores if PCI and PCIE core is available [NET]: Do not check netif_running() and carrier state in ->poll() [NET]: Add NAPI_STATE_DISABLE. ...
-rw-r--r--Documentation/nfsroot.txt1
-rw-r--r--MAINTAINERS18
-rw-r--r--drivers/atm/nicstar.c19
-rw-r--r--drivers/connector/cn_queue.c2
-rw-r--r--drivers/net/e100.c7
-rw-r--r--drivers/net/e1000/e1000_main.c16
-rw-r--r--drivers/net/e1000e/netdev.c14
-rw-r--r--drivers/net/epic100.c2
-rw-r--r--drivers/net/fec_8xx/fec_main.c5
-rw-r--r--drivers/net/forcedeth.c6
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c3
-rw-r--r--drivers/net/ixgb/ixgb_main.c7
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c14
-rw-r--r--drivers/net/ixp2000/ixpdev.c2
-rw-r--r--drivers/net/meth.c10
-rw-r--r--drivers/net/myri10ge/myri10ge.c2
-rw-r--r--drivers/net/natsemi.c2
-rw-r--r--drivers/net/netx-eth.c4
-rw-r--r--drivers/net/netxen/netxen_nic_main.c2
-rw-r--r--drivers/net/niu.c43
-rw-r--r--drivers/net/pcnet32.c5
-rw-r--r--drivers/net/qla3xxx.c7
-rw-r--r--drivers/net/r8169.c2
-rw-r--r--drivers/net/s2io.c3
-rw-r--r--drivers/net/sky2.c3
-rw-r--r--drivers/net/tulip/interrupt.c8
-rw-r--r--drivers/net/usb/kaweth.c2
-rw-r--r--drivers/net/usb/mcs7830.c4
-rw-r--r--drivers/net/wireless/b43/b43.h2
-rw-r--r--drivers/net/wireless/b43/main.h20
-rw-r--r--drivers/net/wireless/b43/xmit.c27
-rw-r--r--drivers/net/wireless/b43/xmit.h65
-rw-r--r--drivers/net/xen-netfront.c5
-rw-r--r--drivers/ssb/scan.c11
-rw-r--r--include/linux/netdevice.h18
-rw-r--r--include/net/sch_generic.h1
-rw-r--r--include/net/sctp/user.h2
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/xfrm.h7
-rw-r--r--net/atm/mpc.c7
-rw-r--r--net/core/dev.c8
-rw-r--r--net/core/skbuff.c11
-rw-r--r--net/ipv4/inet_lro.c16
-rw-r--r--net/ipv4/ipconfig.c22
-rw-r--r--net/ipv4/raw.c4
-rw-r--r--net/ipv4/route.c8
-rw-r--r--net/ipv6/datagram.c6
-rw-r--r--net/irda/af_irda.c2
-rw-r--r--net/mac80211/ieee80211_ioctl.c6
-rw-r--r--net/sctp/sm_make_chunk.c6
-rw-r--r--net/sctp/sm_statefuns.c22
-rw-r--r--net/sctp/ulpevent.c2
-rw-r--r--net/xfrm/xfrm_user.c17
53 files changed, 262 insertions, 248 deletions
diff --git a/Documentation/nfsroot.txt b/Documentation/nfsroot.txt
index c86dd38e2281..31b329172343 100644
--- a/Documentation/nfsroot.txt
+++ b/Documentation/nfsroot.txt
@@ -145,6 +145,7 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
145 this option. 145 this option.
146 146
147 off or none: don't use autoconfiguration 147 off or none: don't use autoconfiguration
148 (do static IP assignment instead)
148 on or any: use any protocol available in the kernel 149 on or any: use any protocol available in the kernel
149 (default) 150 (default)
150 dhcp: use DHCP 151 dhcp: use DHCP
diff --git a/MAINTAINERS b/MAINTAINERS
index 56e6159a1b5d..b4f611c60cfc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1984,29 +1984,27 @@ L: netdev@vger.kernel.org
1984S: Maintained 1984S: Maintained
1985 1985
1986INTEL PRO/100 ETHERNET SUPPORT 1986INTEL PRO/100 ETHERNET SUPPORT
1987P: John Ronciak 1987P: Auke Kok
1988M: john.ronciak@intel.com 1988M: auke-jan.h.kok@intel.com
1989P: Jesse Brandeburg 1989P: Jesse Brandeburg
1990M: jesse.brandeburg@intel.com 1990M: jesse.brandeburg@intel.com
1991P: Jeff Kirsher 1991P: Jeff Kirsher
1992M: jeffrey.t.kirsher@intel.com 1992M: jeffrey.t.kirsher@intel.com
1993P: Auke Kok 1993P: John Ronciak
1994M: auke-jan.h.kok@intel.com 1994M: john.ronciak@intel.com
1995L: e1000-devel@lists.sourceforge.net 1995L: e1000-devel@lists.sourceforge.net
1996W: http://sourceforge.net/projects/e1000/ 1996W: http://sourceforge.net/projects/e1000/
1997S: Supported 1997S: Supported
1998 1998
1999INTEL PRO/1000 GIGABIT ETHERNET SUPPORT 1999INTEL PRO/1000 GIGABIT ETHERNET SUPPORT
2000P: Jeb Cramer 2000P: Auke Kok
2001M: cramerj@intel.com 2001M: auke-jan.h.kok@intel.com
2002P: John Ronciak
2003M: john.ronciak@intel.com
2004P: Jesse Brandeburg 2002P: Jesse Brandeburg
2005M: jesse.brandeburg@intel.com 2003M: jesse.brandeburg@intel.com
2006P: Jeff Kirsher 2004P: Jeff Kirsher
2007M: jeffrey.t.kirsher@intel.com 2005M: jeffrey.t.kirsher@intel.com
2008P: Auke Kok 2006P: John Ronciak
2009M: auke-jan.h.kok@intel.com 2007M: john.ronciak@intel.com
2010L: e1000-devel@lists.sourceforge.net 2008L: e1000-devel@lists.sourceforge.net
2011W: http://sourceforge.net/projects/e1000/ 2009W: http://sourceforge.net/projects/e1000/
2012S: Supported 2010S: Supported
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 14ced85b3f54..0c205b000e8b 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -625,14 +625,6 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
625 if (mac[i] == NULL) 625 if (mac[i] == NULL)
626 nicstar_init_eprom(card->membase); 626 nicstar_init_eprom(card->membase);
627 627
628 if (request_irq(pcidev->irq, &ns_irq_handler, IRQF_DISABLED | IRQF_SHARED, "nicstar", card) != 0)
629 {
630 printk("nicstar%d: can't allocate IRQ %d.\n", i, pcidev->irq);
631 error = 9;
632 ns_init_card_error(card, error);
633 return error;
634 }
635
636 /* Set the VPI/VCI MSb mask to zero so we can receive OAM cells */ 628 /* Set the VPI/VCI MSb mask to zero so we can receive OAM cells */
637 writel(0x00000000, card->membase + VPM); 629 writel(0x00000000, card->membase + VPM);
638 630
@@ -858,8 +850,6 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
858 card->iovpool.count++; 850 card->iovpool.count++;
859 } 851 }
860 852
861 card->intcnt = 0;
862
863 /* Configure NICStAR */ 853 /* Configure NICStAR */
864 if (card->rct_size == 4096) 854 if (card->rct_size == 4096)
865 ns_cfg_rctsize = NS_CFG_RCTSIZE_4096_ENTRIES; 855 ns_cfg_rctsize = NS_CFG_RCTSIZE_4096_ENTRIES;
@@ -868,6 +858,15 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
868 858
869 card->efbie = 1; 859 card->efbie = 1;
870 860
861 card->intcnt = 0;
862 if (request_irq(pcidev->irq, &ns_irq_handler, IRQF_DISABLED | IRQF_SHARED, "nicstar", card) != 0)
863 {
864 printk("nicstar%d: can't allocate IRQ %d.\n", i, pcidev->irq);
865 error = 9;
866 ns_init_card_error(card, error);
867 return error;
868 }
869
871 /* Register device */ 870 /* Register device */
872 card->atmdev = atm_dev_register("nicstar", &atm_ops, -1, NULL); 871 card->atmdev = atm_dev_register("nicstar", &atm_ops, -1, NULL);
873 if (card->atmdev == NULL) 872 if (card->atmdev == NULL)
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c
index 296f51002b55..12ceed54ab18 100644
--- a/drivers/connector/cn_queue.c
+++ b/drivers/connector/cn_queue.c
@@ -99,8 +99,8 @@ int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id
99 spin_unlock_bh(&dev->queue_lock); 99 spin_unlock_bh(&dev->queue_lock);
100 100
101 if (found) { 101 if (found) {
102 atomic_dec(&dev->refcnt);
103 cn_queue_free_callback(cbq); 102 cn_queue_free_callback(cbq);
103 atomic_dec(&dev->refcnt);
104 return -EINVAL; 104 return -EINVAL;
105 } 105 }
106 106
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 2b06e4b4dabc..b87402bc8308 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1991,13 +1991,12 @@ static int e100_poll(struct napi_struct *napi, int budget)
1991 struct nic *nic = container_of(napi, struct nic, napi); 1991 struct nic *nic = container_of(napi, struct nic, napi);
1992 struct net_device *netdev = nic->netdev; 1992 struct net_device *netdev = nic->netdev;
1993 unsigned int work_done = 0; 1993 unsigned int work_done = 0;
1994 int tx_cleaned;
1995 1994
1996 e100_rx_clean(nic, &work_done, budget); 1995 e100_rx_clean(nic, &work_done, budget);
1997 tx_cleaned = e100_tx_clean(nic); 1996 e100_tx_clean(nic);
1998 1997
1999 /* If no Rx and Tx cleanup work was done, exit polling mode. */ 1998 /* If budget not fully consumed, exit the polling mode */
2000 if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) { 1999 if (work_done < budget) {
2001 netif_rx_complete(netdev, napi); 2000 netif_rx_complete(netdev, napi);
2002 e100_enable_irq(nic); 2001 e100_enable_irq(nic);
2003 } 2002 }
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4f37506ad374..13d57b0a88fa 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3919,32 +3919,26 @@ e1000_clean(struct napi_struct *napi, int budget)
3919{ 3919{
3920 struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); 3920 struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi);
3921 struct net_device *poll_dev = adapter->netdev; 3921 struct net_device *poll_dev = adapter->netdev;
3922 int tx_cleaned = 0, work_done = 0; 3922 int work_done = 0;
3923 3923
3924 /* Must NOT use netdev_priv macro here. */ 3924 /* Must NOT use netdev_priv macro here. */
3925 adapter = poll_dev->priv; 3925 adapter = poll_dev->priv;
3926 3926
3927 /* Keep link state information with original netdev */
3928 if (!netif_carrier_ok(poll_dev))
3929 goto quit_polling;
3930
3931 /* e1000_clean is called per-cpu. This lock protects 3927 /* e1000_clean is called per-cpu. This lock protects
3932 * tx_ring[0] from being cleaned by multiple cpus 3928 * tx_ring[0] from being cleaned by multiple cpus
3933 * simultaneously. A failure obtaining the lock means 3929 * simultaneously. A failure obtaining the lock means
3934 * tx_ring[0] is currently being cleaned anyway. */ 3930 * tx_ring[0] is currently being cleaned anyway. */
3935 if (spin_trylock(&adapter->tx_queue_lock)) { 3931 if (spin_trylock(&adapter->tx_queue_lock)) {
3936 tx_cleaned = e1000_clean_tx_irq(adapter, 3932 e1000_clean_tx_irq(adapter,
3937 &adapter->tx_ring[0]); 3933 &adapter->tx_ring[0]);
3938 spin_unlock(&adapter->tx_queue_lock); 3934 spin_unlock(&adapter->tx_queue_lock);
3939 } 3935 }
3940 3936
3941 adapter->clean_rx(adapter, &adapter->rx_ring[0], 3937 adapter->clean_rx(adapter, &adapter->rx_ring[0],
3942 &work_done, budget); 3938 &work_done, budget);
3943 3939
3944 /* If no Tx and not enough Rx work done, exit the polling mode */ 3940 /* If budget not fully consumed, exit the polling mode */
3945 if ((!tx_cleaned && (work_done == 0)) || 3941 if (work_done < budget) {
3946 !netif_running(poll_dev)) {
3947quit_polling:
3948 if (likely(adapter->itr_setting & 3)) 3942 if (likely(adapter->itr_setting & 3))
3949 e1000_set_itr(adapter); 3943 e1000_set_itr(adapter);
3950 netif_rx_complete(poll_dev, napi); 3944 netif_rx_complete(poll_dev, napi);
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 4fd2e23720b6..4a6fc7453776 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -1384,30 +1384,24 @@ static int e1000_clean(struct napi_struct *napi, int budget)
1384{ 1384{
1385 struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); 1385 struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi);
1386 struct net_device *poll_dev = adapter->netdev; 1386 struct net_device *poll_dev = adapter->netdev;
1387 int tx_cleaned = 0, work_done = 0; 1387 int work_done = 0;
1388 1388
1389 /* Must NOT use netdev_priv macro here. */ 1389 /* Must NOT use netdev_priv macro here. */
1390 adapter = poll_dev->priv; 1390 adapter = poll_dev->priv;
1391 1391
1392 /* Keep link state information with original netdev */
1393 if (!netif_carrier_ok(poll_dev))
1394 goto quit_polling;
1395
1396 /* e1000_clean is called per-cpu. This lock protects 1392 /* e1000_clean is called per-cpu. This lock protects
1397 * tx_ring from being cleaned by multiple cpus 1393 * tx_ring from being cleaned by multiple cpus
1398 * simultaneously. A failure obtaining the lock means 1394 * simultaneously. A failure obtaining the lock means
1399 * tx_ring is currently being cleaned anyway. */ 1395 * tx_ring is currently being cleaned anyway. */
1400 if (spin_trylock(&adapter->tx_queue_lock)) { 1396 if (spin_trylock(&adapter->tx_queue_lock)) {
1401 tx_cleaned = e1000_clean_tx_irq(adapter); 1397 e1000_clean_tx_irq(adapter);
1402 spin_unlock(&adapter->tx_queue_lock); 1398 spin_unlock(&adapter->tx_queue_lock);
1403 } 1399 }
1404 1400
1405 adapter->clean_rx(adapter, &work_done, budget); 1401 adapter->clean_rx(adapter, &work_done, budget);
1406 1402
1407 /* If no Tx and not enough Rx work done, exit the polling mode */ 1403 /* If budget not fully consumed, exit the polling mode */
1408 if ((!tx_cleaned && (work_done < budget)) || 1404 if (work_done < budget) {
1409 !netif_running(poll_dev)) {
1410quit_polling:
1411 if (adapter->itr_setting & 3) 1405 if (adapter->itr_setting & 3)
1412 e1000_set_itr(adapter); 1406 e1000_set_itr(adapter);
1413 netif_rx_complete(poll_dev, napi); 1407 netif_rx_complete(poll_dev, napi);
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index ecdd3fc8d70c..0b365b8d947b 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -1273,7 +1273,7 @@ rx_action:
1273 1273
1274 epic_rx_err(dev, ep); 1274 epic_rx_err(dev, ep);
1275 1275
1276 if (netif_running(dev) && (work_done < budget)) { 1276 if (work_done < budget) {
1277 unsigned long flags; 1277 unsigned long flags;
1278 int more; 1278 int more;
1279 1279
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c
index 8d2904fa5789..ab9637ab3a8d 100644
--- a/drivers/net/fec_8xx/fec_main.c
+++ b/drivers/net/fec_8xx/fec_main.c
@@ -476,11 +476,6 @@ static int fec_enet_rx_common(struct fec_enet_private *ep,
476 __u16 pkt_len, sc; 476 __u16 pkt_len, sc;
477 int curidx; 477 int curidx;
478 478
479 if (fpi->use_napi) {
480 if (!netif_running(dev))
481 return 0;
482 }
483
484 /* 479 /*
485 * First, grab all of the stats for the incoming packet. 480 * First, grab all of the stats for the incoming packet.
486 * These get messed up if we get called due to a busy condition. 481 * These get messed up if we get called due to a busy condition.
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index a96583cceb5e..f84c752997a4 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -5199,10 +5199,6 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5199 dev->dev_addr[3] = (np->orig_mac[0] >> 16) & 0xff; 5199 dev->dev_addr[3] = (np->orig_mac[0] >> 16) & 0xff;
5200 dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff; 5200 dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff;
5201 dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff; 5201 dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff;
5202 /* set permanent address to be correct aswell */
5203 np->orig_mac[0] = (dev->dev_addr[0] << 0) + (dev->dev_addr[1] << 8) +
5204 (dev->dev_addr[2] << 16) + (dev->dev_addr[3] << 24);
5205 np->orig_mac[1] = (dev->dev_addr[4] << 0) + (dev->dev_addr[5] << 8);
5206 writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll); 5202 writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll);
5207 } 5203 }
5208 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); 5204 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
@@ -5414,6 +5410,8 @@ static void __devexit nv_remove(struct pci_dev *pci_dev)
5414 */ 5410 */
5415 writel(np->orig_mac[0], base + NvRegMacAddrA); 5411 writel(np->orig_mac[0], base + NvRegMacAddrA);
5416 writel(np->orig_mac[1], base + NvRegMacAddrB); 5412 writel(np->orig_mac[1], base + NvRegMacAddrB);
5413 writel(readl(base + NvRegTransmitPoll) & ~NVREG_TRANSMITPOLL_MAC_ADDR_REV,
5414 base + NvRegTransmitPoll);
5417 5415
5418 /* free all structures */ 5416 /* free all structures */
5419 free_rings(dev); 5417 free_rings(dev);
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index f2a4d399a6e5..3e1a57a42f11 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -96,9 +96,6 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
96 u16 pkt_len, sc; 96 u16 pkt_len, sc;
97 int curidx; 97 int curidx;
98 98
99 if (!netif_running(dev))
100 return 0;
101
102 /* 99 /*
103 * First, grab all of the stats for the incoming packet. 100 * First, grab all of the stats for the incoming packet.
104 * These get messed up if we get called due to a busy condition. 101 * These get messed up if we get called due to a busy condition.
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index bf9085fe035a..d2fb88d5cda2 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1787,14 +1787,13 @@ ixgb_clean(struct napi_struct *napi, int budget)
1787{ 1787{
1788 struct ixgb_adapter *adapter = container_of(napi, struct ixgb_adapter, napi); 1788 struct ixgb_adapter *adapter = container_of(napi, struct ixgb_adapter, napi);
1789 struct net_device *netdev = adapter->netdev; 1789 struct net_device *netdev = adapter->netdev;
1790 int tx_cleaned;
1791 int work_done = 0; 1790 int work_done = 0;
1792 1791
1793 tx_cleaned = ixgb_clean_tx_irq(adapter); 1792 ixgb_clean_tx_irq(adapter);
1794 ixgb_clean_rx_irq(adapter, &work_done, budget); 1793 ixgb_clean_rx_irq(adapter, &work_done, budget);
1795 1794
1796 /* if no Tx and not enough Rx work done, exit the polling mode */ 1795 /* If budget not fully consumed, exit the polling mode */
1797 if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) { 1796 if (work_done < budget) {
1798 netif_rx_complete(netdev, napi); 1797 netif_rx_complete(netdev, napi);
1799 ixgb_irq_enable(adapter); 1798 ixgb_irq_enable(adapter);
1800 } 1799 }
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 00bc525c6560..a56491617661 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -1468,21 +1468,15 @@ static int ixgbe_clean(struct napi_struct *napi, int budget)
1468 struct ixgbe_adapter *adapter = container_of(napi, 1468 struct ixgbe_adapter *adapter = container_of(napi,
1469 struct ixgbe_adapter, napi); 1469 struct ixgbe_adapter, napi);
1470 struct net_device *netdev = adapter->netdev; 1470 struct net_device *netdev = adapter->netdev;
1471 int tx_cleaned = 0, work_done = 0; 1471 int work_done = 0;
1472
1473 /* Keep link state information with original netdev */
1474 if (!netif_carrier_ok(adapter->netdev))
1475 goto quit_polling;
1476 1472
1477 /* In non-MSIX case, there is no multi-Tx/Rx queue */ 1473 /* In non-MSIX case, there is no multi-Tx/Rx queue */
1478 tx_cleaned = ixgbe_clean_tx_irq(adapter, adapter->tx_ring); 1474 ixgbe_clean_tx_irq(adapter, adapter->tx_ring);
1479 ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &work_done, 1475 ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &work_done,
1480 budget); 1476 budget);
1481 1477
1482 /* If no Tx and not enough Rx work done, exit the polling mode */ 1478 /* If budget not fully consumed, exit the polling mode */
1483 if ((!tx_cleaned && (work_done < budget)) || 1479 if (work_done < budget) {
1484 !netif_running(adapter->netdev)) {
1485quit_polling:
1486 netif_rx_complete(netdev, napi); 1480 netif_rx_complete(netdev, napi);
1487 ixgbe_irq_enable(adapter); 1481 ixgbe_irq_enable(adapter);
1488 } 1482 }
diff --git a/drivers/net/ixp2000/ixpdev.c b/drivers/net/ixp2000/ixpdev.c
index 6c0dd49149d0..484cb2ba717f 100644
--- a/drivers/net/ixp2000/ixpdev.c
+++ b/drivers/net/ixp2000/ixpdev.c
@@ -135,8 +135,6 @@ static int ixpdev_poll(struct napi_struct *napi, int budget)
135 struct net_device *dev = ip->dev; 135 struct net_device *dev = ip->dev;
136 int rx; 136 int rx;
137 137
138 /* @@@ Have to stop polling when nds[0] is administratively
139 * downed while we are polling. */
140 rx = 0; 138 rx = 0;
141 do { 139 do {
142 ixp2000_reg_write(IXP2000_IRQ_THD_RAW_STATUS_A_0, 0x00ff); 140 ixp2000_reg_write(IXP2000_IRQ_THD_RAW_STATUS_A_0, 0x00ff);
diff --git a/drivers/net/meth.c b/drivers/net/meth.c
index 0c89b028a80c..cdaa8fc21809 100644
--- a/drivers/net/meth.c
+++ b/drivers/net/meth.c
@@ -95,11 +95,14 @@ static inline void load_eaddr(struct net_device *dev)
95{ 95{
96 int i; 96 int i;
97 DECLARE_MAC_BUF(mac); 97 DECLARE_MAC_BUF(mac);
98 u64 macaddr;
98 99
99 for (i = 0; i < 6; i++)
100 dev->dev_addr[i] = o2meth_eaddr[i];
101 DPRINTK("Loading MAC Address: %s\n", print_mac(mac, dev->dev_addr)); 100 DPRINTK("Loading MAC Address: %s\n", print_mac(mac, dev->dev_addr));
102 mace->eth.mac_addr = (*(unsigned long*)o2meth_eaddr) >> 16; 101 macaddr = 0;
102 for (i = 0; i < 6; i++)
103 macaddr |= dev->dev_addr[i] << ((5 - i) * 8);
104
105 mace->eth.mac_addr = macaddr;
103} 106}
104 107
105/* 108/*
@@ -794,6 +797,7 @@ static int __init meth_probe(struct platform_device *pdev)
794#endif 797#endif
795 dev->irq = MACE_ETHERNET_IRQ; 798 dev->irq = MACE_ETHERNET_IRQ;
796 dev->base_addr = (unsigned long)&mace->eth; 799 dev->base_addr = (unsigned long)&mace->eth;
800 memcpy(dev->dev_addr, o2meth_eaddr, 6);
797 801
798 priv = netdev_priv(dev); 802 priv = netdev_priv(dev);
799 spin_lock_init(&priv->meth_lock); 803 spin_lock_init(&priv->meth_lock);
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 8def8657251f..c90958f6d3fe 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -1239,7 +1239,7 @@ static int myri10ge_poll(struct napi_struct *napi, int budget)
1239 /* process as many rx events as NAPI will allow */ 1239 /* process as many rx events as NAPI will allow */
1240 work_done = myri10ge_clean_rx_done(mgp, budget); 1240 work_done = myri10ge_clean_rx_done(mgp, budget);
1241 1241
1242 if (work_done < budget || !netif_running(netdev)) { 1242 if (work_done < budget) {
1243 netif_rx_complete(netdev, napi); 1243 netif_rx_complete(netdev, napi);
1244 put_be32(htonl(3), mgp->irq_claim); 1244 put_be32(htonl(3), mgp->irq_claim);
1245 } 1245 }
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 87cde062fd63..c329a4f5840c 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -2266,7 +2266,7 @@ static int natsemi_poll(struct napi_struct *napi, int budget)
2266 /* Reenable interrupts providing nothing is trying to shut 2266 /* Reenable interrupts providing nothing is trying to shut
2267 * the chip down. */ 2267 * the chip down. */
2268 spin_lock(&np->lock); 2268 spin_lock(&np->lock);
2269 if (!np->hands_off && netif_running(dev)) 2269 if (!np->hands_off)
2270 natsemi_irq_enable(dev); 2270 natsemi_irq_enable(dev);
2271 spin_unlock(&np->lock); 2271 spin_unlock(&np->lock);
2272 2272
diff --git a/drivers/net/netx-eth.c b/drivers/net/netx-eth.c
index 5267e031daa0..78d34af13a1c 100644
--- a/drivers/net/netx-eth.c
+++ b/drivers/net/netx-eth.c
@@ -169,8 +169,8 @@ static void netx_eth_receive(struct net_device *ndev)
169 ndev->last_rx = jiffies; 169 ndev->last_rx = jiffies;
170 skb->protocol = eth_type_trans(skb, ndev); 170 skb->protocol = eth_type_trans(skb, ndev);
171 netif_rx(skb); 171 netif_rx(skb);
172 dev->stats.rx_packets++; 172 ndev->stats.rx_packets++;
173 dev->stats.rx_bytes += len; 173 ndev->stats.rx_bytes += len;
174} 174}
175 175
176static irqreturn_t 176static irqreturn_t
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index a80f0cd6b528..454226f7baa8 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -1321,7 +1321,7 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget)
1321 budget / MAX_RCV_CTX); 1321 budget / MAX_RCV_CTX);
1322 } 1322 }
1323 1323
1324 if (work_done >= budget && netxen_nic_rx_has_work(adapter) != 0) 1324 if (work_done >= budget)
1325 done = 0; 1325 done = 0;
1326 1326
1327 if (netxen_process_cmd_ring((unsigned long)adapter) == 0) 1327 if (netxen_process_cmd_ring((unsigned long)adapter) == 0)
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index abfc61c3a38c..9a0c6d3adfe9 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -33,8 +33,8 @@
33 33
34#define DRV_MODULE_NAME "niu" 34#define DRV_MODULE_NAME "niu"
35#define PFX DRV_MODULE_NAME ": " 35#define PFX DRV_MODULE_NAME ": "
36#define DRV_MODULE_VERSION "0.5" 36#define DRV_MODULE_VERSION "0.6"
37#define DRV_MODULE_RELDATE "October 5, 2007" 37#define DRV_MODULE_RELDATE "January 5, 2008"
38 38
39static char version[] __devinitdata = 39static char version[] __devinitdata =
40 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; 40 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
@@ -2241,6 +2241,8 @@ static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp)
2241 skb->protocol = eth_type_trans(skb, np->dev); 2241 skb->protocol = eth_type_trans(skb, np->dev);
2242 netif_receive_skb(skb); 2242 netif_receive_skb(skb);
2243 2243
2244 np->dev->last_rx = jiffies;
2245
2244 return num_rcr; 2246 return num_rcr;
2245} 2247}
2246 2248
@@ -2508,15 +2510,19 @@ static int niu_rx_error(struct niu *np, struct rx_ring_info *rp)
2508 u64 stat = nr64(RX_DMA_CTL_STAT(rp->rx_channel)); 2510 u64 stat = nr64(RX_DMA_CTL_STAT(rp->rx_channel));
2509 int err = 0; 2511 int err = 0;
2510 2512
2511 dev_err(np->device, PFX "%s: RX channel %u error, stat[%llx]\n",
2512 np->dev->name, rp->rx_channel, (unsigned long long) stat);
2513
2514 niu_log_rxchan_errors(np, rp, stat);
2515 2513
2516 if (stat & (RX_DMA_CTL_STAT_CHAN_FATAL | 2514 if (stat & (RX_DMA_CTL_STAT_CHAN_FATAL |
2517 RX_DMA_CTL_STAT_PORT_FATAL)) 2515 RX_DMA_CTL_STAT_PORT_FATAL))
2518 err = -EINVAL; 2516 err = -EINVAL;
2519 2517
2518 if (err) {
2519 dev_err(np->device, PFX "%s: RX channel %u error, stat[%llx]\n",
2520 np->dev->name, rp->rx_channel,
2521 (unsigned long long) stat);
2522
2523 niu_log_rxchan_errors(np, rp, stat);
2524 }
2525
2520 nw64(RX_DMA_CTL_STAT(rp->rx_channel), 2526 nw64(RX_DMA_CTL_STAT(rp->rx_channel),
2521 stat & RX_DMA_CTL_WRITE_CLEAR_ERRS); 2527 stat & RX_DMA_CTL_WRITE_CLEAR_ERRS);
2522 2528
@@ -2749,13 +2755,16 @@ static int niu_device_error(struct niu *np)
2749 return -ENODEV; 2755 return -ENODEV;
2750} 2756}
2751 2757
2752static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp) 2758static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp,
2759 u64 v0, u64 v1, u64 v2)
2753{ 2760{
2754 u64 v0 = lp->v0; 2761
2755 u64 v1 = lp->v1;
2756 u64 v2 = lp->v2;
2757 int i, err = 0; 2762 int i, err = 0;
2758 2763
2764 lp->v0 = v0;
2765 lp->v1 = v1;
2766 lp->v2 = v2;
2767
2759 if (v1 & 0x00000000ffffffffULL) { 2768 if (v1 & 0x00000000ffffffffULL) {
2760 u32 rx_vec = (v1 & 0xffffffff); 2769 u32 rx_vec = (v1 & 0xffffffff);
2761 2770
@@ -2764,8 +2773,13 @@ static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp)
2764 2773
2765 if (rx_vec & (1 << rp->rx_channel)) { 2774 if (rx_vec & (1 << rp->rx_channel)) {
2766 int r = niu_rx_error(np, rp); 2775 int r = niu_rx_error(np, rp);
2767 if (r) 2776 if (r) {
2768 err = r; 2777 err = r;
2778 } else {
2779 if (!v0)
2780 nw64(RX_DMA_CTL_STAT(rp->rx_channel),
2781 RX_DMA_CTL_STAT_MEX);
2782 }
2769 } 2783 }
2770 } 2784 }
2771 } 2785 }
@@ -2803,7 +2817,7 @@ static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp)
2803 if (err) 2817 if (err)
2804 niu_enable_interrupts(np, 0); 2818 niu_enable_interrupts(np, 0);
2805 2819
2806 return -EINVAL; 2820 return err;
2807} 2821}
2808 2822
2809static void niu_rxchan_intr(struct niu *np, struct rx_ring_info *rp, 2823static void niu_rxchan_intr(struct niu *np, struct rx_ring_info *rp,
@@ -2905,7 +2919,7 @@ static irqreturn_t niu_interrupt(int irq, void *dev_id)
2905 } 2919 }
2906 2920
2907 if (unlikely((v0 & ((u64)1 << LDN_MIF)) || v1 || v2)) { 2921 if (unlikely((v0 & ((u64)1 << LDN_MIF)) || v1 || v2)) {
2908 int err = niu_slowpath_interrupt(np, lp); 2922 int err = niu_slowpath_interrupt(np, lp, v0, v1, v2);
2909 if (err) 2923 if (err)
2910 goto out; 2924 goto out;
2911 } 2925 }
@@ -5194,7 +5208,8 @@ static int niu_start_xmit(struct sk_buff *skb, struct net_device *dev)
5194 } 5208 }
5195 kfree_skb(skb); 5209 kfree_skb(skb);
5196 skb = skb_new; 5210 skb = skb_new;
5197 } 5211 } else
5212 skb_orphan(skb);
5198 5213
5199 align = ((unsigned long) skb->data & (16 - 1)); 5214 align = ((unsigned long) skb->data & (16 - 1));
5200 headroom = align + sizeof(struct tx_pkt_hdr); 5215 headroom = align + sizeof(struct tx_pkt_hdr);
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index ff92aca0a7b3..90498ffe26f2 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -455,9 +455,14 @@ static void pcnet32_netif_start(struct net_device *dev)
455{ 455{
456#ifdef CONFIG_PCNET32_NAPI 456#ifdef CONFIG_PCNET32_NAPI
457 struct pcnet32_private *lp = netdev_priv(dev); 457 struct pcnet32_private *lp = netdev_priv(dev);
458 ulong ioaddr = dev->base_addr;
459 u16 val;
458#endif 460#endif
459 netif_wake_queue(dev); 461 netif_wake_queue(dev);
460#ifdef CONFIG_PCNET32_NAPI 462#ifdef CONFIG_PCNET32_NAPI
463 val = lp->a.read_csr(ioaddr, CSR3);
464 val &= 0x00ff;
465 lp->a.write_csr(ioaddr, CSR3, val);
461 napi_enable(&lp->napi); 466 napi_enable(&lp->napi);
462#endif 467#endif
463} 468}
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index a5791114b7bd..cf0774de6c41 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -2320,14 +2320,9 @@ static int ql_poll(struct napi_struct *napi, int budget)
2320 unsigned long hw_flags; 2320 unsigned long hw_flags;
2321 struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; 2321 struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers;
2322 2322
2323 if (!netif_carrier_ok(ndev))
2324 goto quit_polling;
2325
2326 ql_tx_rx_clean(qdev, &tx_cleaned, &rx_cleaned, budget); 2323 ql_tx_rx_clean(qdev, &tx_cleaned, &rx_cleaned, budget);
2327 2324
2328 if (tx_cleaned + rx_cleaned != budget || 2325 if (tx_cleaned + rx_cleaned != budget) {
2329 !netif_running(ndev)) {
2330quit_polling:
2331 spin_lock_irqsave(&qdev->hw_lock, hw_flags); 2326 spin_lock_irqsave(&qdev->hw_lock, hw_flags);
2332 __netif_rx_complete(ndev, napi); 2327 __netif_rx_complete(ndev, napi);
2333 ql_update_small_bufq_prod_index(qdev); 2328 ql_update_small_bufq_prod_index(qdev);
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 5863190894cc..af8030981f10 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2398,6 +2398,8 @@ static void rtl8169_wait_for_quiescence(struct net_device *dev)
2398 rtl8169_irq_mask_and_ack(ioaddr); 2398 rtl8169_irq_mask_and_ack(ioaddr);
2399 2399
2400#ifdef CONFIG_R8169_NAPI 2400#ifdef CONFIG_R8169_NAPI
2401 tp->intr_mask = 0xffff;
2402 RTL_W16(IntrMask, tp->intr_event);
2401 napi_enable(&tp->napi); 2403 napi_enable(&tp->napi);
2402#endif 2404#endif
2403} 2405}
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 9d80f1cf73ac..fa57c49c0c51 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2704,9 +2704,6 @@ static int s2io_poll(struct napi_struct *napi, int budget)
2704 struct XENA_dev_config __iomem *bar0 = nic->bar0; 2704 struct XENA_dev_config __iomem *bar0 = nic->bar0;
2705 int i; 2705 int i;
2706 2706
2707 if (!is_s2io_card_up(nic))
2708 return 0;
2709
2710 mac_control = &nic->mac_control; 2707 mac_control = &nic->mac_control;
2711 config = &nic->config; 2708 config = &nic->config;
2712 2709
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index a74fc11a6482..52ec89b82f64 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1168,6 +1168,7 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp
1168 TX_VLAN_TAG_OFF); 1168 TX_VLAN_TAG_OFF);
1169 } 1169 }
1170 1170
1171 sky2_read32(hw, B0_Y2_SP_LISR);
1171 napi_enable(&hw->napi); 1172 napi_enable(&hw->napi);
1172 netif_tx_unlock_bh(dev); 1173 netif_tx_unlock_bh(dev);
1173} 1174}
@@ -2043,6 +2044,7 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu)
2043 err = sky2_rx_start(sky2); 2044 err = sky2_rx_start(sky2);
2044 sky2_write32(hw, B0_IMSK, imask); 2045 sky2_write32(hw, B0_IMSK, imask);
2045 2046
2047 sky2_read32(hw, B0_Y2_SP_LISR);
2046 napi_enable(&hw->napi); 2048 napi_enable(&hw->napi);
2047 2049
2048 if (err) 2050 if (err)
@@ -3861,6 +3863,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
3861 last = sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_PUT_IDX)), 3863 last = sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_PUT_IDX)),
3862 sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_LAST_IDX))); 3864 sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_LAST_IDX)));
3863 3865
3866 sky2_read32(hw, B0_Y2_SP_LISR);
3864 napi_enable(&hw->napi); 3867 napi_enable(&hw->napi);
3865 return 0; 3868 return 0;
3866} 3869}
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c
index 365331446387..6284afd14bbb 100644
--- a/drivers/net/tulip/interrupt.c
+++ b/drivers/net/tulip/interrupt.c
@@ -117,9 +117,6 @@ int tulip_poll(struct napi_struct *napi, int budget)
117 int received = 0; 117 int received = 0;
118#endif 118#endif
119 119
120 if (!netif_running(dev))
121 goto done;
122
123#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION 120#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
124 121
125/* that one buffer is needed for mit activation; or might be a 122/* that one buffer is needed for mit activation; or might be a
@@ -151,7 +148,8 @@ int tulip_poll(struct napi_struct *napi, int budget)
151 if (tulip_debug > 5) 148 if (tulip_debug > 5)
152 printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n", 149 printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n",
153 dev->name, entry, status); 150 dev->name, entry, status);
154 if (work_done++ >= budget) 151
152 if (++work_done >= budget)
155 goto not_done; 153 goto not_done;
156 154
157 if ((status & 0x38008300) != 0x0300) { 155 if ((status & 0x38008300) != 0x0300) {
@@ -260,8 +258,6 @@ int tulip_poll(struct napi_struct *napi, int budget)
260 * finally: amount of IO did not increase at all. */ 258 * finally: amount of IO did not increase at all. */
261 } while ((ioread32(tp->base_addr + CSR5) & RxIntr)); 259 } while ((ioread32(tp->base_addr + CSR5) & RxIntr));
262 260
263done:
264
265 #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION 261 #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
266 262
267 /* We use this simplistic scheme for IM. It's proven by 263 /* We use this simplistic scheme for IM. It's proven by
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 58a53a641754..569ad8bfd383 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -70,7 +70,7 @@
70#define KAWETH_TX_TIMEOUT (5 * HZ) 70#define KAWETH_TX_TIMEOUT (5 * HZ)
71#define KAWETH_SCRATCH_SIZE 32 71#define KAWETH_SCRATCH_SIZE 32
72#define KAWETH_FIRMWARE_BUF_SIZE 4096 72#define KAWETH_FIRMWARE_BUF_SIZE 4096
73#define KAWETH_CONTROL_TIMEOUT (30 * HZ) 73#define KAWETH_CONTROL_TIMEOUT (30000)
74 74
75#define KAWETH_STATUS_BROKEN 0x0000001 75#define KAWETH_STATUS_BROKEN 0x0000001
76#define KAWETH_STATUS_CLOSING 0x0000002 76#define KAWETH_STATUS_CLOSING 0x0000002
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index f55a5951733a..5ea7411e1337 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -94,7 +94,7 @@ static int mcs7830_get_reg(struct usbnet *dev, u16 index, u16 size, void *data)
94 94
95 ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ, 95 ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ,
96 MCS7830_RD_BMREQ, 0x0000, index, data, 96 MCS7830_RD_BMREQ, 0x0000, index, data,
97 size, msecs_to_jiffies(MCS7830_CTRL_TIMEOUT)); 97 size, MCS7830_CTRL_TIMEOUT);
98 return ret; 98 return ret;
99} 99}
100 100
@@ -105,7 +105,7 @@ static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, void *data)
105 105
106 ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ, 106 ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ,
107 MCS7830_WR_BMREQ, 0x0000, index, data, 107 MCS7830_WR_BMREQ, 0x0000, index, data,
108 size, msecs_to_jiffies(MCS7830_CTRL_TIMEOUT)); 108 size, MCS7830_CTRL_TIMEOUT);
109 return ret; 109 return ret;
110} 110}
111 111
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index a28ad230d63e..7b6fc1ab2b90 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -273,6 +273,8 @@ enum {
273#define B43_PHYTYPE_A 0x00 273#define B43_PHYTYPE_A 0x00
274#define B43_PHYTYPE_B 0x01 274#define B43_PHYTYPE_B 0x01
275#define B43_PHYTYPE_G 0x02 275#define B43_PHYTYPE_G 0x02
276#define B43_PHYTYPE_N 0x04
277#define B43_PHYTYPE_LP 0x05
276 278
277/* PHYRegisters */ 279/* PHYRegisters */
278#define B43_PHY_ILT_A_CTRL 0x0072 280#define B43_PHY_ILT_A_CTRL 0x0072
diff --git a/drivers/net/wireless/b43/main.h b/drivers/net/wireless/b43/main.h
index 284d17da17d1..08e2e56e48f4 100644
--- a/drivers/net/wireless/b43/main.h
+++ b/drivers/net/wireless/b43/main.h
@@ -39,11 +39,11 @@
39#define PAD_BYTES(nr_bytes) P4D_BYTES( __LINE__ , (nr_bytes)) 39#define PAD_BYTES(nr_bytes) P4D_BYTES( __LINE__ , (nr_bytes))
40 40
41/* Lightweight function to convert a frequency (in Mhz) to a channel number. */ 41/* Lightweight function to convert a frequency (in Mhz) to a channel number. */
42static inline u8 b43_freq_to_channel_a(int freq) 42static inline u8 b43_freq_to_channel_5ghz(int freq)
43{ 43{
44 return ((freq - 5000) / 5); 44 return ((freq - 5000) / 5);
45} 45}
46static inline u8 b43_freq_to_channel_bg(int freq) 46static inline u8 b43_freq_to_channel_2ghz(int freq)
47{ 47{
48 u8 channel; 48 u8 channel;
49 49
@@ -54,19 +54,13 @@ static inline u8 b43_freq_to_channel_bg(int freq)
54 54
55 return channel; 55 return channel;
56} 56}
57static inline u8 b43_freq_to_channel(struct b43_wldev *dev, int freq)
58{
59 if (dev->phy.type == B43_PHYTYPE_A)
60 return b43_freq_to_channel_a(freq);
61 return b43_freq_to_channel_bg(freq);
62}
63 57
64/* Lightweight function to convert a channel number to a frequency (in Mhz). */ 58/* Lightweight function to convert a channel number to a frequency (in Mhz). */
65static inline int b43_channel_to_freq_a(u8 channel) 59static inline int b43_channel_to_freq_5ghz(u8 channel)
66{ 60{
67 return (5000 + (5 * channel)); 61 return (5000 + (5 * channel));
68} 62}
69static inline int b43_channel_to_freq_bg(u8 channel) 63static inline int b43_channel_to_freq_2ghz(u8 channel)
70{ 64{
71 int freq; 65 int freq;
72 66
@@ -77,12 +71,6 @@ static inline int b43_channel_to_freq_bg(u8 channel)
77 71
78 return freq; 72 return freq;
79} 73}
80static inline int b43_channel_to_freq(struct b43_wldev *dev, u8 channel)
81{
82 if (dev->phy.type == B43_PHYTYPE_A)
83 return b43_channel_to_freq_a(channel);
84 return b43_channel_to_freq_bg(channel);
85}
86 74
87static inline int b43_is_cck_rate(int rate) 75static inline int b43_is_cck_rate(int rate)
88{ 76{
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index 0bd6f8a348a8..3307ba1856b1 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -531,21 +531,32 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
531 switch (chanstat & B43_RX_CHAN_PHYTYPE) { 531 switch (chanstat & B43_RX_CHAN_PHYTYPE) {
532 case B43_PHYTYPE_A: 532 case B43_PHYTYPE_A:
533 status.phymode = MODE_IEEE80211A; 533 status.phymode = MODE_IEEE80211A;
534 status.freq = chanid; 534 B43_WARN_ON(1);
535 status.channel = b43_freq_to_channel_a(chanid); 535 /* FIXME: We don't really know which value the "chanid" contains.
536 break; 536 * So the following assignment might be wrong. */
537 case B43_PHYTYPE_B: 537 status.channel = chanid;
538 status.phymode = MODE_IEEE80211B; 538 status.freq = b43_channel_to_freq_5ghz(status.channel);
539 status.freq = chanid + 2400;
540 status.channel = b43_freq_to_channel_bg(chanid + 2400);
541 break; 539 break;
542 case B43_PHYTYPE_G: 540 case B43_PHYTYPE_G:
543 status.phymode = MODE_IEEE80211G; 541 status.phymode = MODE_IEEE80211G;
542 /* chanid is the radio channel cookie value as used
543 * to tune the radio. */
544 status.freq = chanid + 2400; 544 status.freq = chanid + 2400;
545 status.channel = b43_freq_to_channel_bg(chanid + 2400); 545 status.channel = b43_freq_to_channel_2ghz(status.freq);
546 break;
547 case B43_PHYTYPE_N:
548 status.phymode = 0xDEAD /*FIXME MODE_IEEE80211N*/;
549 /* chanid is the SHM channel cookie. Which is the plain
550 * channel number in b43. */
551 status.channel = chanid;
552 if (chanstat & B43_RX_CHAN_5GHZ)
553 status.freq = b43_freq_to_channel_5ghz(status.freq);
554 else
555 status.freq = b43_freq_to_channel_2ghz(status.freq);
546 break; 556 break;
547 default: 557 default:
548 B43_WARN_ON(1); 558 B43_WARN_ON(1);
559 goto drop;
549 } 560 }
550 561
551 dev->stats.last_rx = jiffies; 562 dev->stats.last_rx = jiffies;
diff --git a/drivers/net/wireless/b43/xmit.h b/drivers/net/wireless/b43/xmit.h
index 03bddd251618..6dc079382f7f 100644
--- a/drivers/net/wireless/b43/xmit.h
+++ b/drivers/net/wireless/b43/xmit.h
@@ -142,49 +142,56 @@ struct b43_rxhdr_fw4 {
142} __attribute__ ((__packed__)); 142} __attribute__ ((__packed__));
143 143
144/* PHY RX Status 0 */ 144/* PHY RX Status 0 */
145#define B43_RX_PHYST0_GAINCTL 0x4000 /* Gain Control */ 145#define B43_RX_PHYST0_GAINCTL 0x4000 /* Gain Control */
146#define B43_RX_PHYST0_PLCPHCF 0x0200 146#define B43_RX_PHYST0_PLCPHCF 0x0200
147#define B43_RX_PHYST0_PLCPFV 0x0100 147#define B43_RX_PHYST0_PLCPFV 0x0100
148#define B43_RX_PHYST0_SHORTPRMBL 0x0080 /* Received with Short Preamble */ 148#define B43_RX_PHYST0_SHORTPRMBL 0x0080 /* Received with Short Preamble */
149#define B43_RX_PHYST0_LCRS 0x0040 149#define B43_RX_PHYST0_LCRS 0x0040
150#define B43_RX_PHYST0_ANT 0x0020 /* Antenna */ 150#define B43_RX_PHYST0_ANT 0x0020 /* Antenna */
151#define B43_RX_PHYST0_UNSRATE 0x0010 151#define B43_RX_PHYST0_UNSRATE 0x0010
152#define B43_RX_PHYST0_CLIP 0x000C 152#define B43_RX_PHYST0_CLIP 0x000C
153#define B43_RX_PHYST0_CLIP_SHIFT 2 153#define B43_RX_PHYST0_CLIP_SHIFT 2
154#define B43_RX_PHYST0_FTYPE 0x0003 /* Frame type */ 154#define B43_RX_PHYST0_FTYPE 0x0003 /* Frame type */
155#define B43_RX_PHYST0_CCK 0x0000 /* Frame type: CCK */ 155#define B43_RX_PHYST0_CCK 0x0000 /* Frame type: CCK */
156#define B43_RX_PHYST0_OFDM 0x0001 /* Frame type: OFDM */ 156#define B43_RX_PHYST0_OFDM 0x0001 /* Frame type: OFDM */
157#define B43_RX_PHYST0_PRE_N 0x0002 /* Pre-standard N-PHY frame */ 157#define B43_RX_PHYST0_PRE_N 0x0002 /* Pre-standard N-PHY frame */
158#define B43_RX_PHYST0_STD_N 0x0003 /* Standard N-PHY frame */ 158#define B43_RX_PHYST0_STD_N 0x0003 /* Standard N-PHY frame */
159 159
160/* PHY RX Status 2 */ 160/* PHY RX Status 2 */
161#define B43_RX_PHYST2_LNAG 0xC000 /* LNA Gain */ 161#define B43_RX_PHYST2_LNAG 0xC000 /* LNA Gain */
162#define B43_RX_PHYST2_LNAG_SHIFT 14 162#define B43_RX_PHYST2_LNAG_SHIFT 14
163#define B43_RX_PHYST2_PNAG 0x3C00 /* PNA Gain */ 163#define B43_RX_PHYST2_PNAG 0x3C00 /* PNA Gain */
164#define B43_RX_PHYST2_PNAG_SHIFT 10 164#define B43_RX_PHYST2_PNAG_SHIFT 10
165#define B43_RX_PHYST2_FOFF 0x03FF /* F offset */ 165#define B43_RX_PHYST2_FOFF 0x03FF /* F offset */
166 166
167/* PHY RX Status 3 */ 167/* PHY RX Status 3 */
168#define B43_RX_PHYST3_DIGG 0x1800 /* DIG Gain */ 168#define B43_RX_PHYST3_DIGG 0x1800 /* DIG Gain */
169#define B43_RX_PHYST3_DIGG_SHIFT 11 169#define B43_RX_PHYST3_DIGG_SHIFT 11
170#define B43_RX_PHYST3_TRSTATE 0x0400 /* TR state */ 170#define B43_RX_PHYST3_TRSTATE 0x0400 /* TR state */
171 171
172/* MAC RX Status */ 172/* MAC RX Status */
173#define B43_RX_MAC_BEACONSENT 0x00008000 /* Beacon send flag */ 173#define B43_RX_MAC_RXST_VALID 0x01000000 /* PHY RXST valid */
174#define B43_RX_MAC_KEYIDX 0x000007E0 /* Key index */ 174#define B43_RX_MAC_TKIP_MICERR 0x00100000 /* TKIP MIC error */
175#define B43_RX_MAC_KEYIDX_SHIFT 5 175#define B43_RX_MAC_TKIP_MICATT 0x00080000 /* TKIP MIC attempted */
176#define B43_RX_MAC_DECERR 0x00000010 /* Decrypt error */ 176#define B43_RX_MAC_AGGTYPE 0x00060000 /* Aggregation type */
177#define B43_RX_MAC_DEC 0x00000008 /* Decryption attempted */ 177#define B43_RX_MAC_AGGTYPE_SHIFT 17
178#define B43_RX_MAC_PADDING 0x00000004 /* Pad bytes present */ 178#define B43_RX_MAC_AMSDU 0x00010000 /* A-MSDU mask */
179#define B43_RX_MAC_RESP 0x00000002 /* Response frame transmitted */ 179#define B43_RX_MAC_BEACONSENT 0x00008000 /* Beacon sent flag */
180#define B43_RX_MAC_FCSERR 0x00000001 /* FCS error */ 180#define B43_RX_MAC_KEYIDX 0x000007E0 /* Key index */
181#define B43_RX_MAC_KEYIDX_SHIFT 5
182#define B43_RX_MAC_DECERR 0x00000010 /* Decrypt error */
183#define B43_RX_MAC_DEC 0x00000008 /* Decryption attempted */
184#define B43_RX_MAC_PADDING 0x00000004 /* Pad bytes present */
185#define B43_RX_MAC_RESP 0x00000002 /* Response frame transmitted */
186#define B43_RX_MAC_FCSERR 0x00000001 /* FCS error */
181 187
182/* RX channel */ 188/* RX channel */
183#define B43_RX_CHAN_GAIN 0xFC00 /* Gain */ 189#define B43_RX_CHAN_40MHZ 0x1000 /* 40 Mhz channel width */
184#define B43_RX_CHAN_GAIN_SHIFT 10 190#define B43_RX_CHAN_5GHZ 0x0800 /* 5 Ghz band */
185#define B43_RX_CHAN_ID 0x03FC /* Channel ID */ 191#define B43_RX_CHAN_ID 0x07F8 /* Channel ID */
186#define B43_RX_CHAN_ID_SHIFT 2 192#define B43_RX_CHAN_ID_SHIFT 3
187#define B43_RX_CHAN_PHYTYPE 0x0003 /* PHY type */ 193#define B43_RX_CHAN_PHYTYPE 0x0007 /* PHY type */
194
188 195
189u8 b43_plcp_get_ratecode_cck(const u8 bitrate); 196u8 b43_plcp_get_ratecode_cck(const u8 bitrate);
190u8 b43_plcp_get_ratecode_ofdm(const u8 bitrate); 197u8 b43_plcp_get_ratecode_ofdm(const u8 bitrate);
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 2a8fc431099f..bca37bf0f545 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -852,11 +852,6 @@ static int xennet_poll(struct napi_struct *napi, int budget)
852 852
853 spin_lock(&np->rx_lock); 853 spin_lock(&np->rx_lock);
854 854
855 if (unlikely(!netif_carrier_ok(dev))) {
856 spin_unlock(&np->rx_lock);
857 return 0;
858 }
859
860 skb_queue_head_init(&rxq); 855 skb_queue_head_init(&rxq);
861 skb_queue_head_init(&errq); 856 skb_queue_head_init(&errq);
862 skb_queue_head_init(&tmpq); 857 skb_queue_head_init(&tmpq);
diff --git a/drivers/ssb/scan.c b/drivers/ssb/scan.c
index 96258c60919d..63ee5cfbefbb 100644
--- a/drivers/ssb/scan.c
+++ b/drivers/ssb/scan.c
@@ -388,6 +388,17 @@ int ssb_bus_scan(struct ssb_bus *bus,
388 case SSB_DEV_PCI: 388 case SSB_DEV_PCI:
389 case SSB_DEV_PCIE: 389 case SSB_DEV_PCIE:
390#ifdef CONFIG_SSB_DRIVER_PCICORE 390#ifdef CONFIG_SSB_DRIVER_PCICORE
391 if (bus->bustype == SSB_BUSTYPE_PCI) {
392 /* Ignore PCI cores on PCI-E cards.
393 * Ignore PCI-E cores on PCI cards. */
394 if (dev->id.coreid == SSB_DEV_PCI) {
395 if (bus->host_pci->is_pcie)
396 continue;
397 } else {
398 if (!bus->host_pci->is_pcie)
399 continue;
400 }
401 }
391 if (bus->pcicore.dev) { 402 if (bus->pcicore.dev) {
392 ssb_printk(KERN_WARNING PFX 403 ssb_printk(KERN_WARNING PFX
393 "WARNING: Multiple PCI(E) cores found\n"); 404 "WARNING: Multiple PCI(E) cores found\n");
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1e6af4f174b6..b0813c3286b1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -319,21 +319,29 @@ struct napi_struct {
319enum 319enum
320{ 320{
321 NAPI_STATE_SCHED, /* Poll is scheduled */ 321 NAPI_STATE_SCHED, /* Poll is scheduled */
322 NAPI_STATE_DISABLE, /* Disable pending */
322}; 323};
323 324
324extern void FASTCALL(__napi_schedule(struct napi_struct *n)); 325extern void FASTCALL(__napi_schedule(struct napi_struct *n));
325 326
327static inline int napi_disable_pending(struct napi_struct *n)
328{
329 return test_bit(NAPI_STATE_DISABLE, &n->state);
330}
331
326/** 332/**
327 * napi_schedule_prep - check if napi can be scheduled 333 * napi_schedule_prep - check if napi can be scheduled
328 * @n: napi context 334 * @n: napi context
329 * 335 *
330 * Test if NAPI routine is already running, and if not mark 336 * Test if NAPI routine is already running, and if not mark
331 * it as running. This is used as a condition variable 337 * it as running. This is used as a condition variable
332 * insure only one NAPI poll instance runs 338 * insure only one NAPI poll instance runs. We also make
339 * sure there is no pending NAPI disable.
333 */ 340 */
334static inline int napi_schedule_prep(struct napi_struct *n) 341static inline int napi_schedule_prep(struct napi_struct *n)
335{ 342{
336 return !test_and_set_bit(NAPI_STATE_SCHED, &n->state); 343 return !napi_disable_pending(n) &&
344 !test_and_set_bit(NAPI_STATE_SCHED, &n->state);
337} 345}
338 346
339/** 347/**
@@ -389,8 +397,10 @@ static inline void napi_complete(struct napi_struct *n)
389 */ 397 */
390static inline void napi_disable(struct napi_struct *n) 398static inline void napi_disable(struct napi_struct *n)
391{ 399{
400 set_bit(NAPI_STATE_DISABLE, &n->state);
392 while (test_and_set_bit(NAPI_STATE_SCHED, &n->state)) 401 while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
393 msleep(1); 402 msleep(1);
403 clear_bit(NAPI_STATE_DISABLE, &n->state);
394} 404}
395 405
396/** 406/**
@@ -1268,7 +1278,7 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
1268static inline int netif_rx_schedule_prep(struct net_device *dev, 1278static inline int netif_rx_schedule_prep(struct net_device *dev,
1269 struct napi_struct *napi) 1279 struct napi_struct *napi)
1270{ 1280{
1271 return netif_running(dev) && napi_schedule_prep(napi); 1281 return napi_schedule_prep(napi);
1272} 1282}
1273 1283
1274/* Add interface to tail of rx poll list. This assumes that _prep has 1284/* Add interface to tail of rx poll list. This assumes that _prep has
@@ -1277,7 +1287,6 @@ static inline int netif_rx_schedule_prep(struct net_device *dev,
1277static inline void __netif_rx_schedule(struct net_device *dev, 1287static inline void __netif_rx_schedule(struct net_device *dev,
1278 struct napi_struct *napi) 1288 struct napi_struct *napi)
1279{ 1289{
1280 dev_hold(dev);
1281 __napi_schedule(napi); 1290 __napi_schedule(napi);
1282} 1291}
1283 1292
@@ -1308,7 +1317,6 @@ static inline void __netif_rx_complete(struct net_device *dev,
1308 struct napi_struct *napi) 1317 struct napi_struct *napi)
1309{ 1318{
1310 __napi_complete(napi); 1319 __napi_complete(napi);
1311 dev_put(dev);
1312} 1320}
1313 1321
1314/* Remove interface from poll list: it must be in the poll list 1322/* Remove interface from poll list: it must be in the poll list
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index c9265518a378..4c3b35153c37 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -325,7 +325,6 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask)
325 n->tc_verd = SET_TC_VERD(n->tc_verd, 0); 325 n->tc_verd = SET_TC_VERD(n->tc_verd, 0);
326 n->tc_verd = CLR_TC_OK2MUNGE(n->tc_verd); 326 n->tc_verd = CLR_TC_OK2MUNGE(n->tc_verd);
327 n->tc_verd = CLR_TC_MUNGED(n->tc_verd); 327 n->tc_verd = CLR_TC_MUNGED(n->tc_verd);
328 n->iif = skb->iif;
329 } 328 }
330 return n; 329 return n;
331} 330}
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 00848b641f59..954090b1e354 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -450,7 +450,7 @@ enum sctp_sn_type {
450 SCTP_SHUTDOWN_EVENT, 450 SCTP_SHUTDOWN_EVENT,
451 SCTP_PARTIAL_DELIVERY_EVENT, 451 SCTP_PARTIAL_DELIVERY_EVENT,
452 SCTP_ADAPTATION_INDICATION, 452 SCTP_ADAPTATION_INDICATION,
453 SCTP_AUTHENTICATION_EVENT, 453 SCTP_AUTHENTICATION_INDICATION,
454}; 454};
455 455
456/* Notification error codes used to fill up the error fields in some 456/* Notification error codes used to fill up the error fields in some
diff --git a/include/net/sock.h b/include/net/sock.h
index 67e35c7e230c..6e1542da33a1 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -944,7 +944,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
944 return err; 944 return err;
945 945
946 rcu_read_lock_bh(); 946 rcu_read_lock_bh();
947 filter = sk->sk_filter; 947 filter = rcu_dereference(sk->sk_filter);
948 if (filter) { 948 if (filter) {
949 unsigned int pkt_len = sk_run_filter(skb, filter->insns, 949 unsigned int pkt_len = sk_run_filter(skb, filter->insns,
950 filter->len); 950 filter->len);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 58dfa82889aa..1dd20cf17982 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1188,10 +1188,15 @@ static inline int xfrm_aevent_is_on(void)
1188 return ret; 1188 return ret;
1189} 1189}
1190 1190
1191static inline int xfrm_alg_len(struct xfrm_algo *alg)
1192{
1193 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
1194}
1195
1191#ifdef CONFIG_XFRM_MIGRATE 1196#ifdef CONFIG_XFRM_MIGRATE
1192static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig) 1197static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig)
1193{ 1198{
1194 return (struct xfrm_algo *)kmemdup(orig, sizeof(*orig) + orig->alg_key_len, GFP_KERNEL); 1199 return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL);
1195} 1200}
1196 1201
1197static inline void xfrm_states_put(struct xfrm_state **states, int n) 1202static inline void xfrm_states_put(struct xfrm_state **states, int n)
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 2086396de177..9c7f712fc7e9 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -542,6 +542,13 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
542 if (eth->h_proto != htons(ETH_P_IP)) 542 if (eth->h_proto != htons(ETH_P_IP))
543 goto non_ip; /* Multi-Protocol Over ATM :-) */ 543 goto non_ip; /* Multi-Protocol Over ATM :-) */
544 544
545 /* Weed out funny packets (e.g., AF_PACKET or raw). */
546 if (skb->len < ETH_HLEN + sizeof(struct iphdr))
547 goto non_ip;
548 skb_set_network_header(skb, ETH_HLEN);
549 if (skb->len < ETH_HLEN + ip_hdr(skb)->ihl * 4 || ip_hdr(skb)->ihl < 5)
550 goto non_ip;
551
545 while (i < mpc->number_of_mps_macs) { 552 while (i < mpc->number_of_mps_macs) {
546 if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN))) 553 if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN)))
547 if ( send_via_shortcut(skb, mpc) == 0 ) /* try shortcut */ 554 if ( send_via_shortcut(skb, mpc) == 0 ) /* try shortcut */
diff --git a/net/core/dev.c b/net/core/dev.c
index be9d3015beaa..0879f52115eb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2207,8 +2207,12 @@ static void net_rx_action(struct softirq_action *h)
2207 * still "owns" the NAPI instance and therefore can 2207 * still "owns" the NAPI instance and therefore can
2208 * move the instance around on the list at-will. 2208 * move the instance around on the list at-will.
2209 */ 2209 */
2210 if (unlikely(work == weight)) 2210 if (unlikely(work == weight)) {
2211 list_move_tail(&n->poll_list, list); 2211 if (unlikely(napi_disable_pending(n)))
2212 __napi_complete(n);
2213 else
2214 list_move_tail(&n->poll_list, list);
2215 }
2212 2216
2213 netpoll_poll_unlock(have); 2217 netpoll_poll_unlock(have);
2214 } 2218 }
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 5b4ce9b4dd20..b6283779e93d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -416,16 +416,17 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
416 C(len); 416 C(len);
417 C(data_len); 417 C(data_len);
418 C(mac_len); 418 C(mac_len);
419 n->cloned = 1;
420 n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len; 419 n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len;
420 n->cloned = 1;
421 n->nohdr = 0; 421 n->nohdr = 0;
422 n->destructor = NULL; 422 n->destructor = NULL;
423 C(truesize); 423 C(iif);
424 atomic_set(&n->users, 1);
425 C(head);
426 C(data);
427 C(tail); 424 C(tail);
428 C(end); 425 C(end);
426 C(head);
427 C(data);
428 C(truesize);
429 atomic_set(&n->users, 1);
429 430
430 atomic_inc(&(skb_shinfo(skb)->dataref)); 431 atomic_inc(&(skb_shinfo(skb)->dataref));
431 skb->cloned = 1; 432 skb->cloned = 1;
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index 9a96c277393d..4a4d49fca1f2 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -310,7 +310,7 @@ static void lro_flush(struct net_lro_mgr *lro_mgr,
310 skb_shinfo(lro_desc->parent)->gso_size = lro_desc->mss; 310 skb_shinfo(lro_desc->parent)->gso_size = lro_desc->mss;
311 311
312 if (lro_desc->vgrp) { 312 if (lro_desc->vgrp) {
313 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 313 if (lro_mgr->features & LRO_F_NAPI)
314 vlan_hwaccel_receive_skb(lro_desc->parent, 314 vlan_hwaccel_receive_skb(lro_desc->parent,
315 lro_desc->vgrp, 315 lro_desc->vgrp,
316 lro_desc->vlan_tag); 316 lro_desc->vlan_tag);
@@ -320,7 +320,7 @@ static void lro_flush(struct net_lro_mgr *lro_mgr,
320 lro_desc->vlan_tag); 320 lro_desc->vlan_tag);
321 321
322 } else { 322 } else {
323 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 323 if (lro_mgr->features & LRO_F_NAPI)
324 netif_receive_skb(lro_desc->parent); 324 netif_receive_skb(lro_desc->parent);
325 else 325 else
326 netif_rx(lro_desc->parent); 326 netif_rx(lro_desc->parent);
@@ -352,7 +352,7 @@ static int __lro_proc_skb(struct net_lro_mgr *lro_mgr, struct sk_buff *skb,
352 goto out; 352 goto out;
353 353
354 if ((skb->protocol == htons(ETH_P_8021Q)) 354 if ((skb->protocol == htons(ETH_P_8021Q))
355 && !test_bit(LRO_F_EXTRACT_VLAN_ID, &lro_mgr->features)) 355 && !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
356 vlan_hdr_len = VLAN_HLEN; 356 vlan_hdr_len = VLAN_HLEN;
357 357
358 if (!lro_desc->active) { /* start new lro session */ 358 if (!lro_desc->active) { /* start new lro session */
@@ -474,7 +474,7 @@ static struct sk_buff *__lro_proc_segment(struct net_lro_mgr *lro_mgr,
474 goto out; 474 goto out;
475 475
476 if ((skb->protocol == htons(ETH_P_8021Q)) 476 if ((skb->protocol == htons(ETH_P_8021Q))
477 && !test_bit(LRO_F_EXTRACT_VLAN_ID, &lro_mgr->features)) 477 && !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
478 vlan_hdr_len = VLAN_HLEN; 478 vlan_hdr_len = VLAN_HLEN;
479 479
480 iph = (void *)(skb->data + vlan_hdr_len); 480 iph = (void *)(skb->data + vlan_hdr_len);
@@ -516,7 +516,7 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr,
516 void *priv) 516 void *priv)
517{ 517{
518 if (__lro_proc_skb(lro_mgr, skb, NULL, 0, priv)) { 518 if (__lro_proc_skb(lro_mgr, skb, NULL, 0, priv)) {
519 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 519 if (lro_mgr->features & LRO_F_NAPI)
520 netif_receive_skb(skb); 520 netif_receive_skb(skb);
521 else 521 else
522 netif_rx(skb); 522 netif_rx(skb);
@@ -531,7 +531,7 @@ void lro_vlan_hwaccel_receive_skb(struct net_lro_mgr *lro_mgr,
531 void *priv) 531 void *priv)
532{ 532{
533 if (__lro_proc_skb(lro_mgr, skb, vgrp, vlan_tag, priv)) { 533 if (__lro_proc_skb(lro_mgr, skb, vgrp, vlan_tag, priv)) {
534 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 534 if (lro_mgr->features & LRO_F_NAPI)
535 vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag); 535 vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag);
536 else 536 else
537 vlan_hwaccel_rx(skb, vgrp, vlan_tag); 537 vlan_hwaccel_rx(skb, vgrp, vlan_tag);
@@ -550,7 +550,7 @@ void lro_receive_frags(struct net_lro_mgr *lro_mgr,
550 if (!skb) 550 if (!skb)
551 return; 551 return;
552 552
553 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 553 if (lro_mgr->features & LRO_F_NAPI)
554 netif_receive_skb(skb); 554 netif_receive_skb(skb);
555 else 555 else
556 netif_rx(skb); 556 netif_rx(skb);
@@ -570,7 +570,7 @@ void lro_vlan_hwaccel_receive_frags(struct net_lro_mgr *lro_mgr,
570 if (!skb) 570 if (!skb)
571 return; 571 return;
572 572
573 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 573 if (lro_mgr->features & LRO_F_NAPI)
574 vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag); 574 vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag);
575 else 575 else
576 vlan_hwaccel_rx(skb, vgrp, vlan_tag); 576 vlan_hwaccel_rx(skb, vgrp, vlan_tag);
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 56a675734ea5..b8f7763b2261 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1404,8 +1404,7 @@ static int __init ic_proto_name(char *name)
1404 return 1; 1404 return 1;
1405 } 1405 }
1406 if (!strcmp(name, "off") || !strcmp(name, "none")) { 1406 if (!strcmp(name, "off") || !strcmp(name, "none")) {
1407 ic_enable = 0; 1407 return 0;
1408 return 1;
1409 } 1408 }
1410#ifdef CONFIG_IP_PNP_DHCP 1409#ifdef CONFIG_IP_PNP_DHCP
1411 else if (!strcmp(name, "dhcp")) { 1410 else if (!strcmp(name, "dhcp")) {
@@ -1442,10 +1441,22 @@ static int __init ip_auto_config_setup(char *addrs)
1442 ic_set_manually = 1; 1441 ic_set_manually = 1;
1443 ic_enable = 1; 1442 ic_enable = 1;
1444 1443
1444 /*
1445 * If any dhcp, bootp etc options are set, leave autoconfig on
1446 * and skip the below static IP processing.
1447 */
1445 if (ic_proto_name(addrs)) 1448 if (ic_proto_name(addrs))
1446 return 1; 1449 return 1;
1447 1450
1448 /* Parse the whole string */ 1451 /* If no static IP is given, turn off autoconfig and bail. */
1452 if (*addrs == 0 ||
1453 strcmp(addrs, "off") == 0 ||
1454 strcmp(addrs, "none") == 0) {
1455 ic_enable = 0;
1456 return 1;
1457 }
1458
1459 /* Parse string for static IP assignment. */
1449 ip = addrs; 1460 ip = addrs;
1450 while (ip && *ip) { 1461 while (ip && *ip) {
1451 if ((cp = strchr(ip, ':'))) 1462 if ((cp = strchr(ip, ':')))
@@ -1483,7 +1494,10 @@ static int __init ip_auto_config_setup(char *addrs)
1483 strlcpy(user_dev_name, ip, sizeof(user_dev_name)); 1494 strlcpy(user_dev_name, ip, sizeof(user_dev_name));
1484 break; 1495 break;
1485 case 6: 1496 case 6:
1486 ic_proto_name(ip); 1497 if (ic_proto_name(ip) == 0 &&
1498 ic_myaddr == NONE) {
1499 ic_enable = 0;
1500 }
1487 break; 1501 break;
1488 } 1502 }
1489 } 1503 }
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 66b42f547bf9..e7050f8eabeb 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -271,6 +271,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
271 int hh_len; 271 int hh_len;
272 struct iphdr *iph; 272 struct iphdr *iph;
273 struct sk_buff *skb; 273 struct sk_buff *skb;
274 unsigned int iphlen;
274 int err; 275 int err;
275 276
276 if (length > rt->u.dst.dev->mtu) { 277 if (length > rt->u.dst.dev->mtu) {
@@ -304,7 +305,8 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
304 goto error_fault; 305 goto error_fault;
305 306
306 /* We don't modify invalid header */ 307 /* We don't modify invalid header */
307 if (length >= sizeof(*iph) && iph->ihl * 4U <= length) { 308 iphlen = iph->ihl * 4;
309 if (iphlen >= sizeof(*iph) && iphlen <= length) {
308 if (!iph->saddr) 310 if (!iph->saddr)
309 iph->saddr = rt->rt_src; 311 iph->saddr = rt->rt_src;
310 iph->check = 0; 312 iph->check = 0;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d2bc6148a737..d3377069ce05 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2626,11 +2626,10 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
2626 int idx, s_idx; 2626 int idx, s_idx;
2627 2627
2628 s_h = cb->args[0]; 2628 s_h = cb->args[0];
2629 if (s_h < 0)
2630 s_h = 0;
2629 s_idx = idx = cb->args[1]; 2631 s_idx = idx = cb->args[1];
2630 for (h = 0; h <= rt_hash_mask; h++) { 2632 for (h = s_h; h <= rt_hash_mask; h++) {
2631 if (h < s_h) continue;
2632 if (h > s_h)
2633 s_idx = 0;
2634 rcu_read_lock_bh(); 2633 rcu_read_lock_bh();
2635 for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt; 2634 for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt;
2636 rt = rcu_dereference(rt->u.dst.rt_next), idx++) { 2635 rt = rcu_dereference(rt->u.dst.rt_next), idx++) {
@@ -2647,6 +2646,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
2647 dst_release(xchg(&skb->dst, NULL)); 2646 dst_release(xchg(&skb->dst, NULL));
2648 } 2647 }
2649 rcu_read_unlock_bh(); 2648 rcu_read_unlock_bh();
2649 s_idx = 0;
2650 } 2650 }
2651 2651
2652done: 2652done:
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 2ed689ac449e..5d4245ab4183 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -123,11 +123,11 @@ ipv4_connected:
123 goto out; 123 goto out;
124 } 124 }
125 sk->sk_bound_dev_if = usin->sin6_scope_id; 125 sk->sk_bound_dev_if = usin->sin6_scope_id;
126 if (!sk->sk_bound_dev_if &&
127 (addr_type & IPV6_ADDR_MULTICAST))
128 fl.oif = np->mcast_oif;
129 } 126 }
130 127
128 if (!sk->sk_bound_dev_if && (addr_type & IPV6_ADDR_MULTICAST))
129 sk->sk_bound_dev_if = np->mcast_oif;
130
131 /* Connect to link-local address requires an interface */ 131 /* Connect to link-local address requires an interface */
132 if (!sk->sk_bound_dev_if) { 132 if (!sk->sk_bound_dev_if) {
133 err = -EINVAL; 133 err = -EINVAL;
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 48ce59a6e026..d5e4dd75200b 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -1118,8 +1118,6 @@ static int irda_create(struct net *net, struct socket *sock, int protocol)
1118 self->max_sdu_size_rx = TTP_SAR_UNBOUND; 1118 self->max_sdu_size_rx = TTP_SAR_UNBOUND;
1119 break; 1119 break;
1120 default: 1120 default:
1121 IRDA_ERROR("%s: protocol not supported!\n",
1122 __FUNCTION__);
1123 return -ESOCKTNOSUPPORT; 1121 return -ESOCKTNOSUPPORT;
1124 } 1122 }
1125 break; 1123 break;
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 7027eed4d4ae..308bbe4a1333 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -591,7 +591,7 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev,
591 sdata->bss->force_unicast_rateidx = -1; 591 sdata->bss->force_unicast_rateidx = -1;
592 if (rate->value < 0) 592 if (rate->value < 0)
593 return 0; 593 return 0;
594 for (i=0; i< mode->num_rates; i++) { 594 for (i=0; i < mode->num_rates; i++) {
595 struct ieee80211_rate *rates = &mode->rates[i]; 595 struct ieee80211_rate *rates = &mode->rates[i];
596 int this_rate = rates->rate; 596 int this_rate = rates->rate;
597 597
@@ -599,10 +599,10 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev,
599 sdata->bss->max_ratectrl_rateidx = i; 599 sdata->bss->max_ratectrl_rateidx = i;
600 if (rate->fixed) 600 if (rate->fixed)
601 sdata->bss->force_unicast_rateidx = i; 601 sdata->bss->force_unicast_rateidx = i;
602 break; 602 return 0;
603 } 603 }
604 } 604 }
605 return 0; 605 return -EINVAL;
606} 606}
607 607
608static int ieee80211_ioctl_giwrate(struct net_device *dev, 608static int ieee80211_ioctl_giwrate(struct net_device *dev,
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index ed7c9e30ebc9..3cc629d3c9ff 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -210,6 +210,9 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
210 chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types); 210 chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types);
211 chunksize += sizeof(ecap_param); 211 chunksize += sizeof(ecap_param);
212 212
213 if (sctp_prsctp_enable)
214 chunksize += sizeof(prsctp_param);
215
213 /* ADDIP: Section 4.2.7: 216 /* ADDIP: Section 4.2.7:
214 * An implementation supporting this extension [ADDIP] MUST list 217 * An implementation supporting this extension [ADDIP] MUST list
215 * the ASCONF,the ASCONF-ACK, and the AUTH chunks in its INIT and 218 * the ASCONF,the ASCONF-ACK, and the AUTH chunks in its INIT and
@@ -369,6 +372,9 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
369 if (asoc->peer.ecn_capable) 372 if (asoc->peer.ecn_capable)
370 chunksize += sizeof(ecap_param); 373 chunksize += sizeof(ecap_param);
371 374
375 if (sctp_prsctp_enable)
376 chunksize += sizeof(prsctp_param);
377
372 if (sctp_addip_enable) { 378 if (sctp_addip_enable) {
373 extensions[num_ext] = SCTP_CID_ASCONF; 379 extensions[num_ext] = SCTP_CID_ASCONF;
374 extensions[num_ext+1] = SCTP_CID_ASCONF_ACK; 380 extensions[num_ext+1] = SCTP_CID_ASCONF_ACK;
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 5fb84778846d..d247ed4ee423 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1309,26 +1309,6 @@ static void sctp_tietags_populate(struct sctp_association *new_asoc,
1309 new_asoc->c.initial_tsn = asoc->c.initial_tsn; 1309 new_asoc->c.initial_tsn = asoc->c.initial_tsn;
1310} 1310}
1311 1311
1312static void sctp_auth_params_populate(struct sctp_association *new_asoc,
1313 const struct sctp_association *asoc)
1314{
1315 /* Only perform this if AUTH extension is enabled */
1316 if (!sctp_auth_enable)
1317 return;
1318
1319 /* We need to provide the same parameter information as
1320 * was in the original INIT. This means that we need to copy
1321 * the HMACS, CHUNKS, and RANDOM parameter from the original
1322 * assocaition.
1323 */
1324 memcpy(new_asoc->c.auth_random, asoc->c.auth_random,
1325 sizeof(asoc->c.auth_random));
1326 memcpy(new_asoc->c.auth_hmacs, asoc->c.auth_hmacs,
1327 sizeof(asoc->c.auth_hmacs));
1328 memcpy(new_asoc->c.auth_chunks, asoc->c.auth_chunks,
1329 sizeof(asoc->c.auth_chunks));
1330}
1331
1332/* 1312/*
1333 * Compare vtag/tietag values to determine unexpected COOKIE-ECHO 1313 * Compare vtag/tietag values to determine unexpected COOKIE-ECHO
1334 * handling action. 1314 * handling action.
@@ -1486,8 +1466,6 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
1486 1466
1487 sctp_tietags_populate(new_asoc, asoc); 1467 sctp_tietags_populate(new_asoc, asoc);
1488 1468
1489 sctp_auth_params_populate(new_asoc, asoc);
1490
1491 /* B) "Z" shall respond immediately with an INIT ACK chunk. */ 1469 /* B) "Z" shall respond immediately with an INIT ACK chunk. */
1492 1470
1493 /* If there are errors need to be reported for unknown parameters, 1471 /* If there are errors need to be reported for unknown parameters,
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index 2c17c7efad46..307314356e16 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -830,7 +830,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_authkey(
830 ak = (struct sctp_authkey_event *) 830 ak = (struct sctp_authkey_event *)
831 skb_put(skb, sizeof(struct sctp_authkey_event)); 831 skb_put(skb, sizeof(struct sctp_authkey_event));
832 832
833 ak->auth_type = SCTP_AUTHENTICATION_EVENT; 833 ak->auth_type = SCTP_AUTHENTICATION_INDICATION;
834 ak->auth_flags = 0; 834 ak->auth_flags = 0;
835 ak->auth_length = sizeof(struct sctp_authkey_event); 835 ak->auth_length = sizeof(struct sctp_authkey_event);
836 836
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index e75dbdcb08a4..c4f6419b1769 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -31,11 +31,6 @@
31#include <linux/in6.h> 31#include <linux/in6.h>
32#endif 32#endif
33 33
34static inline int alg_len(struct xfrm_algo *alg)
35{
36 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
37}
38
39static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type) 34static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type)
40{ 35{
41 struct nlattr *rt = attrs[type]; 36 struct nlattr *rt = attrs[type];
@@ -45,7 +40,7 @@ static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type)
45 return 0; 40 return 0;
46 41
47 algp = nla_data(rt); 42 algp = nla_data(rt);
48 if (nla_len(rt) < alg_len(algp)) 43 if (nla_len(rt) < xfrm_alg_len(algp))
49 return -EINVAL; 44 return -EINVAL;
50 45
51 switch (type) { 46 switch (type) {
@@ -204,7 +199,7 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props,
204 return -ENOSYS; 199 return -ENOSYS;
205 *props = algo->desc.sadb_alg_id; 200 *props = algo->desc.sadb_alg_id;
206 201
207 p = kmemdup(ualg, alg_len(ualg), GFP_KERNEL); 202 p = kmemdup(ualg, xfrm_alg_len(ualg), GFP_KERNEL);
208 if (!p) 203 if (!p)
209 return -ENOMEM; 204 return -ENOMEM;
210 205
@@ -516,9 +511,9 @@ static int copy_to_user_state_extra(struct xfrm_state *x,
516 NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused); 511 NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused);
517 512
518 if (x->aalg) 513 if (x->aalg)
519 NLA_PUT(skb, XFRMA_ALG_AUTH, alg_len(x->aalg), x->aalg); 514 NLA_PUT(skb, XFRMA_ALG_AUTH, xfrm_alg_len(x->aalg), x->aalg);
520 if (x->ealg) 515 if (x->ealg)
521 NLA_PUT(skb, XFRMA_ALG_CRYPT, alg_len(x->ealg), x->ealg); 516 NLA_PUT(skb, XFRMA_ALG_CRYPT, xfrm_alg_len(x->ealg), x->ealg);
522 if (x->calg) 517 if (x->calg)
523 NLA_PUT(skb, XFRMA_ALG_COMP, sizeof(*(x->calg)), x->calg); 518 NLA_PUT(skb, XFRMA_ALG_COMP, sizeof(*(x->calg)), x->calg);
524 519
@@ -1978,9 +1973,9 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x)
1978{ 1973{
1979 size_t l = 0; 1974 size_t l = 0;
1980 if (x->aalg) 1975 if (x->aalg)
1981 l += nla_total_size(alg_len(x->aalg)); 1976 l += nla_total_size(xfrm_alg_len(x->aalg));
1982 if (x->ealg) 1977 if (x->ealg)
1983 l += nla_total_size(alg_len(x->ealg)); 1978 l += nla_total_size(xfrm_alg_len(x->ealg));
1984 if (x->calg) 1979 if (x->calg)
1985 l += nla_total_size(sizeof(*x->calg)); 1980 l += nla_total_size(sizeof(*x->calg));
1986 if (x->encap) 1981 if (x->encap)