aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-09-10 01:27:33 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-10 01:27:33 -0400
commite548833df83c3554229eff0672900bfe958b45fd (patch)
tree85efc4a76dc356593d6d394776aeb845dc580fb6 /drivers/net
parentcbd9da7be869f676afc204e1a664163778c770bd (diff)
parent053d8f6622701f849fda2ca2c9ae596c13599ba9 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: net/mac80211/main.c
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c59x.c30
-rw-r--r--drivers/net/b44.c9
-rw-r--r--drivers/net/benet/be.h1
-rw-r--r--drivers/net/benet/be_cmds.c8
-rw-r--r--drivers/net/benet/be_cmds.h2
-rw-r--r--drivers/net/benet/be_ethtool.c1
-rw-r--r--drivers/net/benet/be_hw.h7
-rw-r--r--drivers/net/benet/be_main.c47
-rw-r--r--drivers/net/bonding/bond_main.c56
-rw-r--r--drivers/net/caif/Kconfig2
-rw-r--r--drivers/net/ibm_newemac/debug.c2
-rw-r--r--drivers/net/ks8851.c39
-rw-r--r--drivers/net/netxen/netxen_nic_main.c9
-rw-r--r--drivers/net/niu.c16
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c1
-rw-r--r--drivers/net/phy/phy_device.c2
-rw-r--r--drivers/net/pxa168_eth.c60
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c9
-rw-r--r--drivers/net/qlge/qlge_main.c4
-rw-r--r--drivers/net/stmmac/stmmac_main.c9
-rw-r--r--drivers/net/usb/ipheth.c12
-rw-r--r--drivers/net/via-velocity.c2
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom.h2
-rw-r--r--drivers/net/wireless/ath/regd.h1
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c2
-rw-r--r--drivers/net/wireless/p54/txrx.c2
28 files changed, 199 insertions, 142 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 7a01588fb6fb..e31a6d1919c6 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -633,7 +633,8 @@ struct vortex_private {
633 open:1, 633 open:1,
634 medialock:1, 634 medialock:1,
635 must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */ 635 must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */
636 large_frames:1; /* accept large frames */ 636 large_frames:1, /* accept large frames */
637 handling_irq:1; /* private in_irq indicator */
637 int drv_flags; 638 int drv_flags;
638 u16 status_enable; 639 u16 status_enable;
639 u16 intr_enable; 640 u16 intr_enable;
@@ -646,7 +647,7 @@ struct vortex_private {
646 u16 io_size; /* Size of PCI region (for release_region) */ 647 u16 io_size; /* Size of PCI region (for release_region) */
647 648
648 /* Serialises access to hardware other than MII and variables below. 649 /* Serialises access to hardware other than MII and variables below.
649 * The lock hierarchy is rtnl_lock > lock > mii_lock > window_lock. */ 650 * The lock hierarchy is rtnl_lock > {lock, mii_lock} > window_lock. */
650 spinlock_t lock; 651 spinlock_t lock;
651 652
652 spinlock_t mii_lock; /* Serialises access to MII */ 653 spinlock_t mii_lock; /* Serialises access to MII */
@@ -1993,10 +1994,9 @@ vortex_error(struct net_device *dev, int status)
1993 } 1994 }
1994 } 1995 }
1995 1996
1996 if (status & RxEarly) { /* Rx early is unused. */ 1997 if (status & RxEarly) /* Rx early is unused. */
1997 vortex_rx(dev);
1998 iowrite16(AckIntr | RxEarly, ioaddr + EL3_CMD); 1998 iowrite16(AckIntr | RxEarly, ioaddr + EL3_CMD);
1999 } 1999
2000 if (status & StatsFull) { /* Empty statistics. */ 2000 if (status & StatsFull) { /* Empty statistics. */
2001 static int DoneDidThat; 2001 static int DoneDidThat;
2002 if (vortex_debug > 4) 2002 if (vortex_debug > 4)
@@ -2133,6 +2133,15 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
2133 dev->name, vp->cur_tx); 2133 dev->name, vp->cur_tx);
2134 } 2134 }
2135 2135
2136 /*
2137 * We can't allow a recursion from our interrupt handler back into the
2138 * tx routine, as they take the same spin lock, and that causes
2139 * deadlock. Just return NETDEV_TX_BUSY and let the stack try again in
2140 * a bit
2141 */
2142 if (vp->handling_irq)
2143 return NETDEV_TX_BUSY;
2144
2136 if (vp->cur_tx - vp->dirty_tx >= TX_RING_SIZE) { 2145 if (vp->cur_tx - vp->dirty_tx >= TX_RING_SIZE) {
2137 if (vortex_debug > 0) 2146 if (vortex_debug > 0)
2138 pr_warning("%s: BUG! Tx Ring full, refusing to send buffer.\n", 2147 pr_warning("%s: BUG! Tx Ring full, refusing to send buffer.\n",
@@ -2288,7 +2297,12 @@ vortex_interrupt(int irq, void *dev_id)
2288 if (status & (HostError | RxEarly | StatsFull | TxComplete | IntReq)) { 2297 if (status & (HostError | RxEarly | StatsFull | TxComplete | IntReq)) {
2289 if (status == 0xffff) 2298 if (status == 0xffff)
2290 break; 2299 break;
2300 if (status & RxEarly)
2301 vortex_rx(dev);
2302 spin_unlock(&vp->window_lock);
2291 vortex_error(dev, status); 2303 vortex_error(dev, status);
2304 spin_lock(&vp->window_lock);
2305 window_set(vp, 7);
2292 } 2306 }
2293 2307
2294 if (--work_done < 0) { 2308 if (--work_done < 0) {
@@ -2335,11 +2349,13 @@ boomerang_interrupt(int irq, void *dev_id)
2335 2349
2336 ioaddr = vp->ioaddr; 2350 ioaddr = vp->ioaddr;
2337 2351
2352
2338 /* 2353 /*
2339 * It seems dopey to put the spinlock this early, but we could race against vortex_tx_timeout 2354 * It seems dopey to put the spinlock this early, but we could race against vortex_tx_timeout
2340 * and boomerang_start_xmit 2355 * and boomerang_start_xmit
2341 */ 2356 */
2342 spin_lock(&vp->lock); 2357 spin_lock(&vp->lock);
2358 vp->handling_irq = 1;
2343 2359
2344 status = ioread16(ioaddr + EL3_STATUS); 2360 status = ioread16(ioaddr + EL3_STATUS);
2345 2361
@@ -2447,6 +2463,7 @@ boomerang_interrupt(int irq, void *dev_id)
2447 pr_debug("%s: exiting interrupt, status %4.4x.\n", 2463 pr_debug("%s: exiting interrupt, status %4.4x.\n",
2448 dev->name, status); 2464 dev->name, status);
2449handler_exit: 2465handler_exit:
2466 vp->handling_irq = 0;
2450 spin_unlock(&vp->lock); 2467 spin_unlock(&vp->lock);
2451 return IRQ_HANDLED; 2468 return IRQ_HANDLED;
2452} 2469}
@@ -2971,7 +2988,6 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2971{ 2988{
2972 int err; 2989 int err;
2973 struct vortex_private *vp = netdev_priv(dev); 2990 struct vortex_private *vp = netdev_priv(dev);
2974 unsigned long flags;
2975 pci_power_t state = 0; 2991 pci_power_t state = 0;
2976 2992
2977 if(VORTEX_PCI(vp)) 2993 if(VORTEX_PCI(vp))
@@ -2981,9 +2997,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2981 2997
2982 if(state != 0) 2998 if(state != 0)
2983 pci_set_power_state(VORTEX_PCI(vp), PCI_D0); 2999 pci_set_power_state(VORTEX_PCI(vp), PCI_D0);
2984 spin_lock_irqsave(&vp->lock, flags);
2985 err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL); 3000 err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL);
2986 spin_unlock_irqrestore(&vp->lock, flags);
2987 if(state != 0) 3001 if(state != 0)
2988 pci_set_power_state(VORTEX_PCI(vp), state); 3002 pci_set_power_state(VORTEX_PCI(vp), state);
2989 3003
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 7342308718a0..8e7c8a8e61c7 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -848,6 +848,15 @@ static int b44_poll(struct napi_struct *napi, int budget)
848 b44_tx(bp); 848 b44_tx(bp);
849 /* spin_unlock(&bp->tx_lock); */ 849 /* spin_unlock(&bp->tx_lock); */
850 } 850 }
851 if (bp->istat & ISTAT_RFO) { /* fast recovery, in ~20msec */
852 bp->istat &= ~ISTAT_RFO;
853 b44_disable_ints(bp);
854 ssb_device_enable(bp->sdev, 0); /* resets ISTAT_RFO */
855 b44_init_rings(bp);
856 b44_init_hw(bp, B44_FULL_RESET_SKIP_PHY);
857 netif_wake_queue(bp->dev);
858 }
859
851 spin_unlock_irqrestore(&bp->lock, flags); 860 spin_unlock_irqrestore(&bp->lock, flags);
852 861
853 work_done = 0; 862 work_done = 0;
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index d1fb7928ffc5..4faf6961dcec 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -181,6 +181,7 @@ struct be_drvr_stats {
181 u64 be_rx_bytes_prev; 181 u64 be_rx_bytes_prev;
182 u64 be_rx_pkts; 182 u64 be_rx_pkts;
183 u32 be_rx_rate; 183 u32 be_rx_rate;
184 u32 be_rx_mcast_pkt;
184 /* number of non ether type II frames dropped where 185 /* number of non ether type II frames dropped where
185 * frame len > length field of Mac Hdr */ 186 * frame len > length field of Mac Hdr */
186 u32 be_802_3_dropped_frames; 187 u32 be_802_3_dropped_frames;
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 3d305494a606..34abcc9403d6 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -140,10 +140,8 @@ int be_process_mcc(struct be_adapter *adapter, int *status)
140 while ((compl = be_mcc_compl_get(adapter))) { 140 while ((compl = be_mcc_compl_get(adapter))) {
141 if (compl->flags & CQE_FLAGS_ASYNC_MASK) { 141 if (compl->flags & CQE_FLAGS_ASYNC_MASK) {
142 /* Interpret flags as an async trailer */ 142 /* Interpret flags as an async trailer */
143 BUG_ON(!is_link_state_evt(compl->flags)); 143 if (is_link_state_evt(compl->flags))
144 144 be_async_link_state_process(adapter,
145 /* Interpret compl as a async link evt */
146 be_async_link_state_process(adapter,
147 (struct be_async_event_link_state *) compl); 145 (struct be_async_event_link_state *) compl);
148 } else if (compl->flags & CQE_FLAGS_COMPLETED_MASK) { 146 } else if (compl->flags & CQE_FLAGS_COMPLETED_MASK) {
149 *status = be_mcc_compl_process(adapter, compl); 147 *status = be_mcc_compl_process(adapter, compl);
@@ -207,7 +205,7 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
207 205
208 if (msecs > 4000) { 206 if (msecs > 4000) {
209 dev_err(&adapter->pdev->dev, "mbox poll timed out\n"); 207 dev_err(&adapter->pdev->dev, "mbox poll timed out\n");
210 be_dump_ue(adapter); 208 be_detect_dump_ue(adapter);
211 return -1; 209 return -1;
212 } 210 }
213 211
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h
index bdc10a28cfda..ad1e6fac60c5 100644
--- a/drivers/net/benet/be_cmds.h
+++ b/drivers/net/benet/be_cmds.h
@@ -992,5 +992,5 @@ extern int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
992extern int be_cmd_get_phy_info(struct be_adapter *adapter, 992extern int be_cmd_get_phy_info(struct be_adapter *adapter,
993 struct be_dma_mem *cmd); 993 struct be_dma_mem *cmd);
994extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain); 994extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain);
995extern void be_dump_ue(struct be_adapter *adapter); 995extern void be_detect_dump_ue(struct be_adapter *adapter);
996 996
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 9bedb9ff6e12..d92063420c25 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -60,6 +60,7 @@ static const struct be_ethtool_stat et_stats[] = {
60 {DRVSTAT_INFO(be_rx_events)}, 60 {DRVSTAT_INFO(be_rx_events)},
61 {DRVSTAT_INFO(be_tx_compl)}, 61 {DRVSTAT_INFO(be_tx_compl)},
62 {DRVSTAT_INFO(be_rx_compl)}, 62 {DRVSTAT_INFO(be_rx_compl)},
63 {DRVSTAT_INFO(be_rx_mcast_pkt)},
63 {DRVSTAT_INFO(be_ethrx_post_fail)}, 64 {DRVSTAT_INFO(be_ethrx_post_fail)},
64 {DRVSTAT_INFO(be_802_3_dropped_frames)}, 65 {DRVSTAT_INFO(be_802_3_dropped_frames)},
65 {DRVSTAT_INFO(be_802_3_malformed_frames)}, 66 {DRVSTAT_INFO(be_802_3_malformed_frames)},
diff --git a/drivers/net/benet/be_hw.h b/drivers/net/benet/be_hw.h
index 5d38046402b2..a2ec5df0d733 100644
--- a/drivers/net/benet/be_hw.h
+++ b/drivers/net/benet/be_hw.h
@@ -167,8 +167,11 @@
167#define FLASH_FCoE_BIOS_START_g3 (13631488) 167#define FLASH_FCoE_BIOS_START_g3 (13631488)
168#define FLASH_REDBOOT_START_g3 (262144) 168#define FLASH_REDBOOT_START_g3 (262144)
169 169
170 170/************* Rx Packet Type Encoding **************/
171 171#define BE_UNICAST_PACKET 0
172#define BE_MULTICAST_PACKET 1
173#define BE_BROADCAST_PACKET 2
174#define BE_RSVD_PACKET 3
172 175
173/* 176/*
174 * BE descriptors: host memory data structures whose formats 177 * BE descriptors: host memory data structures whose formats
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index dcee7a20c0b9..43a3a574e2e0 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -247,6 +247,7 @@ void netdev_stats_update(struct be_adapter *adapter)
247 dev_stats->tx_packets = drvr_stats(adapter)->be_tx_pkts; 247 dev_stats->tx_packets = drvr_stats(adapter)->be_tx_pkts;
248 dev_stats->rx_bytes = drvr_stats(adapter)->be_rx_bytes; 248 dev_stats->rx_bytes = drvr_stats(adapter)->be_rx_bytes;
249 dev_stats->tx_bytes = drvr_stats(adapter)->be_tx_bytes; 249 dev_stats->tx_bytes = drvr_stats(adapter)->be_tx_bytes;
250 dev_stats->multicast = drvr_stats(adapter)->be_rx_mcast_pkt;
250 251
251 /* bad pkts received */ 252 /* bad pkts received */
252 dev_stats->rx_errors = port_stats->rx_crc_errors + 253 dev_stats->rx_errors = port_stats->rx_crc_errors +
@@ -294,7 +295,6 @@ void netdev_stats_update(struct be_adapter *adapter)
294 /* no space available in linux */ 295 /* no space available in linux */
295 dev_stats->tx_dropped = 0; 296 dev_stats->tx_dropped = 0;
296 297
297 dev_stats->multicast = port_stats->rx_multicast_frames;
298 dev_stats->collisions = 0; 298 dev_stats->collisions = 0;
299 299
300 /* detailed tx_errors */ 300 /* detailed tx_errors */
@@ -843,7 +843,7 @@ static void be_rx_rate_update(struct be_adapter *adapter)
843} 843}
844 844
845static void be_rx_stats_update(struct be_adapter *adapter, 845static void be_rx_stats_update(struct be_adapter *adapter,
846 u32 pktsize, u16 numfrags) 846 u32 pktsize, u16 numfrags, u8 pkt_type)
847{ 847{
848 struct be_drvr_stats *stats = drvr_stats(adapter); 848 struct be_drvr_stats *stats = drvr_stats(adapter);
849 849
@@ -851,6 +851,9 @@ static void be_rx_stats_update(struct be_adapter *adapter,
851 stats->be_rx_frags += numfrags; 851 stats->be_rx_frags += numfrags;
852 stats->be_rx_bytes += pktsize; 852 stats->be_rx_bytes += pktsize;
853 stats->be_rx_pkts++; 853 stats->be_rx_pkts++;
854
855 if (pkt_type == BE_MULTICAST_PACKET)
856 stats->be_rx_mcast_pkt++;
854} 857}
855 858
856static inline bool do_pkt_csum(struct be_eth_rx_compl *rxcp, bool cso) 859static inline bool do_pkt_csum(struct be_eth_rx_compl *rxcp, bool cso)
@@ -920,9 +923,11 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
920 u16 rxq_idx, i, j; 923 u16 rxq_idx, i, j;
921 u32 pktsize, hdr_len, curr_frag_len, size; 924 u32 pktsize, hdr_len, curr_frag_len, size;
922 u8 *start; 925 u8 *start;
926 u8 pkt_type;
923 927
924 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); 928 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
925 pktsize = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp); 929 pktsize = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp);
930 pkt_type = AMAP_GET_BITS(struct amap_eth_rx_compl, cast_enc, rxcp);
926 931
927 page_info = get_rx_page_info(adapter, rxq_idx); 932 page_info = get_rx_page_info(adapter, rxq_idx);
928 933
@@ -988,7 +993,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
988 BUG_ON(j > MAX_SKB_FRAGS); 993 BUG_ON(j > MAX_SKB_FRAGS);
989 994
990done: 995done:
991 be_rx_stats_update(adapter, pktsize, num_rcvd); 996 be_rx_stats_update(adapter, pktsize, num_rcvd, pkt_type);
992} 997}
993 998
994/* Process the RX completion indicated by rxcp when GRO is disabled */ 999/* Process the RX completion indicated by rxcp when GRO is disabled */
@@ -1055,6 +1060,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
1055 u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len; 1060 u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len;
1056 u16 i, rxq_idx = 0, vid, j; 1061 u16 i, rxq_idx = 0, vid, j;
1057 u8 vtm; 1062 u8 vtm;
1063 u8 pkt_type;
1058 1064
1059 num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); 1065 num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
1060 /* Is it a flush compl that has no data */ 1066 /* Is it a flush compl that has no data */
@@ -1065,6 +1071,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
1065 vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp); 1071 vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
1066 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); 1072 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
1067 vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp); 1073 vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp);
1074 pkt_type = AMAP_GET_BITS(struct amap_eth_rx_compl, cast_enc, rxcp);
1068 1075
1069 /* vlanf could be wrongly set in some cards. 1076 /* vlanf could be wrongly set in some cards.
1070 * ignore if vtm is not set */ 1077 * ignore if vtm is not set */
@@ -1120,7 +1127,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
1120 vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp, vid); 1127 vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp, vid);
1121 } 1128 }
1122 1129
1123 be_rx_stats_update(adapter, pkt_size, num_rcvd); 1130 be_rx_stats_update(adapter, pkt_size, num_rcvd, pkt_type);
1124} 1131}
1125 1132
1126static struct be_eth_rx_compl *be_rx_compl_get(struct be_adapter *adapter) 1133static struct be_eth_rx_compl *be_rx_compl_get(struct be_adapter *adapter)
@@ -1738,26 +1745,7 @@ static int be_poll_tx_mcc(struct napi_struct *napi, int budget)
1738 return 1; 1745 return 1;
1739} 1746}
1740 1747
1741static inline bool be_detect_ue(struct be_adapter *adapter) 1748void be_detect_dump_ue(struct be_adapter *adapter)
1742{
1743 u32 online0 = 0, online1 = 0;
1744
1745 pci_read_config_dword(adapter->pdev, PCICFG_ONLINE0, &online0);
1746
1747 pci_read_config_dword(adapter->pdev, PCICFG_ONLINE1, &online1);
1748
1749 if (!online0 || !online1) {
1750 adapter->ue_detected = true;
1751 dev_err(&adapter->pdev->dev,
1752 "UE Detected!! online0=%d online1=%d\n",
1753 online0, online1);
1754 return true;
1755 }
1756
1757 return false;
1758}
1759
1760void be_dump_ue(struct be_adapter *adapter)
1761{ 1749{
1762 u32 ue_status_lo, ue_status_hi, ue_status_lo_mask, ue_status_hi_mask; 1750 u32 ue_status_lo, ue_status_hi, ue_status_lo_mask, ue_status_hi_mask;
1763 u32 i; 1751 u32 i;
@@ -1774,6 +1762,11 @@ void be_dump_ue(struct be_adapter *adapter)
1774 ue_status_lo = (ue_status_lo & (~ue_status_lo_mask)); 1762 ue_status_lo = (ue_status_lo & (~ue_status_lo_mask));
1775 ue_status_hi = (ue_status_hi & (~ue_status_hi_mask)); 1763 ue_status_hi = (ue_status_hi & (~ue_status_hi_mask));
1776 1764
1765 if (ue_status_lo || ue_status_hi) {
1766 adapter->ue_detected = true;
1767 dev_err(&adapter->pdev->dev, "UE Detected!!\n");
1768 }
1769
1777 if (ue_status_lo) { 1770 if (ue_status_lo) {
1778 for (i = 0; ue_status_lo; ue_status_lo >>= 1, i++) { 1771 for (i = 0; ue_status_lo; ue_status_lo >>= 1, i++) {
1779 if (ue_status_lo & 1) 1772 if (ue_status_lo & 1)
@@ -1809,10 +1802,8 @@ static void be_worker(struct work_struct *work)
1809 adapter->rx_post_starved = false; 1802 adapter->rx_post_starved = false;
1810 be_post_rx_frags(adapter); 1803 be_post_rx_frags(adapter);
1811 } 1804 }
1812 if (!adapter->ue_detected) { 1805 if (!adapter->ue_detected)
1813 if (be_detect_ue(adapter)) 1806 be_detect_dump_ue(adapter);
1814 be_dump_ue(adapter);
1815 }
1816 1807
1817 schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); 1808 schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
1818} 1809}
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2cc4cfc31892..3b16f62d5606 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2797,9 +2797,15 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
2797 * so it can wait 2797 * so it can wait
2798 */ 2798 */
2799 bond_for_each_slave(bond, slave, i) { 2799 bond_for_each_slave(bond, slave, i) {
2800 unsigned long trans_start = dev_trans_start(slave->dev);
2801
2800 if (slave->link != BOND_LINK_UP) { 2802 if (slave->link != BOND_LINK_UP) {
2801 if (time_before_eq(jiffies, dev_trans_start(slave->dev) + delta_in_ticks) && 2803 if (time_in_range(jiffies,
2802 time_before_eq(jiffies, slave->dev->last_rx + delta_in_ticks)) { 2804 trans_start - delta_in_ticks,
2805 trans_start + delta_in_ticks) &&
2806 time_in_range(jiffies,
2807 slave->dev->last_rx - delta_in_ticks,
2808 slave->dev->last_rx + delta_in_ticks)) {
2803 2809
2804 slave->link = BOND_LINK_UP; 2810 slave->link = BOND_LINK_UP;
2805 slave->state = BOND_STATE_ACTIVE; 2811 slave->state = BOND_STATE_ACTIVE;
@@ -2827,8 +2833,12 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
2827 * when the source ip is 0, so don't take the link down 2833 * when the source ip is 0, so don't take the link down
2828 * if we don't know our ip yet 2834 * if we don't know our ip yet
2829 */ 2835 */
2830 if (time_after_eq(jiffies, dev_trans_start(slave->dev) + 2*delta_in_ticks) || 2836 if (!time_in_range(jiffies,
2831 (time_after_eq(jiffies, slave->dev->last_rx + 2*delta_in_ticks))) { 2837 trans_start - delta_in_ticks,
2838 trans_start + 2 * delta_in_ticks) ||
2839 !time_in_range(jiffies,
2840 slave->dev->last_rx - delta_in_ticks,
2841 slave->dev->last_rx + 2 * delta_in_ticks)) {
2832 2842
2833 slave->link = BOND_LINK_DOWN; 2843 slave->link = BOND_LINK_DOWN;
2834 slave->state = BOND_STATE_BACKUP; 2844 slave->state = BOND_STATE_BACKUP;
@@ -2883,13 +2893,16 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks)
2883{ 2893{
2884 struct slave *slave; 2894 struct slave *slave;
2885 int i, commit = 0; 2895 int i, commit = 0;
2896 unsigned long trans_start;
2886 2897
2887 bond_for_each_slave(bond, slave, i) { 2898 bond_for_each_slave(bond, slave, i) {
2888 slave->new_link = BOND_LINK_NOCHANGE; 2899 slave->new_link = BOND_LINK_NOCHANGE;
2889 2900
2890 if (slave->link != BOND_LINK_UP) { 2901 if (slave->link != BOND_LINK_UP) {
2891 if (time_before_eq(jiffies, slave_last_rx(bond, slave) + 2902 if (time_in_range(jiffies,
2892 delta_in_ticks)) { 2903 slave_last_rx(bond, slave) - delta_in_ticks,
2904 slave_last_rx(bond, slave) + delta_in_ticks)) {
2905
2893 slave->new_link = BOND_LINK_UP; 2906 slave->new_link = BOND_LINK_UP;
2894 commit++; 2907 commit++;
2895 } 2908 }
@@ -2902,8 +2915,9 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks)
2902 * active. This avoids bouncing, as the last receive 2915 * active. This avoids bouncing, as the last receive
2903 * times need a full ARP monitor cycle to be updated. 2916 * times need a full ARP monitor cycle to be updated.
2904 */ 2917 */
2905 if (!time_after_eq(jiffies, slave->jiffies + 2918 if (time_in_range(jiffies,
2906 2 * delta_in_ticks)) 2919 slave->jiffies - delta_in_ticks,
2920 slave->jiffies + 2 * delta_in_ticks))
2907 continue; 2921 continue;
2908 2922
2909 /* 2923 /*
@@ -2921,8 +2935,10 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks)
2921 */ 2935 */
2922 if (slave->state == BOND_STATE_BACKUP && 2936 if (slave->state == BOND_STATE_BACKUP &&
2923 !bond->current_arp_slave && 2937 !bond->current_arp_slave &&
2924 time_after(jiffies, slave_last_rx(bond, slave) + 2938 !time_in_range(jiffies,
2925 3 * delta_in_ticks)) { 2939 slave_last_rx(bond, slave) - delta_in_ticks,
2940 slave_last_rx(bond, slave) + 3 * delta_in_ticks)) {
2941
2926 slave->new_link = BOND_LINK_DOWN; 2942 slave->new_link = BOND_LINK_DOWN;
2927 commit++; 2943 commit++;
2928 } 2944 }
@@ -2933,11 +2949,15 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks)
2933 * - (more than 2*delta since receive AND 2949 * - (more than 2*delta since receive AND
2934 * the bond has an IP address) 2950 * the bond has an IP address)
2935 */ 2951 */
2952 trans_start = dev_trans_start(slave->dev);
2936 if ((slave->state == BOND_STATE_ACTIVE) && 2953 if ((slave->state == BOND_STATE_ACTIVE) &&
2937 (time_after_eq(jiffies, dev_trans_start(slave->dev) + 2954 (!time_in_range(jiffies,
2938 2 * delta_in_ticks) || 2955 trans_start - delta_in_ticks,
2939 (time_after_eq(jiffies, slave_last_rx(bond, slave) 2956 trans_start + 2 * delta_in_ticks) ||
2940 + 2 * delta_in_ticks)))) { 2957 !time_in_range(jiffies,
2958 slave_last_rx(bond, slave) - delta_in_ticks,
2959 slave_last_rx(bond, slave) + 2 * delta_in_ticks))) {
2960
2941 slave->new_link = BOND_LINK_DOWN; 2961 slave->new_link = BOND_LINK_DOWN;
2942 commit++; 2962 commit++;
2943 } 2963 }
@@ -2956,6 +2976,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
2956{ 2976{
2957 struct slave *slave; 2977 struct slave *slave;
2958 int i; 2978 int i;
2979 unsigned long trans_start;
2959 2980
2960 bond_for_each_slave(bond, slave, i) { 2981 bond_for_each_slave(bond, slave, i) {
2961 switch (slave->new_link) { 2982 switch (slave->new_link) {
@@ -2963,10 +2984,11 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
2963 continue; 2984 continue;
2964 2985
2965 case BOND_LINK_UP: 2986 case BOND_LINK_UP:
2987 trans_start = dev_trans_start(slave->dev);
2966 if ((!bond->curr_active_slave && 2988 if ((!bond->curr_active_slave &&
2967 time_before_eq(jiffies, 2989 time_in_range(jiffies,
2968 dev_trans_start(slave->dev) + 2990 trans_start - delta_in_ticks,
2969 delta_in_ticks)) || 2991 trans_start + delta_in_ticks)) ||
2970 bond->curr_active_slave != slave) { 2992 bond->curr_active_slave != slave) {
2971 slave->link = BOND_LINK_UP; 2993 slave->link = BOND_LINK_UP;
2972 bond->current_arp_slave = NULL; 2994 bond->current_arp_slave = NULL;
diff --git a/drivers/net/caif/Kconfig b/drivers/net/caif/Kconfig
index 631a6242b011..75bfc3a9d95f 100644
--- a/drivers/net/caif/Kconfig
+++ b/drivers/net/caif/Kconfig
@@ -15,7 +15,7 @@ config CAIF_TTY
15 15
16config CAIF_SPI_SLAVE 16config CAIF_SPI_SLAVE
17 tristate "CAIF SPI transport driver for slave interface" 17 tristate "CAIF SPI transport driver for slave interface"
18 depends on CAIF 18 depends on CAIF && HAS_DMA
19 default n 19 default n
20 ---help--- 20 ---help---
21 The CAIF Link layer SPI Protocol driver for Slave SPI interface. 21 The CAIF Link layer SPI Protocol driver for Slave SPI interface.
diff --git a/drivers/net/ibm_newemac/debug.c b/drivers/net/ibm_newemac/debug.c
index 3995fafc1e08..8c6c1e2a8750 100644
--- a/drivers/net/ibm_newemac/debug.c
+++ b/drivers/net/ibm_newemac/debug.c
@@ -238,7 +238,7 @@ void emac_dbg_dump_all(void)
238} 238}
239 239
240#if defined(CONFIG_MAGIC_SYSRQ) 240#if defined(CONFIG_MAGIC_SYSRQ)
241static void emac_sysrq_handler(int key, struct tty_struct *tty) 241static void emac_sysrq_handler(int key)
242{ 242{
243 emac_dbg_dump_all(); 243 emac_dbg_dump_all();
244} 244}
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c
index b4fb07a6f13f..51919fcd50c2 100644
--- a/drivers/net/ks8851.c
+++ b/drivers/net/ks8851.c
@@ -503,30 +503,33 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
503 ks8851_wrreg16(ks, KS_RXQCR, 503 ks8851_wrreg16(ks, KS_RXQCR,
504 ks->rc_rxqcr | RXQCR_SDA | RXQCR_ADRFE); 504 ks->rc_rxqcr | RXQCR_SDA | RXQCR_ADRFE);
505 505
506 if (rxlen > 0) { 506 if (rxlen > 4) {
507 skb = netdev_alloc_skb(ks->netdev, rxlen + 2 + 8); 507 unsigned int rxalign;
508 if (!skb) { 508
509 /* todo - dump frame and move on */ 509 rxlen -= 4;
510 } 510 rxalign = ALIGN(rxlen, 4);
511 skb = netdev_alloc_skb_ip_align(ks->netdev, rxalign);
512 if (skb) {
511 513
512 /* two bytes to ensure ip is aligned, and four bytes 514 /* 4 bytes of status header + 4 bytes of
513 * for the status header and 4 bytes of garbage */ 515 * garbage: we put them before ethernet
514 skb_reserve(skb, 2 + 4 + 4); 516 * header, so that they are copied,
517 * but ignored.
518 */
515 519
516 rxpkt = skb_put(skb, rxlen - 4) - 8; 520 rxpkt = skb_put(skb, rxlen) - 8;
517 521
518 /* align the packet length to 4 bytes, and add 4 bytes 522 ks8851_rdfifo(ks, rxpkt, rxalign + 8);
519 * as we're getting the rx status header as well */
520 ks8851_rdfifo(ks, rxpkt, ALIGN(rxlen, 4) + 8);
521 523
522 if (netif_msg_pktdata(ks)) 524 if (netif_msg_pktdata(ks))
523 ks8851_dbg_dumpkkt(ks, rxpkt); 525 ks8851_dbg_dumpkkt(ks, rxpkt);
524 526
525 skb->protocol = eth_type_trans(skb, ks->netdev); 527 skb->protocol = eth_type_trans(skb, ks->netdev);
526 netif_rx(skb); 528 netif_rx(skb);
527 529
528 ks->netdev->stats.rx_packets++; 530 ks->netdev->stats.rx_packets++;
529 ks->netdev->stats.rx_bytes += rxlen - 4; 531 ks->netdev->stats.rx_bytes += rxlen;
532 }
530 } 533 }
531 534
532 ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr); 535 ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr);
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index cb30df106a2c..73d314592230 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -2131,9 +2131,16 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget)
2131#ifdef CONFIG_NET_POLL_CONTROLLER 2131#ifdef CONFIG_NET_POLL_CONTROLLER
2132static void netxen_nic_poll_controller(struct net_device *netdev) 2132static void netxen_nic_poll_controller(struct net_device *netdev)
2133{ 2133{
2134 int ring;
2135 struct nx_host_sds_ring *sds_ring;
2134 struct netxen_adapter *adapter = netdev_priv(netdev); 2136 struct netxen_adapter *adapter = netdev_priv(netdev);
2137 struct netxen_recv_context *recv_ctx = &adapter->recv_ctx;
2138
2135 disable_irq(adapter->irq); 2139 disable_irq(adapter->irq);
2136 netxen_intr(adapter->irq, adapter); 2140 for (ring = 0; ring < adapter->max_sds_rings; ring++) {
2141 sds_ring = &recv_ctx->sds_rings[ring];
2142 netxen_intr(adapter->irq, sds_ring);
2143 }
2137 enable_irq(adapter->irq); 2144 enable_irq(adapter->irq);
2138} 2145}
2139#endif 2146#endif
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 1f89f472cbfb..8e1859c801a4 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -7269,32 +7269,28 @@ static int niu_get_ethtool_tcam_all(struct niu *np,
7269 struct niu_parent *parent = np->parent; 7269 struct niu_parent *parent = np->parent;
7270 struct niu_tcam_entry *tp; 7270 struct niu_tcam_entry *tp;
7271 int i, idx, cnt; 7271 int i, idx, cnt;
7272 u16 n_entries;
7273 unsigned long flags; 7272 unsigned long flags;
7274 7273 int ret = 0;
7275 7274
7276 /* put the tcam size here */ 7275 /* put the tcam size here */
7277 nfc->data = tcam_get_size(np); 7276 nfc->data = tcam_get_size(np);
7278 7277
7279 niu_lock_parent(np, flags); 7278 niu_lock_parent(np, flags);
7280 n_entries = nfc->rule_cnt;
7281 for (cnt = 0, i = 0; i < nfc->data; i++) { 7279 for (cnt = 0, i = 0; i < nfc->data; i++) {
7282 idx = tcam_get_index(np, i); 7280 idx = tcam_get_index(np, i);
7283 tp = &parent->tcam[idx]; 7281 tp = &parent->tcam[idx];
7284 if (!tp->valid) 7282 if (!tp->valid)
7285 continue; 7283 continue;
7284 if (cnt == nfc->rule_cnt) {
7285 ret = -EMSGSIZE;
7286 break;
7287 }
7286 rule_locs[cnt] = i; 7288 rule_locs[cnt] = i;
7287 cnt++; 7289 cnt++;
7288 } 7290 }
7289 niu_unlock_parent(np, flags); 7291 niu_unlock_parent(np, flags);
7290 7292
7291 if (n_entries != cnt) { 7293 return ret;
7292 /* print warning, this should not happen */
7293 netdev_info(np->dev, "niu%d: In %s(): n_entries[%d] != cnt[%d]!!!\n",
7294 np->parent->index, __func__, n_entries, cnt);
7295 }
7296
7297 return 0;
7298} 7294}
7299 7295
7300static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd, 7296static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 5ad42e0aee25..e180832c278f 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -1617,6 +1617,7 @@ static struct pcmcia_device_id pcnet_ids[] = {
1617 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCETTX", 0x547e66dc, 0x6fc5459b), 1617 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCETTX", 0x547e66dc, 0x6fc5459b),
1618 PCMCIA_DEVICE_PROD_ID12("iPort", "10/100 Ethernet Card", 0x56c538d2, 0x11b0ffc0), 1618 PCMCIA_DEVICE_PROD_ID12("iPort", "10/100 Ethernet Card", 0x56c538d2, 0x11b0ffc0),
1619 PCMCIA_DEVICE_PROD_ID12("KANSAI ELECTRIC CO.,LTD", "KLA-PCM/T", 0xb18dc3b4, 0xcc51a956), 1619 PCMCIA_DEVICE_PROD_ID12("KANSAI ELECTRIC CO.,LTD", "KLA-PCM/T", 0xb18dc3b4, 0xcc51a956),
1620 PCMCIA_DEVICE_PROD_ID12("KENTRONICS", "KEP-230", 0xaf8144c9, 0x868f6616),
1620 PCMCIA_DEVICE_PROD_ID12("KCI", "PE520 PCMCIA Ethernet Adapter", 0xa89b87d3, 0x1eb88e64), 1621 PCMCIA_DEVICE_PROD_ID12("KCI", "PE520 PCMCIA Ethernet Adapter", 0xa89b87d3, 0x1eb88e64),
1621 PCMCIA_DEVICE_PROD_ID12("KINGMAX", "EN10T2T", 0x7bcb459a, 0xa5c81fa5), 1622 PCMCIA_DEVICE_PROD_ID12("KINGMAX", "EN10T2T", 0x7bcb459a, 0xa5c81fa5),
1622 PCMCIA_DEVICE_PROD_ID12("Kingston", "KNE-PC2", 0x1128e633, 0xce2a89b3), 1623 PCMCIA_DEVICE_PROD_ID12("Kingston", "KNE-PC2", 0x1128e633, 0xce2a89b3),
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index c0761197c07e..16ddc77313cb 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -466,6 +466,8 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
466 466
467 phydev->interface = interface; 467 phydev->interface = interface;
468 468
469 phydev->state = PHY_READY;
470
469 /* Do initial configuration here, now that 471 /* Do initial configuration here, now that
470 * we have certain key parameters 472 * we have certain key parameters
471 * (dev_flags and interface) */ 473 * (dev_flags and interface) */
diff --git a/drivers/net/pxa168_eth.c b/drivers/net/pxa168_eth.c
index 764aa9099468..75c2ff99d66d 100644
--- a/drivers/net/pxa168_eth.c
+++ b/drivers/net/pxa168_eth.c
@@ -652,15 +652,15 @@ static void eth_port_start(struct net_device *dev)
652 /* Assignment of Tx CTRP of given queue */ 652 /* Assignment of Tx CTRP of given queue */
653 tx_curr_desc = pep->tx_curr_desc_q; 653 tx_curr_desc = pep->tx_curr_desc_q;
654 wrl(pep, ETH_C_TX_DESC_1, 654 wrl(pep, ETH_C_TX_DESC_1,
655 (u32) ((struct tx_desc *)pep->tx_desc_dma + tx_curr_desc)); 655 (u32) (pep->tx_desc_dma + tx_curr_desc * sizeof(struct tx_desc)));
656 656
657 /* Assignment of Rx CRDP of given queue */ 657 /* Assignment of Rx CRDP of given queue */
658 rx_curr_desc = pep->rx_curr_desc_q; 658 rx_curr_desc = pep->rx_curr_desc_q;
659 wrl(pep, ETH_C_RX_DESC_0, 659 wrl(pep, ETH_C_RX_DESC_0,
660 (u32) ((struct rx_desc *)pep->rx_desc_dma + rx_curr_desc)); 660 (u32) (pep->rx_desc_dma + rx_curr_desc * sizeof(struct rx_desc)));
661 661
662 wrl(pep, ETH_F_RX_DESC_0, 662 wrl(pep, ETH_F_RX_DESC_0,
663 (u32) ((struct rx_desc *)pep->rx_desc_dma + rx_curr_desc)); 663 (u32) (pep->rx_desc_dma + rx_curr_desc * sizeof(struct rx_desc)));
664 664
665 /* Clear all interrupts */ 665 /* Clear all interrupts */
666 wrl(pep, INT_CAUSE, 0); 666 wrl(pep, INT_CAUSE, 0);
@@ -1347,7 +1347,7 @@ static int pxa168_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr,
1347{ 1347{
1348 struct pxa168_eth_private *pep = netdev_priv(dev); 1348 struct pxa168_eth_private *pep = netdev_priv(dev);
1349 if (pep->phy != NULL) 1349 if (pep->phy != NULL)
1350 return phy_mii_ioctl(pep->phy, if_mii(ifr), cmd); 1350 return phy_mii_ioctl(pep->phy, ifr, cmd);
1351 1351
1352 return -EOPNOTSUPP; 1352 return -EOPNOTSUPP;
1353} 1353}
@@ -1411,10 +1411,8 @@ static int ethernet_phy_setup(struct net_device *dev)
1411{ 1411{
1412 struct pxa168_eth_private *pep = netdev_priv(dev); 1412 struct pxa168_eth_private *pep = netdev_priv(dev);
1413 1413
1414 if (pep->pd != NULL) { 1414 if (pep->pd->init)
1415 if (pep->pd->init) 1415 pep->pd->init();
1416 pep->pd->init();
1417 }
1418 pep->phy = phy_scan(pep, pep->pd->phy_addr & 0x1f); 1416 pep->phy = phy_scan(pep, pep->pd->phy_addr & 0x1f);
1419 if (pep->phy != NULL) 1417 if (pep->phy != NULL)
1420 phy_init(pep, pep->pd->speed, pep->pd->duplex); 1418 phy_init(pep, pep->pd->speed, pep->pd->duplex);
@@ -1496,7 +1494,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
1496 dev = alloc_etherdev(sizeof(struct pxa168_eth_private)); 1494 dev = alloc_etherdev(sizeof(struct pxa168_eth_private));
1497 if (!dev) { 1495 if (!dev) {
1498 err = -ENOMEM; 1496 err = -ENOMEM;
1499 goto out; 1497 goto err_clk;
1500 } 1498 }
1501 1499
1502 platform_set_drvdata(pdev, dev); 1500 platform_set_drvdata(pdev, dev);
@@ -1506,12 +1504,12 @@ static int pxa168_eth_probe(struct platform_device *pdev)
1506 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1504 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1507 if (res == NULL) { 1505 if (res == NULL) {
1508 err = -ENODEV; 1506 err = -ENODEV;
1509 goto out; 1507 goto err_netdev;
1510 } 1508 }
1511 pep->base = ioremap(res->start, res->end - res->start + 1); 1509 pep->base = ioremap(res->start, res->end - res->start + 1);
1512 if (pep->base == NULL) { 1510 if (pep->base == NULL) {
1513 err = -ENOMEM; 1511 err = -ENOMEM;
1514 goto out; 1512 goto err_netdev;
1515 } 1513 }
1516 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1514 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
1517 BUG_ON(!res); 1515 BUG_ON(!res);
@@ -1548,7 +1546,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
1548 pep->smi_bus = mdiobus_alloc(); 1546 pep->smi_bus = mdiobus_alloc();
1549 if (pep->smi_bus == NULL) { 1547 if (pep->smi_bus == NULL) {
1550 err = -ENOMEM; 1548 err = -ENOMEM;
1551 goto out; 1549 goto err_base;
1552 } 1550 }
1553 pep->smi_bus->priv = pep; 1551 pep->smi_bus->priv = pep;
1554 pep->smi_bus->name = "pxa168_eth smi"; 1552 pep->smi_bus->name = "pxa168_eth smi";
@@ -1557,31 +1555,31 @@ static int pxa168_eth_probe(struct platform_device *pdev)
1557 snprintf(pep->smi_bus->id, MII_BUS_ID_SIZE, "%d", pdev->id); 1555 snprintf(pep->smi_bus->id, MII_BUS_ID_SIZE, "%d", pdev->id);
1558 pep->smi_bus->parent = &pdev->dev; 1556 pep->smi_bus->parent = &pdev->dev;
1559 pep->smi_bus->phy_mask = 0xffffffff; 1557 pep->smi_bus->phy_mask = 0xffffffff;
1560 if (mdiobus_register(pep->smi_bus) < 0) { 1558 err = mdiobus_register(pep->smi_bus);
1561 err = -ENOMEM; 1559 if (err)
1562 goto out; 1560 goto err_free_mdio;
1563 } 1561
1564 pxa168_init_hw(pep); 1562 pxa168_init_hw(pep);
1565 err = ethernet_phy_setup(dev); 1563 err = ethernet_phy_setup(dev);
1566 if (err) 1564 if (err)
1567 goto out; 1565 goto err_mdiobus;
1568 SET_NETDEV_DEV(dev, &pdev->dev); 1566 SET_NETDEV_DEV(dev, &pdev->dev);
1569 err = register_netdev(dev); 1567 err = register_netdev(dev);
1570 if (err) 1568 if (err)
1571 goto out; 1569 goto err_mdiobus;
1572 return 0; 1570 return 0;
1573out: 1571
1574 if (pep->clk) { 1572err_mdiobus:
1575 clk_disable(pep->clk); 1573 mdiobus_unregister(pep->smi_bus);
1576 clk_put(pep->clk); 1574err_free_mdio:
1577 pep->clk = NULL; 1575 mdiobus_free(pep->smi_bus);
1578 } 1576err_base:
1579 if (pep->base) { 1577 iounmap(pep->base);
1580 iounmap(pep->base); 1578err_netdev:
1581 pep->base = NULL; 1579 free_netdev(dev);
1582 } 1580err_clk:
1583 if (dev) 1581 clk_disable(clk);
1584 free_netdev(dev); 1582 clk_put(clk);
1585 return err; 1583 return err;
1586} 1584}
1587 1585
@@ -1605,6 +1603,8 @@ static int pxa168_eth_remove(struct platform_device *pdev)
1605 1603
1606 iounmap(pep->base); 1604 iounmap(pep->base);
1607 pep->base = NULL; 1605 pep->base = NULL;
1606 mdiobus_unregister(pep->smi_bus);
1607 mdiobus_free(pep->smi_bus);
1608 unregister_netdev(dev); 1608 unregister_netdev(dev);
1609 flush_scheduled_work(); 1609 flush_scheduled_work();
1610 free_netdev(dev); 1610 free_netdev(dev);
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 5a6445a691b3..5fd2abd1eb67 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -2513,9 +2513,16 @@ static int qlcnic_rx_poll(struct napi_struct *napi, int budget)
2513#ifdef CONFIG_NET_POLL_CONTROLLER 2513#ifdef CONFIG_NET_POLL_CONTROLLER
2514static void qlcnic_poll_controller(struct net_device *netdev) 2514static void qlcnic_poll_controller(struct net_device *netdev)
2515{ 2515{
2516 int ring;
2517 struct qlcnic_host_sds_ring *sds_ring;
2516 struct qlcnic_adapter *adapter = netdev_priv(netdev); 2518 struct qlcnic_adapter *adapter = netdev_priv(netdev);
2519 struct qlcnic_recv_context *recv_ctx = &adapter->recv_ctx;
2520
2517 disable_irq(adapter->irq); 2521 disable_irq(adapter->irq);
2518 qlcnic_intr(adapter->irq, adapter); 2522 for (ring = 0; ring < adapter->max_sds_rings; ring++) {
2523 sds_ring = &recv_ctx->sds_rings[ring];
2524 qlcnic_intr(adapter->irq, sds_ring);
2525 }
2519 enable_irq(adapter->irq); 2526 enable_irq(adapter->irq);
2520} 2527}
2521#endif 2528#endif
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index e2d0e108b9aa..4ffebe83d883 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -3926,12 +3926,12 @@ static int ql_adapter_down(struct ql_adapter *qdev)
3926 for (i = 0; i < qdev->rss_ring_count; i++) 3926 for (i = 0; i < qdev->rss_ring_count; i++)
3927 netif_napi_del(&qdev->rx_ring[i].napi); 3927 netif_napi_del(&qdev->rx_ring[i].napi);
3928 3928
3929 ql_free_rx_buffers(qdev);
3930
3931 status = ql_adapter_reset(qdev); 3929 status = ql_adapter_reset(qdev);
3932 if (status) 3930 if (status)
3933 netif_err(qdev, ifdown, qdev->ndev, "reset(func #%d) FAILED!\n", 3931 netif_err(qdev, ifdown, qdev->ndev, "reset(func #%d) FAILED!\n",
3934 qdev->func); 3932 qdev->func);
3933 ql_free_rx_buffers(qdev);
3934
3935 return status; 3935 return status;
3936} 3936}
3937 3937
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
index 1ccea76d89ae..03c160c6d75c 100644
--- a/drivers/net/stmmac/stmmac_main.c
+++ b/drivers/net/stmmac/stmmac_main.c
@@ -1862,15 +1862,15 @@ static int stmmac_resume(struct platform_device *pdev)
1862 if (!netif_running(dev)) 1862 if (!netif_running(dev))
1863 return 0; 1863 return 0;
1864 1864
1865 spin_lock(&priv->lock);
1866
1867 if (priv->shutdown) { 1865 if (priv->shutdown) {
1868 /* Re-open the interface and re-init the MAC/DMA 1866 /* Re-open the interface and re-init the MAC/DMA
1869 and the rings. */ 1867 and the rings (i.e. on hibernation stage) */
1870 stmmac_open(dev); 1868 stmmac_open(dev);
1871 goto out_resume; 1869 return 0;
1872 } 1870 }
1873 1871
1872 spin_lock(&priv->lock);
1873
1874 /* Power Down bit, into the PM register, is cleared 1874 /* Power Down bit, into the PM register, is cleared
1875 * automatically as soon as a magic packet or a Wake-up frame 1875 * automatically as soon as a magic packet or a Wake-up frame
1876 * is received. Anyway, it's better to manually clear 1876 * is received. Anyway, it's better to manually clear
@@ -1898,7 +1898,6 @@ static int stmmac_resume(struct platform_device *pdev)
1898 1898
1899 netif_start_queue(dev); 1899 netif_start_queue(dev);
1900 1900
1901out_resume:
1902 spin_unlock(&priv->lock); 1901 spin_unlock(&priv->lock);
1903 return 0; 1902 return 0;
1904} 1903}
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 08e7b6abacdd..b2bcf99e6f08 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -58,6 +58,7 @@
58#define USB_PRODUCT_IPHONE 0x1290 58#define USB_PRODUCT_IPHONE 0x1290
59#define USB_PRODUCT_IPHONE_3G 0x1292 59#define USB_PRODUCT_IPHONE_3G 0x1292
60#define USB_PRODUCT_IPHONE_3GS 0x1294 60#define USB_PRODUCT_IPHONE_3GS 0x1294
61#define USB_PRODUCT_IPHONE_4 0x1297
61 62
62#define IPHETH_USBINTF_CLASS 255 63#define IPHETH_USBINTF_CLASS 255
63#define IPHETH_USBINTF_SUBCLASS 253 64#define IPHETH_USBINTF_SUBCLASS 253
@@ -92,6 +93,10 @@ static struct usb_device_id ipheth_table[] = {
92 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_3GS, 93 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_3GS,
93 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 94 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
94 IPHETH_USBINTF_PROTO) }, 95 IPHETH_USBINTF_PROTO) },
96 { USB_DEVICE_AND_INTERFACE_INFO(
97 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4,
98 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
99 IPHETH_USBINTF_PROTO) },
95 { } 100 { }
96}; 101};
97MODULE_DEVICE_TABLE(usb, ipheth_table); 102MODULE_DEVICE_TABLE(usb, ipheth_table);
@@ -424,10 +429,6 @@ static const struct net_device_ops ipheth_netdev_ops = {
424 .ndo_get_stats = &ipheth_stats, 429 .ndo_get_stats = &ipheth_stats,
425}; 430};
426 431
427static struct device_type ipheth_type = {
428 .name = "wwan",
429};
430
431static int ipheth_probe(struct usb_interface *intf, 432static int ipheth_probe(struct usb_interface *intf,
432 const struct usb_device_id *id) 433 const struct usb_device_id *id)
433{ 434{
@@ -445,7 +446,7 @@ static int ipheth_probe(struct usb_interface *intf,
445 446
446 netdev->netdev_ops = &ipheth_netdev_ops; 447 netdev->netdev_ops = &ipheth_netdev_ops;
447 netdev->watchdog_timeo = IPHETH_TX_TIMEOUT; 448 netdev->watchdog_timeo = IPHETH_TX_TIMEOUT;
448 strcpy(netdev->name, "wwan%d"); 449 strcpy(netdev->name, "eth%d");
449 450
450 dev = netdev_priv(netdev); 451 dev = netdev_priv(netdev);
451 dev->udev = udev; 452 dev->udev = udev;
@@ -495,7 +496,6 @@ static int ipheth_probe(struct usb_interface *intf,
495 496
496 SET_NETDEV_DEV(netdev, &intf->dev); 497 SET_NETDEV_DEV(netdev, &intf->dev);
497 SET_ETHTOOL_OPS(netdev, &ops); 498 SET_ETHTOOL_OPS(netdev, &ops);
498 SET_NETDEV_DEVTYPE(netdev, &ipheth_type);
499 499
500 retval = register_netdev(netdev); 500 retval = register_netdev(netdev);
501 if (retval) { 501 if (retval) {
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index ed7f4f5c4062..6884813b809c 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -2824,7 +2824,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
2824 netif_napi_add(dev, &vptr->napi, velocity_poll, VELOCITY_NAPI_WEIGHT); 2824 netif_napi_add(dev, &vptr->napi, velocity_poll, VELOCITY_NAPI_WEIGHT);
2825 2825
2826 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | 2826 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER |
2827 NETIF_F_HW_VLAN_RX | NETIF_F_IP_CSUM | NETIF_F_SG; 2827 NETIF_F_HW_VLAN_RX | NETIF_F_IP_CSUM;
2828 2828
2829 ret = register_netdev(dev); 2829 ret = register_netdev(dev);
2830 if (ret < 0) 2830 if (ret < 0)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 45789c8990d3..116ac66c6e3e 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1327,6 +1327,10 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
1327 PCI_DMA_TODEVICE); 1327 PCI_DMA_TODEVICE);
1328 1328
1329 rate = ieee80211_get_tx_rate(sc->hw, info); 1329 rate = ieee80211_get_tx_rate(sc->hw, info);
1330 if (!rate) {
1331 ret = -EINVAL;
1332 goto err_unmap;
1333 }
1330 1334
1331 if (info->flags & IEEE80211_TX_CTL_NO_ACK) 1335 if (info->flags & IEEE80211_TX_CTL_NO_ACK)
1332 flags |= AR5K_TXDESC_NOACK; 1336 flags |= AR5K_TXDESC_NOACK;
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index b883b174385b..057fb69ddf7f 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -797,7 +797,7 @@ static bool ar9300_uncompress_block(struct ath_hw *ah,
797 length = block[it+1]; 797 length = block[it+1];
798 length &= 0xff; 798 length &= 0xff;
799 799
800 if (length > 0 && spot >= 0 && spot+length < mdataSize) { 800 if (length > 0 && spot >= 0 && spot+length <= mdataSize) {
801 ath_print(common, ATH_DBG_EEPROM, 801 ath_print(common, ATH_DBG_EEPROM,
802 "Restore at %d: spot=%d " 802 "Restore at %d: spot=%d "
803 "offset=%d length=%d\n", 803 "offset=%d length=%d\n",
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h
index 7f48df1e2903..0b09db0f8e7d 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
@@ -62,7 +62,7 @@
62 62
63#define SD_NO_CTL 0xE0 63#define SD_NO_CTL 0xE0
64#define NO_CTL 0xff 64#define NO_CTL 0xff
65#define CTL_MODE_M 7 65#define CTL_MODE_M 0xf
66#define CTL_11A 0 66#define CTL_11A 0
67#define CTL_11B 1 67#define CTL_11B 1
68#define CTL_11G 2 68#define CTL_11G 2
diff --git a/drivers/net/wireless/ath/regd.h b/drivers/net/wireless/ath/regd.h
index a1c39526161a..345dd9721b41 100644
--- a/drivers/net/wireless/ath/regd.h
+++ b/drivers/net/wireless/ath/regd.h
@@ -31,7 +31,6 @@ enum ctl_group {
31#define NO_CTL 0xff 31#define NO_CTL 0xff
32#define SD_NO_CTL 0xE0 32#define SD_NO_CTL 0xE0
33#define NO_CTL 0xff 33#define NO_CTL 0xff
34#define CTL_MODE_M 7
35#define CTL_11A 0 34#define CTL_11A 0
36#define CTL_11B 1 35#define CTL_11B 1
37#define CTL_11G 2 36#define CTL_11G 2
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 1bbaaa44d981..296fd00a5129 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -124,7 +124,7 @@ struct if_sdio_card {
124 bool helper_allocated; 124 bool helper_allocated;
125 bool firmware_allocated; 125 bool firmware_allocated;
126 126
127 u8 buffer[65536]; 127 u8 buffer[65536] __attribute__((aligned(4)));
128 128
129 spinlock_t lock; 129 spinlock_t lock;
130 struct if_sdio_packet *packets; 130 struct if_sdio_packet *packets;
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 8f67db487f57..76b2318a7dc7 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -446,7 +446,7 @@ static void p54_rx_frame_sent(struct p54_common *priv, struct sk_buff *skb)
446 } 446 }
447 447
448 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) && 448 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) &&
449 (!payload->status)) 449 !(payload->status & P54_TX_FAILED))
450 info->flags |= IEEE80211_TX_STAT_ACK; 450 info->flags |= IEEE80211_TX_STAT_ACK;
451 if (payload->status & P54_TX_PSM_CANCELLED) 451 if (payload->status & P54_TX_PSM_CANCELLED)
452 info->flags |= IEEE80211_TX_STAT_TX_FILTERED; 452 info->flags |= IEEE80211_TX_STAT_TX_FILTERED;