Skip to content

Commit a5d5a91

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
2 parents d5eab91 + f352910 commit a5d5a91

17 files changed

Lines changed: 85 additions & 41 deletions

File tree

‎drivers/net/wireless/ath/ath9k/ar9002_hw.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,7 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah,
309309
u8 i;
310310
u32 val;
311311

312-
if (ah->is_pciexpress != true)
313-
return;
314-
315-
/* Do not touch SerDes registers */
316-
if (ah->config.pcie_powersave_enable == 2)
312+
if (ah->is_pciexpress != true || ah->aspm_enabled != true)
317313
return;
318314

319315
/* Nothing to do on restore for 11N */

‎drivers/net/wireless/ath/ath9k/ar9003_hw.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,7 @@ static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
519519
int restore,
520520
int power_off)
521521
{
522-
if (ah->is_pciexpress != true)
523-
return;
524-
525-
/* Do not touch SerDes registers */
526-
if (ah->config.pcie_powersave_enable == 2)
522+
if (ah->is_pciexpress != true || ah->aspm_enabled != true)
527523
return;
528524

529525
/* Nothing to do on restore for 11N */

‎drivers/net/wireless/ath/ath9k/hw.c‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,14 @@ static void ath9k_hw_disablepcie(struct ath_hw *ah)
318318
REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000);
319319
}
320320

321+
static void ath9k_hw_aspm_init(struct ath_hw *ah)
322+
{
323+
struct ath_common *common = ath9k_hw_common(ah);
324+
325+
if (common->bus_ops->aspm_init)
326+
common->bus_ops->aspm_init(common);
327+
}
328+
321329
/* This should work for all families including legacy */
322330
static bool ath9k_hw_chip_test(struct ath_hw *ah)
323331
{
@@ -378,7 +386,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
378386
ah->config.additional_swba_backoff = 0;
379387
ah->config.ack_6mb = 0x0;
380388
ah->config.cwm_ignore_extcca = 0;
381-
ah->config.pcie_powersave_enable = 0;
382389
ah->config.pcie_clock_req = 0;
383390
ah->config.pcie_waen = 0;
384391
ah->config.analog_shiftreg = 1;
@@ -598,7 +605,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)
598605

599606

600607
if (ah->is_pciexpress)
601-
ath9k_hw_configpcipowersave(ah, 0, 0);
608+
ath9k_hw_aspm_init(ah);
602609
else
603610
ath9k_hw_disablepcie(ah);
604611

‎drivers/net/wireless/ath/ath9k/hw.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ struct ath9k_ops_config {
219219
int additional_swba_backoff;
220220
int ack_6mb;
221221
u32 cwm_ignore_extcca;
222-
u8 pcie_powersave_enable;
223222
bool pcieSerDesWrite;
224223
u8 pcie_clock_req;
225224
u32 pcie_waen;
@@ -673,6 +672,7 @@ struct ath_hw {
673672

674673
bool sw_mgmt_crypto;
675674
bool is_pciexpress;
675+
bool aspm_enabled;
676676
bool is_monitoring;
677677
bool need_an_top2_fixup;
678678
u16 tx_trig_level;
@@ -874,6 +874,7 @@ struct ath_bus_ops {
874874
bool (*eeprom_read)(struct ath_common *common, u32 off, u16 *data);
875875
void (*bt_coex_prep)(struct ath_common *common);
876876
void (*extn_synch_en)(struct ath_common *common);
877+
void (*aspm_init)(struct ath_common *common);
877878
};
878879

879880
static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah)

‎drivers/net/wireless/ath/ath9k/init.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,10 @@ static void ath9k_init_band_txpower(struct ath_softc *sc, int band)
670670
static void ath9k_init_txpower_limits(struct ath_softc *sc)
671671
{
672672
struct ath_hw *ah = sc->sc_ah;
673+
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
673674
struct ath9k_channel *curchan = ah->curchan;
674675

676+
ah->txchainmask = common->tx_chainmask;
675677
if (ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ)
676678
ath9k_init_band_txpower(sc, IEEE80211_BAND_2GHZ);
677679
if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ)

‎drivers/net/wireless/ath/ath9k/pci.c‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include <linux/nl80211.h>
1818
#include <linux/pci.h>
19+
#include <linux/pci-aspm.h>
1920
#include <linux/ath9k_platform.h>
2021
#include "ath9k.h"
2122

@@ -115,12 +116,38 @@ static void ath_pci_extn_synch_enable(struct ath_common *common)
115116
pci_write_config_byte(pdev, sc->sc_ah->caps.pcie_lcr_offset, lnkctl);
116117
}
117118

