aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-04-26 15:39:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-26 15:39:10 -0400
commit429576b97c623b9c4e3375fb7c37bce377f51e68 (patch)
treedc4fd40ae54d177ddb3cb3991e8c3ff019eef238 /drivers
parent9835a30e980561082beb02ce724f6e555787bc19 (diff)
parent069f40fc07f6df3da325e7ea1698a0d6247983d5 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c25
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c12
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c6
-rw-r--r--drivers/net/wireless/iwlegacy/Kconfig9
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945-hw.h2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-hw.h3
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-tx.c10
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-core.c17
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-eeprom.c7
-rw-r--r--drivers/net/wireless/iwlegacy/iwl3945-base.c4
-rw-r--r--drivers/net/wireless/iwlegacy/iwl4965-base.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c10
-rw-r--r--drivers/net/wireless/p54/txrx.c2
17 files changed, 70 insertions, 65 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 48bcc1a21076..2e3a33a53406 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1178,7 +1178,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
1178 } 1178 }
1179 1179
1180 ret = ath9k_htc_hw_init(hif_dev->htc_handle, 1180 ret = ath9k_htc_hw_init(hif_dev->htc_handle,
1181 &hif_dev->udev->dev, hif_dev->device_id, 1181 &interface->dev, hif_dev->device_id,
1182 hif_dev->udev->product, id->driver_info); 1182 hif_dev->udev->product, id->driver_info);
1183 if (ret) { 1183 if (ret) {
1184 ret = -EINVAL; 1184 ret = -EINVAL;
@@ -1296,7 +1296,7 @@ fail_resume:
1296#endif 1296#endif
1297 1297
1298static struct usb_driver ath9k_hif_usb_driver = { 1298static struct usb_driver ath9k_hif_usb_driver = {
1299 .name = "ath9k_hif_usb", 1299 .name = KBUILD_MODNAME,
1300 .probe = ath9k_hif_usb_probe, 1300 .probe = ath9k_hif_usb_probe,
1301 .disconnect = ath9k_hif_usb_disconnect, 1301 .disconnect = ath9k_hif_usb_disconnect,
1302#ifdef CONFIG_PM 1302#ifdef CONFIG_PM
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 2b4e7c0225ab..e99e319feaa8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1320,15 +1320,6 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1320 ah->txchainmask = common->tx_chainmask; 1320 ah->txchainmask = common->tx_chainmask;
1321 ah->rxchainmask = common->rx_chainmask; 1321 ah->rxchainmask = common->rx_chainmask;
1322 1322
1323 if ((common->bus_ops->ath_bus_type != ATH_USB) && !ah->chip_fullsleep) {
1324 ath9k_hw_abortpcurecv(ah);
1325 if (!ath9k_hw_stopdmarecv(ah)) {
1326 ath_dbg(common, ATH_DBG_XMIT,
1327 "Failed to stop receive dma\n");
1328 bChannelChange = false;
1329 }
1330 }
1331
1332 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) 1323 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
1333 return -EIO; 1324 return -EIO;
1334 1325
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index d86b8393b8dd..c8a4cedce805 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -710,27 +710,46 @@ void ath9k_hw_abortpcurecv(struct ath_hw *ah)
710} 710}
711EXPORT_SYMBOL(ath9k_hw_abortpcurecv); 711EXPORT_SYMBOL(ath9k_hw_abortpcurecv);
712 712
713bool ath9k_hw_stopdmarecv(struct ath_hw *ah) 713bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
714{ 714{
715#define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */ 715#define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */
716 struct ath_common *common = ath9k_hw_common(ah); 716 struct ath_common *common = ath9k_hw_common(ah);
717 u32 mac_status, last_mac_status = 0;
717 int i; 718 int i;
718 719
720 /* Enable access to the DMA observation bus */
721 REG_WRITE(ah, AR_MACMISC,
722 ((AR_MACMISC_DMA_OBS_LINE_8 << AR_MACMISC_DMA_OBS_S) |
723 (AR_MACMISC_MISC_OBS_BUS_1 <<
724 AR_MACMISC_MISC_OBS_BUS_MSB_S)));
725
719 REG_WRITE(ah, AR_CR, AR_CR_RXD); 726 REG_WRITE(ah, AR_CR, AR_CR_RXD);
720 727
721 /* Wait for rx enable bit to go low */ 728 /* Wait for rx enable bit to go low */
722 for (i = AH_RX_STOP_DMA_TIMEOUT / AH_TIME_QUANTUM; i != 0; i--) { 729 for (i = AH_RX_STOP_DMA_TIMEOUT / AH_TIME_QUANTUM; i != 0; i--) {
723 if ((REG_READ(ah, AR_CR) & AR_CR_RXE) == 0) 730 if ((REG_READ(ah, AR_CR) & AR_CR_RXE) == 0)
724 break; 731 break;
732
733 if (!AR_SREV_9300_20_OR_LATER(ah)) {
734 mac_status = REG_READ(ah, AR_DMADBG_7) & 0x7f0;
735 if (mac_status == 0x1c0 && mac_status == last_mac_status) {
736 *reset = true;
737 break;
738 }
739
740 last_mac_status = mac_status;
741 }
742
725 udelay(AH_TIME_QUANTUM); 743 udelay(AH_TIME_QUANTUM);
726 } 744 }
727 745
728 if (i == 0) { 746 if (i == 0) {
729 ath_err(common, 747 ath_err(common,
730 "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n", 748 "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n",
731 AH_RX_STOP_DMA_TIMEOUT / 1000, 749 AH_RX_STOP_DMA_TIMEOUT / 1000,
732 REG_READ(ah, AR_CR), 750 REG_READ(ah, AR_CR),
733 REG_READ(ah, AR_DIAG_SW)); 751 REG_READ(ah, AR_DIAG_SW),
752 REG_READ(ah, AR_DMADBG_7));
734 return false; 753 return false;
735 } else { 754 } else {
736 return true; 755 return true;
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index a60edb44127b..b60c130917f7 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -694,7 +694,7 @@ bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set);
694void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp); 694void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp);
695void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning); 695void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning);
696void ath9k_hw_abortpcurecv(struct ath_hw *ah); 696void ath9k_hw_abortpcurecv(struct ath_hw *ah);
697bool ath9k_hw_stopdmarecv(struct ath_hw *ah); 697bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset);
698int ath9k_hw_beaconq_setup(struct ath_hw *ah); 698int ath9k_hw_beaconq_setup(struct ath_hw *ah);
699 699
700/* Interrupt Handling */ 700/* Interrupt Handling */
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 20a2cf731d83..475009b578de 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1371,7 +1371,6 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
1371 1371
1372 ath9k_calculate_iter_data(hw, vif, &iter_data); 1372 ath9k_calculate_iter_data(hw, vif, &iter_data);
1373 1373
1374 ath9k_ps_wakeup(sc);
1375 /* Set BSSID mask. */ 1374 /* Set BSSID mask. */
1376 memcpy(common->bssidmask, iter_data.mask, ETH_ALEN); 1375 memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
1377 ath_hw_setbssidmask(common); 1376 ath_hw_setbssidmask(common);
@@ -1406,7 +1405,6 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
1406 } 1405 }
1407 1406
1408 ath9k_hw_set_interrupts(ah, ah->imask); 1407 ath9k_hw_set_interrupts(ah, ah->imask);
1409 ath9k_ps_restore(sc);
1410 1408
1411 /* Set up ANI */ 1409 /* Set up ANI */
1412 if ((iter_data.naps + iter_data.nadhocs) > 0) { 1410 if ((iter_data.naps + iter_data.nadhocs) > 0) {
@@ -1451,6 +1449,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1451 struct ath_common *common = ath9k_hw_common(ah); 1449 struct ath_common *common = ath9k_hw_common(ah);
1452 int ret = 0; 1450 int ret = 0;
1453 1451
1452 ath9k_ps_wakeup(sc);
1454 mutex_lock(&sc->mutex); 1453 mutex_lock(&sc->mutex);
1455 1454
1456 switch (vif->type) { 1455 switch (vif->type) {
@@ -1494,6 +1493,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1494 ath9k_do_vif_add_setup(hw, vif); 1493 ath9k_do_vif_add_setup(hw, vif);
1495out: 1494out:
1496 mutex_unlock(&sc->mutex); 1495 mutex_unlock(&sc->mutex);
1496 ath9k_ps_restore(sc);
1497 return ret; 1497 return ret;
1498} 1498}
1499 1499
@@ -1508,6 +1508,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
1508 1508
1509 ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n"); 1509 ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n");
1510 mutex_lock(&sc->mutex); 1510 mutex_lock(&sc->mutex);
1511 ath9k_ps_wakeup(sc);
1511 1512
1512 /* See if new interface type is valid. */ 1513 /* See if new interface type is valid. */
1513 if ((new_type == NL80211_IFTYPE_ADHOC) && 1514 if ((new_type == NL80211_IFTYPE_ADHOC) &&
@@ -1537,6 +1538,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
1537 1538
1538 ath9k_do_vif_add_setup(hw, vif); 1539 ath9k_do_vif_add_setup(hw, vif);
1539out: 1540out:
1541 ath9k_ps_restore(sc);
1540 mutex_unlock(&sc->mutex); 1542 mutex_unlock(&sc->mutex);
1541 return ret; 1543 return ret;
1542} 1544}
@@ -1549,6 +1551,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
1549 1551
1550 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n"); 1552 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n");
1551 1553
1554 ath9k_ps_wakeup(sc);
1552 mutex_lock(&sc->mutex); 1555 mutex_lock(&sc->mutex);
1553 1556
1554 sc->nvifs--; 1557 sc->nvifs--;
@@ -1560,6 +1563,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
1560 ath9k_calculate_summary_state(hw, NULL); 1563 ath9k_calculate_summary_state(hw, NULL);
1561 1564
1562 mutex_unlock(&sc->mutex); 1565 mutex_unlock(&sc->mutex);
1566 ath9k_ps_restore(sc);
1563} 1567}
1564 1568
1565static void ath9k_enable_ps(struct ath_softc *sc) 1569static void ath9k_enable_ps(struct ath_softc *sc)
@@ -1840,6 +1844,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
1840 1844
1841 txq = sc->tx.txq_map[queue]; 1845 txq = sc->tx.txq_map[queue];
1842 1846
1847 ath9k_ps_wakeup(sc);
1843 mutex_lock(&sc->mutex); 1848 mutex_lock(&sc->mutex);
1844 1849
1845 memset(&qi, 0, sizeof(struct ath9k_tx_queue_info)); 1850 memset(&qi, 0, sizeof(struct ath9k_tx_queue_info));
@@ -1863,6 +1868,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
1863 ath_beaconq_config(sc); 1868 ath_beaconq_config(sc);
1864 1869
1865 mutex_unlock(&sc->mutex); 1870 mutex_unlock(&sc->mutex);
1871 ath9k_ps_restore(sc);
1866 1872
1867 return ret; 1873 return ret;
1868} 1874}
@@ -2021,6 +2027,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
2021 int slottime; 2027 int slottime;
2022 int error; 2028 int error;
2023 2029
2030 ath9k_ps_wakeup(sc);
2024 mutex_lock(&sc->mutex); 2031 mutex_lock(&sc->mutex);
2025 2032
2026 if (changed & BSS_CHANGED_BSSID) { 2033 if (changed & BSS_CHANGED_BSSID) {
@@ -2106,6 +2113,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
2106 } 2113 }
2107 2114
2108 mutex_unlock(&sc->mutex); 2115 mutex_unlock(&sc->mutex);
2116 ath9k_ps_restore(sc);
2109} 2117}
2110 2118
2111static u64 ath9k_get_tsf(struct ieee80211_hw *hw) 2119static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 916b3409a0e8..c5b7cbe59bfa 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -483,12 +483,12 @@ start_recv:
483bool ath_stoprecv(struct ath_softc *sc) 483bool ath_stoprecv(struct ath_softc *sc)
484{ 484{
485 struct ath_hw *ah = sc->sc_ah; 485 struct ath_hw *ah = sc->sc_ah;
486 bool stopped; 486 bool stopped, reset = false;
487 487
488 spin_lock_bh(&sc->rx.rxbuflock); 488 spin_lock_bh(&sc->rx.rxbuflock);
489 ath9k_hw_abortpcurecv(ah); 489 ath9k_hw_abortpcurecv(ah);
490 ath9k_hw_setrxfilter(ah, 0); 490 ath9k_hw_setrxfilter(ah, 0);
491 stopped = ath9k_hw_stopdmarecv(ah); 491 stopped = ath9k_hw_stopdmarecv(ah, &reset);
492 492
493 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) 493 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
494 ath_edma_stop_recv(sc); 494 ath_edma_stop_recv(sc);
@@ -503,7 +503,7 @@ bool ath_stoprecv(struct ath_softc *sc)
503 "confusing the DMA engine when we start RX up\n"); 503 "confusing the DMA engine when we start RX up\n");
504 ATH_DBG_WARN_ON_ONCE(!stopped); 504 ATH_DBG_WARN_ON_ONCE(!stopped);
505 } 505 }
506 return stopped; 506 return stopped && !reset;
507} 507}
508 508
509void ath_flushrecv(struct ath_softc *sc) 509void ath_flushrecv(struct ath_softc *sc)
diff --git a/drivers/net/wireless/iwlegacy/Kconfig b/drivers/net/wireless/iwlegacy/Kconfig
index 2a45dd44cc12..aef65cd47661 100644
--- a/drivers/net/wireless/iwlegacy/Kconfig
+++ b/drivers/net/wireless/iwlegacy/Kconfig
@@ -1,6 +1,5 @@
1config IWLWIFI_LEGACY 1config IWLWIFI_LEGACY
2 tristate "Intel Wireless Wifi legacy devices" 2 tristate
3 depends on PCI && MAC80211
4 select FW_LOADER 3 select FW_LOADER
5 select NEW_LEDS 4 select NEW_LEDS
6 select LEDS_CLASS 5 select LEDS_CLASS
@@ -65,7 +64,8 @@ endmenu
65 64
66config IWL4965 65config IWL4965
67 tristate "Intel Wireless WiFi 4965AGN (iwl4965)" 66 tristate "Intel Wireless WiFi 4965AGN (iwl4965)"
68 depends on IWLWIFI_LEGACY 67 depends on PCI && MAC80211
68 select IWLWIFI_LEGACY
69 ---help--- 69 ---help---
70 This option enables support for 70 This option enables support for
71 71
@@ -92,7 +92,8 @@ config IWL4965
92 92
93config IWL3945 93config IWL3945
94 tristate "Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945)" 94 tristate "Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945)"
95 depends on IWLWIFI_LEGACY 95 depends on PCI && MAC80211
96 select IWLWIFI_LEGACY
96 ---help--- 97 ---help---
97 Select to build the driver supporting the: 98 Select to build the driver supporting the:
98 99
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-hw.h b/drivers/net/wireless/iwlegacy/iwl-3945-hw.h
index 779d3cb86e2c..5c3a68d3af12 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945-hw.h
+++ b/drivers/net/wireless/iwlegacy/iwl-3945-hw.h
@@ -74,8 +74,6 @@
74/* RSSI to dBm */ 74/* RSSI to dBm */
75#define IWL39_RSSI_OFFSET 95 75#define IWL39_RSSI_OFFSET 95
76 76
77#define IWL_DEFAULT_TX_POWER 0x0F
78
79/* 77/*
80 * EEPROM related constants, enums, and structures. 78 * EEPROM related constants, enums, and structures.
81 */ 79 */
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-hw.h b/drivers/net/wireless/iwlegacy/iwl-4965-hw.h
index 08b189c8472d..fc6fa2886d9c 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-hw.h
@@ -804,9 +804,6 @@ struct iwl4965_scd_bc_tbl {
804 804
805#define IWL4965_DEFAULT_TX_RETRY 15 805#define IWL4965_DEFAULT_TX_RETRY 15
806 806
807/* Limit range of txpower output target to be between these values */
808#define IWL4965_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm: 1 milliwatt */
809
810/* EEPROM */ 807/* EEPROM */
811#define IWL4965_FIRST_AMPDU_QUEUE 10 808#define IWL4965_FIRST_AMPDU_QUEUE 10
812 809
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
index 5c40502f869a..fbec88d48f1b 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
@@ -1127,12 +1127,16 @@ int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
1127 q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) { 1127 q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) {
1128 1128
1129 tx_info = &txq->txb[txq->q.read_ptr]; 1129 tx_info = &txq->txb[txq->q.read_ptr];
1130 iwl4965_tx_status(priv, tx_info, 1130
1131 txq_id >= IWL4965_FIRST_AMPDU_QUEUE); 1131 if (WARN_ON_ONCE(tx_info->skb == NULL))
1132 continue;
1132 1133
1133 hdr = (struct ieee80211_hdr *)tx_info->skb->data; 1134 hdr = (struct ieee80211_hdr *)tx_info->skb->data;
1134 if (hdr && ieee80211_is_data_qos(hdr->frame_control)) 1135 if (ieee80211_is_data_qos(hdr->frame_control))
1135 nfreed++; 1136 nfreed++;
1137
1138 iwl4965_tx_status(priv, tx_info,
1139 txq_id >= IWL4965_FIRST_AMPDU_QUEUE);
1136 tx_info->skb = NULL; 1140 tx_info->skb = NULL;
1137 1141
1138 priv->cfg->ops->lib->txq_free_tfd(priv, txq); 1142 priv->cfg->ops->lib->txq_free_tfd(priv, txq);
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c
index a209a0e76bf0..2b08efb3b658 100644
--- a/drivers/net/wireless/iwlegacy/iwl-core.c
+++ b/drivers/net/wireless/iwlegacy/iwl-core.c
@@ -160,6 +160,7 @@ int iwl_legacy_init_geos(struct iwl_priv *priv)
160 struct ieee80211_channel *geo_ch; 160 struct ieee80211_channel *geo_ch;
161 struct ieee80211_rate *rates; 161 struct ieee80211_rate *rates;
162 int i = 0; 162 int i = 0;
163 s8 max_tx_power = 0;
163 164
164 if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates || 165 if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||
165 priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) { 166 priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {
@@ -235,8 +236,8 @@ int iwl_legacy_init_geos(struct iwl_priv *priv)
235 236
236 geo_ch->flags |= ch->ht40_extension_channel; 237 geo_ch->flags |= ch->ht40_extension_channel;
237 238
238 if (ch->max_power_avg > priv->tx_power_device_lmt) 239 if (ch->max_power_avg > max_tx_power)
239 priv->tx_power_device_lmt = ch->max_power_avg; 240 max_tx_power = ch->max_power_avg;
240 } else { 241 } else {
241 geo_ch->flags |= IEEE80211_CHAN_DISABLED; 242 geo_ch->flags |= IEEE80211_CHAN_DISABLED;
242 } 243 }
@@ -249,6 +250,10 @@ int iwl_legacy_init_geos(struct iwl_priv *priv)
249 geo_ch->flags); 250 geo_ch->flags);
250 } 251 }
251 252
253 priv->tx_power_device_lmt = max_tx_power;
254 priv->tx_power_user_lmt = max_tx_power;
255 priv->tx_power_next = max_tx_power;
256
252 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) && 257 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
253 priv->cfg->sku & IWL_SKU_A) { 258 priv->cfg->sku & IWL_SKU_A) {
254 IWL_INFO(priv, "Incorrectly detected BG card as ABG. " 259 IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
@@ -1124,11 +1129,11 @@ int iwl_legacy_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
1124 if (!priv->cfg->ops->lib->send_tx_power) 1129 if (!priv->cfg->ops->lib->send_tx_power)
1125 return -EOPNOTSUPP; 1130 return -EOPNOTSUPP;
1126 1131
1127 if (tx_power < IWL4965_TX_POWER_TARGET_POWER_MIN) { 1132 /* 0 dBm mean 1 milliwatt */
1133 if (tx_power < 0) {
1128 IWL_WARN(priv, 1134 IWL_WARN(priv,
1129 "Requested user TXPOWER %d below lower limit %d.\n", 1135 "Requested user TXPOWER %d below 1 mW.\n",
1130 tx_power, 1136 tx_power);
1131 IWL4965_TX_POWER_TARGET_POWER_MIN);
1132 return -EINVAL; 1137 return -EINVAL;
1133 } 1138 }
1134 1139
diff --git a/drivers/net/wireless/iwlegacy/iwl-eeprom.c b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
index 04c5648027df..cb346d1a9ffa 100644
--- a/drivers/net/wireless/iwlegacy/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
@@ -471,13 +471,6 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv)
471 flags & EEPROM_CHANNEL_RADAR)) 471 flags & EEPROM_CHANNEL_RADAR))
472 ? "" : "not "); 472 ? "" : "not ");
473 473
474 /* Set the tx_power_user_lmt to the highest power
475 * supported by any channel */
476 if (eeprom_ch_info[ch].max_power_avg >
477 priv->tx_power_user_lmt)
478 priv->tx_power_user_lmt =
479 eeprom_ch_info[ch].max_power_avg;
480
481 ch_info++; 474 ch_info++;
482 } 475 }
483 } 476 }
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c
index 28eb3d885ba1..cc7ebcee60e5 100644
--- a/drivers/net/wireless/iwlegacy/iwl3945-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c
@@ -3825,10 +3825,6 @@ static int iwl3945_init_drv(struct iwl_priv *priv)
3825 priv->force_reset[IWL_FW_RESET].reset_duration = 3825 priv->force_reset[IWL_FW_RESET].reset_duration =
3826 IWL_DELAY_NEXT_FORCE_FW_RELOAD; 3826 IWL_DELAY_NEXT_FORCE_FW_RELOAD;
3827 3827
3828
3829 priv->tx_power_user_lmt = IWL_DEFAULT_TX_POWER;
3830 priv->tx_power_next = IWL_DEFAULT_TX_POWER;
3831
3832 if (eeprom->version < EEPROM_3945_EEPROM_VERSION) { 3828 if (eeprom->version < EEPROM_3945_EEPROM_VERSION) {
3833 IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n", 3829 IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n",
3834 eeprom->version); 3830 eeprom->version);
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c
index dd90619fdce7..f8870543d68f 100644
--- a/drivers/net/wireless/iwlegacy/iwl4965-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c
@@ -3140,12 +3140,6 @@ static int iwl4965_init_drv(struct iwl_priv *priv)
3140 3140
3141 iwl_legacy_init_scan_params(priv); 3141 iwl_legacy_init_scan_params(priv);
3142 3142
3143 /* Set the tx_power_user_lmt to the lowest power level
3144 * this value will get overwritten by channel max power avg
3145 * from eeprom */
3146 priv->tx_power_user_lmt = IWL4965_TX_POWER_TARGET_POWER_MIN;
3147 priv->tx_power_next = IWL4965_TX_POWER_TARGET_POWER_MIN;
3148
3149 ret = iwl_legacy_init_channel_map(priv); 3143 ret = iwl_legacy_init_channel_map(priv);
3150 if (ret) { 3144 if (ret) {
3151 IWL_ERR(priv, "initializing regulatory failed: %d\n", ret); 3145 IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 435dd2d6c0ab..202ef64a14d5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -333,7 +333,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
333 struct ieee80211_channel *channel = conf->channel; 333 struct ieee80211_channel *channel = conf->channel;
334 const struct iwl_channel_info *ch_info; 334 const struct iwl_channel_info *ch_info;
335 int ret = 0; 335 int ret = 0;
336 bool ht_changed[NUM_IWL_RXON_CTX] = {};
337 336
338 IWL_DEBUG_MAC80211(priv, "changed %#x", changed); 337 IWL_DEBUG_MAC80211(priv, "changed %#x", changed);
339 338
@@ -381,10 +380,8 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
381 380
382 for_each_context(priv, ctx) { 381 for_each_context(priv, ctx) {
383 /* Configure HT40 channels */ 382 /* Configure HT40 channels */
384 if (ctx->ht.enabled != conf_is_ht(conf)) { 383 if (ctx->ht.enabled != conf_is_ht(conf))
385 ctx->ht.enabled = conf_is_ht(conf); 384 ctx->ht.enabled = conf_is_ht(conf);
386 ht_changed[ctx->ctxid] = true;
387 }
388 385
389 if (ctx->ht.enabled) { 386 if (ctx->ht.enabled) {
390 if (conf_is_ht40_minus(conf)) { 387 if (conf_is_ht40_minus(conf)) {
@@ -453,8 +450,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
453 if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging))) 450 if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
454 continue; 451 continue;
455 iwlagn_commit_rxon(priv, ctx); 452 iwlagn_commit_rxon(priv, ctx);
456 if (ht_changed[ctx->ctxid])
457 iwlagn_update_qos(priv, ctx);
458 } 453 }
459 out: 454 out:
460 mutex_unlock(&priv->mutex); 455 mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index 2816b432c62f..494de0e59cb4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -1236,12 +1236,16 @@ int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
1236 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { 1236 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
1237 1237
1238 tx_info = &txq->txb[txq->q.read_ptr]; 1238 tx_info = &txq->txb[txq->q.read_ptr];
1239 iwlagn_tx_status(priv, tx_info, 1239
1240 txq_id >= IWLAGN_FIRST_AMPDU_QUEUE); 1240 if (WARN_ON_ONCE(tx_info->skb == NULL))
1241 continue;
1241 1242
1242 hdr = (struct ieee80211_hdr *)tx_info->skb->data; 1243 hdr = (struct ieee80211_hdr *)tx_info->skb->data;
1243 if (hdr && ieee80211_is_data_qos(hdr->frame_control)) 1244 if (ieee80211_is_data_qos(hdr->frame_control))
1244 nfreed++; 1245 nfreed++;
1246
1247 iwlagn_tx_status(priv, tx_info,
1248 txq_id >= IWLAGN_FIRST_AMPDU_QUEUE);
1245 tx_info->skb = NULL; 1249 tx_info->skb = NULL;
1246 1250
1247 if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl) 1251 if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl)
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 7834c26c2954..042842e704de 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -703,7 +703,7 @@ void p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
703 struct p54_tx_info *p54info; 703 struct p54_tx_info *p54info;
704 struct p54_hdr *hdr; 704 struct p54_hdr *hdr;
705 struct p54_tx_data *txhdr; 705 struct p54_tx_data *txhdr;
706 unsigned int padding, len, extra_len; 706 unsigned int padding, len, extra_len = 0;
707 int i, j, ridx; 707 int i, j, ridx;
708 u16 hdr_flags = 0, aid = 0; 708 u16 hdr_flags = 0, aid = 0;
709 u8 rate, queue = 0, crypt_offset = 0; 709 u8 rate, queue = 0, crypt_offset = 0;