diff options
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/hif_usb.c | 4 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 9 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/mac.c | 25 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/mac.h | 2 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 6 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-3945-hw.h | 2 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-4965-hw.h | 3 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-core.c | 17 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-eeprom.c | 7 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlegacy/iwl3945-base.c | 4 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlegacy/iwl4965-base.c | 6 |
11 files changed, 39 insertions, 46 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index f1b8af64569c..2d10239ce829 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
| @@ -1040,7 +1040,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface, | |||
| 1040 | } | 1040 | } |
| 1041 | 1041 | ||
| 1042 | ret = ath9k_htc_hw_init(hif_dev->htc_handle, | 1042 | ret = ath9k_htc_hw_init(hif_dev->htc_handle, |
| 1043 | &hif_dev->udev->dev, hif_dev->device_id, | 1043 | &interface->dev, hif_dev->device_id, |
| 1044 | hif_dev->udev->product, id->driver_info); | 1044 | hif_dev->udev->product, id->driver_info); |
| 1045 | if (ret) { | 1045 | if (ret) { |
| 1046 | ret = -EINVAL; | 1046 | ret = -EINVAL; |
| @@ -1158,7 +1158,7 @@ fail_resume: | |||
| 1158 | #endif | 1158 | #endif |
| 1159 | 1159 | ||
| 1160 | static struct usb_driver ath9k_hif_usb_driver = { | 1160 | static struct usb_driver ath9k_hif_usb_driver = { |
| 1161 | .name = "ath9k_hif_usb", | 1161 | .name = KBUILD_MODNAME, |
| 1162 | .probe = ath9k_hif_usb_probe, | 1162 | .probe = ath9k_hif_usb_probe, |
| 1163 | .disconnect = ath9k_hif_usb_disconnect, | 1163 | .disconnect = ath9k_hif_usb_disconnect, |
| 1164 | #ifdef CONFIG_PM | 1164 | #ifdef CONFIG_PM |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 1ec9bcd6b281..c95bc5cc1a1f 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
| @@ -1254,15 +1254,6 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
| 1254 | ah->txchainmask = common->tx_chainmask; | 1254 | ah->txchainmask = common->tx_chainmask; |
| 1255 | ah->rxchainmask = common->rx_chainmask; | 1255 | ah->rxchainmask = common->rx_chainmask; |
| 1256 | 1256 | ||
| 1257 | if ((common->bus_ops->ath_bus_type != ATH_USB) && !ah->chip_fullsleep) { | ||
| 1258 | ath9k_hw_abortpcurecv(ah); | ||
| 1259 | if (!ath9k_hw_stopdmarecv(ah)) { | ||
| 1260 | ath_dbg(common, ATH_DBG_XMIT, | ||
| 1261 | "Failed to stop receive dma\n"); | ||
| 1262 | bChannelChange = false; | ||
| 1263 | } | ||
| 1264 | } | ||
| 1265 | |||
| 1266 | if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) | 1257 | if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) |
| 1267 | return -EIO; | 1258 | return -EIO; |
| 1268 | 1259 | ||
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c index 562257ac52cf..edc1cbbfecaf 100644 --- a/drivers/net/wireless/ath/ath9k/mac.c +++ b/drivers/net/wireless/ath/ath9k/mac.c | |||
| @@ -751,28 +751,47 @@ void ath9k_hw_abortpcurecv(struct ath_hw *ah) | |||
| 751 | } | 751 | } |
| 752 | EXPORT_SYMBOL(ath9k_hw_abortpcurecv); | 752 | EXPORT_SYMBOL(ath9k_hw_abortpcurecv); |
| 753 | 753 | ||
| 754 | bool ath9k_hw_stopdmarecv(struct ath_hw *ah) | 754 | bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset) |
| 755 | { | 755 | { |
| 756 | #define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */ | 756 | #define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */ |
| 757 | #define AH_RX_TIME_QUANTUM 100 /* usec */ | 757 | #define AH_RX_TIME_QUANTUM 100 /* usec */ |
| 758 | struct ath_common *common = ath9k_hw_common(ah); | 758 | struct ath_common *common = ath9k_hw_common(ah); |
| 759 | u32 mac_status, last_mac_status = 0; | ||
| 759 | int i; | 760 | int i; |
| 760 | 761 | ||
| 762 | /* Enable access to the DMA observation bus */ | ||
| 763 | REG_WRITE(ah, AR_MACMISC, | ||
| 764 | ((AR_MACMISC_DMA_OBS_LINE_8 << AR_MACMISC_DMA_OBS_S) | | ||
| 765 | (AR_MACMISC_MISC_OBS_BUS_1 << | ||
| 766 | AR_MACMISC_MISC_OBS_BUS_MSB_S))); | ||
| 767 | |||
| 761 | REG_WRITE(ah, AR_CR, AR_CR_RXD); | 768 | REG_WRITE(ah, AR_CR, AR_CR_RXD); |
| 762 | 769 | ||
| 763 | /* Wait for rx enable bit to go low */ | 770 | /* Wait for rx enable bit to go low */ |
| 764 | for (i = AH_RX_STOP_DMA_TIMEOUT / AH_TIME_QUANTUM; i != 0; i--) { | 771 | for (i = AH_RX_STOP_DMA_TIMEOUT / AH_TIME_QUANTUM; i != 0; i--) { |
| 765 | if ((REG_READ(ah, AR_CR) & AR_CR_RXE) == 0) | 772 | if ((REG_READ(ah, AR_CR) & AR_CR_RXE) == 0) |
| 766 | break; | 773 | break; |
| 774 | |||
| 775 | if (!AR_SREV_9300_20_OR_LATER(ah)) { | ||
| 776 | mac_status = REG_READ(ah, AR_DMADBG_7) & 0x7f0; | ||
| 777 | if (mac_status == 0x1c0 && mac_status == last_mac_status) { | ||
| 778 | *reset = true; | ||
| 779 | break; | ||
| 780 | } | ||
| 781 | |||
| 782 | last_mac_status = mac_status; | ||
| 783 | } | ||
| 784 | |||
| 767 | udelay(AH_TIME_QUANTUM); | 785 | udelay(AH_TIME_QUANTUM); |
| 768 | } | 786 | } |
| 769 | 787 | ||
| 770 | if (i == 0) { | 788 | if (i == 0) { |
| 771 | ath_err(common, | 789 | ath_err(common, |
| 772 | "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n", | 790 | "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n", |
| 773 | AH_RX_STOP_DMA_TIMEOUT / 1000, | 791 | AH_RX_STOP_DMA_TIMEOUT / 1000, |
| 774 | REG_READ(ah, AR_CR), | 792 | REG_READ(ah, AR_CR), |
| 775 | REG_READ(ah, AR_DIAG_SW)); | 793 | REG_READ(ah, AR_DIAG_SW), |
| 794 | REG_READ(ah, AR_DMADBG_7)); | ||
| 776 | return false; | 795 | return false; |
| 777 | } else { | 796 | } else { |
| 778 | return true; | 797 | return true; |
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h index b2b2ff852c32..c2a59386fb9c 100644 --- a/drivers/net/wireless/ath/ath9k/mac.h +++ b/drivers/net/wireless/ath/ath9k/mac.h | |||
| @@ -695,7 +695,7 @@ bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set); | |||
| 695 | void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp); | 695 | void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp); |
| 696 | void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning); | 696 | void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning); |
| 697 | void ath9k_hw_abortpcurecv(struct ath_hw *ah); | 697 | void ath9k_hw_abortpcurecv(struct ath_hw *ah); |
| 698 | bool ath9k_hw_stopdmarecv(struct ath_hw *ah); | 698 | bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset); |
| 699 | int ath9k_hw_beaconq_setup(struct ath_hw *ah); | 699 | int ath9k_hw_beaconq_setup(struct ath_hw *ah); |
| 700 | 700 | ||
| 701 | /* Interrupt Handling */ | 701 | /* Interrupt Handling */ |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index a9c3f4672aa0..dcd19bc337d1 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
| @@ -486,12 +486,12 @@ start_recv: | |||
| 486 | bool ath_stoprecv(struct ath_softc *sc) | 486 | bool ath_stoprecv(struct ath_softc *sc) |
| 487 | { | 487 | { |
| 488 | struct ath_hw *ah = sc->sc_ah; | 488 | struct ath_hw *ah = sc->sc_ah; |
| 489 | bool stopped; | 489 | bool stopped, reset = false; |
| 490 | 490 | ||
| 491 | spin_lock_bh(&sc->rx.rxbuflock); | 491 | spin_lock_bh(&sc->rx.rxbuflock); |
| 492 | ath9k_hw_abortpcurecv(ah); | 492 | ath9k_hw_abortpcurecv(ah); |
| 493 | ath9k_hw_setrxfilter(ah, 0); | 493 | ath9k_hw_setrxfilter(ah, 0); |
| 494 | stopped = ath9k_hw_stopdmarecv(ah); | 494 | stopped = ath9k_hw_stopdmarecv(ah, &reset); |
| 495 | 495 | ||
| 496 | if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) | 496 | if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) |
| 497 | ath_edma_stop_recv(sc); | 497 | ath_edma_stop_recv(sc); |
| @@ -506,7 +506,7 @@ bool ath_stoprecv(struct ath_softc *sc) | |||
| 506 | "confusing the DMA engine when we start RX up\n"); | 506 | "confusing the DMA engine when we start RX up\n"); |
| 507 | ATH_DBG_WARN_ON_ONCE(!stopped); | 507 | ATH_DBG_WARN_ON_ONCE(!stopped); |
| 508 | } | 508 | } |
| 509 | return stopped; | 509 | return stopped || reset; |
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | void ath_flushrecv(struct ath_softc *sc) | 512 | void ath_flushrecv(struct ath_softc *sc) |
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-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c index 7007d61bb6b5..c1511b14b239 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 91b3d8b9d7a5..d484c3678163 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); |
