aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c59x.c22
-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_3ad.c3
-rw-r--r--drivers/net/bonding/bond_alb.c3
-rw-r--r--drivers/net/bonding/bond_main.c56
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c2
-rw-r--r--drivers/net/eql.c2
-rw-r--r--drivers/net/ks8851.c39
-rw-r--r--drivers/net/ll_temac_main.c1
-rw-r--r--drivers/net/ll_temac_mdio.c1
-rw-r--r--drivers/net/niu.c16
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c140
-rw-r--r--drivers/net/phy/mdio_bus.c4
-rw-r--r--drivers/net/ppp_generic.c9
-rw-r--r--drivers/net/pxa168_eth.c2
-rw-r--r--drivers/net/r8169.c5
-rw-r--r--drivers/net/stmmac/stmmac_main.c9
-rw-r--r--drivers/net/usb/hso.c2
-rw-r--r--drivers/net/usb/ipheth.c7
-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
32 files changed, 241 insertions, 172 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index c685a55fc2f4..fa42103b2874 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -635,6 +635,9 @@ struct vortex_private {
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 handling_irq:1; /* private in_irq indicator */
638 /* {get|set}_wol operations are already serialized by rtnl.
639 * no additional locking is required for the enable_wol and acpi_set_WOL()
640 */
638 int drv_flags; 641 int drv_flags;
639 u16 status_enable; 642 u16 status_enable;
640 u16 intr_enable; 643 u16 intr_enable;
@@ -647,7 +650,7 @@ struct vortex_private {
647 u16 io_size; /* Size of PCI region (for release_region) */ 650 u16 io_size; /* Size of PCI region (for release_region) */
648 651
649 /* Serialises access to hardware other than MII and variables below. 652 /* Serialises access to hardware other than MII and variables below.
650 * The lock hierarchy is rtnl_lock > lock > mii_lock > window_lock. */ 653 * The lock hierarchy is rtnl_lock > {lock, mii_lock} > window_lock. */
651 spinlock_t lock; 654 spinlock_t lock;
652 655
653 spinlock_t mii_lock; /* Serialises access to MII */ 656 spinlock_t mii_lock; /* Serialises access to MII */
@@ -1994,10 +1997,9 @@ vortex_error(struct net_device *dev, int status)
1994 } 1997 }
1995 } 1998 }
1996 1999
1997 if (status & RxEarly) { /* Rx early is unused. */ 2000 if (status & RxEarly) /* Rx early is unused. */
1998 vortex_rx(dev);
1999 iowrite16(AckIntr | RxEarly, ioaddr + EL3_CMD); 2001 iowrite16(AckIntr | RxEarly, ioaddr + EL3_CMD);
2000 } 2002
2001 if (status & StatsFull) { /* Empty statistics. */ 2003 if (status & StatsFull) { /* Empty statistics. */
2002 static int DoneDidThat; 2004 static int DoneDidThat;
2003 if (vortex_debug > 4) 2005 if (vortex_debug > 4)
@@ -2298,7 +2300,12 @@ vortex_interrupt(int irq, void *dev_id)
2298 if (status & (HostError | RxEarly | StatsFull | TxComplete | IntReq)) { 2300 if (status & (HostError | RxEarly | StatsFull | TxComplete | IntReq)) {
2299 if (status == 0xffff) 2301 if (status == 0xffff)
2300 break; 2302 break;
2303 if (status & RxEarly)
2304 vortex_rx(dev);
2305 spin_unlock(&vp->window_lock);
2301 vortex_error(dev, status); 2306 vortex_error(dev, status);
2307 spin_lock(&vp->window_lock);
2308 window_set(vp, 7);
2302 } 2309 }
2303 2310
2304 if (--work_done < 0) { 2311 if (--work_done < 0) {
@@ -2935,13 +2942,11 @@ static void vortex_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2935{ 2942{
2936 struct vortex_private *vp = netdev_priv(dev); 2943 struct vortex_private *vp = netdev_priv(dev);
2937 2944
2938 spin_lock_irq(&vp->lock);
2939 wol->supported = WAKE_MAGIC; 2945 wol->supported = WAKE_MAGIC;
2940 2946
2941 wol->wolopts = 0; 2947 wol->wolopts = 0;
2942 if (vp->enable_wol) 2948 if (vp->enable_wol)
2943 wol->wolopts |= WAKE_MAGIC; 2949 wol->wolopts |= WAKE_MAGIC;
2944 spin_unlock_irq(&vp->lock);
2945} 2950}
2946 2951
2947static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 2952static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
@@ -2950,13 +2955,11 @@ static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2950 if (wol->wolopts & ~WAKE_MAGIC) 2955 if (wol->wolopts & ~WAKE_MAGIC)
2951 return -EINVAL; 2956 return -EINVAL;
2952 2957
2953 spin_lock_irq(&vp->lock);
2954 if (wol->wolopts & WAKE_MAGIC) 2958 if (wol->wolopts & WAKE_MAGIC)
2955 vp->enable_wol = 1; 2959 vp->enable_wol = 1;
2956 else 2960 else
2957 vp->enable_wol = 0; 2961 vp->enable_wol = 0;
2958 acpi_set_WOL(dev); 2962 acpi_set_WOL(dev);
2959 spin_unlock_irq(&vp->lock);
2960 2963
2961 return 0; 2964 return 0;
2962} 2965}
@@ -2984,7 +2987,6 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2984{ 2987{
2985 int err; 2988 int err;
2986 struct vortex_private *vp = netdev_priv(dev); 2989 struct vortex_private *vp = netdev_priv(dev);
2987 unsigned long flags;
2988 pci_power_t state = 0; 2990 pci_power_t state = 0;
2989 2991
2990 if(VORTEX_PCI(vp)) 2992 if(VORTEX_PCI(vp))
@@ -2994,9 +2996,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2994 2996
2995 if(state != 0) 2997 if(state != 0)
2996 pci_set_power_state(VORTEX_PCI(vp), PCI_D0); 2998 pci_set_power_state(VORTEX_PCI(vp), PCI_D0);
2997 spin_lock_irqsave(&vp->lock, flags);
2998 err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL); 2999 err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL);
2999 spin_unlock_irqrestore(&vp->lock, flags);
3000 if(state != 0) 3000 if(state != 0)
3001 pci_set_power_state(VORTEX_PCI(vp), state); 3001 pci_set_power_state(VORTEX_PCI(vp), state);
3002 3002
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 37617abc1647..1e620e287ae0 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 99197bd54da5..53306bf3f401 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 cd16243c7c36..13f0abbc5205 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 74e146f470c6..6eda7a022256 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 */
@@ -848,7 +848,7 @@ static void be_rx_rate_update(struct be_adapter *adapter)
848} 848}
849 849
850static void be_rx_stats_update(struct be_adapter *adapter, 850static void be_rx_stats_update(struct be_adapter *adapter,
851 u32 pktsize, u16 numfrags) 851 u32 pktsize, u16 numfrags, u8 pkt_type)
852{ 852{
853 struct be_drvr_stats *stats = drvr_stats(adapter); 853 struct be_drvr_stats *stats = drvr_stats(adapter);
854 854
@@ -856,6 +856,9 @@ static void be_rx_stats_update(struct be_adapter *adapter,
856 stats->be_rx_frags += numfrags; 856 stats->be_rx_frags += numfrags;
857 stats->be_rx_bytes += pktsize; 857 stats->be_rx_bytes += pktsize;
858 stats->be_rx_pkts++; 858 stats->be_rx_pkts++;
859
860 if (pkt_type == BE_MULTICAST_PACKET)
861 stats->be_rx_mcast_pkt++;
859} 862}
860 863
861static inline bool do_pkt_csum(struct be_eth_rx_compl *rxcp, bool cso) 864static inline bool do_pkt_csum(struct be_eth_rx_compl *rxcp, bool cso)
@@ -925,9 +928,11 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
925 u16 rxq_idx, i, j; 928 u16 rxq_idx, i, j;
926 u32 pktsize, hdr_len, curr_frag_len, size; 929 u32 pktsize, hdr_len, curr_frag_len, size;
927 u8 *start; 930 u8 *start;
931 u8 pkt_type;
928 932
929 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); 933 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
930 pktsize = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp); 934 pktsize = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp);
935 pkt_type = AMAP_GET_BITS(struct amap_eth_rx_compl, cast_enc, rxcp);
931 936
932 page_info = get_rx_page_info(adapter, rxq_idx); 937 page_info = get_rx_page_info(adapter, rxq_idx);
933 938
@@ -993,7 +998,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
993 BUG_ON(j > MAX_SKB_FRAGS); 998 BUG_ON(j > MAX_SKB_FRAGS);
994 999
995done: 1000done:
996 be_rx_stats_update(adapter, pktsize, num_rcvd); 1001 be_rx_stats_update(adapter, pktsize, num_rcvd, pkt_type);
997} 1002}
998 1003
999/* Process the RX completion indicated by rxcp when GRO is disabled */ 1004/* Process the RX completion indicated by rxcp when GRO is disabled */
@@ -1060,6 +1065,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
1060 u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len; 1065 u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len;
1061 u16 i, rxq_idx = 0, vid, j; 1066 u16 i, rxq_idx = 0, vid, j;
1062 u8 vtm; 1067 u8 vtm;
1068 u8 pkt_type;
1063 1069
1064 num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); 1070 num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
1065 /* Is it a flush compl that has no data */ 1071 /* Is it a flush compl that has no data */
@@ -1070,6 +1076,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
1070 vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp); 1076 vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
1071 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); 1077 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
1072 vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp); 1078 vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp);
1079 pkt_type = AMAP_GET_BITS(struct amap_eth_rx_compl, cast_enc, rxcp);
1073 1080
1074 /* vlanf could be wrongly set in some cards. 1081 /* vlanf could be wrongly set in some cards.
1075 * ignore if vtm is not set */ 1082 * ignore if vtm is not set */
@@ -1125,7 +1132,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
1125 vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp, vid); 1132 vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp, vid);
1126 } 1133 }
1127 1134
1128 be_rx_stats_update(adapter, pkt_size, num_rcvd); 1135 be_rx_stats_update(adapter, pkt_size, num_rcvd, pkt_type);
1129} 1136}
1130 1137
1131static struct be_eth_rx_compl *be_rx_compl_get(struct be_adapter *adapter) 1138static struct be_eth_rx_compl *be_rx_compl_get(struct be_adapter *adapter)
@@ -1743,26 +1750,7 @@ static int be_poll_tx_mcc(struct napi_struct *napi, int budget)
1743 return 1; 1750 return 1;
1744} 1751}
1745 1752
1746static inline bool be_detect_ue(struct be_adapter *adapter) 1753void be_detect_dump_ue(struct be_adapter *adapter)
1747{
1748 u32 online0 = 0, online1 = 0;
1749
1750 pci_read_config_dword(adapter->pdev, PCICFG_ONLINE0, &online0);
1751
1752 pci_read_config_dword(adapter->pdev, PCICFG_ONLINE1, &online1);
1753
1754 if (!online0 || !online1) {
1755 adapter->ue_detected = true;
1756 dev_err(&adapter->pdev->dev,
1757 "UE Detected!! online0=%d online1=%d\n",
1758 online0, online1);
1759 return true;
1760 }
1761
1762 return false;
1763}
1764
1765void be_dump_ue(struct be_adapter *adapter)
1766{ 1754{
1767 u32 ue_status_lo, ue_status_hi, ue_status_lo_mask, ue_status_hi_mask; 1755 u32 ue_status_lo, ue_status_hi, ue_status_lo_mask, ue_status_hi_mask;
1768 u32 i; 1756 u32 i;
@@ -1779,6 +1767,11 @@ void be_dump_ue(struct be_adapter *adapter)
1779 ue_status_lo = (ue_status_lo & (~ue_status_lo_mask)); 1767 ue_status_lo = (ue_status_lo & (~ue_status_lo_mask));
1780 ue_status_hi = (ue_status_hi & (~ue_status_hi_mask)); 1768 ue_status_hi = (ue_status_hi & (~ue_status_hi_mask));
1781 1769
1770 if (ue_status_lo || ue_status_hi) {
1771 adapter->ue_detected = true;
1772 dev_err(&adapter->pdev->dev, "UE Detected!!\n");
1773 }
1774
1782 if (ue_status_lo) { 1775 if (ue_status_lo) {
1783 for (i = 0; ue_status_lo; ue_status_lo >>= 1, i++) { 1776 for (i = 0; ue_status_lo; ue_status_lo >>= 1, i++) {
1784 if (ue_status_lo & 1) 1777 if (ue_status_lo & 1)
@@ -1814,10 +1807,8 @@ static void be_worker(struct work_struct *work)
1814 adapter->rx_post_starved = false; 1807 adapter->rx_post_starved = false;
1815 be_post_rx_frags(adapter); 1808 be_post_rx_frags(adapter);
1816 } 1809 }
1817 if (!adapter->ue_detected) { 1810 if (!adapter->ue_detected)
1818 if (be_detect_ue(adapter)) 1811 be_detect_dump_ue(adapter);
1819 be_dump_ue(adapter);
1820 }
1821 1812
1822 schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); 1813 schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
1823} 1814}
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 822f586d72af..0ddf4c66afe2 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2466,6 +2466,9 @@ int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct pac
2466 if (!(dev->flags & IFF_MASTER)) 2466 if (!(dev->flags & IFF_MASTER))
2467 goto out; 2467 goto out;
2468 2468
2469 if (!pskb_may_pull(skb, sizeof(struct lacpdu)))
2470 goto out;
2471
2469 read_lock(&bond->lock); 2472 read_lock(&bond->lock);
2470 slave = bond_get_slave_by_dev((struct bonding *)netdev_priv(dev), 2473 slave = bond_get_slave_by_dev((struct bonding *)netdev_priv(dev),
2471 orig_dev); 2474 orig_dev);
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index c746b331771d..26bb118c4533 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -362,6 +362,9 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct
362 goto out; 362 goto out;
363 } 363 }
364 364
365 if (!pskb_may_pull(skb, arp_hdr_len(bond_dev)))
366 goto out;
367
365 if (skb->len < sizeof(struct arp_pkt)) { 368 if (skb->len < sizeof(struct arp_pkt)) {
366 pr_debug("Packet is too small to be an ARP\n"); 369 pr_debug("Packet is too small to be an ARP\n");
367 goto out; 370 goto out;
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/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index ad19585d960b..f208712c0b90 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2296,6 +2296,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
2296 case CHELSIO_GET_QSET_NUM:{ 2296 case CHELSIO_GET_QSET_NUM:{
2297 struct ch_reg edata; 2297 struct ch_reg edata;
2298 2298
2299 memset(&edata, 0, sizeof(struct ch_reg));
2300
2299 edata.cmd = CHELSIO_GET_QSET_NUM; 2301 edata.cmd = CHELSIO_GET_QSET_NUM;
2300 edata.val = pi->nqsets; 2302 edata.val = pi->nqsets;
2301 if (copy_to_user(useraddr, &edata, sizeof(edata))) 2303 if (copy_to_user(useraddr, &edata, sizeof(edata)))
diff --git a/drivers/net/eql.c b/drivers/net/eql.c
index dda2c7944da9..0cb1cf9cf4b0 100644
--- a/drivers/net/eql.c
+++ b/drivers/net/eql.c
@@ -555,6 +555,8 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp)
555 equalizer_t *eql; 555 equalizer_t *eql;
556 master_config_t mc; 556 master_config_t mc;
557 557
558 memset(&mc, 0, sizeof(master_config_t));
559
558 if (eql_is_master(dev)) { 560 if (eql_is_master(dev)) {
559 eql = netdev_priv(dev); 561 eql = netdev_priv(dev);
560 mc.max_slaves = eql->max_slaves; 562 mc.max_slaves = eql->max_slaves;
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/ll_temac_main.c b/drivers/net/ll_temac_main.c
index bdf2149e5296..87f0a93b165c 100644
--- a/drivers/net/ll_temac_main.c
+++ b/drivers/net/ll_temac_main.c
@@ -38,6 +38,7 @@
38#include <linux/of_device.h> 38#include <linux/of_device.h>
39#include <linux/of_mdio.h> 39#include <linux/of_mdio.h>
40#include <linux/of_platform.h> 40#include <linux/of_platform.h>
41#include <linux/of_address.h>
41#include <linux/skbuff.h> 42#include <linux/skbuff.h>
42#include <linux/spinlock.h> 43#include <linux/spinlock.h>
43#include <linux/tcp.h> /* needed for sizeof(tcphdr) */ 44#include <linux/tcp.h> /* needed for sizeof(tcphdr) */
diff --git a/drivers/net/ll_temac_mdio.c b/drivers/net/ll_temac_mdio.c
index 5ae28c975b38..8cf9d4f56bb2 100644
--- a/drivers/net/ll_temac_mdio.c
+++ b/drivers/net/ll_temac_mdio.c
@@ -10,6 +10,7 @@
10#include <linux/phy.h> 10#include <linux/phy.h>
11#include <linux/of.h> 11#include <linux/of.h>
12#include <linux/of_device.h> 12#include <linux/of_device.h>
13#include <linux/of_address.h>
13#include <linux/slab.h> 14#include <linux/slab.h>
14#include <linux/of_mdio.h> 15#include <linux/of_mdio.h>
15 16
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index bc695d53cdcc..fe6983af6918 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 c3edfe4c2651..f9b509a6b09a 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -508,7 +508,8 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev,
508 unsigned int vcc, 508 unsigned int vcc,
509 void *priv_data) 509 void *priv_data)
510{ 510{
511 int *has_shmem = priv_data; 511 int *priv = priv_data;
512 int try = (*priv & 0x1);
512 int i; 513 int i;
513 cistpl_io_t *io = &cfg->io; 514 cistpl_io_t *io = &cfg->io;
514 515
@@ -525,77 +526,103 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev,
525 i = p_dev->resource[1]->end = 0; 526 i = p_dev->resource[1]->end = 0;
526 } 527 }
527 528
528 *has_shmem = ((cfg->mem.nwin == 1) && 529 *priv &= ((cfg->mem.nwin == 1) &&
529 (cfg->mem.win[0].len >= 0x4000)); 530 (cfg->mem.win[0].len >= 0x4000)) ? 0x10 : ~0x10;
531
530 p_dev->resource[0]->start = io->win[i].base; 532 p_dev->resource[0]->start = io->win[i].base;
531 p_dev->resource[0]->end = io->win[i].len; 533 p_dev->resource[0]->end = io->win[i].len;
532 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; 534 if (!try)
535 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
536 else
537 p_dev->io_lines = 16;
533 if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32) 538 if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32)
534 return try_io_port(p_dev); 539 return try_io_port(p_dev);
535 540
536 return 0; 541 return -EINVAL;
542}
543
544static hw_info_t *pcnet_try_config(struct pcmcia_device *link,
545 int *has_shmem, int try)
546{
547 struct net_device *dev = link->priv;
548 hw_info_t *local_hw_info;
549 pcnet_dev_t *info = PRIV(dev);
550 int priv = try;
551 int ret;
552
553 ret = pcmcia_loop_config(link, pcnet_confcheck, &priv);
554 if (ret) {
555 dev_warn(&link->dev, "no useable port range found\n");
556 return NULL;
557 }
558 *has_shmem = (priv & 0x10);
559
560 if (!link->irq)
561 return NULL;
562
563 if (resource_size(link->resource[1]) == 8) {
564 link->conf.Attributes |= CONF_ENABLE_SPKR;
565 link->conf.Status = CCSR_AUDIO_ENA;
566 }
567 if ((link->manf_id == MANFID_IBM) &&
568 (link->card_id == PRODID_IBM_HOME_AND_AWAY))
569 link->conf.ConfigIndex |= 0x10;
570
571 ret = pcmcia_request_configuration(link, &link->conf);
572 if (ret)
573 return NULL;
574
575 dev->irq = link->irq;
576 dev->base_addr = link->resource[0]->start;
577
578 if (info->flags & HAS_MISC_REG) {
579 if ((if_port == 1) || (if_port == 2))
580 dev->if_port = if_port;
581 else
582 dev_notice(&link->dev, "invalid if_port requested\n");
583 } else
584 dev->if_port = 0;
585
586 if ((link->conf.ConfigBase == 0x03c0) &&
587 (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) {
588 dev_info(&link->dev,
589 "this is an AX88190 card - use axnet_cs instead.\n");
590 return NULL;
591 }
592
593 local_hw_info = get_hwinfo(link);
594 if (!local_hw_info)
595 local_hw_info = get_prom(link);
596 if (!local_hw_info)
597 local_hw_info = get_dl10019(link);
598 if (!local_hw_info)
599 local_hw_info = get_ax88190(link);
600 if (!local_hw_info)
601 local_hw_info = get_hwired(link);
602
603 return local_hw_info;
537} 604}
538 605
539static int pcnet_config(struct pcmcia_device *link) 606static int pcnet_config(struct pcmcia_device *link)
540{ 607{
541 struct net_device *dev = link->priv; 608 struct net_device *dev = link->priv;
542 pcnet_dev_t *info = PRIV(dev); 609 pcnet_dev_t *info = PRIV(dev);
543 int ret, start_pg, stop_pg, cm_offset; 610 int start_pg, stop_pg, cm_offset;
544 int has_shmem = 0; 611 int has_shmem = 0;
545 hw_info_t *local_hw_info; 612 hw_info_t *local_hw_info;
546 613
547 dev_dbg(&link->dev, "pcnet_config\n"); 614 dev_dbg(&link->dev, "pcnet_config\n");
548 615
549 ret = pcmcia_loop_config(link, pcnet_confcheck, &has_shmem); 616 local_hw_info = pcnet_try_config(link, &has_shmem, 0);
550 if (ret) 617 if (!local_hw_info) {
551 goto failed; 618 /* check whether forcing io_lines to 16 helps... */
552 619 pcmcia_disable_device(link);
553 if (!link->irq) 620 local_hw_info = pcnet_try_config(link, &has_shmem, 1);
554 goto failed; 621 if (local_hw_info == NULL) {
555 622 dev_notice(&link->dev, "unable to read hardware net"
556 if (resource_size(link->resource[1]) == 8) { 623 " address for io base %#3lx\n", dev->base_addr);
557 link->conf.Attributes |= CONF_ENABLE_SPKR; 624 goto failed;
558 link->conf.Status = CCSR_AUDIO_ENA; 625 }
559 }
560 if ((link->manf_id == MANFID_IBM) &&
561 (link->card_id == PRODID_IBM_HOME_AND_AWAY))
562 link->conf.ConfigIndex |= 0x10;
563
564 ret = pcmcia_request_configuration(link, &link->conf);
565 if (ret)
566 goto failed;
567 dev->irq = link->irq;
568 dev->base_addr = link->resource[0]->start;
569 if (info->flags & HAS_MISC_REG) {
570 if ((if_port == 1) || (if_port == 2))
571 dev->if_port = if_port;
572 else
573 printk(KERN_NOTICE "pcnet_cs: invalid if_port requested\n");
574 } else {
575 dev->if_port = 0;
576 }
577
578 if ((link->conf.ConfigBase == 0x03c0) &&
579 (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) {
580 printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n");
581 printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n");
582 goto failed;
583 }
584
585 local_hw_info = get_hwinfo(link);
586 if (local_hw_info == NULL)
587 local_hw_info = get_prom(link);
588 if (local_hw_info == NULL)
589 local_hw_info = get_dl10019(link);
590 if (local_hw_info == NULL)
591 local_hw_info = get_ax88190(link);
592 if (local_hw_info == NULL)
593 local_hw_info = get_hwired(link);
594
595 if (local_hw_info == NULL) {
596 printk(KERN_NOTICE "pcnet_cs: unable to read hardware net"
597 " address for io base %#3lx\n", dev->base_addr);
598 goto failed;
599 } 626 }
600 627
601 info->flags = local_hw_info->flags; 628 info->flags = local_hw_info->flags;
@@ -1637,6 +1664,7 @@ static struct pcmcia_device_id pcnet_ids[] = {
1637 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCETTX", 0x547e66dc, 0x6fc5459b), 1664 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCETTX", 0x547e66dc, 0x6fc5459b),
1638 PCMCIA_DEVICE_PROD_ID12("iPort", "10/100 Ethernet Card", 0x56c538d2, 0x11b0ffc0), 1665 PCMCIA_DEVICE_PROD_ID12("iPort", "10/100 Ethernet Card", 0x56c538d2, 0x11b0ffc0),
1639 PCMCIA_DEVICE_PROD_ID12("KANSAI ELECTRIC CO.,LTD", "KLA-PCM/T", 0xb18dc3b4, 0xcc51a956), 1666 PCMCIA_DEVICE_PROD_ID12("KANSAI ELECTRIC CO.,LTD", "KLA-PCM/T", 0xb18dc3b4, 0xcc51a956),
1667 PCMCIA_DEVICE_PROD_ID12("KENTRONICS", "KEP-230", 0xaf8144c9, 0x868f6616),
1640 PCMCIA_DEVICE_PROD_ID12("KCI", "PE520 PCMCIA Ethernet Adapter", 0xa89b87d3, 0x1eb88e64), 1668 PCMCIA_DEVICE_PROD_ID12("KCI", "PE520 PCMCIA Ethernet Adapter", 0xa89b87d3, 0x1eb88e64),
1641 PCMCIA_DEVICE_PROD_ID12("KINGMAX", "EN10T2T", 0x7bcb459a, 0xa5c81fa5), 1669 PCMCIA_DEVICE_PROD_ID12("KINGMAX", "EN10T2T", 0x7bcb459a, 0xa5c81fa5),
1642 PCMCIA_DEVICE_PROD_ID12("Kingston", "KNE-PC2", 0x1128e633, 0xce2a89b3), 1670 PCMCIA_DEVICE_PROD_ID12("Kingston", "KNE-PC2", 0x1128e633, 0xce2a89b3),
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 6a6b8199a0d6..6c58da2b882c 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -308,7 +308,7 @@ static int mdio_bus_suspend(struct device *dev)
308 * may call phy routines that try to grab the same lock, and that may 308 * may call phy routines that try to grab the same lock, and that may
309 * lead to a deadlock. 309 * lead to a deadlock.
310 */ 310 */
311 if (phydev->attached_dev) 311 if (phydev->attached_dev && phydev->adjust_link)
312 phy_stop_machine(phydev); 312 phy_stop_machine(phydev);
313 313
314 if (!mdio_bus_phy_may_suspend(phydev)) 314 if (!mdio_bus_phy_may_suspend(phydev))
@@ -331,7 +331,7 @@ static int mdio_bus_resume(struct device *dev)
331 return ret; 331 return ret;
332 332
333no_resume: 333no_resume:
334 if (phydev->attached_dev) 334 if (phydev->attached_dev && phydev->adjust_link)
335 phy_start_machine(phydev, NULL); 335 phy_start_machine(phydev, NULL);
336 336
337 return 0; 337 return 0;
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 6695a51e09e9..736b91703b3e 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1314,8 +1314,13 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1314 hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; 1314 hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN;
1315 i = 0; 1315 i = 0;
1316 list_for_each_entry(pch, &ppp->channels, clist) { 1316 list_for_each_entry(pch, &ppp->channels, clist) {
1317 navail += pch->avail = (pch->chan != NULL); 1317 if (pch->chan) {
1318 pch->speed = pch->chan->speed; 1318 pch->avail = 1;
1319 navail++;
1320 pch->speed = pch->chan->speed;
1321 } else {
1322 pch->avail = 0;
1323 }
1319 if (pch->avail) { 1324 if (pch->avail) {
1320 if (skb_queue_empty(&pch->file.xq) || 1325 if (skb_queue_empty(&pch->file.xq) ||
1321 !pch->had_frag) { 1326 !pch->had_frag) {
diff --git a/drivers/net/pxa168_eth.c b/drivers/net/pxa168_eth.c
index 410ea0a61371..85eddda276bd 100644
--- a/drivers/net/pxa168_eth.c
+++ b/drivers/net/pxa168_eth.c
@@ -1606,6 +1606,8 @@ static int pxa168_eth_remove(struct platform_device *pdev)
1606 1606
1607 iounmap(pep->base); 1607 iounmap(pep->base);
1608 pep->base = NULL; 1608 pep->base = NULL;
1609 mdiobus_unregister(pep->smi_bus);
1610 mdiobus_free(pep->smi_bus);
1609 unregister_netdev(dev); 1611 unregister_netdev(dev);
1610 flush_scheduled_work(); 1612 flush_scheduled_work();
1611 free_netdev(dev); 1613 free_netdev(dev);
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 078bbf4e6f19..a0da4a17b025 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2934,7 +2934,7 @@ static const struct rtl_cfg_info {
2934 .hw_start = rtl_hw_start_8168, 2934 .hw_start = rtl_hw_start_8168,
2935 .region = 2, 2935 .region = 2,
2936 .align = 8, 2936 .align = 8,
2937 .intr_event = SYSErr | LinkChg | RxOverflow | 2937 .intr_event = SYSErr | RxFIFOOver | LinkChg | RxOverflow |
2938 TxErr | TxOK | RxOK | RxErr, 2938 TxErr | TxOK | RxOK | RxErr,
2939 .napi_event = TxErr | TxOK | RxOK | RxOverflow, 2939 .napi_event = TxErr | TxOK | RxOK | RxOverflow,
2940 .features = RTL_FEATURE_GMII | RTL_FEATURE_MSI, 2940 .features = RTL_FEATURE_GMII | RTL_FEATURE_MSI,
@@ -4625,8 +4625,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
4625 } 4625 }
4626 4626
4627 /* Work around for rx fifo overflow */ 4627 /* Work around for rx fifo overflow */
4628 if (unlikely(status & RxFIFOOver) && 4628 if (unlikely(status & RxFIFOOver)) {
4629 (tp->mac_version == RTL_GIGA_MAC_VER_11)) {
4630 netif_stop_queue(dev); 4629 netif_stop_queue(dev);
4631 rtl8169_tx_timeout(dev); 4630 rtl8169_tx_timeout(dev);
4632 break; 4631 break;
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
index bbb7951b9c4c..ea0461eb2dbe 100644
--- a/drivers/net/stmmac/stmmac_main.c
+++ b/drivers/net/stmmac/stmmac_main.c
@@ -1865,15 +1865,15 @@ static int stmmac_resume(struct platform_device *pdev)
1865 if (!netif_running(dev)) 1865 if (!netif_running(dev))
1866 return 0; 1866 return 0;
1867 1867
1868 spin_lock(&priv->lock);
1869
1870 if (priv->shutdown) { 1868 if (priv->shutdown) {
1871 /* Re-open the interface and re-init the MAC/DMA 1869 /* Re-open the interface and re-init the MAC/DMA
1872 and the rings. */ 1870 and the rings (i.e. on hibernation stage) */
1873 stmmac_open(dev); 1871 stmmac_open(dev);
1874 goto out_resume; 1872 return 0;
1875 } 1873 }
1876 1874
1875 spin_lock(&priv->lock);
1876
1877 /* Power Down bit, into the PM register, is cleared 1877 /* Power Down bit, into the PM register, is cleared
1878 * automatically as soon as a magic packet or a Wake-up frame 1878 * automatically as soon as a magic packet or a Wake-up frame
1879 * is received. Anyway, it's better to manually clear 1879 * is received. Anyway, it's better to manually clear
@@ -1901,7 +1901,6 @@ static int stmmac_resume(struct platform_device *pdev)
1901 1901
1902 netif_start_queue(dev); 1902 netif_start_queue(dev);
1903 1903
1904out_resume:
1905 spin_unlock(&priv->lock); 1904 spin_unlock(&priv->lock);
1906 return 0; 1905 return 0;
1907} 1906}
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 6efca66b8766..1cd752f9a6e1 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1652,6 +1652,8 @@ static int hso_get_count(struct hso_serial *serial,
1652 struct uart_icount cnow; 1652 struct uart_icount cnow;
1653 struct hso_tiocmget *tiocmget = serial->tiocmget; 1653 struct hso_tiocmget *tiocmget = serial->tiocmget;
1654 1654
1655 memset(&icount, 0, sizeof(struct serial_icounter_struct));
1656
1655 if (!tiocmget) 1657 if (!tiocmget)
1656 return -ENOENT; 1658 return -ENOENT;
1657 spin_lock_irq(&serial->serial_lock); 1659 spin_lock_irq(&serial->serial_lock);
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 8ed30fa35d0a..b2bcf99e6f08 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -429,10 +429,6 @@ static const struct net_device_ops ipheth_netdev_ops = {
429 .ndo_get_stats = &ipheth_stats, 429 .ndo_get_stats = &ipheth_stats,
430}; 430};
431 431
432static struct device_type ipheth_type = {
433 .name = "wwan",
434};
435
436static int ipheth_probe(struct usb_interface *intf, 432static int ipheth_probe(struct usb_interface *intf,
437 const struct usb_device_id *id) 433 const struct usb_device_id *id)
438{ 434{
@@ -450,7 +446,7 @@ static int ipheth_probe(struct usb_interface *intf,
450 446
451 netdev->netdev_ops = &ipheth_netdev_ops; 447 netdev->netdev_ops = &ipheth_netdev_ops;
452 netdev->watchdog_timeo = IPHETH_TX_TIMEOUT; 448 netdev->watchdog_timeo = IPHETH_TX_TIMEOUT;
453 strcpy(netdev->name, "wwan%d"); 449 strcpy(netdev->name, "eth%d");
454 450
455 dev = netdev_priv(netdev); 451 dev = netdev_priv(netdev);
456 dev->udev = udev; 452 dev->udev = udev;
@@ -500,7 +496,6 @@ static int ipheth_probe(struct usb_interface *intf,
500 496
501 SET_NETDEV_DEV(netdev, &intf->dev); 497 SET_NETDEV_DEV(netdev, &intf->dev);
502 SET_ETHTOOL_OPS(netdev, &ops); 498 SET_ETHTOOL_OPS(netdev, &ops);
503 SET_NETDEV_DEVTYPE(netdev, &ipheth_type);
504 499
505 retval = register_netdev(netdev); 500 retval = register_netdev(netdev);
506 if (retval) { 501 if (retval) {
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index fd69095ef6e3..f53412368ce1 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 373dcfec689c..d77ce9906b6c 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 ba854c70ab94..87b634978b35 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -128,7 +128,7 @@ struct if_sdio_card {
128 bool helper_allocated; 128 bool helper_allocated;
129 bool firmware_allocated; 129 bool firmware_allocated;
130 130
131 u8 buffer[65536]; 131 u8 buffer[65536] __attribute__((aligned(4)));
132 132
133 spinlock_t lock; 133 spinlock_t lock;
134 struct if_sdio_packet *packets; 134 struct if_sdio_packet *packets;
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 173aec3d6e7e..0e937dc0c9c4 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;