diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-04-26 15:39:10 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-26 15:39:10 -0400 |
commit | 429576b97c623b9c4e3375fb7c37bce377f51e68 (patch) | |
tree | dc4fd40ae54d177ddb3cb3991e8c3ff019eef238 | |
parent | 9835a30e980561082beb02ce724f6e555787bc19 (diff) | |
parent | 069f40fc07f6df3da325e7ea1698a0d6247983d5 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
23 files changed, 86 insertions, 72 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 | ||
1298 | static struct usb_driver ath9k_hif_usb_driver = { | 1298 | static 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 | } |
711 | EXPORT_SYMBOL(ath9k_hw_abortpcurecv); | 711 | EXPORT_SYMBOL(ath9k_hw_abortpcurecv); |
712 | 712 | ||
713 | bool ath9k_hw_stopdmarecv(struct ath_hw *ah) | 713 | bool 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); | |||
694 | void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp); | 694 | void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp); |
695 | void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning); | 695 | void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning); |
696 | void ath9k_hw_abortpcurecv(struct ath_hw *ah); | 696 | void ath9k_hw_abortpcurecv(struct ath_hw *ah); |
697 | bool ath9k_hw_stopdmarecv(struct ath_hw *ah); | 697 | bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset); |
698 | int ath9k_hw_beaconq_setup(struct ath_hw *ah); | 698 | int 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); |
1495 | out: | 1494 | out: |
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); |
1539 | out: | 1540 | out: |
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 | ||
1565 | static void ath9k_enable_ps(struct ath_softc *sc) | 1569 | static 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 | ||
2111 | static u64 ath9k_get_tsf(struct ieee80211_hw *hw) | 2119 | static 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: | |||
483 | bool ath_stoprecv(struct ath_softc *sc) | 483 | bool 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 | ||
509 | void ath_flushrecv(struct ath_softc *sc) | 509 | void 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 @@ | |||
1 | config IWLWIFI_LEGACY | 1 | config 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 | ||
66 | config IWL4965 | 65 | config 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 | ||
93 | config IWL3945 | 93 | config 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; |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index a80bc1cdb35b..227bde39ee58 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -586,10 +586,8 @@ static int hci_dev_do_close(struct hci_dev *hdev) | |||
586 | hci_req_cancel(hdev, ENODEV); | 586 | hci_req_cancel(hdev, ENODEV); |
587 | hci_req_lock(hdev); | 587 | hci_req_lock(hdev); |
588 | 588 | ||
589 | /* Stop timer, it might be running */ | ||
590 | del_timer_sync(&hdev->cmd_timer); | ||
591 | |||
592 | if (!test_and_clear_bit(HCI_UP, &hdev->flags)) { | 589 | if (!test_and_clear_bit(HCI_UP, &hdev->flags)) { |
590 | del_timer_sync(&hdev->cmd_timer); | ||
593 | hci_req_unlock(hdev); | 591 | hci_req_unlock(hdev); |
594 | return 0; | 592 | return 0; |
595 | } | 593 | } |
@@ -628,6 +626,7 @@ static int hci_dev_do_close(struct hci_dev *hdev) | |||
628 | 626 | ||
629 | /* Drop last sent command */ | 627 | /* Drop last sent command */ |
630 | if (hdev->sent_cmd) { | 628 | if (hdev->sent_cmd) { |
629 | del_timer_sync(&hdev->cmd_timer); | ||
631 | kfree_skb(hdev->sent_cmd); | 630 | kfree_skb(hdev->sent_cmd); |
632 | hdev->sent_cmd = NULL; | 631 | hdev->sent_cmd = NULL; |
633 | } | 632 | } |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index c7eb073fe633..cb25628c0583 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -2419,8 +2419,6 @@ static inline void hci_io_capa_reply_evt(struct hci_dev *hdev, struct sk_buff *s | |||
2419 | if (!conn) | 2419 | if (!conn) |
2420 | goto unlock; | 2420 | goto unlock; |
2421 | 2421 | ||
2422 | hci_conn_hold(conn); | ||
2423 | |||
2424 | conn->remote_cap = ev->capability; | 2422 | conn->remote_cap = ev->capability; |
2425 | conn->remote_oob = ev->oob_data; | 2423 | conn->remote_oob = ev->oob_data; |
2426 | conn->remote_auth = ev->authentication; | 2424 | conn->remote_auth = ev->authentication; |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index d47de2b04b2e..9e8dc136ef16 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -1079,6 +1079,7 @@ static void l2cap_retransmit_one_frame(struct l2cap_chan *chan, u8 tx_seq) | |||
1079 | tx_skb = skb_clone(skb, GFP_ATOMIC); | 1079 | tx_skb = skb_clone(skb, GFP_ATOMIC); |
1080 | bt_cb(skb)->retries++; | 1080 | bt_cb(skb)->retries++; |
1081 | control = get_unaligned_le16(tx_skb->data + L2CAP_HDR_SIZE); | 1081 | control = get_unaligned_le16(tx_skb->data + L2CAP_HDR_SIZE); |
1082 | control &= L2CAP_CTRL_SAR; | ||
1082 | 1083 | ||
1083 | if (chan->conn_state & L2CAP_CONN_SEND_FBIT) { | 1084 | if (chan->conn_state & L2CAP_CONN_SEND_FBIT) { |
1084 | control |= L2CAP_CTRL_FINAL; | 1085 | control |= L2CAP_CTRL_FINAL; |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 42fdffd1d76c..94954c74f6ae 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -369,6 +369,15 @@ static void __sco_sock_close(struct sock *sk) | |||
369 | 369 | ||
370 | case BT_CONNECTED: | 370 | case BT_CONNECTED: |
371 | case BT_CONFIG: | 371 | case BT_CONFIG: |
372 | if (sco_pi(sk)->conn) { | ||
373 | sk->sk_state = BT_DISCONN; | ||
374 | sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT); | ||
375 | hci_conn_put(sco_pi(sk)->conn->hcon); | ||
376 | sco_pi(sk)->conn = NULL; | ||
377 | } else | ||
378 | sco_chan_del(sk, ECONNRESET); | ||
379 | break; | ||
380 | |||
372 | case BT_CONNECT: | 381 | case BT_CONNECT: |
373 | case BT_DISCONN: | 382 | case BT_DISCONN: |
374 | sco_chan_del(sk, ECONNRESET); | 383 | sco_chan_del(sk, ECONNRESET); |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index a6d191f2a0fe..a9ddaf63ee14 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1526,6 +1526,8 @@ int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata, | |||
1526 | enum ieee80211_smps_mode old_req; | 1526 | enum ieee80211_smps_mode old_req; |
1527 | int err; | 1527 | int err; |
1528 | 1528 | ||
1529 | lockdep_assert_held(&sdata->u.mgd.mtx); | ||
1530 | |||
1529 | old_req = sdata->u.mgd.req_smps; | 1531 | old_req = sdata->u.mgd.req_smps; |
1530 | sdata->u.mgd.req_smps = smps_mode; | 1532 | sdata->u.mgd.req_smps = smps_mode; |
1531 | 1533 | ||
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index dacace6b1393..9ea7c0d0103f 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -177,9 +177,9 @@ static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata, | |||
177 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 177 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
178 | return -EOPNOTSUPP; | 178 | return -EOPNOTSUPP; |
179 | 179 | ||
180 | mutex_lock(&local->iflist_mtx); | 180 | mutex_lock(&sdata->u.mgd.mtx); |
181 | err = __ieee80211_request_smps(sdata, smps_mode); | 181 | err = __ieee80211_request_smps(sdata, smps_mode); |
182 | mutex_unlock(&local->iflist_mtx); | 182 | mutex_unlock(&sdata->u.mgd.mtx); |
183 | 183 | ||
184 | return err; | 184 | return err; |
185 | } | 185 | } |