119+
static void ath_pci_aspm_init(struct ath_common *common)
120+
{
121+
struct ath_softc *sc = (struct ath_softc *) common->priv;
122+
struct ath_hw *ah = sc->sc_ah;
123+
struct pci_dev *pdev = to_pci_dev(sc->dev);
124+
struct pci_dev *parent;
125+
int pos;
126+
u8 aspm;
127+
128+
if (!pci_is_pcie(pdev))
129+
return;
130+
131+
parent = pdev->bus->self;
132+
if (WARN_ON(!parent))
133+
return;
134+
135+
pos = pci_pcie_cap(parent);
136+
pci_read_config_byte(parent, pos + PCI_EXP_LNKCTL, &aspm);
137+
if (aspm & (PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1)) {
138+
ah->aspm_enabled = true;
139+
/* Initialize PCIe PM and SERDES registers. */
140+
ath9k_hw_configpcipowersave(ah, 0, 0);
141+
}
142+
}
143+
118144
static const struct ath_bus_ops ath_pci_bus_ops = {
119145
.ath_bus_type = ATH_PCI,
120146
.read_cachesize = ath_pci_read_cachesize,
121147
.eeprom_read = ath_pci_eeprom_read,
122148
.bt_coex_prep = ath_pci_bt_coex_prep,
123149
.extn_synch_en = ath_pci_extn_synch_enable,
150+
.aspm_init = ath_pci_aspm_init,
124151
};
125152

126153
static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)

‎drivers/net/wireless/iwlegacy/iwl-3945.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,11 @@ int iwl3945_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
17461746
}
17471747

17481748
memcpy(active_rxon, staging_rxon, sizeof(*active_rxon));
1749-
1749+
/*
1750+
* We do not commit tx power settings while channel changing,
1751+
* do it now if tx power changed.
1752+
*/
1753+
iwl_legacy_set_tx_power(priv, priv->tx_power_next, false);
17501754
return 0;
17511755
}
17521756

‎drivers/net/wireless/iwlegacy/iwl-4965.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,12 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
12351235

12361236
memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon));
12371237
iwl_legacy_print_rx_config_cmd(priv, ctx);
1238-
goto set_tx_power;
1238+
/*
1239+
* We do not commit tx power settings while channel changing,
1240+
* do it now if tx power changed.
1241+
*/
1242+
iwl_legacy_set_tx_power(priv, priv->tx_power_next, false);
1243+
return 0;
12391244
}
12401245

12411246
/* If we are currently associated and the new config requires
@@ -1315,7 +1320,6 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
13151320

13161321
iwl4965_init_sensitivity(priv);
13171322

1318-
set_tx_power:
13191323
/* If we issue a new RXON command which required a tune then we must
13201324
* send a new TXPOWER command or we won't be able to Tx any frames */
13211325
ret = iwl_legacy_set_tx_power(priv, priv->tx_power_next, true);

‎drivers/net/wireless/iwlwifi/iwl-5000.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ static struct iwl_base_params iwl5000_base_params = {
365365
.chain_noise_scale = 1000,
366366
.wd_timeout = IWL_LONG_WD_TIMEOUT,
367367
.max_event_log_size = 512,
368+
.no_idle_support = true,
368369
};
369370
static struct iwl_ht_params iwl5000_ht_params = {
370371
.ht_greenfield_support = true,

‎drivers/net/wireless/iwlwifi/iwl-core.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ struct iwl_mod_params {
135135
* @temperature_kelvin: temperature report by uCode in kelvin
136136
* @max_event_log_size: size of event log buffer size for ucode event logging
137137
* @shadow_reg_enable: HW shadhow register bit
138+
* @no_idle_support: do not support idle mode
138139
*/
139140
struct iwl_base_params {
140141
int eeprom_size;
@@ -156,6 +157,7 @@ struct iwl_base_params {
156157
bool temperature_kelvin;
157158
u32 max_event_log_size;
158159
const bool shadow_reg_enable;
160+
const bool no_idle_support;
159161
};
160162
/*
161163
* @advanced_bt_coexist: support advanced bt coexist

0 commit comments

Comments
 (0)