mirror of https://github.com/hak5/openwrt.git
ath9k: fix sleep mode handling issues, should improve client mode reliability
SVN-Revision: 31265lede-17.01
parent
a43ae30e1b
commit
a7db0ceda4
|
@ -1614,7 +1614,37 @@
|
||||||
mode = ATH9K_PM_NETWORK_SLEEP;
|
mode = ATH9K_PM_NETWORK_SLEEP;
|
||||||
else
|
else
|
||||||
goto unlock;
|
goto unlock;
|
||||||
@@ -1955,6 +1957,7 @@ static void ath9k_config_bss(struct ath_
|
@@ -1559,6 +1561,7 @@ static int ath9k_config(struct ieee80211
|
||||||
|
struct ath_hw *ah = sc->sc_ah;
|
||||||
|
struct ath_common *common = ath9k_hw_common(ah);
|
||||||
|
struct ieee80211_conf *conf = &hw->conf;
|
||||||
|
+ bool reset_channel = false;
|
||||||
|
|
||||||
|
ath9k_ps_wakeup(sc);
|
||||||
|
mutex_lock(&sc->mutex);
|
||||||
|
@@ -1567,6 +1570,12 @@ static int ath9k_config(struct ieee80211
|
||||||
|
sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE);
|
||||||
|
if (sc->ps_idle)
|
||||||
|
ath_cancel_work(sc);
|
||||||
|
+ else
|
||||||
|
+ /*
|
||||||
|
+ * The chip needs a reset to properly wake up from
|
||||||
|
+ * full sleep
|
||||||
|
+ */
|
||||||
|
+ reset_channel = ah->chip_fullsleep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -1595,7 +1604,7 @@ static int ath9k_config(struct ieee80211
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
|
||||||
|
+ if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) {
|
||||||
|
struct ieee80211_channel *curchan = hw->conf.channel;
|
||||||
|
int pos = curchan->hw_value;
|
||||||
|
int old_pos = -1;
|
||||||
|
@@ -1955,6 +1964,7 @@ static void ath9k_config_bss(struct ath_
|
||||||
sc->sc_flags &= ~SC_OP_ANI_RUN;
|
sc->sc_flags &= ~SC_OP_ANI_RUN;
|
||||||
del_timer_sync(&common->ani.timer);
|
del_timer_sync(&common->ani.timer);
|
||||||
memset(&sc->caldata, 0, sizeof(sc->caldata));
|
memset(&sc->caldata, 0, sizeof(sc->caldata));
|
||||||
|
@ -1622,7 +1652,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2300,6 +2303,7 @@ static int ath9k_tx_last_beacon(struct i
|
@@ -2300,6 +2310,7 @@ static int ath9k_tx_last_beacon(struct i
|
||||||
struct ath_vif *avp;
|
struct ath_vif *avp;
|
||||||
struct ath_buf *bf;
|
struct ath_buf *bf;
|
||||||
struct ath_tx_status ts;
|
struct ath_tx_status ts;
|
||||||
|
@ -1630,7 +1660,7 @@
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
vif = sc->beacon.bslot[0];
|
vif = sc->beacon.bslot[0];
|
||||||
@@ -2310,7 +2314,7 @@ static int ath9k_tx_last_beacon(struct i
|
@@ -2310,7 +2321,7 @@ static int ath9k_tx_last_beacon(struct i
|
||||||
if (!avp->is_bslot_active)
|
if (!avp->is_bslot_active)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -89,9 +89,9 @@
|
||||||
{
|
{
|
||||||
struct ath_softc *sc = hw->priv;
|
struct ath_softc *sc = hw->priv;
|
||||||
struct ath_hw *ah = sc->sc_ah;
|
struct ath_hw *ah = sc->sc_ah;
|
||||||
@@ -1581,9 +1581,11 @@ static int ath9k_config(struct ieee80211
|
@@ -1588,9 +1588,11 @@ static int ath9k_config(struct ieee80211
|
||||||
|
|
||||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
|
if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) {
|
||||||
struct ieee80211_channel *curchan = hw->conf.channel;
|
struct ieee80211_channel *curchan = hw->conf.channel;
|
||||||
+ struct ath9k_channel *hchan;
|
+ struct ath9k_channel *hchan;
|
||||||
int pos = curchan->hw_value;
|
int pos = curchan->hw_value;
|
||||||
|
@ -101,7 +101,7 @@
|
||||||
|
|
||||||
if (ah->curchan)
|
if (ah->curchan)
|
||||||
old_pos = ah->curchan - &ah->channels[0];
|
old_pos = ah->curchan - &ah->channels[0];
|
||||||
@@ -1631,7 +1633,23 @@ static int ath9k_config(struct ieee80211
|
@@ -1638,7 +1640,23 @@ static int ath9k_config(struct ieee80211
|
||||||
memset(&sc->survey[pos], 0, sizeof(struct survey_info));
|
memset(&sc->survey[pos], 0, sizeof(struct survey_info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/drivers/net/wireless/ath/ath9k/main.c
|
--- a/drivers/net/wireless/ath/ath9k/main.c
|
||||||
+++ b/drivers/net/wireless/ath/ath9k/main.c
|
+++ b/drivers/net/wireless/ath/ath9k/main.c
|
||||||
@@ -1655,6 +1655,8 @@ int ath9k_config(struct ieee80211_hw *hw
|
@@ -1662,6 +1662,8 @@ int ath9k_config(struct ieee80211_hw *hw
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
/*
|
/*
|
||||||
* The most recent snapshot of channel->noisefloor for the old
|
* The most recent snapshot of channel->noisefloor for the old
|
||||||
* channel is only available after the hardware reset. Copy it to
|
* channel is only available after the hardware reset. Copy it to
|
||||||
@@ -1669,6 +1671,7 @@ int ath9k_config(struct ieee80211_hw *hw
|
@@ -1676,6 +1678,7 @@ int ath9k_config(struct ieee80211_hw *hw
|
||||||
sc->config.txpowlimit = 2 * conf->power_level;
|
sc->config.txpowlimit = 2 * conf->power_level;
|
||||||
ath9k_cmn_update_txpow(ah, sc->curtxpow,
|
ath9k_cmn_update_txpow(ah, sc->curtxpow,
|
||||||
sc->config.txpowlimit, &sc->curtxpow);
|
sc->config.txpowlimit, &sc->curtxpow);
|
||||||
|
|
|
@ -171,7 +171,7 @@
|
||||||
|
|
||||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||||
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
||||||
@@ -759,7 +759,7 @@ int ath9k_init_device(u16 devid, struct
|
@@ -761,7 +761,7 @@ int ath9k_init_device(u16 devid, struct
|
||||||
|
|
||||||
#ifdef CONFIG_MAC80211_LEDS
|
#ifdef CONFIG_MAC80211_LEDS
|
||||||
/* must be initialized before ieee80211_register_hw */
|
/* must be initialized before ieee80211_register_hw */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/include/linux/ath9k_platform.h
|
--- a/include/linux/ath9k_platform.h
|
||||||
+++ b/include/linux/ath9k_platform.h
|
+++ b/include/linux/ath9k_platform.h
|
||||||
@@ -32,6 +32,9 @@ struct ath9k_platform_data {
|
@@ -33,6 +33,9 @@ struct ath9k_platform_data {
|
||||||
bool is_clk_25mhz;
|
bool is_clk_25mhz;
|
||||||
int (*get_mac_revision)(void);
|
int (*get_mac_revision)(void);
|
||||||
int (*external_reset)(void);
|
int (*external_reset)(void);
|
||||||
|
|
Loading…
Reference in New Issue