aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/Kconfig1
-rw-r--r--drivers/net/atarilance.c2
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c2
-rw-r--r--drivers/net/cxgb3/sge.c4
-rw-r--r--drivers/net/e1000e/82571.c38
-rw-r--r--drivers/net/e1000e/e1000.h3
-rw-r--r--drivers/net/e1000e/netdev.c29
-rw-r--r--drivers/net/igb/igb_main.c1
-rw-r--r--drivers/net/igbvf/netdev.c8
-rw-r--r--drivers/net/ixgb/ixgb_main.c1
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb.c39
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb.h5
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82599.c5
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82599.h3
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c12
-rw-r--r--drivers/net/lib8390.c1
-rw-r--r--drivers/net/netxen/netxen_nic_ctx.c15
-rw-r--r--drivers/net/netxen/netxen_nic_main.c7
-rw-r--r--drivers/net/stmmac/stmmac_main.c40
-rw-r--r--drivers/net/wireless/ath/ath5k/attach.c17
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c31
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c15
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c18
-rw-r--r--drivers/net/wireless/b43/sdio.c2
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c32
28 files changed, 244 insertions, 101 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 9334539ebf75..f6668cdaac85 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2541,6 +2541,7 @@ source "drivers/net/stmmac/Kconfig"
2541config PCH_GBE 2541config PCH_GBE
2542 tristate "PCH Gigabit Ethernet" 2542 tristate "PCH Gigabit Ethernet"
2543 depends on PCI 2543 depends on PCI
2544 select MII
2544 ---help--- 2545 ---help---
2545 This is a gigabit ethernet driver for Topcliff PCH. 2546 This is a gigabit ethernet driver for Topcliff PCH.
2546 Topcliff PCH is the platform controller hub that is used in Intel's 2547 Topcliff PCH is the platform controller hub that is used in Intel's
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c
index 3134e5326231..8cb27cb7bca1 100644
--- a/drivers/net/atarilance.c
+++ b/drivers/net/atarilance.c
@@ -407,7 +407,7 @@ static noinline int __init addr_accessible(volatile void *regp, int wordflag,
407 int writeflag) 407 int writeflag)
408{ 408{
409 int ret; 409 int ret;
410 long flags; 410 unsigned long flags;
411 long *vbr, save_berr; 411 long *vbr, save_berr;
412 412
413 local_irq_save(flags); 413 local_irq_save(flags);
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 4e3c12371aae..407d4e272075 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -3301,7 +3301,6 @@ static int __devinit init_one(struct pci_dev *pdev,
3301 pi->rx_offload = T3_RX_CSUM | T3_LRO; 3301 pi->rx_offload = T3_RX_CSUM | T3_LRO;
3302 pi->port_id = i; 3302 pi->port_id = i;
3303 netif_carrier_off(netdev); 3303 netif_carrier_off(netdev);
3304 netif_tx_stop_all_queues(netdev);
3305 netdev->irq = pdev->irq; 3304 netdev->irq = pdev->irq;
3306 netdev->mem_start = mmio_start; 3305 netdev->mem_start = mmio_start;
3307 netdev->mem_end = mmio_start + mmio_len - 1; 3306 netdev->mem_end = mmio_start + mmio_len - 1;
@@ -3342,6 +3341,7 @@ static int __devinit init_one(struct pci_dev *pdev,
3342 adapter->name = adapter->port[i]->name; 3341 adapter->name = adapter->port[i]->name;
3343 3342
3344 __set_bit(i, &adapter->registered_device_map); 3343 __set_bit(i, &adapter->registered_device_map);
3344 netif_tx_stop_all_queues(adapter->port[i]);
3345 } 3345 }
3346 } 3346 }
3347 if (!adapter->registered_device_map) { 3347 if (!adapter->registered_device_map) {
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 5d72bda54389..f9f6645b2e61 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -296,8 +296,10 @@ static void free_tx_desc(struct adapter *adapter, struct sge_txq *q,
296 if (d->skb) { /* an SGL is present */ 296 if (d->skb) { /* an SGL is present */
297 if (need_unmap) 297 if (need_unmap)
298 unmap_skb(d->skb, q, cidx, pdev); 298 unmap_skb(d->skb, q, cidx, pdev);
299 if (d->eop) 299 if (d->eop) {
300 kfree_skb(d->skb); 300 kfree_skb(d->skb);
301 d->skb = NULL;
302 }
301 } 303 }
302 ++d; 304 ++d;
303 if (++cidx == q->size) { 305 if (++cidx == q->size) {
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index ca663f19d7df..7236f1a53ba0 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -52,6 +52,10 @@
52 (ID_LED_DEF1_DEF2)) 52 (ID_LED_DEF1_DEF2))
53 53
54#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 54#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
55#define E1000_BASE1000T_STATUS 10
56#define E1000_IDLE_ERROR_COUNT_MASK 0xFF
57#define E1000_RECEIVE_ERROR_COUNTER 21
58#define E1000_RECEIVE_ERROR_MAX 0xFFFF
55 59
56#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */ 60#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */
57 61
@@ -1243,6 +1247,39 @@ static s32 e1000_led_on_82574(struct e1000_hw *hw)
1243} 1247}
1244 1248
1245/** 1249/**
1250 * e1000_check_phy_82574 - check 82574 phy hung state
1251 * @hw: pointer to the HW structure
1252 *
1253 * Returns whether phy is hung or not
1254 **/
1255bool e1000_check_phy_82574(struct e1000_hw *hw)
1256{
1257 u16 status_1kbt = 0;
1258 u16 receive_errors = 0;
1259 bool phy_hung = false;
1260 s32 ret_val = 0;
1261
1262 /*
1263 * Read PHY Receive Error counter first, if its is max - all F's then
1264 * read the Base1000T status register If both are max then PHY is hung.
1265 */
1266 ret_val = e1e_rphy(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors);
1267
1268 if (ret_val)
1269 goto out;
1270 if (receive_errors == E1000_RECEIVE_ERROR_MAX) {
1271 ret_val = e1e_rphy(hw, E1000_BASE1000T_STATUS, &status_1kbt);
1272 if (ret_val)
1273 goto out;
1274 if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) ==
1275 E1000_IDLE_ERROR_COUNT_MASK)
1276 phy_hung = true;
1277 }
1278out:
1279 return phy_hung;
1280}
1281
1282/**
1246 * e1000_setup_link_82571 - Setup flow control and link settings 1283 * e1000_setup_link_82571 - Setup flow control and link settings
1247 * @hw: pointer to the HW structure 1284 * @hw: pointer to the HW structure
1248 * 1285 *
@@ -1859,6 +1896,7 @@ struct e1000_info e1000_82574_info = {
1859 | FLAG_HAS_SMART_POWER_DOWN 1896 | FLAG_HAS_SMART_POWER_DOWN
1860 | FLAG_HAS_AMT 1897 | FLAG_HAS_AMT
1861 | FLAG_HAS_CTRLEXT_ON_LOAD, 1898 | FLAG_HAS_CTRLEXT_ON_LOAD,
1899 .flags2 = FLAG2_CHECK_PHY_HANG,
1862 .pba = 36, 1900 .pba = 36,
1863 .max_hw_frame_size = DEFAULT_JUMBO, 1901 .max_hw_frame_size = DEFAULT_JUMBO,
1864 .get_variants = e1000_get_variants_82571, 1902 .get_variants = e1000_get_variants_82571,
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index cee882dd67bf..fdc67fead4ea 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -397,6 +397,7 @@ struct e1000_adapter {
397 struct work_struct print_hang_task; 397 struct work_struct print_hang_task;
398 398
399 bool idle_check; 399 bool idle_check;
400 int phy_hang_count;
400}; 401};
401 402
402struct e1000_info { 403struct e1000_info {
@@ -454,6 +455,7 @@ struct e1000_info {
454#define FLAG2_HAS_EEE (1 << 5) 455#define FLAG2_HAS_EEE (1 << 5)
455#define FLAG2_DMA_BURST (1 << 6) 456#define FLAG2_DMA_BURST (1 << 6)
456#define FLAG2_DISABLE_AIM (1 << 8) 457#define FLAG2_DISABLE_AIM (1 << 8)
458#define FLAG2_CHECK_PHY_HANG (1 << 9)
457 459
458#define E1000_RX_DESC_PS(R, i) \ 460#define E1000_RX_DESC_PS(R, i) \
459 (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) 461 (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
@@ -631,6 +633,7 @@ extern s32 e1000_get_phy_info_ife(struct e1000_hw *hw);
631extern s32 e1000_check_polarity_ife(struct e1000_hw *hw); 633extern s32 e1000_check_polarity_ife(struct e1000_hw *hw);
632extern s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw); 634extern s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw);
633extern s32 e1000_check_polarity_igp(struct e1000_hw *hw); 635extern s32 e1000_check_polarity_igp(struct e1000_hw *hw);
636extern bool e1000_check_phy_82574(struct e1000_hw *hw);
634 637
635static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw) 638static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
636{ 639{
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index ec8cf3f51423..c4ca1629f532 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -4098,6 +4098,25 @@ static void e1000e_enable_receives(struct e1000_adapter *adapter)
4098 } 4098 }
4099} 4099}
4100 4100
4101static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter)
4102{
4103 struct e1000_hw *hw = &adapter->hw;
4104
4105 /*
4106 * With 82574 controllers, PHY needs to be checked periodically
4107 * for hung state and reset, if two calls return true
4108 */
4109 if (e1000_check_phy_82574(hw))
4110 adapter->phy_hang_count++;
4111 else
4112 adapter->phy_hang_count = 0;
4113
4114 if (adapter->phy_hang_count > 1) {
4115 adapter->phy_hang_count = 0;
4116 schedule_work(&adapter->reset_task);
4117 }
4118}
4119
4101/** 4120/**
4102 * e1000_watchdog - Timer Call-back 4121 * e1000_watchdog - Timer Call-back
4103 * @data: pointer to adapter cast into an unsigned long 4122 * @data: pointer to adapter cast into an unsigned long
@@ -4333,6 +4352,9 @@ link_up:
4333 if (e1000e_get_laa_state_82571(hw)) 4352 if (e1000e_get_laa_state_82571(hw))
4334 e1000e_rar_set(hw, adapter->hw.mac.addr, 0); 4353 e1000e_rar_set(hw, adapter->hw.mac.addr, 0);
4335 4354
4355 if (adapter->flags2 & FLAG2_CHECK_PHY_HANG)
4356 e1000e_check_82574_phy_workaround(adapter);
4357
4336 /* Reset the timer */ 4358 /* Reset the timer */
4337 if (!test_bit(__E1000_DOWN, &adapter->state)) 4359 if (!test_bit(__E1000_DOWN, &adapter->state))
4338 mod_timer(&adapter->watchdog_timer, 4360 mod_timer(&adapter->watchdog_timer,
@@ -4860,8 +4882,11 @@ static void e1000_reset_task(struct work_struct *work)
4860 struct e1000_adapter *adapter; 4882 struct e1000_adapter *adapter;
4861 adapter = container_of(work, struct e1000_adapter, reset_task); 4883 adapter = container_of(work, struct e1000_adapter, reset_task);
4862 4884
4863 e1000e_dump(adapter); 4885 if (!((adapter->flags & FLAG_RX_NEEDS_RESTART) &&
4864 e_err("Reset adapter\n"); 4886 (adapter->flags & FLAG_RX_RESTART_NOW))) {
4887 e1000e_dump(adapter);
4888 e_err("Reset adapter\n");
4889 }
4865 e1000e_reinit_locked(adapter); 4890 e1000e_reinit_locked(adapter);
4866} 4891}
4867 4892
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 14db09e2fa8b..892d196f17ac 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -4107,7 +4107,6 @@ static inline int igb_maybe_stop_tx(struct igb_ring *tx_ring, int size)
4107netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb, 4107netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
4108 struct igb_ring *tx_ring) 4108 struct igb_ring *tx_ring)
4109{ 4109{
4110 struct igb_adapter *adapter = netdev_priv(tx_ring->netdev);
4111 int tso = 0, count; 4110 int tso = 0, count;
4112 u32 tx_flags = 0; 4111 u32 tx_flags = 0;
4113 u16 first; 4112 u16 first;
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index ebfaa68ee630..28af019c97bb 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -2783,15 +2783,15 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
2783 /* reset the hardware with the new settings */ 2783 /* reset the hardware with the new settings */
2784 igbvf_reset(adapter); 2784 igbvf_reset(adapter);
2785 2785
2786 /* tell the stack to leave us alone until igbvf_open() is called */
2787 netif_carrier_off(netdev);
2788 netif_stop_queue(netdev);
2789
2790 strcpy(netdev->name, "eth%d"); 2786 strcpy(netdev->name, "eth%d");
2791 err = register_netdev(netdev); 2787 err = register_netdev(netdev);
2792 if (err) 2788 if (err)
2793 goto err_hw_init; 2789 goto err_hw_init;
2794 2790
2791 /* tell the stack to leave us alone until igbvf_open() is called */
2792 netif_carrier_off(netdev);
2793 netif_stop_queue(netdev);
2794
2795 igbvf_print_device_info(adapter); 2795 igbvf_print_device_info(adapter);
2796 2796
2797 igbvf_initialize_last_counter_stats(adapter); 2797 igbvf_initialize_last_counter_stats(adapter);
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 666207a9c039..caa8192fff2a 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -533,6 +533,7 @@ ixgb_remove(struct pci_dev *pdev)
533 pci_release_regions(pdev); 533 pci_release_regions(pdev);
534 534
535 free_netdev(netdev); 535 free_netdev(netdev);
536 pci_disable_device(pdev);
536} 537}
537 538
538/** 539/**
diff --git a/drivers/net/ixgbe/ixgbe_dcb.c b/drivers/net/ixgbe/ixgbe_dcb.c
index 8bb9ddb6dffe..0d44c6470ca3 100644
--- a/drivers/net/ixgbe/ixgbe_dcb.c
+++ b/drivers/net/ixgbe/ixgbe_dcb.c
@@ -43,9 +43,12 @@
43 * ixgbe_dcb_check_config(). 43 * ixgbe_dcb_check_config().
44 */ 44 */
45s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_dcb_config *dcb_config, 45s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_dcb_config *dcb_config,
46 u8 direction) 46 int max_frame, u8 direction)
47{ 47{
48 struct tc_bw_alloc *p; 48 struct tc_bw_alloc *p;
49 int min_credit;
50 int min_multiplier;
51 int min_percent = 100;
49 s32 ret_val = 0; 52 s32 ret_val = 0;
50 /* Initialization values default for Tx settings */ 53 /* Initialization values default for Tx settings */
51 u32 credit_refill = 0; 54 u32 credit_refill = 0;
@@ -59,6 +62,31 @@ s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_dcb_config *dcb_config,
59 goto out; 62 goto out;
60 } 63 }
61 64
65 min_credit = ((max_frame / 2) + DCB_CREDIT_QUANTUM - 1) /
66 DCB_CREDIT_QUANTUM;
67
68 /* Find smallest link percentage */
69 for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
70 p = &dcb_config->tc_config[i].path[direction];
71 bw_percent = dcb_config->bw_percentage[direction][p->bwg_id];
72 link_percentage = p->bwg_percent;
73
74 link_percentage = (link_percentage * bw_percent) / 100;
75
76 if (link_percentage && link_percentage < min_percent)
77 min_percent = link_percentage;
78 }
79
80 /*
81 * The ratio between traffic classes will control the bandwidth
82 * percentages seen on the wire. To calculate this ratio we use
83 * a multiplier. It is required that the refill credits must be
84 * larger than the max frame size so here we find the smallest
85 * multiplier that will allow all bandwidth percentages to be
86 * greater than the max frame size.
87 */
88 min_multiplier = (min_credit / min_percent) + 1;
89
62 /* Find out the link percentage for each TC first */ 90 /* Find out the link percentage for each TC first */
63 for (i = 0; i < MAX_TRAFFIC_CLASS; i++) { 91 for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
64 p = &dcb_config->tc_config[i].path[direction]; 92 p = &dcb_config->tc_config[i].path[direction];
@@ -73,8 +101,9 @@ s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_dcb_config *dcb_config,
73 /* Save link_percentage for reference */ 101 /* Save link_percentage for reference */
74 p->link_percent = (u8)link_percentage; 102 p->link_percent = (u8)link_percentage;
75 103
76 /* Calculate credit refill and save it */ 104 /* Calculate credit refill ratio using multiplier */
77 credit_refill = link_percentage * MINIMUM_CREDIT_REFILL; 105 credit_refill = min(link_percentage * min_multiplier,
106 MAX_CREDIT_REFILL);
78 p->data_credits_refill = (u16)credit_refill; 107 p->data_credits_refill = (u16)credit_refill;
79 108
80 /* Calculate maximum credit for the TC */ 109 /* Calculate maximum credit for the TC */
@@ -85,8 +114,8 @@ s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_dcb_config *dcb_config,
85 * of a TC is too small, the maximum credit may not be 114 * of a TC is too small, the maximum credit may not be
86 * enough to send out a jumbo frame in data plane arbitration. 115 * enough to send out a jumbo frame in data plane arbitration.
87 */ 116 */
88 if (credit_max && (credit_max < MINIMUM_CREDIT_FOR_JUMBO)) 117 if (credit_max && (credit_max < min_credit))
89 credit_max = MINIMUM_CREDIT_FOR_JUMBO; 118 credit_max = min_credit;
90 119
91 if (direction == DCB_TX_CONFIG) { 120 if (direction == DCB_TX_CONFIG) {
92 /* 121 /*
diff --git a/drivers/net/ixgbe/ixgbe_dcb.h b/drivers/net/ixgbe/ixgbe_dcb.h
index eb1059f09da0..0208a87b129e 100644
--- a/drivers/net/ixgbe/ixgbe_dcb.h
+++ b/drivers/net/ixgbe/ixgbe_dcb.h
@@ -150,15 +150,14 @@ struct ixgbe_dcb_config {
150/* DCB driver APIs */ 150/* DCB driver APIs */
151 151
152/* DCB credits calculation */ 152/* DCB credits calculation */
153s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_dcb_config *, u8); 153s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_dcb_config *, int, u8);
154 154
155/* DCB hw initialization */ 155/* DCB hw initialization */
156s32 ixgbe_dcb_hw_config(struct ixgbe_hw *, struct ixgbe_dcb_config *); 156s32 ixgbe_dcb_hw_config(struct ixgbe_hw *, struct ixgbe_dcb_config *);
157 157
158/* DCB definitions for credit calculation */ 158/* DCB definitions for credit calculation */
159#define DCB_CREDIT_QUANTUM 64 /* DCB Quantum */
159#define MAX_CREDIT_REFILL 511 /* 0x1FF * 64B = 32704B */ 160#define MAX_CREDIT_REFILL 511 /* 0x1FF * 64B = 32704B */
160#define MINIMUM_CREDIT_REFILL 5 /* 5*64B = 320B */
161#define MINIMUM_CREDIT_FOR_JUMBO 145 /* 145= UpperBound((9*1024+54)/64B) for 9KB jumbo frame */
162#define DCB_MAX_TSO_SIZE (32*1024) /* MAX TSO packet size supported in DCB mode */ 161#define DCB_MAX_TSO_SIZE (32*1024) /* MAX TSO packet size supported in DCB mode */
163#define MINIMUM_CREDIT_FOR_TSO (DCB_MAX_TSO_SIZE/64 + 1) /* 513 for 32KB TSO packet */ 162#define MINIMUM_CREDIT_FOR_TSO (DCB_MAX_TSO_SIZE/64 + 1) /* 513 for 32KB TSO packet */
164#define MAX_CREDIT 4095 /* Maximum credit supported: 256KB * 1204 / 64B */ 163#define MAX_CREDIT 4095 /* Maximum credit supported: 256KB * 1204 / 64B */
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ixgbe/ixgbe_dcb_82599.c
index 67c219f86c3a..05f224715073 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_82599.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_82599.c
@@ -397,6 +397,11 @@ static s32 ixgbe_dcb_config_82599(struct ixgbe_hw *hw)
397 reg &= ~IXGBE_RTTDCS_ARBDIS; 397 reg &= ~IXGBE_RTTDCS_ARBDIS;
398 IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, reg); 398 IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, reg);
399 399
400 /* Enable Security TX Buffer IFG for DCB */
401 reg = IXGBE_READ_REG(hw, IXGBE_SECTXMINIFG);
402 reg |= IXGBE_SECTX_DCB;
403 IXGBE_WRITE_REG(hw, IXGBE_SECTXMINIFG, reg);
404
400 return 0; 405 return 0;
401} 406}
402 407
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.h b/drivers/net/ixgbe/ixgbe_dcb_82599.h
index 18d7fbf6c292..3841649fb954 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_82599.h
+++ b/drivers/net/ixgbe/ixgbe_dcb_82599.h
@@ -95,6 +95,9 @@
95 95
96#define IXGBE_TXPBTHRESH_DCB 0xA /* THRESH value for DCB mode */ 96#define IXGBE_TXPBTHRESH_DCB 0xA /* THRESH value for DCB mode */
97 97
98/* SECTXMINIFG DCB */
99#define IXGBE_SECTX_DCB 0x00001F00 /* DCB TX Buffer IFG */
100
98 101
99/* DCB hardware-specific driver APIs */ 102/* DCB hardware-specific driver APIs */
100 103
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index f85631263af8..2bd3eb4ee5a1 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3347,6 +3347,7 @@ static void ixgbe_napi_disable_all(struct ixgbe_adapter *adapter)
3347static void ixgbe_configure_dcb(struct ixgbe_adapter *adapter) 3347static void ixgbe_configure_dcb(struct ixgbe_adapter *adapter)
3348{ 3348{
3349 struct ixgbe_hw *hw = &adapter->hw; 3349 struct ixgbe_hw *hw = &adapter->hw;
3350 int max_frame = adapter->netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
3350 u32 txdctl; 3351 u32 txdctl;
3351 int i, j; 3352 int i, j;
3352 3353
@@ -3359,8 +3360,15 @@ static void ixgbe_configure_dcb(struct ixgbe_adapter *adapter)
3359 if (hw->mac.type == ixgbe_mac_82598EB) 3360 if (hw->mac.type == ixgbe_mac_82598EB)
3360 netif_set_gso_max_size(adapter->netdev, 32768); 3361 netif_set_gso_max_size(adapter->netdev, 32768);
3361 3362
3362 ixgbe_dcb_calculate_tc_credits(&adapter->dcb_cfg, DCB_TX_CONFIG); 3363#ifdef CONFIG_FCOE
3363 ixgbe_dcb_calculate_tc_credits(&adapter->dcb_cfg, DCB_RX_CONFIG); 3364 if (adapter->netdev->features & NETIF_F_FCOE_MTU)
3365 max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE);
3366#endif
3367
3368 ixgbe_dcb_calculate_tc_credits(&adapter->dcb_cfg, max_frame,
3369 DCB_TX_CONFIG);
3370 ixgbe_dcb_calculate_tc_credits(&adapter->dcb_cfg, max_frame,
3371 DCB_RX_CONFIG);
3364 3372
3365 /* reconfigure the hardware */ 3373 /* reconfigure the hardware */
3366 ixgbe_dcb_hw_config(&adapter->hw, &adapter->dcb_cfg); 3374 ixgbe_dcb_hw_config(&adapter->hw, &adapter->dcb_cfg);
diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c
index 316bb70775b1..e7030ceb178b 100644
--- a/drivers/net/lib8390.c
+++ b/drivers/net/lib8390.c
@@ -1077,7 +1077,6 @@ static void __NS8390_init(struct net_device *dev, int startp)
1077 ei_outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG); 1077 ei_outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG);
1078 ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); 1078 ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD);
1079 1079
1080 netif_start_queue(dev);
1081 ei_local->tx1 = ei_local->tx2 = 0; 1080 ei_local->tx1 = ei_local->tx2 = 0;
1082 ei_local->txing = 0; 1081 ei_local->txing = 0;
1083 1082
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c
index 12612127a087..f7d06cbc70ae 100644
--- a/drivers/net/netxen/netxen_nic_ctx.c
+++ b/drivers/net/netxen/netxen_nic_ctx.c
@@ -255,19 +255,6 @@ out_free_rq:
255} 255}
256 256
257static void 257static void
258nx_fw_cmd_reset_ctx(struct netxen_adapter *adapter)
259{
260
261 netxen_issue_cmd(adapter, adapter->ahw.pci_func, NXHAL_VERSION,
262 adapter->ahw.pci_func, NX_DESTROY_CTX_RESET, 0,
263 NX_CDRP_CMD_DESTROY_RX_CTX);
264
265 netxen_issue_cmd(adapter, adapter->ahw.pci_func, NXHAL_VERSION,
266 adapter->ahw.pci_func, NX_DESTROY_CTX_RESET, 0,
267 NX_CDRP_CMD_DESTROY_TX_CTX);
268}
269
270static void
271nx_fw_cmd_destroy_rx_ctx(struct netxen_adapter *adapter) 258nx_fw_cmd_destroy_rx_ctx(struct netxen_adapter *adapter)
272{ 259{
273 struct netxen_recv_context *recv_ctx = &adapter->recv_ctx; 260 struct netxen_recv_context *recv_ctx = &adapter->recv_ctx;
@@ -698,8 +685,6 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
698 if (!NX_IS_REVISION_P2(adapter->ahw.revision_id)) { 685 if (!NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
699 if (test_and_set_bit(__NX_FW_ATTACHED, &adapter->state)) 686 if (test_and_set_bit(__NX_FW_ATTACHED, &adapter->state))
700 goto done; 687 goto done;
701 if (reset_devices)
702 nx_fw_cmd_reset_ctx(adapter);
703 err = nx_fw_cmd_create_rx_ctx(adapter); 688 err = nx_fw_cmd_create_rx_ctx(adapter);
704 if (err) 689 if (err)
705 goto err_out_free; 690 goto err_out_free;
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 50820beac3aa..35ae1aa12896 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -1356,6 +1356,13 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1356 break; 1356 break;
1357 } 1357 }
1358 1358
1359 if (reset_devices) {
1360 if (adapter->portnum == 0) {
1361 NXWR32(adapter, NX_CRB_DEV_REF_COUNT, 0);
1362 adapter->need_fw_reset = 1;
1363 }
1364 }
1365
1359 err = netxen_start_firmware(adapter); 1366 err = netxen_start_firmware(adapter);
1360 if (err) 1367 if (err)
1361 goto err_out_decr_ref; 1368 goto err_out_decr_ref;
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
index 823b9e6431d5..06bc6034ce81 100644
--- a/drivers/net/stmmac/stmmac_main.c
+++ b/drivers/net/stmmac/stmmac_main.c
@@ -337,33 +337,19 @@ static int stmmac_init_phy(struct net_device *dev)
337 return 0; 337 return 0;
338} 338}
339 339
340static inline void stmmac_mac_enable_rx(void __iomem *ioaddr) 340static inline void stmmac_enable_mac(void __iomem *ioaddr)
341{ 341{
342 u32 value = readl(ioaddr + MAC_CTRL_REG); 342 u32 value = readl(ioaddr + MAC_CTRL_REG);
343 value |= MAC_RNABLE_RX;
344 /* Set the RE (receive enable bit into the MAC CTRL register). */
345 writel(value, ioaddr + MAC_CTRL_REG);
346}
347 343
348static inline void stmmac_mac_enable_tx(void __iomem *ioaddr) 344 value |= MAC_RNABLE_RX | MAC_ENABLE_TX;
349{
350 u32 value = readl(ioaddr + MAC_CTRL_REG);
351 value |= MAC_ENABLE_TX;
352 /* Set the TE (transmit enable bit into the MAC CTRL register). */
353 writel(value, ioaddr + MAC_CTRL_REG); 345 writel(value, ioaddr + MAC_CTRL_REG);
354} 346}
355 347
356static inline void stmmac_mac_disable_rx(void __iomem *ioaddr) 348static inline void stmmac_disable_mac(void __iomem *ioaddr)
357{ 349{
358 u32 value = readl(ioaddr + MAC_CTRL_REG); 350 u32 value = readl(ioaddr + MAC_CTRL_REG);
359 value &= ~MAC_RNABLE_RX;
360 writel(value, ioaddr + MAC_CTRL_REG);
361}
362 351
363static inline void stmmac_mac_disable_tx(void __iomem *ioaddr) 352 value &= ~(MAC_ENABLE_TX | MAC_RNABLE_RX);
364{
365 u32 value = readl(ioaddr + MAC_CTRL_REG);
366 value &= ~MAC_ENABLE_TX;
367 writel(value, ioaddr + MAC_CTRL_REG); 353 writel(value, ioaddr + MAC_CTRL_REG);
368} 354}
369 355
@@ -857,8 +843,7 @@ static int stmmac_open(struct net_device *dev)
857 writel(0xffffffff, priv->ioaddr + MMC_LOW_INTR_MASK); 843 writel(0xffffffff, priv->ioaddr + MMC_LOW_INTR_MASK);
858 844
859 /* Enable the MAC Rx/Tx */ 845 /* Enable the MAC Rx/Tx */
860 stmmac_mac_enable_rx(priv->ioaddr); 846 stmmac_enable_mac(priv->ioaddr);
861 stmmac_mac_enable_tx(priv->ioaddr);
862 847
863 /* Set the HW DMA mode and the COE */ 848 /* Set the HW DMA mode and the COE */
864 stmmac_dma_operation_mode(priv); 849 stmmac_dma_operation_mode(priv);
@@ -928,9 +913,8 @@ static int stmmac_release(struct net_device *dev)
928 /* Release and free the Rx/Tx resources */ 913 /* Release and free the Rx/Tx resources */
929 free_dma_desc_resources(priv); 914 free_dma_desc_resources(priv);
930 915
931 /* Disable the MAC core */ 916 /* Disable the MAC Rx/Tx */
932 stmmac_mac_disable_tx(priv->ioaddr); 917 stmmac_disable_mac(priv->ioaddr);
933 stmmac_mac_disable_rx(priv->ioaddr);
934 918
935 netif_carrier_off(dev); 919 netif_carrier_off(dev);
936 920
@@ -1787,8 +1771,7 @@ static int stmmac_dvr_remove(struct platform_device *pdev)
1787 priv->hw->dma->stop_rx(priv->ioaddr); 1771 priv->hw->dma->stop_rx(priv->ioaddr);
1788 priv->hw->dma->stop_tx(priv->ioaddr); 1772 priv->hw->dma->stop_tx(priv->ioaddr);
1789 1773
1790 stmmac_mac_disable_rx(priv->ioaddr); 1774 stmmac_disable_mac(priv->ioaddr);
1791 stmmac_mac_disable_tx(priv->ioaddr);
1792 1775
1793 netif_carrier_off(ndev); 1776 netif_carrier_off(ndev);
1794 1777
@@ -1839,13 +1822,11 @@ static int stmmac_suspend(struct platform_device *pdev, pm_message_t state)
1839 dis_ic); 1822 dis_ic);
1840 priv->hw->desc->init_tx_desc(priv->dma_tx, priv->dma_tx_size); 1823 priv->hw->desc->init_tx_desc(priv->dma_tx, priv->dma_tx_size);
1841 1824
1842 stmmac_mac_disable_tx(priv->ioaddr);
1843
1844 /* Enable Power down mode by programming the PMT regs */ 1825 /* Enable Power down mode by programming the PMT regs */
1845 if (device_can_wakeup(priv->device)) 1826 if (device_can_wakeup(priv->device))
1846 priv->hw->mac->pmt(priv->ioaddr, priv->wolopts); 1827 priv->hw->mac->pmt(priv->ioaddr, priv->wolopts);
1847 else 1828 else
1848 stmmac_mac_disable_rx(priv->ioaddr); 1829 stmmac_disable_mac(priv->ioaddr);
1849 } else { 1830 } else {
1850 priv->shutdown = 1; 1831 priv->shutdown = 1;
1851 /* Although this can appear slightly redundant it actually 1832 /* Although this can appear slightly redundant it actually
@@ -1886,8 +1867,7 @@ static int stmmac_resume(struct platform_device *pdev)
1886 netif_device_attach(dev); 1867 netif_device_attach(dev);
1887 1868
1888 /* Enable the MAC and DMA */ 1869 /* Enable the MAC and DMA */
1889 stmmac_mac_enable_rx(priv->ioaddr); 1870 stmmac_enable_mac(priv->ioaddr);
1890 stmmac_mac_enable_tx(priv->ioaddr);
1891 priv->hw->dma->start_tx(priv->ioaddr); 1871 priv->hw->dma->start_tx(priv->ioaddr);
1892 priv->hw->dma->start_rx(priv->ioaddr); 1872 priv->hw->dma->start_rx(priv->ioaddr);
1893 1873
diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c
index cd0b14a0a93a..fbe8aca975d8 100644
--- a/drivers/net/wireless/ath/ath5k/attach.c
+++ b/drivers/net/wireless/ath/ath5k/attach.c
@@ -139,12 +139,12 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
139 /* Fill the ath5k_hw struct with the needed functions */ 139 /* Fill the ath5k_hw struct with the needed functions */
140 ret = ath5k_hw_init_desc_functions(ah); 140 ret = ath5k_hw_init_desc_functions(ah);
141 if (ret) 141 if (ret)
142 goto err_free; 142 goto err;
143 143
144 /* Bring device out of sleep and reset its units */ 144 /* Bring device out of sleep and reset its units */
145 ret = ath5k_hw_nic_wakeup(ah, 0, true); 145 ret = ath5k_hw_nic_wakeup(ah, 0, true);
146 if (ret) 146 if (ret)
147 goto err_free; 147 goto err;
148 148
149 /* Get MAC, PHY and RADIO revisions */ 149 /* Get MAC, PHY and RADIO revisions */
150 ah->ah_mac_srev = srev; 150 ah->ah_mac_srev = srev;
@@ -234,7 +234,7 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
234 } else { 234 } else {
235 ATH5K_ERR(sc, "Couldn't identify radio revision.\n"); 235 ATH5K_ERR(sc, "Couldn't identify radio revision.\n");
236 ret = -ENODEV; 236 ret = -ENODEV;
237 goto err_free; 237 goto err;
238 } 238 }
239 } 239 }
240 240
@@ -244,7 +244,7 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
244 (srev < AR5K_SREV_AR2425)) { 244 (srev < AR5K_SREV_AR2425)) {
245 ATH5K_ERR(sc, "Device not yet supported.\n"); 245 ATH5K_ERR(sc, "Device not yet supported.\n");
246 ret = -ENODEV; 246 ret = -ENODEV;
247 goto err_free; 247 goto err;
248 } 248 }
249 249
250 /* 250 /*
@@ -252,7 +252,7 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
252 */ 252 */
253 ret = ath5k_hw_post(ah); 253 ret = ath5k_hw_post(ah);
254 if (ret) 254 if (ret)
255 goto err_free; 255 goto err;
256 256
257 /* Enable pci core retry fix on Hainan (5213A) and later chips */ 257 /* Enable pci core retry fix on Hainan (5213A) and later chips */
258 if (srev >= AR5K_SREV_AR5213A) 258 if (srev >= AR5K_SREV_AR5213A)
@@ -265,7 +265,7 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
265 ret = ath5k_eeprom_init(ah); 265 ret = ath5k_eeprom_init(ah);
266 if (ret) { 266 if (ret) {
267 ATH5K_ERR(sc, "unable to init EEPROM\n"); 267 ATH5K_ERR(sc, "unable to init EEPROM\n");
268 goto err_free; 268 goto err;
269 } 269 }
270 270
271 ee = &ah->ah_capabilities.cap_eeprom; 271 ee = &ah->ah_capabilities.cap_eeprom;
@@ -307,7 +307,7 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
307 if (ret) { 307 if (ret) {
308 ATH5K_ERR(sc, "unable to get device capabilities: 0x%04x\n", 308 ATH5K_ERR(sc, "unable to get device capabilities: 0x%04x\n",
309 sc->pdev->device); 309 sc->pdev->device);
310 goto err_free; 310 goto err;
311 } 311 }
312 312
313 /* Crypto settings */ 313 /* Crypto settings */
@@ -341,8 +341,7 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
341 ath5k_hw_set_ledstate(ah, AR5K_LED_INIT); 341 ath5k_hw_set_ledstate(ah, AR5K_LED_INIT);
342 342
343 return 0; 343 return 0;
344err_free: 344err:
345 kfree(ah);
346 return ret; 345 return ret;
347} 346}
348 347
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 973c919fdd27..9b8e7e3fcebd 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -310,7 +310,7 @@ struct ath_rx {
310 u8 rxotherant; 310 u8 rxotherant;
311 u32 *rxlink; 311 u32 *rxlink;
312 unsigned int rxfilter; 312 unsigned int rxfilter;
313 spinlock_t rxflushlock; 313 spinlock_t pcu_lock;
314 spinlock_t rxbuflock; 314 spinlock_t rxbuflock;
315 struct list_head rxbuf; 315 struct list_head rxbuf;
316 struct ath_descdma rxdma; 316 struct ath_descdma rxdma;
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 728d904c74d7..6576f683dba0 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -801,10 +801,16 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
801 } 801 }
802 kfree(buf); 802 kfree(buf);
803 803
804 if ((hif_dev->device_id == 0x7010) || (hif_dev->device_id == 0x7015)) 804 switch (hif_dev->device_id) {
805 case 0x7010:
806 case 0x7015:
807 case 0x9018:
805 firm_offset = AR7010_FIRMWARE_TEXT; 808 firm_offset = AR7010_FIRMWARE_TEXT;
806 else 809 break;
810 default:
807 firm_offset = AR9271_FIRMWARE_TEXT; 811 firm_offset = AR9271_FIRMWARE_TEXT;
812 break;
813 }
808 814
809 /* 815 /*
810 * Issue FW download complete command to firmware. 816 * Issue FW download complete command to firmware.
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c6ec800d7a6b..b52f1cf8a603 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -241,6 +241,9 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
241 */ 241 */
242 ath9k_hw_set_interrupts(ah, 0); 242 ath9k_hw_set_interrupts(ah, 0);
243 ath_drain_all_txq(sc, false); 243 ath_drain_all_txq(sc, false);
244
245 spin_lock_bh(&sc->rx.pcu_lock);
246
244 stopped = ath_stoprecv(sc); 247 stopped = ath_stoprecv(sc);
245 248
246 /* XXX: do not flush receive queue here. We don't want 249 /* XXX: do not flush receive queue here. We don't want
@@ -268,6 +271,7 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
268 "reset status %d\n", 271 "reset status %d\n",
269 channel->center_freq, r); 272 channel->center_freq, r);
270 spin_unlock_bh(&sc->sc_resetlock); 273 spin_unlock_bh(&sc->sc_resetlock);
274 spin_unlock_bh(&sc->rx.pcu_lock);
271 goto ps_restore; 275 goto ps_restore;
272 } 276 }
273 spin_unlock_bh(&sc->sc_resetlock); 277 spin_unlock_bh(&sc->sc_resetlock);
@@ -276,9 +280,12 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
276 ath_print(common, ATH_DBG_FATAL, 280 ath_print(common, ATH_DBG_FATAL,
277 "Unable to restart recv logic\n"); 281 "Unable to restart recv logic\n");
278 r = -EIO; 282 r = -EIO;
283 spin_unlock_bh(&sc->rx.pcu_lock);
279 goto ps_restore; 284 goto ps_restore;
280 } 285 }
281 286
287 spin_unlock_bh(&sc->rx.pcu_lock);
288
282 ath_update_txpow(sc); 289 ath_update_txpow(sc);
283 ath9k_hw_set_interrupts(ah, ah->imask); 290 ath9k_hw_set_interrupts(ah, ah->imask);
284 291
@@ -613,7 +620,7 @@ void ath9k_tasklet(unsigned long data)
613 rxmask = (ATH9K_INT_RX | ATH9K_INT_RXEOL | ATH9K_INT_RXORN); 620 rxmask = (ATH9K_INT_RX | ATH9K_INT_RXEOL | ATH9K_INT_RXORN);
614 621
615 if (status & rxmask) { 622 if (status & rxmask) {
616 spin_lock_bh(&sc->rx.rxflushlock); 623 spin_lock_bh(&sc->rx.pcu_lock);
617 624
618 /* Check for high priority Rx first */ 625 /* Check for high priority Rx first */
619 if ((ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) && 626 if ((ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) &&
@@ -621,7 +628,7 @@ void ath9k_tasklet(unsigned long data)
621 ath_rx_tasklet(sc, 0, true); 628 ath_rx_tasklet(sc, 0, true);
622 629
623 ath_rx_tasklet(sc, 0, false); 630 ath_rx_tasklet(sc, 0, false);
624 spin_unlock_bh(&sc->rx.rxflushlock); 631 spin_unlock_bh(&sc->rx.pcu_lock);
625 } 632 }
626 633
627 if (status & ATH9K_INT_TX) { 634 if (status & ATH9K_INT_TX) {
@@ -876,6 +883,7 @@ void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw)
876 if (!ah->curchan) 883 if (!ah->curchan)
877 ah->curchan = ath_get_curchannel(sc, sc->hw); 884 ah->curchan = ath_get_curchannel(sc, sc->hw);
878 885
886 spin_lock_bh(&sc->rx.pcu_lock);
879 spin_lock_bh(&sc->sc_resetlock); 887 spin_lock_bh(&sc->sc_resetlock);
880 r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false); 888 r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
881 if (r) { 889 if (r) {
@@ -890,8 +898,10 @@ void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw)
890 if (ath_startrecv(sc) != 0) { 898 if (ath_startrecv(sc) != 0) {
891 ath_print(common, ATH_DBG_FATAL, 899 ath_print(common, ATH_DBG_FATAL,
892 "Unable to restart recv logic\n"); 900 "Unable to restart recv logic\n");
901 spin_unlock_bh(&sc->rx.pcu_lock);
893 return; 902 return;
894 } 903 }
904 spin_unlock_bh(&sc->rx.pcu_lock);
895 905
896 if (sc->sc_flags & SC_OP_BEACONS) 906 if (sc->sc_flags & SC_OP_BEACONS)
897 ath_beacon_config(sc, NULL); /* restart beacons */ 907 ath_beacon_config(sc, NULL); /* restart beacons */
@@ -930,6 +940,9 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)
930 ath9k_hw_set_interrupts(ah, 0); 940 ath9k_hw_set_interrupts(ah, 0);
931 941
932 ath_drain_all_txq(sc, false); /* clear pending tx frames */ 942 ath_drain_all_txq(sc, false); /* clear pending tx frames */
943
944 spin_lock_bh(&sc->rx.pcu_lock);
945
933 ath_stoprecv(sc); /* turn off frame recv */ 946 ath_stoprecv(sc); /* turn off frame recv */
934 ath_flushrecv(sc); /* flush recv queue */ 947 ath_flushrecv(sc); /* flush recv queue */
935 948
@@ -947,6 +960,9 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)
947 spin_unlock_bh(&sc->sc_resetlock); 960 spin_unlock_bh(&sc->sc_resetlock);
948 961
949 ath9k_hw_phy_disable(ah); 962 ath9k_hw_phy_disable(ah);
963
964 spin_unlock_bh(&sc->rx.pcu_lock);
965
950 ath9k_hw_configpcipowersave(ah, 1, 1); 966 ath9k_hw_configpcipowersave(ah, 1, 1);
951 ath9k_ps_restore(sc); 967 ath9k_ps_restore(sc);
952 ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP); 968 ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP);
@@ -966,6 +982,9 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
966 982
967 ath9k_hw_set_interrupts(ah, 0); 983 ath9k_hw_set_interrupts(ah, 0);
968 ath_drain_all_txq(sc, retry_tx); 984 ath_drain_all_txq(sc, retry_tx);
985
986 spin_lock_bh(&sc->rx.pcu_lock);
987
969 ath_stoprecv(sc); 988 ath_stoprecv(sc);
970 ath_flushrecv(sc); 989 ath_flushrecv(sc);
971 990
@@ -980,6 +999,8 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
980 ath_print(common, ATH_DBG_FATAL, 999 ath_print(common, ATH_DBG_FATAL,
981 "Unable to start recv logic\n"); 1000 "Unable to start recv logic\n");
982 1001
1002 spin_unlock_bh(&sc->rx.pcu_lock);
1003
983 /* 1004 /*
984 * We may be doing a reset in response to a request 1005 * We may be doing a reset in response to a request
985 * that changes the channel so update any state that 1006 * that changes the channel so update any state that
@@ -1142,6 +1163,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
1142 * be followed by initialization of the appropriate bits 1163 * be followed by initialization of the appropriate bits
1143 * and then setup of the interrupt mask. 1164 * and then setup of the interrupt mask.
1144 */ 1165 */
1166 spin_lock_bh(&sc->rx.pcu_lock);
1145 spin_lock_bh(&sc->sc_resetlock); 1167 spin_lock_bh(&sc->sc_resetlock);
1146 r = ath9k_hw_reset(ah, init_channel, ah->caldata, false); 1168 r = ath9k_hw_reset(ah, init_channel, ah->caldata, false);
1147 if (r) { 1169 if (r) {
@@ -1150,6 +1172,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
1150 "(freq %u MHz)\n", r, 1172 "(freq %u MHz)\n", r,
1151 curchan->center_freq); 1173 curchan->center_freq);
1152 spin_unlock_bh(&sc->sc_resetlock); 1174 spin_unlock_bh(&sc->sc_resetlock);
1175 spin_unlock_bh(&sc->rx.pcu_lock);
1153 goto mutex_unlock; 1176 goto mutex_unlock;
1154 } 1177 }
1155 spin_unlock_bh(&sc->sc_resetlock); 1178 spin_unlock_bh(&sc->sc_resetlock);
@@ -1171,8 +1194,10 @@ static int ath9k_start(struct ieee80211_hw *hw)
1171 ath_print(common, ATH_DBG_FATAL, 1194 ath_print(common, ATH_DBG_FATAL,
1172 "Unable to start recv logic\n"); 1195 "Unable to start recv logic\n");
1173 r = -EIO; 1196 r = -EIO;
1197 spin_unlock_bh(&sc->rx.pcu_lock);
1174 goto mutex_unlock; 1198 goto mutex_unlock;
1175 } 1199 }
1200 spin_unlock_bh(&sc->rx.pcu_lock);
1176 1201
1177 /* Setup our intr mask. */ 1202 /* Setup our intr mask. */
1178 ah->imask = ATH9K_INT_TX | ATH9K_INT_RXEOL | 1203 ah->imask = ATH9K_INT_TX | ATH9K_INT_RXEOL |
@@ -1371,12 +1396,14 @@ static void ath9k_stop(struct ieee80211_hw *hw)
1371 * before setting the invalid flag. */ 1396 * before setting the invalid flag. */
1372 ath9k_hw_set_interrupts(ah, 0); 1397 ath9k_hw_set_interrupts(ah, 0);
1373 1398
1399 spin_lock_bh(&sc->rx.pcu_lock);
1374 if (!(sc->sc_flags & SC_OP_INVALID)) { 1400 if (!(sc->sc_flags & SC_OP_INVALID)) {
1375 ath_drain_all_txq(sc, false); 1401 ath_drain_all_txq(sc, false);
1376 ath_stoprecv(sc); 1402 ath_stoprecv(sc);
1377 ath9k_hw_phy_disable(ah); 1403 ath9k_hw_phy_disable(ah);
1378 } else 1404 } else
1379 sc->rx.rxlink = NULL; 1405 sc->rx.rxlink = NULL;
1406 spin_unlock_bh(&sc->rx.pcu_lock);
1380 1407
1381 /* disable HAL and put h/w to sleep */ 1408 /* disable HAL and put h/w to sleep */
1382 ath9k_hw_disable(ah); 1409 ath9k_hw_disable(ah);
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 0cee90cf8dc9..89978d71617f 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -527,7 +527,7 @@ static u8 ath_rc_setvalid_rates(struct ath_rate_priv *ath_rc_priv,
527 for (i = 0; i < rateset->rs_nrates; i++) { 527 for (i = 0; i < rateset->rs_nrates; i++) {
528 for (j = 0; j < rate_table->rate_cnt; j++) { 528 for (j = 0; j < rate_table->rate_cnt; j++) {
529 u32 phy = rate_table->info[j].phy; 529 u32 phy = rate_table->info[j].phy;
530 u16 rate_flags = rate_table->info[i].rate_flags; 530 u16 rate_flags = rate_table->info[j].rate_flags;
531 u8 rate = rateset->rs_rates[i]; 531 u8 rate = rateset->rs_rates[i];
532 u8 dot11rate = rate_table->info[j].dot11rate; 532 u8 dot11rate = rate_table->info[j].dot11rate;
533 533
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index fe73fc50082a..fddb0129bb57 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -297,19 +297,17 @@ static void ath_edma_start_recv(struct ath_softc *sc)
297 ath_rx_addbuffer_edma(sc, ATH9K_RX_QUEUE_LP, 297 ath_rx_addbuffer_edma(sc, ATH9K_RX_QUEUE_LP,
298 sc->rx.rx_edma[ATH9K_RX_QUEUE_LP].rx_fifo_hwsize); 298 sc->rx.rx_edma[ATH9K_RX_QUEUE_LP].rx_fifo_hwsize);
299 299
300 spin_unlock_bh(&sc->rx.rxbuflock);
301
302 ath_opmode_init(sc); 300 ath_opmode_init(sc);
303 301
304 ath9k_hw_startpcureceive(sc->sc_ah, (sc->sc_flags & SC_OP_OFFCHANNEL)); 302 ath9k_hw_startpcureceive(sc->sc_ah, (sc->sc_flags & SC_OP_OFFCHANNEL));
303
304 spin_unlock_bh(&sc->rx.rxbuflock);
305} 305}
306 306
307static void ath_edma_stop_recv(struct ath_softc *sc) 307static void ath_edma_stop_recv(struct ath_softc *sc)
308{ 308{
309 spin_lock_bh(&sc->rx.rxbuflock);
310 ath_rx_remove_buffer(sc, ATH9K_RX_QUEUE_HP); 309 ath_rx_remove_buffer(sc, ATH9K_RX_QUEUE_HP);
311 ath_rx_remove_buffer(sc, ATH9K_RX_QUEUE_LP); 310 ath_rx_remove_buffer(sc, ATH9K_RX_QUEUE_LP);
312 spin_unlock_bh(&sc->rx.rxbuflock);
313} 311}
314 312
315int ath_rx_init(struct ath_softc *sc, int nbufs) 313int ath_rx_init(struct ath_softc *sc, int nbufs)
@@ -319,7 +317,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
319 struct ath_buf *bf; 317 struct ath_buf *bf;
320 int error = 0; 318 int error = 0;
321 319
322 spin_lock_init(&sc->rx.rxflushlock); 320 spin_lock_init(&sc->rx.pcu_lock);
323 sc->sc_flags &= ~SC_OP_RXFLUSH; 321 sc->sc_flags &= ~SC_OP_RXFLUSH;
324 spin_lock_init(&sc->rx.rxbuflock); 322 spin_lock_init(&sc->rx.rxbuflock);
325 323
@@ -506,10 +504,11 @@ int ath_startrecv(struct ath_softc *sc)
506 ath9k_hw_rxena(ah); 504 ath9k_hw_rxena(ah);
507 505
508start_recv: 506start_recv:
509 spin_unlock_bh(&sc->rx.rxbuflock);
510 ath_opmode_init(sc); 507 ath_opmode_init(sc);
511 ath9k_hw_startpcureceive(ah, (sc->sc_flags & SC_OP_OFFCHANNEL)); 508 ath9k_hw_startpcureceive(ah, (sc->sc_flags & SC_OP_OFFCHANNEL));
512 509
510 spin_unlock_bh(&sc->rx.rxbuflock);
511
513 return 0; 512 return 0;
514} 513}
515 514
@@ -518,6 +517,7 @@ bool ath_stoprecv(struct ath_softc *sc)
518 struct ath_hw *ah = sc->sc_ah; 517 struct ath_hw *ah = sc->sc_ah;
519 bool stopped; 518 bool stopped;
520 519
520 spin_lock_bh(&sc->rx.rxbuflock);
521 ath9k_hw_stoppcurecv(ah); 521 ath9k_hw_stoppcurecv(ah);
522 ath9k_hw_setrxfilter(ah, 0); 522 ath9k_hw_setrxfilter(ah, 0);
523 stopped = ath9k_hw_stopdmarecv(ah); 523 stopped = ath9k_hw_stopdmarecv(ah);
@@ -526,19 +526,18 @@ bool ath_stoprecv(struct ath_softc *sc)
526 ath_edma_stop_recv(sc); 526 ath_edma_stop_recv(sc);
527 else 527 else
528 sc->rx.rxlink = NULL; 528 sc->rx.rxlink = NULL;
529 spin_unlock_bh(&sc->rx.rxbuflock);
529 530
530 return stopped; 531 return stopped;
531} 532}
532 533
533void ath_flushrecv(struct ath_softc *sc) 534void ath_flushrecv(struct ath_softc *sc)
534{ 535{
535 spin_lock_bh(&sc->rx.rxflushlock);
536 sc->sc_flags |= SC_OP_RXFLUSH; 536 sc->sc_flags |= SC_OP_RXFLUSH;
537 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) 537 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
538 ath_rx_tasklet(sc, 1, true); 538 ath_rx_tasklet(sc, 1, true);
539 ath_rx_tasklet(sc, 1, false); 539 ath_rx_tasklet(sc, 1, false);
540 sc->sc_flags &= ~SC_OP_RXFLUSH; 540 sc->sc_flags &= ~SC_OP_RXFLUSH;
541 spin_unlock_bh(&sc->rx.rxflushlock);
542} 541}
543 542
544static bool ath_beacon_dtim_pending_cab(struct sk_buff *skb) 543static bool ath_beacon_dtim_pending_cab(struct sk_buff *skb)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 30ef2dfc1ed2..f2ade2402ce2 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1089,15 +1089,6 @@ void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx)
1089 txq->axq_tx_inprogress = false; 1089 txq->axq_tx_inprogress = false;
1090 spin_unlock_bh(&txq->axq_lock); 1090 spin_unlock_bh(&txq->axq_lock);
1091 1091
1092 /* flush any pending frames if aggregation is enabled */
1093 if (sc->sc_flags & SC_OP_TXAGGR) {
1094 if (!retry_tx) {
1095 spin_lock_bh(&txq->axq_lock);
1096 ath_txq_drain_pending_buffers(sc, txq);
1097 spin_unlock_bh(&txq->axq_lock);
1098 }
1099 }
1100
1101 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { 1092 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
1102 spin_lock_bh(&txq->axq_lock); 1093 spin_lock_bh(&txq->axq_lock);
1103 while (!list_empty(&txq->txq_fifo_pending)) { 1094 while (!list_empty(&txq->txq_fifo_pending)) {
@@ -1118,6 +1109,15 @@ void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx)
1118 } 1109 }
1119 spin_unlock_bh(&txq->axq_lock); 1110 spin_unlock_bh(&txq->axq_lock);
1120 } 1111 }
1112
1113 /* flush any pending frames if aggregation is enabled */
1114 if (sc->sc_flags & SC_OP_TXAGGR) {
1115 if (!retry_tx) {
1116 spin_lock_bh(&txq->axq_lock);
1117 ath_txq_drain_pending_buffers(sc, txq);
1118 spin_unlock_bh(&txq->axq_lock);
1119 }
1120 }
1121} 1121}
1122 1122
1123void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) 1123void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
diff --git a/drivers/net/wireless/b43/sdio.c b/drivers/net/wireless/b43/sdio.c
index 45933cf8e8c2..9a55338d957f 100644
--- a/drivers/net/wireless/b43/sdio.c
+++ b/drivers/net/wireless/b43/sdio.c
@@ -175,7 +175,9 @@ static void b43_sdio_remove(struct sdio_func *func)
175 struct b43_sdio *sdio = sdio_get_drvdata(func); 175 struct b43_sdio *sdio = sdio_get_drvdata(func);
176 176
177 ssb_bus_unregister(&sdio->ssb); 177 ssb_bus_unregister(&sdio->ssb);
178 sdio_claim_host(func);
178 sdio_disable_func(func); 179 sdio_disable_func(func);
180 sdio_release_host(func);
179 kfree(sdio); 181 kfree(sdio);
180 sdio_set_drvdata(func, NULL); 182 sdio_set_drvdata(func, NULL);
181} 183}
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 296fd00a5129..e5685dc317a8 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -684,18 +684,40 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card)
684 684
685 lbs_deb_enter(LBS_DEB_SDIO); 685 lbs_deb_enter(LBS_DEB_SDIO);
686 686
687 /*
688 * Disable interrupts
689 */
690 sdio_claim_host(card->func);
691 sdio_writeb(card->func, 0x00, IF_SDIO_H_INT_MASK, &ret);
692 sdio_release_host(card->func);
693
687 sdio_claim_host(card->func); 694 sdio_claim_host(card->func);
688 scratch = if_sdio_read_scratch(card, &ret); 695 scratch = if_sdio_read_scratch(card, &ret);
689 sdio_release_host(card->func); 696 sdio_release_host(card->func);
690 697
698 lbs_deb_sdio("firmware status = %#x\n", scratch);
699 lbs_deb_sdio("scratch ret = %d\n", ret);
700
691 if (ret) 701 if (ret)
692 goto out; 702 goto out;
693 703
694 lbs_deb_sdio("firmware status = %#x\n", scratch);
695 704
705 /*
706 * The manual clearly describes that FEDC is the right code to use
707 * to detect firmware presence, but for SD8686 it is not that simple.
708 * Scratch is also used to store the RX packet length, so we lose
709 * the FEDC value early on. So we use a non-zero check in order
710 * to validate firmware presence.
711 * Additionally, the SD8686 in the Gumstix always has the high scratch
712 * bit set, even when the firmware is not loaded. So we have to
713 * exclude that from the test.
714 */
696 if (scratch == IF_SDIO_FIRMWARE_OK) { 715 if (scratch == IF_SDIO_FIRMWARE_OK) {
697 lbs_deb_sdio("firmware already loaded\n"); 716 lbs_deb_sdio("firmware already loaded\n");
698 goto success; 717 goto success;
718 } else if ((card->model == MODEL_8686) && (scratch & 0x7fff)) {
719 lbs_deb_sdio("firmware may be running\n");
720 goto success;
699 } 721 }
700 722
701 ret = lbs_get_firmware(&card->func->dev, lbs_helper_name, lbs_fw_name, 723 ret = lbs_get_firmware(&card->func->dev, lbs_helper_name, lbs_fw_name,
@@ -709,10 +731,14 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card)
709 if (ret) 731 if (ret)
710 goto out; 732 goto out;
711 733
734 lbs_deb_sdio("Helper firmware loaded\n");
735
712 ret = if_sdio_prog_real(card, mainfw); 736 ret = if_sdio_prog_real(card, mainfw);
713 if (ret) 737 if (ret)
714 goto out; 738 goto out;
715 739
740 lbs_deb_sdio("Firmware loaded\n");
741
716success: 742success:
717 sdio_claim_host(card->func); 743 sdio_claim_host(card->func);
718 sdio_set_block_size(card->func, IF_SDIO_BLOCK_SIZE); 744 sdio_set_block_size(card->func, IF_SDIO_BLOCK_SIZE);
@@ -1042,8 +1068,6 @@ static int if_sdio_probe(struct sdio_func *func,
1042 priv->exit_deep_sleep = if_sdio_exit_deep_sleep; 1068 priv->exit_deep_sleep = if_sdio_exit_deep_sleep;
1043 priv->reset_deep_sleep_wakeup = if_sdio_reset_deep_sleep_wakeup; 1069 priv->reset_deep_sleep_wakeup = if_sdio_reset_deep_sleep_wakeup;
1044 1070
1045 priv->fw_ready = 1;
1046
1047 sdio_claim_host(func); 1071 sdio_claim_host(func);
1048 1072
1049 /* 1073 /*
@@ -1064,6 +1088,8 @@ static int if_sdio_probe(struct sdio_func *func,
1064 if (ret) 1088 if (ret)
1065 goto reclaim; 1089 goto reclaim;
1066 1090
1091 priv->fw_ready = 1;
1092
1067 /* 1093 /*
1068 * FUNC_INIT is required for SD8688 WLAN/BT multiple functions 1094 * FUNC_INIT is required for SD8688 WLAN/BT multiple functions
1069 */ 1095 */