aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-03 20:10:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-03 20:10:39 -0400
commitc42f1d4b523950c4af060f8fc0c7016755d8a3bc (patch)
tree8322c9c14b0c7055ce924d12c1150d2acb0ea95e /drivers
parent913a90416918a591e6d5ece036b795c58a08131d (diff)
parent5a8887d39e1ba5ee2d4ccb94b14d6f2dce5ddfca (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Transfer padding was wrong for full-speed USB in ASIX driver, fix from Ingo van Lil. 2) Propagate the negative packet offset fix into the PowerPC BPF JIT. From Jan Seiffert. 3) dl2k driver's private ioctls were letting unprivileged tasks make MII writes and other ugly bits like that. Fix from Jeff Mahoney. 4) Fix TX VLAN and RX packet drops in ucc_geth, from Joakim Tjernlund. 5) OOPS and network namespace fixes in IPVS from Hans Schillstrom and Julian Anastasov. 6) Fix races and sleeping in locked context bugs in drop_monitor, from Neil Horman. 7) Fix link status indication in smsc95xx driver, from Paolo Pisati. 8) Fix bridge netfilter OOPS, from Peter Huang. 9) L2TP sendmsg can return on error conditions with the socket lock held, oops. Fix from Sasha Levin. 10) udp_diag should return meaningful values for socket memory usage, from Shan Wei. 11) Eric Dumazet is so awesome he gets his own section: Socket memory cgroup code (I never should have applied those patches, grumble...) made erroneous changes to sk_sockets_allocated_read_positive(). It was changed to use percpu_counter_sum_positive (which requires BH disabling) instead of percpu_counter_read_positive (which does not). Revert back to avoid crashes and lockdep warnings. Adjust the default tcp_adv_win_scale and tcp_rmem[2] values to fix throughput regressions. This is necessary as a result of our more precise skb->truesize tracking. Fix SKB leak in netem packet scheduler. 12) New device IDs for various bluetooth devices, from Manoj Iyer, AceLan Kao, and Steven Harms. 13) Fix command completion race in ipw2200, from Stanislav Yakovlev. 14) Fix rtlwifi oops on unload, from Larry Finger. 15) Fix hard_mtu when adjusting hard_header_len in smsc95xx driver. From Stephane Fillod. 16) ehea driver registers it's IRQ before all the necessary state is setup, resulting in crashes. Fix from Thadeu Lima de Souza Cascardo. 17) Fix PHY connection failures in davinci_emac driver, from Anatolij Gustschin. 18) Missing break; in switch statement in bluetooth's hci_cmd_complete_evt(). Fix from Szymon Janc. 19) Fix queue programming in iwlwifi, from Johannes Berg. 20) Interrupt throttling defaults not being actually programmed into the hardware, fix from Jeff Kirsher and Ying Cai. 21) TLAN driver SKB encoding in descriptor busted on 64-bit, fix from Benjamin Poirier. 22) Fix blind status block RX producer pointer deref in TG3 driver, from Matt Carlson. 23) Promisc and multicast are busted on ehea, fixes from Thadeu Lima de Souza Cascardo. 24) Fix crashes in 6lowpan, from Alexander Smirnov. 25) tcp_complete_cwr() needs to be careful to not rewind the CWND to ssthresh if ssthresh has the "infinite" value. Fix from Yuchung Cheng. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (81 commits) sungem: Fix WakeOnLan tcp: change tcp_adv_win_scale and tcp_rmem[2] net: l2tp: unlock socket lock before returning from l2tp_ip_sendmsg drop_monitor: prevent init path from scheduling on the wrong cpu usbnet: fix failure handling in usbnet_probe usbnet: fix leak of transfer buffer of dev->interrupt ucc_geth: Add 16 bytes to max TX frame for VLANs net: ucc_geth, increase no. of HW RX descriptors netem: fix possible skb leak sky2: fix receive length error in mixed non-VLAN/VLAN traffic sky2: propogate rx hash when packet is copied net: fix two typos in skbuff.h cxgb3: Don't call cxgb_vlan_mode until q locks are initialized ixgbe: fix calling skb_put on nonlinear skb assertion bug ixgbe: Fix a memory leak in IEEE DCB igbvf: fix the bug when initializing the igbvf smsc75xx: enable mac to detect speed/duplex from phy smsc75xx: declare smsc75xx's MII as GMII capable smsc75xx: fix phy interrupt acknowledge smsc75xx: fix phy init reset loop ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bluetooth/ath3k.c4
-rw-r--r--drivers/bluetooth/btusb.c6
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c18
-rw-r--r--drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c92
-rw-r--r--drivers/net/ethernet/dlink/dl2k.c52
-rw-r--r--drivers/net/ethernet/dlink/dl2k.h7
-rw-r--r--drivers/net/ethernet/freescale/ucc_geth.c6
-rw-r--r--drivers/net/ethernet/freescale/ucc_geth.h2
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c60
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_phyp.h2
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c2
-rw-r--r--drivers/net/ethernet/intel/e1000e/param.c99
-rw-r--r--drivers/net/ethernet/intel/igbvf/netdev.c4
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c9
-rw-r--r--drivers/net/ethernet/marvell/sky2.c31
-rw-r--r--drivers/net/ethernet/marvell/sky2.h1
-rw-r--r--drivers/net/ethernet/sun/sungem.c2
-rw-r--r--drivers/net/ethernet/ti/davinci_emac.c2
-rw-r--r--drivers/net/ethernet/ti/tlan.c2
-rw-r--r--drivers/net/usb/asix.c4
-rw-r--r--drivers/net/usb/smsc75xx.c35
-rw-r--r--drivers/net/usb/smsc95xx.c3
-rw-r--r--drivers/net/usb/usbnet.c5
-rw-r--r--drivers/net/wireless/ath/ath5k/ahb.c1
-rw-r--r--drivers/net/wireless/ath/ath9k/ar5008_phy.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_paprd.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_9287.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h3
-rw-r--r--drivers/net/wireless/b43/main.c10
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c8
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c63
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c3
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-2000.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fh.h24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-mac80211.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-prph.h27
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c1
-rw-r--r--drivers/net/wireless/wl1251/main.c1
-rw-r--r--drivers/net/wireless/wl1251/sdio.c2
-rw-r--r--drivers/s390/net/qeth_core_main.c6
48 files changed, 415 insertions, 271 deletions
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index ae9edca7b56d..57fd867553d7 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -75,6 +75,8 @@ static struct usb_device_id ath3k_table[] = {
75 { USB_DEVICE(0x0CF3, 0x311D) }, 75 { USB_DEVICE(0x0CF3, 0x311D) },
76 { USB_DEVICE(0x13d3, 0x3375) }, 76 { USB_DEVICE(0x13d3, 0x3375) },
77 { USB_DEVICE(0x04CA, 0x3005) }, 77 { USB_DEVICE(0x04CA, 0x3005) },
78 { USB_DEVICE(0x13d3, 0x3362) },
79 { USB_DEVICE(0x0CF3, 0xE004) },
78 80
79 /* Atheros AR5BBU12 with sflash firmware */ 81 /* Atheros AR5BBU12 with sflash firmware */
80 { USB_DEVICE(0x0489, 0xE02C) }, 82 { USB_DEVICE(0x0489, 0xE02C) },
@@ -94,6 +96,8 @@ static struct usb_device_id ath3k_blist_tbl[] = {
94 { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 }, 96 { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
95 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, 97 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
96 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, 98 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
99 { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
100 { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
97 101
98 { } /* Terminating entry */ 102 { } /* Terminating entry */
99}; 103};
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 3311b812a0c6..9217121362e1 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -101,12 +101,16 @@ static struct usb_device_id btusb_table[] = {
101 { USB_DEVICE(0x0c10, 0x0000) }, 101 { USB_DEVICE(0x0c10, 0x0000) },
102 102
103 /* Broadcom BCM20702A0 */ 103 /* Broadcom BCM20702A0 */
104 { USB_DEVICE(0x0489, 0xe042) },
104 { USB_DEVICE(0x0a5c, 0x21e3) }, 105 { USB_DEVICE(0x0a5c, 0x21e3) },
105 { USB_DEVICE(0x0a5c, 0x21e6) }, 106 { USB_DEVICE(0x0a5c, 0x21e6) },
106 { USB_DEVICE(0x0a5c, 0x21e8) }, 107 { USB_DEVICE(0x0a5c, 0x21e8) },
107 { USB_DEVICE(0x0a5c, 0x21f3) }, 108 { USB_DEVICE(0x0a5c, 0x21f3) },
108 { USB_DEVICE(0x413c, 0x8197) }, 109 { USB_DEVICE(0x413c, 0x8197) },
109 110
111 /* Foxconn - Hon Hai */
112 { USB_DEVICE(0x0489, 0xe033) },
113
110 { } /* Terminating entry */ 114 { } /* Terminating entry */
111}; 115};
112 116
@@ -133,6 +137,8 @@ static struct usb_device_id blacklist_table[] = {
133 { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, 137 { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
134 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, 138 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
135 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, 139 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
140 { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
141 { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
136 142
137 /* Atheros AR5BBU12 with sflash firmware */ 143 /* Atheros AR5BBU12 with sflash firmware */
138 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, 144 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 062ac333fde6..ceeab8e852ef 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -879,8 +879,13 @@ static inline unsigned int tg3_has_work(struct tg3_napi *tnapi)
879 if (sblk->status & SD_STATUS_LINK_CHG) 879 if (sblk->status & SD_STATUS_LINK_CHG)
880 work_exists = 1; 880 work_exists = 1;
881 } 881 }
882 /* check for RX/TX work to do */ 882
883 if (sblk->idx[0].tx_consumer != tnapi->tx_cons || 883 /* check for TX work to do */
884 if (sblk->idx[0].tx_consumer != tnapi->tx_cons)
885 work_exists = 1;
886
887 /* check for RX work to do */
888 if (tnapi->rx_rcb_prod_idx &&
884 *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr) 889 *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr)
885 work_exists = 1; 890 work_exists = 1;
886 891
@@ -6124,6 +6129,9 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
6124 return work_done; 6129 return work_done;
6125 } 6130 }
6126 6131
6132 if (!tnapi->rx_rcb_prod_idx)
6133 return work_done;
6134
6127 /* run RX thread, within the bounds set by NAPI. 6135 /* run RX thread, within the bounds set by NAPI.
6128 * All RX "locking" is done by ensuring outside 6136 * All RX "locking" is done by ensuring outside
6129 * code synchronizes with tg3->napi.poll() 6137 * code synchronizes with tg3->napi.poll()
@@ -7567,6 +7575,12 @@ static int tg3_alloc_consistent(struct tg3 *tp)
7567 */ 7575 */
7568 switch (i) { 7576 switch (i) {
7569 default: 7577 default:
7578 if (tg3_flag(tp, ENABLE_RSS)) {
7579 tnapi->rx_rcb_prod_idx = NULL;
7580 break;
7581 }
7582 /* Fall through */
7583 case 1:
7570 tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer; 7584 tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer;
7571 break; 7585 break;
7572 case 2: 7586 case 2:
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
index 63bfdd10bd6d..abb6ce7c1b7e 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
@@ -1150,6 +1150,48 @@ release_tpsram:
1150} 1150}
1151 1151
1152/** 1152/**
1153 * t3_synchronize_rx - wait for current Rx processing on a port to complete
1154 * @adap: the adapter
1155 * @p: the port
1156 *
1157 * Ensures that current Rx processing on any of the queues associated with
1158 * the given port completes before returning. We do this by acquiring and
1159 * releasing the locks of the response queues associated with the port.
1160 */
1161static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p)
1162{
1163 int i;
1164
1165 for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) {
1166 struct sge_rspq *q = &adap->sge.qs[i].rspq;
1167
1168 spin_lock_irq(&q->lock);
1169 spin_unlock_irq(&q->lock);
1170 }
1171}
1172
1173static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features)
1174{
1175 struct port_info *pi = netdev_priv(dev);
1176 struct adapter *adapter = pi->adapter;
1177
1178 if (adapter->params.rev > 0) {
1179 t3_set_vlan_accel(adapter, 1 << pi->port_id,
1180 features & NETIF_F_HW_VLAN_RX);
1181 } else {
1182 /* single control for all ports */
1183 unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX;
1184
1185 for_each_port(adapter, i)
1186 have_vlans |=
1187 adapter->port[i]->features & NETIF_F_HW_VLAN_RX;
1188
1189 t3_set_vlan_accel(adapter, 1, have_vlans);
1190 }
1191 t3_synchronize_rx(adapter, pi);
1192}
1193
1194/**
1153 * cxgb_up - enable the adapter 1195 * cxgb_up - enable the adapter
1154 * @adapter: adapter being enabled 1196 * @adapter: adapter being enabled
1155 * 1197 *
@@ -1161,7 +1203,7 @@ release_tpsram:
1161 */ 1203 */
1162static int cxgb_up(struct adapter *adap) 1204static int cxgb_up(struct adapter *adap)
1163{ 1205{
1164 int err; 1206 int i, err;
1165 1207
1166 if (!(adap->flags & FULL_INIT_DONE)) { 1208 if (!(adap->flags & FULL_INIT_DONE)) {
1167 err = t3_check_fw_version(adap); 1209 err = t3_check_fw_version(adap);
@@ -1198,6 +1240,9 @@ static int cxgb_up(struct adapter *adap)
1198 if (err) 1240 if (err)
1199 goto out; 1241 goto out;
1200 1242
1243 for_each_port(adap, i)
1244 cxgb_vlan_mode(adap->port[i], adap->port[i]->features);
1245
1201 setup_rss(adap); 1246 setup_rss(adap);
1202 if (!(adap->flags & NAPI_INIT)) 1247 if (!(adap->flags & NAPI_INIT))
1203 init_napi(adap); 1248 init_napi(adap);
@@ -2508,48 +2553,6 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p)
2508 return 0; 2553 return 0;
2509} 2554}
2510 2555
2511/**
2512 * t3_synchronize_rx - wait for current Rx processing on a port to complete
2513 * @adap: the adapter
2514 * @p: the port
2515 *
2516 * Ensures that current Rx processing on any of the queues associated with
2517 * the given port completes before returning. We do this by acquiring and
2518 * releasing the locks of the response queues associated with the port.
2519 */
2520static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p)
2521{
2522 int i;
2523
2524 for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) {
2525 struct sge_rspq *q = &adap->sge.qs[i].rspq;
2526
2527 spin_lock_irq(&q->lock);
2528 spin_unlock_irq(&q->lock);
2529 }
2530}
2531
2532static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features)
2533{
2534 struct port_info *pi = netdev_priv(dev);
2535 struct adapter *adapter = pi->adapter;
2536
2537 if (adapter->params.rev > 0) {
2538 t3_set_vlan_accel(adapter, 1 << pi->port_id,
2539 features & NETIF_F_HW_VLAN_RX);
2540 } else {
2541 /* single control for all ports */
2542 unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX;
2543
2544 for_each_port(adapter, i)
2545 have_vlans |=
2546 adapter->port[i]->features & NETIF_F_HW_VLAN_RX;
2547
2548 t3_set_vlan_accel(adapter, 1, have_vlans);
2549 }
2550 t3_synchronize_rx(adapter, pi);
2551}
2552
2553static netdev_features_t cxgb_fix_features(struct net_device *dev, 2556static netdev_features_t cxgb_fix_features(struct net_device *dev,
2554 netdev_features_t features) 2557 netdev_features_t features)
2555{ 2558{
@@ -3353,9 +3356,6 @@ static int __devinit init_one(struct pci_dev *pdev,
3353 err = sysfs_create_group(&adapter->port[0]->dev.kobj, 3356 err = sysfs_create_group(&adapter->port[0]->dev.kobj,
3354 &cxgb3_attr_group); 3357 &cxgb3_attr_group);
3355 3358
3356 for_each_port(adapter, i)
3357 cxgb_vlan_mode(adapter->port[i], adapter->port[i]->features);
3358
3359 print_port_info(adapter, ai); 3359 print_port_info(adapter, ai);
3360 return 0; 3360 return 0;
3361 3361
diff --git a/drivers/net/ethernet/dlink/dl2k.c b/drivers/net/ethernet/dlink/dl2k.c
index b2dc2c81a147..2e09edb9cdf8 100644
--- a/drivers/net/ethernet/dlink/dl2k.c
+++ b/drivers/net/ethernet/dlink/dl2k.c
@@ -1259,55 +1259,21 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
1259{ 1259{
1260 int phy_addr; 1260 int phy_addr;
1261 struct netdev_private *np = netdev_priv(dev); 1261 struct netdev_private *np = netdev_priv(dev);
1262 struct mii_data *miidata = (struct mii_data *) &rq->ifr_ifru; 1262 struct mii_ioctl_data *miidata = if_mii(rq);
1263
1264 struct netdev_desc *desc;
1265 int i;
1266 1263
1267 phy_addr = np->phy_addr; 1264 phy_addr = np->phy_addr;
1268 switch (cmd) { 1265 switch (cmd) {
1269 case SIOCDEVPRIVATE: 1266 case SIOCGMIIPHY:
1270 break; 1267 miidata->phy_id = phy_addr;
1271
1272 case SIOCDEVPRIVATE + 1:
1273 miidata->out_value = mii_read (dev, phy_addr, miidata->reg_num);
1274 break; 1268 break;
1275 case SIOCDEVPRIVATE + 2: 1269 case SIOCGMIIREG:
1276 mii_write (dev, phy_addr, miidata->reg_num, miidata->in_value); 1270 miidata->val_out = mii_read (dev, phy_addr, miidata->reg_num);
1277 break; 1271 break;
1278 case SIOCDEVPRIVATE + 3: 1272 case SIOCSMIIREG:
1279 break; 1273 if (!capable(CAP_NET_ADMIN))
1280 case SIOCDEVPRIVATE + 4: 1274 return -EPERM;
1281 break; 1275 mii_write (dev, phy_addr, miidata->reg_num, miidata->val_in);
1282 case SIOCDEVPRIVATE + 5:
1283 netif_stop_queue (dev);
1284 break; 1276 break;
1285 case SIOCDEVPRIVATE + 6:
1286 netif_wake_queue (dev);
1287 break;
1288 case SIOCDEVPRIVATE + 7:
1289 printk
1290 ("tx_full=%x cur_tx=%lx old_tx=%lx cur_rx=%lx old_rx=%lx\n",
1291 netif_queue_stopped(dev), np->cur_tx, np->old_tx, np->cur_rx,
1292 np->old_rx);
1293 break;
1294 case SIOCDEVPRIVATE + 8:
1295 printk("TX ring:\n");
1296 for (i = 0; i < TX_RING_SIZE; i++) {
1297 desc = &np->tx_ring[i];
1298 printk
1299 ("%02x:cur:%08x next:%08x status:%08x frag1:%08x frag0:%08x",
1300 i,
1301 (u32) (np->tx_ring_dma + i * sizeof (*desc)),
1302 (u32)le64_to_cpu(desc->next_desc),
1303 (u32)le64_to_cpu(desc->status),
1304 (u32)(le64_to_cpu(desc->fraginfo) >> 32),
1305 (u32)le64_to_cpu(desc->fraginfo));
1306 printk ("\n");
1307 }
1308 printk ("\n");
1309 break;
1310
1311 default: 1277 default:
1312 return -EOPNOTSUPP; 1278 return -EOPNOTSUPP;
1313 } 1279 }
diff --git a/drivers/net/ethernet/dlink/dl2k.h b/drivers/net/ethernet/dlink/dl2k.h
index ba0adcafa55a..30c2da3de548 100644
--- a/drivers/net/ethernet/dlink/dl2k.h
+++ b/drivers/net/ethernet/dlink/dl2k.h
@@ -365,13 +365,6 @@ struct ioctl_data {
365 char *data; 365 char *data;
366}; 366};
367 367
368struct mii_data {
369 __u16 reserved;
370 __u16 reg_num;
371 __u16 in_value;
372 __u16 out_value;
373};
374
375/* The Rx and Tx buffer descriptors. */ 368/* The Rx and Tx buffer descriptors. */
376struct netdev_desc { 369struct netdev_desc {
377 __le64 next_desc; 370 __le64 next_desc;
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index 17a46e76123f..9ac14f804851 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -116,10 +116,10 @@ static struct ucc_geth_info ugeth_primary_info = {
116 .maxGroupAddrInHash = 4, 116 .maxGroupAddrInHash = 4,
117 .maxIndAddrInHash = 4, 117 .maxIndAddrInHash = 4,
118 .prel = 7, 118 .prel = 7,
119 .maxFrameLength = 1518, 119 .maxFrameLength = 1518+16, /* Add extra bytes for VLANs etc. */
120 .minFrameLength = 64, 120 .minFrameLength = 64,
121 .maxD1Length = 1520, 121 .maxD1Length = 1520+16, /* Add extra bytes for VLANs etc. */
122 .maxD2Length = 1520, 122 .maxD2Length = 1520+16, /* Add extra bytes for VLANs etc. */
123 .vlantype = 0x8100, 123 .vlantype = 0x8100,
124 .ecamptr = ((uint32_t) NULL), 124 .ecamptr = ((uint32_t) NULL),
125 .eventRegMask = UCCE_OTHER, 125 .eventRegMask = UCCE_OTHER,
diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h
index 2e395a2566b8..f71b3e7b12de 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.h
+++ b/drivers/net/ethernet/freescale/ucc_geth.h
@@ -877,7 +877,7 @@ struct ucc_geth_hardware_statistics {
877 877
878/* Driver definitions */ 878/* Driver definitions */
879#define TX_BD_RING_LEN 0x10 879#define TX_BD_RING_LEN 0x10
880#define RX_BD_RING_LEN 0x10 880#define RX_BD_RING_LEN 0x20
881 881
882#define TX_RING_MOD_MASK(size) (size-1) 882#define TX_RING_MOD_MASK(size) (size-1)
883#define RX_RING_MOD_MASK(size) (size-1) 883#define RX_RING_MOD_MASK(size) (size-1)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 3516e17a399d..c9069a28832b 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -290,16 +290,18 @@ static void ehea_update_bcmc_registrations(void)
290 290
291 arr[i].adh = adapter->handle; 291 arr[i].adh = adapter->handle;
292 arr[i].port_id = port->logical_port_id; 292 arr[i].port_id = port->logical_port_id;
293 arr[i].reg_type = EHEA_BCMC_SCOPE_ALL | 293 arr[i].reg_type = EHEA_BCMC_MULTICAST |
294 EHEA_BCMC_MULTICAST |
295 EHEA_BCMC_UNTAGGED; 294 EHEA_BCMC_UNTAGGED;
295 if (mc_entry->macaddr == 0)
296 arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL;
296 arr[i++].macaddr = mc_entry->macaddr; 297 arr[i++].macaddr = mc_entry->macaddr;
297 298
298 arr[i].adh = adapter->handle; 299 arr[i].adh = adapter->handle;
299 arr[i].port_id = port->logical_port_id; 300 arr[i].port_id = port->logical_port_id;
300 arr[i].reg_type = EHEA_BCMC_SCOPE_ALL | 301 arr[i].reg_type = EHEA_BCMC_MULTICAST |
301 EHEA_BCMC_MULTICAST |
302 EHEA_BCMC_VLANID_ALL; 302 EHEA_BCMC_VLANID_ALL;
303 if (mc_entry->macaddr == 0)
304 arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL;
303 arr[i++].macaddr = mc_entry->macaddr; 305 arr[i++].macaddr = mc_entry->macaddr;
304 num_registrations -= 2; 306 num_registrations -= 2;
305 } 307 }
@@ -1838,8 +1840,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr,
1838 u64 hret; 1840 u64 hret;
1839 u8 reg_type; 1841 u8 reg_type;
1840 1842
1841 reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST 1843 reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_UNTAGGED;
1842 | EHEA_BCMC_UNTAGGED; 1844 if (mc_mac_addr == 0)
1845 reg_type |= EHEA_BCMC_SCOPE_ALL;
1843 1846
1844 hret = ehea_h_reg_dereg_bcmc(port->adapter->handle, 1847 hret = ehea_h_reg_dereg_bcmc(port->adapter->handle,
1845 port->logical_port_id, 1848 port->logical_port_id,
@@ -1847,8 +1850,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr,
1847 if (hret) 1850 if (hret)
1848 goto out; 1851 goto out;
1849 1852
1850 reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST 1853 reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_VLANID_ALL;
1851 | EHEA_BCMC_VLANID_ALL; 1854 if (mc_mac_addr == 0)
1855 reg_type |= EHEA_BCMC_SCOPE_ALL;
1852 1856
1853 hret = ehea_h_reg_dereg_bcmc(port->adapter->handle, 1857 hret = ehea_h_reg_dereg_bcmc(port->adapter->handle,
1854 port->logical_port_id, 1858 port->logical_port_id,
@@ -1898,7 +1902,7 @@ static void ehea_allmulti(struct net_device *dev, int enable)
1898 netdev_err(dev, 1902 netdev_err(dev,
1899 "failed enabling IFF_ALLMULTI\n"); 1903 "failed enabling IFF_ALLMULTI\n");
1900 } 1904 }
1901 } else 1905 } else {
1902 if (!enable) { 1906 if (!enable) {
1903 /* Disable ALLMULTI */ 1907 /* Disable ALLMULTI */
1904 hret = ehea_multicast_reg_helper(port, 0, H_DEREG_BCMC); 1908 hret = ehea_multicast_reg_helper(port, 0, H_DEREG_BCMC);
@@ -1908,6 +1912,7 @@ static void ehea_allmulti(struct net_device *dev, int enable)
1908 netdev_err(dev, 1912 netdev_err(dev,
1909 "failed disabling IFF_ALLMULTI\n"); 1913 "failed disabling IFF_ALLMULTI\n");
1910 } 1914 }
1915 }
1911} 1916}
1912 1917
1913static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr) 1918static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr)
@@ -1941,11 +1946,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
1941 struct netdev_hw_addr *ha; 1946 struct netdev_hw_addr *ha;
1942 int ret; 1947 int ret;
1943 1948
1944 if (port->promisc) { 1949 ehea_promiscuous(dev, !!(dev->flags & IFF_PROMISC));
1945 ehea_promiscuous(dev, 1);
1946 return;
1947 }
1948 ehea_promiscuous(dev, 0);
1949 1950
1950 if (dev->flags & IFF_ALLMULTI) { 1951 if (dev->flags & IFF_ALLMULTI) {
1951 ehea_allmulti(dev, 1); 1952 ehea_allmulti(dev, 1);
@@ -2463,6 +2464,7 @@ static int ehea_down(struct net_device *dev)
2463 return 0; 2464 return 0;
2464 2465
2465 ehea_drop_multicast_list(dev); 2466 ehea_drop_multicast_list(dev);
2467 ehea_allmulti(dev, 0);
2466 ehea_broadcast_reg_helper(port, H_DEREG_BCMC); 2468 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2467 2469
2468 ehea_free_interrupts(dev); 2470 ehea_free_interrupts(dev);
@@ -3261,6 +3263,7 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
3261 struct ehea_adapter *adapter; 3263 struct ehea_adapter *adapter;
3262 const u64 *adapter_handle; 3264 const u64 *adapter_handle;
3263 int ret; 3265 int ret;
3266 int i;
3264 3267
3265 if (!dev || !dev->dev.of_node) { 3268 if (!dev || !dev->dev.of_node) {
3266 pr_err("Invalid ibmebus device probed\n"); 3269 pr_err("Invalid ibmebus device probed\n");
@@ -3314,17 +3317,9 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
3314 tasklet_init(&adapter->neq_tasklet, ehea_neq_tasklet, 3317 tasklet_init(&adapter->neq_tasklet, ehea_neq_tasklet,
3315 (unsigned long)adapter); 3318 (unsigned long)adapter);
3316 3319
3317 ret = ibmebus_request_irq(adapter->neq->attr.ist1,
3318 ehea_interrupt_neq, IRQF_DISABLED,
3319 "ehea_neq", adapter);
3320 if (ret) {
3321 dev_err(&dev->dev, "requesting NEQ IRQ failed\n");
3322 goto out_kill_eq;
3323 }
3324
3325 ret = ehea_create_device_sysfs(dev); 3320 ret = ehea_create_device_sysfs(dev);
3326 if (ret) 3321 if (ret)
3327 goto out_free_irq; 3322 goto out_kill_eq;
3328 3323
3329 ret = ehea_setup_ports(adapter); 3324 ret = ehea_setup_ports(adapter);
3330 if (ret) { 3325 if (ret) {
@@ -3332,15 +3327,28 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
3332 goto out_rem_dev_sysfs; 3327 goto out_rem_dev_sysfs;
3333 } 3328 }
3334 3329
3330 ret = ibmebus_request_irq(adapter->neq->attr.ist1,
3331 ehea_interrupt_neq, IRQF_DISABLED,
3332 "ehea_neq", adapter);
3333 if (ret) {
3334 dev_err(&dev->dev, "requesting NEQ IRQ failed\n");
3335 goto out_shutdown_ports;
3336 }
3337
3338
3335 ret = 0; 3339 ret = 0;
3336 goto out; 3340 goto out;
3337 3341
3342out_shutdown_ports:
3343 for (i = 0; i < EHEA_MAX_PORTS; i++)
3344 if (adapter->port[i]) {
3345 ehea_shutdown_single_port(adapter->port[i]);
3346 adapter->port[i] = NULL;
3347 }
3348
3338out_rem_dev_sysfs: 3349out_rem_dev_sysfs:
3339 ehea_remove_device_sysfs(dev); 3350 ehea_remove_device_sysfs(dev);
3340 3351
3341out_free_irq:
3342 ibmebus_free_irq(adapter->neq->attr.ist1, adapter);
3343
3344out_kill_eq: 3352out_kill_eq:
3345 ehea_destroy_eq(adapter->neq); 3353 ehea_destroy_eq(adapter->neq);
3346 3354
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_phyp.h b/drivers/net/ethernet/ibm/ehea/ehea_phyp.h
index 52c456ec4d6c..8364815c32ff 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_phyp.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea_phyp.h
@@ -450,7 +450,7 @@ u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num,
450 void *cb_addr); 450 void *cb_addr);
451 451
452#define H_REGBCMC_PN EHEA_BMASK_IBM(48, 63) 452#define H_REGBCMC_PN EHEA_BMASK_IBM(48, 63)
453#define H_REGBCMC_REGTYPE EHEA_BMASK_IBM(61, 63) 453#define H_REGBCMC_REGTYPE EHEA_BMASK_IBM(60, 63)
454#define H_REGBCMC_MACADDR EHEA_BMASK_IBM(16, 63) 454#define H_REGBCMC_MACADDR EHEA_BMASK_IBM(16, 63)
455#define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63) 455#define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63)
456 456
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 19ab2154802c..9520a6ac1f30 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3799,7 +3799,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter)
3799 /* fire an unusual interrupt on the test handler */ 3799 /* fire an unusual interrupt on the test handler */
3800 ew32(ICS, E1000_ICS_RXSEQ); 3800 ew32(ICS, E1000_ICS_RXSEQ);
3801 e1e_flush(); 3801 e1e_flush();
3802 msleep(50); 3802 msleep(100);
3803 3803
3804 e1000_irq_disable(adapter); 3804 e1000_irq_disable(adapter);
3805 3805
diff --git a/drivers/net/ethernet/intel/e1000e/param.c b/drivers/net/ethernet/intel/e1000e/param.c
index ff796e42c3eb..16adeb9418a8 100644
--- a/drivers/net/ethernet/intel/e1000e/param.c
+++ b/drivers/net/ethernet/intel/e1000e/param.c
@@ -106,7 +106,7 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
106/* 106/*
107 * Interrupt Throttle Rate (interrupts/sec) 107 * Interrupt Throttle Rate (interrupts/sec)
108 * 108 *
109 * Valid Range: 100-100000 (0=off, 1=dynamic, 3=dynamic conservative) 109 * Valid Range: 100-100000 or one of: 0=off, 1=dynamic, 3=dynamic conservative
110 */ 110 */
111E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate"); 111E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
112#define DEFAULT_ITR 3 112#define DEFAULT_ITR 3
@@ -344,53 +344,60 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
344 344
345 if (num_InterruptThrottleRate > bd) { 345 if (num_InterruptThrottleRate > bd) {
346 adapter->itr = InterruptThrottleRate[bd]; 346 adapter->itr = InterruptThrottleRate[bd];
347 switch (adapter->itr) { 347
348 case 0: 348 /*
349 e_info("%s turned off\n", opt.name); 349 * Make sure a message is printed for non-special
350 break; 350 * values. And in case of an invalid option, display
351 case 1: 351 * warning, use default and got through itr/itr_setting
352 e_info("%s set to dynamic mode\n", opt.name); 352 * adjustment logic below
353 adapter->itr_setting = adapter->itr; 353 */
354 adapter->itr = 20000; 354 if ((adapter->itr > 4) &&
355 break; 355 e1000_validate_option(&adapter->itr, &opt, adapter))
356 case 3: 356 adapter->itr = opt.def;
357 e_info("%s set to dynamic conservative mode\n",
358 opt.name);
359 adapter->itr_setting = adapter->itr;
360 adapter->itr = 20000;
361 break;
362 case 4:
363 e_info("%s set to simplified (2000-8000 ints) "
364 "mode\n", opt.name);
365 adapter->itr_setting = 4;
366 break;
367 default:
368 /*
369 * Save the setting, because the dynamic bits
370 * change itr.
371 */
372 if (e1000_validate_option(&adapter->itr, &opt,
373 adapter) &&
374 (adapter->itr == 3)) {
375 /*
376 * In case of invalid user value,
377 * default to conservative mode.
378 */
379 adapter->itr_setting = adapter->itr;
380 adapter->itr = 20000;
381 } else {
382 /*
383 * Clear the lower two bits because
384 * they are used as control.
385 */
386 adapter->itr_setting =
387 adapter->itr & ~3;
388 }
389 break;
390 }
391 } else { 357 } else {
392 adapter->itr_setting = opt.def; 358 /*
359 * If no option specified, use default value and go
360 * through the logic below to adjust itr/itr_setting
361 */
362 adapter->itr = opt.def;
363
364 /*
365 * Make sure a message is printed for non-special
366 * default values
367 */
368 if (adapter->itr > 40)
369 e_info("%s set to default %d\n", opt.name,
370 adapter->itr);
371 }
372
373 adapter->itr_setting = adapter->itr;
374 switch (adapter->itr) {
375 case 0:
376 e_info("%s turned off\n", opt.name);
377 break;
378 case 1:
379 e_info("%s set to dynamic mode\n", opt.name);
380 adapter->itr = 20000;
381 break;
382 case 3:
383 e_info("%s set to dynamic conservative mode\n",
384 opt.name);
393 adapter->itr = 20000; 385 adapter->itr = 20000;
386 break;
387 case 4:
388 e_info("%s set to simplified (2000-8000 ints) mode\n",
389 opt.name);
390 break;
391 default:
392 /*
393 * Save the setting, because the dynamic bits
394 * change itr.
395 *
396 * Clear the lower two bits because
397 * they are used as control.
398 */
399 adapter->itr_setting &= ~3;
400 break;
394 } 401 }
395 } 402 }
396 { /* Interrupt Mode */ 403 { /* Interrupt Mode */
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index d61ca2a732f0..8ec74b07f940 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2731,14 +2731,14 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
2731 netdev->addr_len); 2731 netdev->addr_len);
2732 } 2732 }
2733 2733
2734 if (!is_valid_ether_addr(netdev->perm_addr)) { 2734 if (!is_valid_ether_addr(netdev->dev_addr)) {
2735 dev_err(&pdev->dev, "Invalid MAC Address: %pM\n", 2735 dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
2736 netdev->dev_addr); 2736 netdev->dev_addr);
2737 err = -EIO; 2737 err = -EIO;
2738 goto err_hw_init; 2738 goto err_hw_init;
2739 } 2739 }
2740 2740
2741 memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); 2741 memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
2742 2742
2743 setup_timer(&adapter->watchdog_timer, &igbvf_watchdog, 2743 setup_timer(&adapter->watchdog_timer, &igbvf_watchdog,
2744 (unsigned long) adapter); 2744 (unsigned long) adapter);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index 77ea4b716535..bc07933d67da 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -437,6 +437,7 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter,
437 */ 437 */
438 if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) && 438 if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) &&
439 (fctl & FC_FC_END_SEQ)) { 439 (fctl & FC_FC_END_SEQ)) {
440 skb_linearize(skb);
440 crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc)); 441 crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc));
441 crc->fcoe_eof = FC_EOF_T; 442 crc->fcoe_eof = FC_EOF_T;
442 } 443 }
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index a7f3cd872caf..88f6b2e9b72d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4873,10 +4873,6 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
4873 } 4873 }
4874 4874
4875 ixgbe_clear_interrupt_scheme(adapter); 4875 ixgbe_clear_interrupt_scheme(adapter);
4876#ifdef CONFIG_DCB
4877 kfree(adapter->ixgbe_ieee_pfc);
4878 kfree(adapter->ixgbe_ieee_ets);
4879#endif
4880 4876
4881#ifdef CONFIG_PM 4877#ifdef CONFIG_PM
4882 retval = pci_save_state(pdev); 4878 retval = pci_save_state(pdev);
@@ -7224,6 +7220,11 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
7224 7220
7225 ixgbe_release_hw_control(adapter); 7221 ixgbe_release_hw_control(adapter);
7226 7222
7223#ifdef CONFIG_DCB
7224 kfree(adapter->ixgbe_ieee_pfc);
7225 kfree(adapter->ixgbe_ieee_ets);
7226
7227#endif
7227 iounmap(adapter->hw.hw_addr); 7228 iounmap(adapter->hw.hw_addr);
7228 pci_release_selected_regions(pdev, pci_select_bars(pdev, 7229 pci_release_selected_regions(pdev, pci_select_bars(pdev,
7229 IORESOURCE_MEM)); 7230 IORESOURCE_MEM));
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index c9b504e2dfc3..487a6c8bd4ec 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -2494,8 +2494,13 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
2494 skb_copy_from_linear_data(re->skb, skb->data, length); 2494 skb_copy_from_linear_data(re->skb, skb->data, length);
2495 skb->ip_summed = re->skb->ip_summed; 2495 skb->ip_summed = re->skb->ip_summed;
2496 skb->csum = re->skb->csum; 2496 skb->csum = re->skb->csum;
2497 skb->rxhash = re->skb->rxhash;
2498 skb->vlan_tci = re->skb->vlan_tci;
2499
2497 pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, 2500 pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
2498 length, PCI_DMA_FROMDEVICE); 2501 length, PCI_DMA_FROMDEVICE);
2502 re->skb->vlan_tci = 0;
2503 re->skb->rxhash = 0;
2499 re->skb->ip_summed = CHECKSUM_NONE; 2504 re->skb->ip_summed = CHECKSUM_NONE;
2500 skb_put(skb, length); 2505 skb_put(skb, length);
2501 } 2506 }
@@ -2580,9 +2585,6 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
2580 struct sk_buff *skb = NULL; 2585 struct sk_buff *skb = NULL;
2581 u16 count = (status & GMR_FS_LEN) >> 16; 2586 u16 count = (status & GMR_FS_LEN) >> 16;
2582 2587
2583 if (status & GMR_FS_VLAN)
2584 count -= VLAN_HLEN; /* Account for vlan tag */
2585
2586 netif_printk(sky2, rx_status, KERN_DEBUG, dev, 2588 netif_printk(sky2, rx_status, KERN_DEBUG, dev,
2587 "rx slot %u status 0x%x len %d\n", 2589 "rx slot %u status 0x%x len %d\n",
2588 sky2->rx_next, status, length); 2590 sky2->rx_next, status, length);
@@ -2590,6 +2592,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
2590 sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; 2592 sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
2591 prefetch(sky2->rx_ring + sky2->rx_next); 2593 prefetch(sky2->rx_ring + sky2->rx_next);
2592 2594
2595 if (vlan_tx_tag_present(re->skb))
2596 count -= VLAN_HLEN; /* Account for vlan tag */
2597
2593 /* This chip has hardware problems that generates bogus status. 2598 /* This chip has hardware problems that generates bogus status.
2594 * So do only marginal checking and expect higher level protocols 2599 * So do only marginal checking and expect higher level protocols
2595 * to handle crap frames. 2600 * to handle crap frames.
@@ -2647,11 +2652,8 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
2647} 2652}
2648 2653
2649static inline void sky2_skb_rx(const struct sky2_port *sky2, 2654static inline void sky2_skb_rx(const struct sky2_port *sky2,
2650 u32 status, struct sk_buff *skb) 2655 struct sk_buff *skb)
2651{ 2656{
2652 if (status & GMR_FS_VLAN)
2653 __vlan_hwaccel_put_tag(skb, be16_to_cpu(sky2->rx_tag));
2654
2655 if (skb->ip_summed == CHECKSUM_NONE) 2657 if (skb->ip_summed == CHECKSUM_NONE)
2656 netif_receive_skb(skb); 2658 netif_receive_skb(skb);
2657 else 2659 else
@@ -2705,6 +2707,14 @@ static void sky2_rx_checksum(struct sky2_port *sky2, u32 status)
2705 } 2707 }
2706} 2708}
2707 2709
2710static void sky2_rx_tag(struct sky2_port *sky2, u16 length)
2711{
2712 struct sk_buff *skb;
2713
2714 skb = sky2->rx_ring[sky2->rx_next].skb;
2715 __vlan_hwaccel_put_tag(skb, be16_to_cpu(length));
2716}
2717
2708static void sky2_rx_hash(struct sky2_port *sky2, u32 status) 2718static void sky2_rx_hash(struct sky2_port *sky2, u32 status)
2709{ 2719{
2710 struct sk_buff *skb; 2720 struct sk_buff *skb;
@@ -2763,8 +2773,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
2763 } 2773 }
2764 2774
2765 skb->protocol = eth_type_trans(skb, dev); 2775 skb->protocol = eth_type_trans(skb, dev);
2766 2776 sky2_skb_rx(sky2, skb);
2767 sky2_skb_rx(sky2, status, skb);
2768 2777
2769 /* Stop after net poll weight */ 2778 /* Stop after net poll weight */
2770 if (++work_done >= to_do) 2779 if (++work_done >= to_do)
@@ -2772,11 +2781,11 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
2772 break; 2781 break;
2773 2782
2774 case OP_RXVLAN: 2783 case OP_RXVLAN:
2775 sky2->rx_tag = length; 2784 sky2_rx_tag(sky2, length);
2776 break; 2785 break;
2777 2786
2778 case OP_RXCHKSVLAN: 2787 case OP_RXCHKSVLAN:
2779 sky2->rx_tag = length; 2788 sky2_rx_tag(sky2, length);
2780 /* fall through */ 2789 /* fall through */
2781 case OP_RXCHKS: 2790 case OP_RXCHKS:
2782 if (likely(dev->features & NETIF_F_RXCSUM)) 2791 if (likely(dev->features & NETIF_F_RXCSUM))
diff --git a/drivers/net/ethernet/marvell/sky2.h b/drivers/net/ethernet/marvell/sky2.h
index ff6f58bf822a..3c896ce80b71 100644
--- a/drivers/net/ethernet/marvell/sky2.h
+++ b/drivers/net/ethernet/marvell/sky2.h
@@ -2241,7 +2241,6 @@ struct sky2_port {
2241 u16 rx_pending; 2241 u16 rx_pending;
2242 u16 rx_data_size; 2242 u16 rx_data_size;
2243 u16 rx_nfrags; 2243 u16 rx_nfrags;
2244 u16 rx_tag;
2245 2244
2246 struct { 2245 struct {
2247 unsigned long last; 2246 unsigned long last;
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index 558409ff4058..4ba969096717 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -2339,7 +2339,7 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
2339 netif_device_detach(dev); 2339 netif_device_detach(dev);
2340 2340
2341 /* Switch off chip, remember WOL setting */ 2341 /* Switch off chip, remember WOL setting */
2342 gp->asleep_wol = gp->wake_on_lan; 2342 gp->asleep_wol = !!gp->wake_on_lan;
2343 gem_do_stop(dev, gp->asleep_wol); 2343 gem_do_stop(dev, gp->asleep_wol);
2344 2344
2345 /* Unlock the network stack */ 2345 /* Unlock the network stack */
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 174a3348f676..08aff1a2087c 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1511,7 +1511,7 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd)
1511 1511
1512static int match_first_device(struct device *dev, void *data) 1512static int match_first_device(struct device *dev, void *data)
1513{ 1513{
1514 return 1; 1514 return !strncmp(dev_name(dev), "davinci_mdio", 12);
1515} 1515}
1516 1516
1517/** 1517/**
diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
index 817ad3bc4957..efd36691ce54 100644
--- a/drivers/net/ethernet/ti/tlan.c
+++ b/drivers/net/ethernet/ti/tlan.c
@@ -228,7 +228,7 @@ tlan_get_skb(const struct tlan_list *tag)
228 unsigned long addr; 228 unsigned long addr;
229 229
230 addr = tag->buffer[9].address; 230 addr = tag->buffer[9].address;
231 addr |= (tag->buffer[8].address << 16) << 16; 231 addr |= ((unsigned long) tag->buffer[8].address << 16) << 16;
232 return (struct sk_buff *) addr; 232 return (struct sk_buff *) addr;
233} 233}
234 234
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 5ee032cafade..42b5151aa78a 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -355,7 +355,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
355 u32 packet_len; 355 u32 packet_len;
356 u32 padbytes = 0xffff0000; 356 u32 padbytes = 0xffff0000;
357 357
358 padlen = ((skb->len + 4) % 512) ? 0 : 4; 358 padlen = ((skb->len + 4) & (dev->maxpacket - 1)) ? 0 : 4;
359 359
360 if ((!skb_cloned(skb)) && 360 if ((!skb_cloned(skb)) &&
361 ((headroom + tailroom) >= (4 + padlen))) { 361 ((headroom + tailroom) >= (4 + padlen))) {
@@ -377,7 +377,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
377 cpu_to_le32s(&packet_len); 377 cpu_to_le32s(&packet_len);
378 skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len)); 378 skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len));
379 379
380 if ((skb->len % 512) == 0) { 380 if (padlen) {
381 cpu_to_le32s(&padbytes); 381 cpu_to_le32s(&padbytes);
382 memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes)); 382 memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes));
383 skb_put(skb, sizeof(padbytes)); 383 skb_put(skb, sizeof(padbytes));
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index a2349483cd2a..00103a8c5e04 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -98,7 +98,7 @@ static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index,
98 98
99 if (unlikely(ret < 0)) 99 if (unlikely(ret < 0))
100 netdev_warn(dev->net, 100 netdev_warn(dev->net,
101 "Failed to read register index 0x%08x", index); 101 "Failed to read reg index 0x%08x: %d", index, ret);
102 102
103 le32_to_cpus(buf); 103 le32_to_cpus(buf);
104 *data = *buf; 104 *data = *buf;
@@ -128,7 +128,7 @@ static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index,
128 128
129 if (unlikely(ret < 0)) 129 if (unlikely(ret < 0))
130 netdev_warn(dev->net, 130 netdev_warn(dev->net,
131 "Failed to write register index 0x%08x", index); 131 "Failed to write reg index 0x%08x: %d", index, ret);
132 132
133 kfree(buf); 133 kfree(buf);
134 134
@@ -171,7 +171,7 @@ static int smsc75xx_mdio_read(struct net_device *netdev, int phy_id, int idx)
171 idx &= dev->mii.reg_num_mask; 171 idx &= dev->mii.reg_num_mask;
172 addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR) 172 addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
173 | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) 173 | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
174 | MII_ACCESS_READ; 174 | MII_ACCESS_READ | MII_ACCESS_BUSY;
175 ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); 175 ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
176 check_warn_goto_done(ret, "Error writing MII_ACCESS"); 176 check_warn_goto_done(ret, "Error writing MII_ACCESS");
177 177
@@ -210,7 +210,7 @@ static void smsc75xx_mdio_write(struct net_device *netdev, int phy_id, int idx,
210 idx &= dev->mii.reg_num_mask; 210 idx &= dev->mii.reg_num_mask;
211 addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR) 211 addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
212 | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) 212 | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
213 | MII_ACCESS_WRITE; 213 | MII_ACCESS_WRITE | MII_ACCESS_BUSY;
214 ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); 214 ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
215 check_warn_goto_done(ret, "Error writing MII_ACCESS"); 215 check_warn_goto_done(ret, "Error writing MII_ACCESS");
216 216
@@ -508,9 +508,10 @@ static int smsc75xx_link_reset(struct usbnet *dev)
508 u16 lcladv, rmtadv; 508 u16 lcladv, rmtadv;
509 int ret; 509 int ret;
510 510
511 /* clear interrupt status */ 511 /* read and write to clear phy interrupt status */
512 ret = smsc75xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC); 512 ret = smsc75xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC);
513 check_warn_return(ret, "Error reading PHY_INT_SRC"); 513 check_warn_return(ret, "Error reading PHY_INT_SRC");
514 smsc75xx_mdio_write(dev->net, mii->phy_id, PHY_INT_SRC, 0xffff);
514 515
515 ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL); 516 ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL);
516 check_warn_return(ret, "Error writing INT_STS"); 517 check_warn_return(ret, "Error writing INT_STS");
@@ -643,7 +644,7 @@ static int smsc75xx_set_mac_address(struct usbnet *dev)
643 644
644static int smsc75xx_phy_initialize(struct usbnet *dev) 645static int smsc75xx_phy_initialize(struct usbnet *dev)
645{ 646{
646 int bmcr, timeout = 0; 647 int bmcr, ret, timeout = 0;
647 648
648 /* Initialize MII structure */ 649 /* Initialize MII structure */
649 dev->mii.dev = dev->net; 650 dev->mii.dev = dev->net;
@@ -651,6 +652,7 @@ static int smsc75xx_phy_initialize(struct usbnet *dev)
651 dev->mii.mdio_write = smsc75xx_mdio_write; 652 dev->mii.mdio_write = smsc75xx_mdio_write;
652 dev->mii.phy_id_mask = 0x1f; 653 dev->mii.phy_id_mask = 0x1f;
653 dev->mii.reg_num_mask = 0x1f; 654 dev->mii.reg_num_mask = 0x1f;
655 dev->mii.supports_gmii = 1;
654 dev->mii.phy_id = SMSC75XX_INTERNAL_PHY_ID; 656 dev->mii.phy_id = SMSC75XX_INTERNAL_PHY_ID;
655 657
656 /* reset phy and wait for reset to complete */ 658 /* reset phy and wait for reset to complete */
@@ -661,7 +663,7 @@ static int smsc75xx_phy_initialize(struct usbnet *dev)
661 bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR); 663 bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
662 check_warn_return(bmcr, "Error reading MII_BMCR"); 664 check_warn_return(bmcr, "Error reading MII_BMCR");
663 timeout++; 665 timeout++;
664 } while ((bmcr & MII_BMCR) && (timeout < 100)); 666 } while ((bmcr & BMCR_RESET) && (timeout < 100));
665 667
666 if (timeout >= 100) { 668 if (timeout >= 100) {
667 netdev_warn(dev->net, "timeout on PHY Reset"); 669 netdev_warn(dev->net, "timeout on PHY Reset");
@@ -671,10 +673,13 @@ static int smsc75xx_phy_initialize(struct usbnet *dev)
671 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE, 673 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
672 ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP | 674 ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
673 ADVERTISE_PAUSE_ASYM); 675 ADVERTISE_PAUSE_ASYM);
676 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000,
677 ADVERTISE_1000FULL);
674 678
675 /* read to clear */ 679 /* read and write to clear phy interrupt status */
676 smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); 680 ret = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC);
677 check_warn_return(bmcr, "Error reading PHY_INT_SRC"); 681 check_warn_return(ret, "Error reading PHY_INT_SRC");
682 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_SRC, 0xffff);
678 683
679 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK, 684 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK,
680 PHY_INT_MASK_DEFAULT); 685 PHY_INT_MASK_DEFAULT);
@@ -946,6 +951,14 @@ static int smsc75xx_reset(struct usbnet *dev)
946 ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf); 951 ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf);
947 check_warn_return(ret, "Failed to write INT_EP_CTL: %d", ret); 952 check_warn_return(ret, "Failed to write INT_EP_CTL: %d", ret);
948 953
954 /* allow mac to detect speed and duplex from phy */
955 ret = smsc75xx_read_reg(dev, MAC_CR, &buf);
956 check_warn_return(ret, "Failed to read MAC_CR: %d", ret);
957
958 buf |= (MAC_CR_ADD | MAC_CR_ASD);
959 ret = smsc75xx_write_reg(dev, MAC_CR, buf);
960 check_warn_return(ret, "Failed to write MAC_CR: %d", ret);
961
949 ret = smsc75xx_read_reg(dev, MAC_TX, &buf); 962 ret = smsc75xx_read_reg(dev, MAC_TX, &buf);
950 check_warn_return(ret, "Failed to read MAC_TX: %d", ret); 963 check_warn_return(ret, "Failed to read MAC_TX: %d", ret);
951 964
@@ -1212,7 +1225,7 @@ static const struct driver_info smsc75xx_info = {
1212 .rx_fixup = smsc75xx_rx_fixup, 1225 .rx_fixup = smsc75xx_rx_fixup,
1213 .tx_fixup = smsc75xx_tx_fixup, 1226 .tx_fixup = smsc75xx_tx_fixup,
1214 .status = smsc75xx_status, 1227 .status = smsc75xx_status,
1215 .flags = FLAG_ETHER | FLAG_SEND_ZLP, 1228 .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
1216}; 1229};
1217 1230
1218static const struct usb_device_id products[] = { 1231static const struct usb_device_id products[] = {
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 5f19f84d3494..94ae66999f59 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1017,6 +1017,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
1017 dev->net->ethtool_ops = &smsc95xx_ethtool_ops; 1017 dev->net->ethtool_ops = &smsc95xx_ethtool_ops;
1018 dev->net->flags |= IFF_MULTICAST; 1018 dev->net->flags |= IFF_MULTICAST;
1019 dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM; 1019 dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM;
1020 dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
1020 return 0; 1021 return 0;
1021} 1022}
1022 1023
@@ -1191,7 +1192,7 @@ static const struct driver_info smsc95xx_info = {
1191 .rx_fixup = smsc95xx_rx_fixup, 1192 .rx_fixup = smsc95xx_rx_fixup,
1192 .tx_fixup = smsc95xx_tx_fixup, 1193 .tx_fixup = smsc95xx_tx_fixup,
1193 .status = smsc95xx_status, 1194 .status = smsc95xx_status,
1194 .flags = FLAG_ETHER | FLAG_SEND_ZLP, 1195 .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
1195}; 1196};
1196 1197
1197static const struct usb_device_id products[] = { 1198static const struct usb_device_id products[] = {
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index b7b3f5b0d406..2d927fb4adf4 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -210,6 +210,7 @@ static int init_status (struct usbnet *dev, struct usb_interface *intf)
210 } else { 210 } else {
211 usb_fill_int_urb(dev->interrupt, dev->udev, pipe, 211 usb_fill_int_urb(dev->interrupt, dev->udev, pipe,
212 buf, maxp, intr_complete, dev, period); 212 buf, maxp, intr_complete, dev, period);
213 dev->interrupt->transfer_flags |= URB_FREE_BUFFER;
213 dev_dbg(&intf->dev, 214 dev_dbg(&intf->dev,
214 "status ep%din, %d bytes period %d\n", 215 "status ep%din, %d bytes period %d\n",
215 usb_pipeendpoint(pipe), maxp, period); 216 usb_pipeendpoint(pipe), maxp, period);
@@ -1443,7 +1444,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
1443 1444
1444 status = register_netdev (net); 1445 status = register_netdev (net);
1445 if (status) 1446 if (status)
1446 goto out3; 1447 goto out4;
1447 netif_info(dev, probe, dev->net, 1448 netif_info(dev, probe, dev->net,
1448 "register '%s' at usb-%s-%s, %s, %pM\n", 1449 "register '%s' at usb-%s-%s, %s, %pM\n",
1449 udev->dev.driver->name, 1450 udev->dev.driver->name,
@@ -1461,6 +1462,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
1461 1462
1462 return 0; 1463 return 0;
1463 1464
1465out4:
1466 usb_free_urb(dev->interrupt);
1464out3: 1467out3:
1465 if (info->unbind) 1468 if (info->unbind)
1466 info->unbind (dev, udev); 1469 info->unbind (dev, udev);
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
index 8c50d9d19d78..aec33cc207fd 100644
--- a/drivers/net/wireless/ath/ath5k/ahb.c
+++ b/drivers/net/wireless/ath/ath5k/ahb.c
@@ -220,6 +220,7 @@ static int ath_ahb_remove(struct platform_device *pdev)
220 } 220 }
221 221
222 ath5k_deinit_ah(ah); 222 ath5k_deinit_ah(ah);
223 iounmap(ah->iobase);
223 platform_set_drvdata(pdev, NULL); 224 platform_set_drvdata(pdev, NULL);
224 ieee80211_free_hw(hw); 225 ieee80211_free_hw(hw);
225 226
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index d7d8e9199140..aba088005b22 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -869,7 +869,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah,
869 ar5008_hw_set_channel_regs(ah, chan); 869 ar5008_hw_set_channel_regs(ah, chan);
870 ar5008_hw_init_chain_masks(ah); 870 ar5008_hw_init_chain_masks(ah);
871 ath9k_olc_init(ah); 871 ath9k_olc_init(ah);
872 ath9k_hw_apply_txpower(ah, chan); 872 ath9k_hw_apply_txpower(ah, chan, false);
873 873
874 /* Write analog registers */ 874 /* Write analog registers */
875 if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) { 875 if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) {
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
index 59647a3ceb7f..3d400e8d6535 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
@@ -54,7 +54,7 @@ void ar9003_paprd_enable(struct ath_hw *ah, bool val)
54 54
55 if (val) { 55 if (val) {
56 ah->paprd_table_write_done = true; 56 ah->paprd_table_write_done = true;
57 ath9k_hw_apply_txpower(ah, chan); 57 ath9k_hw_apply_txpower(ah, chan, false);
58 } 58 }
59 59
60 REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0, 60 REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0,
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index bc992b237ae5..deb6cfb2959a 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -694,7 +694,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
694 ar9003_hw_override_ini(ah); 694 ar9003_hw_override_ini(ah);
695 ar9003_hw_set_channel_regs(ah, chan); 695 ar9003_hw_set_channel_regs(ah, chan);
696 ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); 696 ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
697 ath9k_hw_apply_txpower(ah, chan); 697 ath9k_hw_apply_txpower(ah, chan, false);
698 698
699 if (AR_SREV_9462(ah)) { 699 if (AR_SREV_9462(ah)) {
700 if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0, 700 if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0,
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index f272236d8053..b34e8b2990b1 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -824,6 +824,8 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
824 regulatory->max_power_level = ratesArray[i]; 824 regulatory->max_power_level = ratesArray[i];
825 } 825 }
826 826
827 ath9k_hw_update_regulatory_maxpower(ah);
828
827 if (test) 829 if (test)
828 return; 830 return;
829 831
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 6c69e4e8b1cb..fa84e37bf091 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1454,7 +1454,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
1454 return false; 1454 return false;
1455 } 1455 }
1456 ath9k_hw_set_clockrate(ah); 1456 ath9k_hw_set_clockrate(ah);
1457 ath9k_hw_apply_txpower(ah, chan); 1457 ath9k_hw_apply_txpower(ah, chan, false);
1458 ath9k_hw_rfbus_done(ah); 1458 ath9k_hw_rfbus_done(ah);
1459 1459
1460 if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan)) 1460 if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan))
@@ -2652,7 +2652,8 @@ static int get_antenna_gain(struct ath_hw *ah, struct ath9k_channel *chan)
2652 return ah->eep_ops->get_eeprom(ah, gain_param); 2652 return ah->eep_ops->get_eeprom(ah, gain_param);
2653} 2653}
2654 2654
2655void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan) 2655void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
2656 bool test)
2656{ 2657{
2657 struct ath_regulatory *reg = ath9k_hw_regulatory(ah); 2658 struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
2658 struct ieee80211_channel *channel; 2659 struct ieee80211_channel *channel;
@@ -2673,7 +2674,7 @@ void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan)
2673 2674
2674 ah->eep_ops->set_txpower(ah, chan, 2675 ah->eep_ops->set_txpower(ah, chan,
2675 ath9k_regd_get_ctl(reg, chan), 2676 ath9k_regd_get_ctl(reg, chan),
2676 ant_reduction, new_pwr, false); 2677 ant_reduction, new_pwr, test);
2677} 2678}
2678 2679
2679void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) 2680void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test)
@@ -2686,7 +2687,7 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test)
2686 if (test) 2687 if (test)
2687 channel->max_power = MAX_RATE_POWER / 2; 2688 channel->max_power = MAX_RATE_POWER / 2;
2688 2689
2689 ath9k_hw_apply_txpower(ah, chan); 2690 ath9k_hw_apply_txpower(ah, chan, test);
2690 2691
2691 if (test) 2692 if (test)
2692 channel->max_power = DIV_ROUND_UP(reg->max_power_level, 2); 2693 channel->max_power = DIV_ROUND_UP(reg->max_power_level, 2);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index aa1680a0c7fd..e88f182ff45c 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -985,7 +985,8 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len);
985/* PHY */ 985/* PHY */
986void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, 986void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled,
987 u32 *coef_mantissa, u32 *coef_exponent); 987 u32 *coef_mantissa, u32 *coef_exponent);
988void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan); 988void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
989 bool test);
989 990
990/* 991/*
991 * Code Specific to AR5008, AR9001 or AR9002, 992 * Code Specific to AR5008, AR9001 or AR9002,
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index c79e6638c88d..e4d6dc2e37d1 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4827,8 +4827,14 @@ static int b43_op_start(struct ieee80211_hw *hw)
4827 out_mutex_unlock: 4827 out_mutex_unlock:
4828 mutex_unlock(&wl->mutex); 4828 mutex_unlock(&wl->mutex);
4829 4829
4830 /* reload configuration */ 4830 /*
4831 b43_op_config(hw, ~0); 4831 * Configuration may have been overwritten during initialization.
4832 * Reload the configuration, but only if initialization was
4833 * successful. Reloading the configuration after a failed init
4834 * may hang the system.
4835 */
4836 if (!err)
4837 b43_op_config(hw, ~0);
4832 4838
4833 return err; 4839 return err;
4834} 4840}
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 4688904908ec..758c115b556e 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -108,9 +108,15 @@ static inline int brcmf_sdioh_f0_write_byte(struct brcmf_sdio_dev *sdiodev,
108 sdio_release_host(sdfunc); 108 sdio_release_host(sdfunc);
109 } 109 }
110 } else if (regaddr == SDIO_CCCR_ABORT) { 110 } else if (regaddr == SDIO_CCCR_ABORT) {
111 sdfunc = kmemdup(sdiodev->func[0], sizeof(struct sdio_func),
112 GFP_KERNEL);
113 if (!sdfunc)
114 return -ENOMEM;
115 sdfunc->num = 0;
111 sdio_claim_host(sdfunc); 116 sdio_claim_host(sdfunc);
112 sdio_writeb(sdfunc, *byte, regaddr, &err_ret); 117 sdio_writeb(sdfunc, *byte, regaddr, &err_ret);
113 sdio_release_host(sdfunc); 118 sdio_release_host(sdfunc);
119 kfree(sdfunc);
114 } else if (regaddr < 0xF0) { 120 } else if (regaddr < 0xF0) {
115 brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr); 121 brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr);
116 err_ret = -EPERM; 122 err_ret = -EPERM;
@@ -486,7 +492,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
486 kfree(bus_if); 492 kfree(bus_if);
487 return -ENOMEM; 493 return -ENOMEM;
488 } 494 }
489 sdiodev->func[0] = func->card->sdio_func[0]; 495 sdiodev->func[0] = func;
490 sdiodev->func[1] = func; 496 sdiodev->func[1] = func;
491 sdiodev->bus_if = bus_if; 497 sdiodev->bus_if = bus_if;
492 bus_if->bus_priv.sdio = sdiodev; 498 bus_if->bus_priv.sdio = sdiodev;
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index 2bf5dda29291..eb3829b03cd3 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -574,6 +574,8 @@ struct brcmf_sdio {
574 574
575 struct task_struct *dpc_tsk; 575 struct task_struct *dpc_tsk;
576 struct completion dpc_wait; 576 struct completion dpc_wait;
577 struct list_head dpc_tsklst;
578 spinlock_t dpc_tl_lock;
577 579
578 struct semaphore sdsem; 580 struct semaphore sdsem;
579 581
@@ -2594,29 +2596,58 @@ clkwait:
2594 return resched; 2596 return resched;
2595} 2597}
2596 2598
2599static inline void brcmf_sdbrcm_adddpctsk(struct brcmf_sdio *bus)
2600{
2601 struct list_head *new_hd;
2602 unsigned long flags;
2603
2604 if (in_interrupt())
2605 new_hd = kzalloc(sizeof(struct list_head), GFP_ATOMIC);
2606 else
2607 new_hd = kzalloc(sizeof(struct list_head), GFP_KERNEL);
2608 if (new_hd == NULL)
2609 return;
2610
2611 spin_lock_irqsave(&bus->dpc_tl_lock, flags);
2612 list_add_tail(new_hd, &bus->dpc_tsklst);
2613 spin_unlock_irqrestore(&bus->dpc_tl_lock, flags);
2614}
2615
2597static int brcmf_sdbrcm_dpc_thread(void *data) 2616static int brcmf_sdbrcm_dpc_thread(void *data)
2598{ 2617{
2599 struct brcmf_sdio *bus = (struct brcmf_sdio *) data; 2618 struct brcmf_sdio *bus = (struct brcmf_sdio *) data;
2619 struct list_head *cur_hd, *tmp_hd;
2620 unsigned long flags;
2600 2621
2601 allow_signal(SIGTERM); 2622 allow_signal(SIGTERM);
2602 /* Run until signal received */ 2623 /* Run until signal received */
2603 while (1) { 2624 while (1) {
2604 if (kthread_should_stop()) 2625 if (kthread_should_stop())
2605 break; 2626 break;
2606 if (!wait_for_completion_interruptible(&bus->dpc_wait)) { 2627
2607 /* Call bus dpc unless it indicated down 2628 if (list_empty(&bus->dpc_tsklst))
2608 (then clean stop) */ 2629 if (wait_for_completion_interruptible(&bus->dpc_wait))
2609 if (bus->sdiodev->bus_if->state != BRCMF_BUS_DOWN) { 2630 break;
2610 if (brcmf_sdbrcm_dpc(bus)) 2631
2611 complete(&bus->dpc_wait); 2632 spin_lock_irqsave(&bus->dpc_tl_lock, flags);
2612 } else { 2633 list_for_each_safe(cur_hd, tmp_hd, &bus->dpc_tsklst) {
2634 spin_unlock_irqrestore(&bus->dpc_tl_lock, flags);
2635
2636 if (bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) {
2613 /* after stopping the bus, exit thread */ 2637 /* after stopping the bus, exit thread */
2614 brcmf_sdbrcm_bus_stop(bus->sdiodev->dev); 2638 brcmf_sdbrcm_bus_stop(bus->sdiodev->dev);
2615 bus->dpc_tsk = NULL; 2639 bus->dpc_tsk = NULL;
2616 break; 2640 break;
2617 } 2641 }
2618 } else 2642
2619 break; 2643 if (brcmf_sdbrcm_dpc(bus))
2644 brcmf_sdbrcm_adddpctsk(bus);
2645
2646 spin_lock_irqsave(&bus->dpc_tl_lock, flags);
2647 list_del(cur_hd);
2648 kfree(cur_hd);
2649 }
2650 spin_unlock_irqrestore(&bus->dpc_tl_lock, flags);
2620 } 2651 }
2621 return 0; 2652 return 0;
2622} 2653}
@@ -2669,8 +2700,10 @@ static int brcmf_sdbrcm_bus_txdata(struct device *dev, struct sk_buff *pkt)
2669 /* Schedule DPC if needed to send queued packet(s) */ 2700 /* Schedule DPC if needed to send queued packet(s) */
2670 if (!bus->dpc_sched) { 2701 if (!bus->dpc_sched) {
2671 bus->dpc_sched = true; 2702 bus->dpc_sched = true;
2672 if (bus->dpc_tsk) 2703 if (bus->dpc_tsk) {
2704 brcmf_sdbrcm_adddpctsk(bus);
2673 complete(&bus->dpc_wait); 2705 complete(&bus->dpc_wait);
2706 }
2674 } 2707 }
2675 2708
2676 return ret; 2709 return ret;
@@ -3514,8 +3547,10 @@ void brcmf_sdbrcm_isr(void *arg)
3514 brcmf_dbg(ERROR, "isr w/o interrupt configured!\n"); 3547 brcmf_dbg(ERROR, "isr w/o interrupt configured!\n");
3515 3548
3516 bus->dpc_sched = true; 3549 bus->dpc_sched = true;
3517 if (bus->dpc_tsk) 3550 if (bus->dpc_tsk) {
3551 brcmf_sdbrcm_adddpctsk(bus);
3518 complete(&bus->dpc_wait); 3552 complete(&bus->dpc_wait);
3553 }
3519} 3554}
3520 3555
3521static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus) 3556static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus)
@@ -3559,8 +3594,10 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus)
3559 bus->ipend = true; 3594 bus->ipend = true;
3560 3595
3561 bus->dpc_sched = true; 3596 bus->dpc_sched = true;
3562 if (bus->dpc_tsk) 3597 if (bus->dpc_tsk) {
3598 brcmf_sdbrcm_adddpctsk(bus);
3563 complete(&bus->dpc_wait); 3599 complete(&bus->dpc_wait);
3600 }
3564 } 3601 }
3565 } 3602 }
3566 3603
@@ -3897,6 +3934,8 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
3897 } 3934 }
3898 /* Initialize DPC thread */ 3935 /* Initialize DPC thread */
3899 init_completion(&bus->dpc_wait); 3936 init_completion(&bus->dpc_wait);
3937 INIT_LIST_HEAD(&bus->dpc_tsklst);
3938 spin_lock_init(&bus->dpc_tl_lock);
3900 bus->dpc_tsk = kthread_run(brcmf_sdbrcm_dpc_thread, 3939 bus->dpc_tsk = kthread_run(brcmf_sdbrcm_dpc_thread,
3901 bus, "brcmf_dpc"); 3940 bus, "brcmf_dpc");
3902 if (IS_ERR(bus->dpc_tsk)) { 3941 if (IS_ERR(bus->dpc_tsk)) {
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 7083db75b00c..b4d92792c502 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -847,8 +847,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
847 */ 847 */
848 if (!(txs->status & TX_STATUS_AMPDU) 848 if (!(txs->status & TX_STATUS_AMPDU)
849 && (txs->status & TX_STATUS_INTERMEDIATE)) { 849 && (txs->status & TX_STATUS_INTERMEDIATE)) {
850 wiphy_err(wlc->wiphy, "%s: INTERMEDIATE but not AMPDU\n", 850 BCMMSG(wlc->wiphy, "INTERMEDIATE but not AMPDU\n");
851 __func__);
852 return false; 851 return false;
853 } 852 }
854 853
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 2b022571a859..1779db3aa2b0 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -2191,6 +2191,7 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
2191{ 2191{
2192 int rc = 0; 2192 int rc = 0;
2193 unsigned long flags; 2193 unsigned long flags;
2194 unsigned long now, end;
2194 2195
2195 spin_lock_irqsave(&priv->lock, flags); 2196 spin_lock_irqsave(&priv->lock, flags);
2196 if (priv->status & STATUS_HCMD_ACTIVE) { 2197 if (priv->status & STATUS_HCMD_ACTIVE) {
@@ -2232,10 +2233,20 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
2232 } 2233 }
2233 spin_unlock_irqrestore(&priv->lock, flags); 2234 spin_unlock_irqrestore(&priv->lock, flags);
2234 2235
2236 now = jiffies;
2237 end = now + HOST_COMPLETE_TIMEOUT;
2238again:
2235 rc = wait_event_interruptible_timeout(priv->wait_command_queue, 2239 rc = wait_event_interruptible_timeout(priv->wait_command_queue,
2236 !(priv-> 2240 !(priv->
2237 status & STATUS_HCMD_ACTIVE), 2241 status & STATUS_HCMD_ACTIVE),
2238 HOST_COMPLETE_TIMEOUT); 2242 end - now);
2243 if (rc < 0) {
2244 now = jiffies;
2245 if (time_before(now, end))
2246 goto again;
2247 rc = 0;
2248 }
2249
2239 if (rc == 0) { 2250 if (rc == 0) {
2240 spin_lock_irqsave(&priv->lock, flags); 2251 spin_lock_irqsave(&priv->lock, flags);
2241 if (priv->status & STATUS_HCMD_ACTIVE) { 2252 if (priv->status & STATUS_HCMD_ACTIVE) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 5b0d888f746b..8d80e233bc7a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -46,8 +46,8 @@
46#include "iwl-prph.h" 46#include "iwl-prph.h"
47 47
48/* Highest firmware API version supported */ 48/* Highest firmware API version supported */
49#define IWL1000_UCODE_API_MAX 6 49#define IWL1000_UCODE_API_MAX 5
50#define IWL100_UCODE_API_MAX 6 50#define IWL100_UCODE_API_MAX 5
51 51
52/* Oldest version we won't warn about */ 52/* Oldest version we won't warn about */
53#define IWL1000_UCODE_API_OK 5 53#define IWL1000_UCODE_API_OK 5
@@ -226,5 +226,5 @@ const struct iwl_cfg iwl100_bg_cfg = {
226 IWL_DEVICE_100, 226 IWL_DEVICE_100,
227}; 227};
228 228
229MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); 229MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_OK));
230MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_MAX)); 230MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_OK));
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c
index 5635b9e2c69e..ea108622e0bd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-2000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-2000.c
@@ -51,10 +51,10 @@
51#define IWL135_UCODE_API_MAX 6 51#define IWL135_UCODE_API_MAX 6
52 52
53/* Oldest version we won't warn about */ 53/* Oldest version we won't warn about */
54#define IWL2030_UCODE_API_OK 5 54#define IWL2030_UCODE_API_OK 6
55#define IWL2000_UCODE_API_OK 5 55#define IWL2000_UCODE_API_OK 6
56#define IWL105_UCODE_API_OK 5 56#define IWL105_UCODE_API_OK 6
57#define IWL135_UCODE_API_OK 5 57#define IWL135_UCODE_API_OK 6
58 58
59/* Lowest firmware API version supported */ 59/* Lowest firmware API version supported */
60#define IWL2030_UCODE_API_MIN 5 60#define IWL2030_UCODE_API_MIN 5
@@ -328,7 +328,7 @@ const struct iwl_cfg iwl135_bgn_cfg = {
328 .ht_params = &iwl2000_ht_params, 328 .ht_params = &iwl2000_ht_params,
329}; 329};
330 330
331MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX)); 331MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK));
332MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX)); 332MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK));
333MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX)); 333MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK));
334MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX)); 334MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK));
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index a805e97b89af..de0920c74cdd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -51,6 +51,10 @@
51#define IWL5000_UCODE_API_MAX 5 51#define IWL5000_UCODE_API_MAX 5
52#define IWL5150_UCODE_API_MAX 2 52#define IWL5150_UCODE_API_MAX 2
53 53
54/* Oldest version we won't warn about */
55#define IWL5000_UCODE_API_OK 5
56#define IWL5150_UCODE_API_OK 2
57
54/* Lowest firmware API version supported */ 58/* Lowest firmware API version supported */
55#define IWL5000_UCODE_API_MIN 1 59#define IWL5000_UCODE_API_MIN 1
56#define IWL5150_UCODE_API_MIN 1 60#define IWL5150_UCODE_API_MIN 1
@@ -326,6 +330,7 @@ static const struct iwl_ht_params iwl5000_ht_params = {
326#define IWL_DEVICE_5000 \ 330#define IWL_DEVICE_5000 \
327 .fw_name_pre = IWL5000_FW_PRE, \ 331 .fw_name_pre = IWL5000_FW_PRE, \
328 .ucode_api_max = IWL5000_UCODE_API_MAX, \ 332 .ucode_api_max = IWL5000_UCODE_API_MAX, \
333 .ucode_api_ok = IWL5000_UCODE_API_OK, \
329 .ucode_api_min = IWL5000_UCODE_API_MIN, \ 334 .ucode_api_min = IWL5000_UCODE_API_MIN, \
330 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 335 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
331 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 336 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
@@ -371,6 +376,7 @@ const struct iwl_cfg iwl5350_agn_cfg = {
371 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN", 376 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
372 .fw_name_pre = IWL5000_FW_PRE, 377 .fw_name_pre = IWL5000_FW_PRE,
373 .ucode_api_max = IWL5000_UCODE_API_MAX, 378 .ucode_api_max = IWL5000_UCODE_API_MAX,
379 .ucode_api_ok = IWL5000_UCODE_API_OK,
374 .ucode_api_min = IWL5000_UCODE_API_MIN, 380 .ucode_api_min = IWL5000_UCODE_API_MIN,
375 .max_inst_size = IWLAGN_RTC_INST_SIZE, 381 .max_inst_size = IWLAGN_RTC_INST_SIZE,
376 .max_data_size = IWLAGN_RTC_DATA_SIZE, 382 .max_data_size = IWLAGN_RTC_DATA_SIZE,
@@ -386,6 +392,7 @@ const struct iwl_cfg iwl5350_agn_cfg = {
386#define IWL_DEVICE_5150 \ 392#define IWL_DEVICE_5150 \
387 .fw_name_pre = IWL5150_FW_PRE, \ 393 .fw_name_pre = IWL5150_FW_PRE, \
388 .ucode_api_max = IWL5150_UCODE_API_MAX, \ 394 .ucode_api_max = IWL5150_UCODE_API_MAX, \
395 .ucode_api_ok = IWL5150_UCODE_API_OK, \
389 .ucode_api_min = IWL5150_UCODE_API_MIN, \ 396 .ucode_api_min = IWL5150_UCODE_API_MIN, \
390 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 397 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
391 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 398 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
@@ -409,5 +416,5 @@ const struct iwl_cfg iwl5150_abg_cfg = {
409 IWL_DEVICE_5150, 416 IWL_DEVICE_5150,
410}; 417};
411 418
412MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); 419MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_OK));
413MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX)); 420MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_OK));
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 64060cd738b5..f0c91505a7f7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -53,6 +53,8 @@
53/* Oldest version we won't warn about */ 53/* Oldest version we won't warn about */
54#define IWL6000_UCODE_API_OK 4 54#define IWL6000_UCODE_API_OK 4
55#define IWL6000G2_UCODE_API_OK 5 55#define IWL6000G2_UCODE_API_OK 5
56#define IWL6050_UCODE_API_OK 5
57#define IWL6000G2B_UCODE_API_OK 6
56 58
57/* Lowest firmware API version supported */ 59/* Lowest firmware API version supported */
58#define IWL6000_UCODE_API_MIN 4 60#define IWL6000_UCODE_API_MIN 4
@@ -388,7 +390,7 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
388#define IWL_DEVICE_6030 \ 390#define IWL_DEVICE_6030 \
389 .fw_name_pre = IWL6030_FW_PRE, \ 391 .fw_name_pre = IWL6030_FW_PRE, \
390 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \ 392 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
391 .ucode_api_ok = IWL6000G2_UCODE_API_OK, \ 393 .ucode_api_ok = IWL6000G2B_UCODE_API_OK, \
392 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \ 394 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
393 .max_inst_size = IWL60_RTC_INST_SIZE, \ 395 .max_inst_size = IWL60_RTC_INST_SIZE, \
394 .max_data_size = IWL60_RTC_DATA_SIZE, \ 396 .max_data_size = IWL60_RTC_DATA_SIZE, \
@@ -557,6 +559,6 @@ const struct iwl_cfg iwl6000_3agn_cfg = {
557}; 559};
558 560
559MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK)); 561MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
560MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX)); 562MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
561MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX)); 563MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
562MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX)); 564MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index f1226dbf789d..2a9a16f901c3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -863,7 +863,6 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
863 863
864void iwlagn_prepare_restart(struct iwl_priv *priv) 864void iwlagn_prepare_restart(struct iwl_priv *priv)
865{ 865{
866 struct iwl_rxon_context *ctx;
867 bool bt_full_concurrent; 866 bool bt_full_concurrent;
868 u8 bt_ci_compliance; 867 u8 bt_ci_compliance;
869 u8 bt_load; 868 u8 bt_load;
@@ -872,8 +871,6 @@ void iwlagn_prepare_restart(struct iwl_priv *priv)
872 871
873 lockdep_assert_held(&priv->mutex); 872 lockdep_assert_held(&priv->mutex);
874 873
875 for_each_context(priv, ctx)
876 ctx->vif = NULL;
877 priv->is_open = 0; 874 priv->is_open = 0;
878 875
879 /* 876 /*
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h
index 90208094b8eb..74bce97a8600 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fh.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fh.h
@@ -104,15 +104,29 @@
104 * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04 104 * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04
105 * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte 105 * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte
106 * aligned (address bits 0-7 must be 0). 106 * aligned (address bits 0-7 must be 0).
107 * Later devices have 20 (5000 series) or 30 (higher) queues, but the registers
108 * for them are in different places.
107 * 109 *
108 * Bit fields in each pointer register: 110 * Bit fields in each pointer register:
109 * 27-0: TFD CB physical base address [35:8], must be 256-byte aligned 111 * 27-0: TFD CB physical base address [35:8], must be 256-byte aligned
110 */ 112 */
111#define FH_MEM_CBBC_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0x9D0) 113#define FH_MEM_CBBC_0_15_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0x9D0)
112#define FH_MEM_CBBC_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xA10) 114#define FH_MEM_CBBC_0_15_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xA10)
113 115#define FH_MEM_CBBC_16_19_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0xBF0)
114/* Find TFD CB base pointer for given queue (range 0-15). */ 116#define FH_MEM_CBBC_16_19_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xC00)
115#define FH_MEM_CBBC_QUEUE(x) (FH_MEM_CBBC_LOWER_BOUND + (x) * 0x4) 117#define FH_MEM_CBBC_20_31_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0xB20)
118#define FH_MEM_CBBC_20_31_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xB80)
119
120/* Find TFD CB base pointer for given queue */
121static inline unsigned int FH_MEM_CBBC_QUEUE(unsigned int chnl)
122{
123 if (chnl < 16)
124 return FH_MEM_CBBC_0_15_LOWER_BOUND + 4 * chnl;
125 if (chnl < 20)
126 return FH_MEM_CBBC_16_19_LOWER_BOUND + 4 * (chnl - 16);
127 WARN_ON_ONCE(chnl >= 32);
128 return FH_MEM_CBBC_20_31_LOWER_BOUND + 4 * (chnl - 20);
129}
116 130
117 131
118/** 132/**
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index b6805f8e9a01..c24a7134a6f9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -1244,6 +1244,7 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
1244 struct iwl_rxon_context *tmp, *ctx = NULL; 1244 struct iwl_rxon_context *tmp, *ctx = NULL;
1245 int err; 1245 int err;
1246 enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif); 1246 enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif);
1247 bool reset = false;
1247 1248
1248 IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n", 1249 IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n",
1249 viftype, vif->addr); 1250 viftype, vif->addr);
@@ -1265,6 +1266,13 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
1265 tmp->interface_modes | tmp->exclusive_interface_modes; 1266 tmp->interface_modes | tmp->exclusive_interface_modes;
1266 1267
1267 if (tmp->vif) { 1268 if (tmp->vif) {
1269 /* On reset we need to add the same interface again */
1270 if (tmp->vif == vif) {
1271 reset = true;
1272 ctx = tmp;
1273 break;
1274 }
1275
1268 /* check if this busy context is exclusive */ 1276 /* check if this busy context is exclusive */
1269 if (tmp->exclusive_interface_modes & 1277 if (tmp->exclusive_interface_modes &
1270 BIT(tmp->vif->type)) { 1278 BIT(tmp->vif->type)) {
@@ -1291,7 +1299,7 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
1291 ctx->vif = vif; 1299 ctx->vif = vif;
1292 1300
1293 err = iwl_setup_interface(priv, ctx); 1301 err = iwl_setup_interface(priv, ctx);
1294 if (!err) 1302 if (!err || reset)
1295 goto out; 1303 goto out;
1296 1304
1297 ctx->vif = NULL; 1305 ctx->vif = NULL;
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h
index 75dc20bd965b..3b1069290fa9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/iwlwifi/iwl-prph.h
@@ -223,12 +223,33 @@
223#define SCD_AIT (SCD_BASE + 0x0c) 223#define SCD_AIT (SCD_BASE + 0x0c)
224#define SCD_TXFACT (SCD_BASE + 0x10) 224#define SCD_TXFACT (SCD_BASE + 0x10)
225#define SCD_ACTIVE (SCD_BASE + 0x14) 225#define SCD_ACTIVE (SCD_BASE + 0x14)
226#define SCD_QUEUE_WRPTR(x) (SCD_BASE + 0x18 + (x) * 4)
227#define SCD_QUEUE_RDPTR(x) (SCD_BASE + 0x68 + (x) * 4)
228#define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8) 226#define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8)
229#define SCD_AGGR_SEL (SCD_BASE + 0x248) 227#define SCD_AGGR_SEL (SCD_BASE + 0x248)
230#define SCD_INTERRUPT_MASK (SCD_BASE + 0x108) 228#define SCD_INTERRUPT_MASK (SCD_BASE + 0x108)
231#define SCD_QUEUE_STATUS_BITS(x) (SCD_BASE + 0x10c + (x) * 4) 229
230static inline unsigned int SCD_QUEUE_WRPTR(unsigned int chnl)
231{
232 if (chnl < 20)
233 return SCD_BASE + 0x18 + chnl * 4;
234 WARN_ON_ONCE(chnl >= 32);
235 return SCD_BASE + 0x284 + (chnl - 20) * 4;
236}
237
238static inline unsigned int SCD_QUEUE_RDPTR(unsigned int chnl)
239{
240 if (chnl < 20)
241 return SCD_BASE + 0x68 + chnl * 4;
242 WARN_ON_ONCE(chnl >= 32);
243 return SCD_BASE + 0x2B4 + (chnl - 20) * 4;
244}
245
246static inline unsigned int SCD_QUEUE_STATUS_BITS(unsigned int chnl)
247{
248 if (chnl < 20)
249 return SCD_BASE + 0x10c + chnl * 4;
250 WARN_ON_ONCE(chnl >= 32);
251 return SCD_BASE + 0x384 + (chnl - 20) * 4;
252}
232 253
233/*********************** END TX SCHEDULER *************************************/ 254/*********************** END TX SCHEDULER *************************************/
234 255
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 288b035a3579..cc15fdb36060 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1941,6 +1941,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
1941 rtl_deinit_deferred_work(hw); 1941 rtl_deinit_deferred_work(hw);
1942 rtlpriv->intf_ops->adapter_stop(hw); 1942 rtlpriv->intf_ops->adapter_stop(hw);
1943 } 1943 }
1944 rtlpriv->cfg->ops->disable_interrupt(hw);
1944 1945
1945 /*deinit rfkill */ 1946 /*deinit rfkill */
1946 rtl_deinit_rfkill(hw); 1947 rtl_deinit_rfkill(hw);
diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c
index 41302c7b1ad0..d1afb8e3b2ef 100644
--- a/drivers/net/wireless/wl1251/main.c
+++ b/drivers/net/wireless/wl1251/main.c
@@ -479,6 +479,7 @@ static void wl1251_op_stop(struct ieee80211_hw *hw)
479 cancel_work_sync(&wl->irq_work); 479 cancel_work_sync(&wl->irq_work);
480 cancel_work_sync(&wl->tx_work); 480 cancel_work_sync(&wl->tx_work);
481 cancel_work_sync(&wl->filter_work); 481 cancel_work_sync(&wl->filter_work);
482 cancel_delayed_work_sync(&wl->elp_work);
482 483
483 mutex_lock(&wl->mutex); 484 mutex_lock(&wl->mutex);
484 485
diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c
index f78694295c39..1b851f650e07 100644
--- a/drivers/net/wireless/wl1251/sdio.c
+++ b/drivers/net/wireless/wl1251/sdio.c
@@ -315,8 +315,8 @@ static void __devexit wl1251_sdio_remove(struct sdio_func *func)
315 315
316 if (wl->irq) 316 if (wl->irq)
317 free_irq(wl->irq, wl); 317 free_irq(wl->irq, wl);
318 kfree(wl_sdio);
319 wl1251_free_hw(wl); 318 wl1251_free_hw(wl);
319 kfree(wl_sdio);
320 320
321 sdio_claim_host(func); 321 sdio_claim_host(func);
322 sdio_release_irq(func); 322 sdio_release_irq(func);
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 120955c66410..8334dadc681d 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1672,7 +1672,8 @@ static void qeth_configure_blkt_default(struct qeth_card *card, char *prcd)
1672{ 1672{
1673 QETH_DBF_TEXT(SETUP, 2, "cfgblkt"); 1673 QETH_DBF_TEXT(SETUP, 2, "cfgblkt");
1674 1674
1675 if (prcd[74] == 0xF0 && prcd[75] == 0xF0 && prcd[76] == 0xF5) { 1675 if (prcd[74] == 0xF0 && prcd[75] == 0xF0 &&
1676 (prcd[76] == 0xF5 || prcd[76] == 0xF6)) {
1676 card->info.blkt.time_total = 250; 1677 card->info.blkt.time_total = 250;
1677 card->info.blkt.inter_packet = 5; 1678 card->info.blkt.inter_packet = 5;
1678 card->info.blkt.inter_packet_jumbo = 15; 1679 card->info.blkt.inter_packet_jumbo = 15;
@@ -4540,7 +4541,8 @@ static void qeth_determine_capabilities(struct qeth_card *card)
4540 goto out_offline; 4541 goto out_offline;
4541 } 4542 }
4542 qeth_configure_unitaddr(card, prcd); 4543 qeth_configure_unitaddr(card, prcd);
4543 qeth_configure_blkt_default(card, prcd); 4544 if (ddev_offline)
4545 qeth_configure_blkt_default(card, prcd);
4544 kfree(prcd); 4546 kfree(prcd);
4545 4547
4546 rc = qdio_get_ssqd_desc(ddev, &card->ssqd); 4548 rc = qdio_get_ssqd_desc(ddev, &card->ssqd);