ath9k: fix sleep mode handling issues, should improve client mode reliability (backpo...
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 12 Apr 2012 21:30:39 +0000 (21:30 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 12 Apr 2012 21:30:39 +0000 (21:30 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@31266 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/mac80211/patches/300-pending_work.patch
package/mac80211/patches/513-ath9k_channelbw_debugfs.patch
package/mac80211/patches/531-ath9k_cur_txpower.patch

index eb09e03e1cce49f7c9cae47bd9b6eebea6281125..b69ecc6b0417d6f4c5b72f8305bc925920efb861 100644 (file)
  
        mutex_unlock(&sc->mutex);
  
  
        mutex_unlock(&sc->mutex);
  
-@@ -1627,8 +1588,8 @@ static int ath9k_config(struct ieee80211
+@@ -1627,8 +1588,9 @@ 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 disable_radio = false;
        struct ath_hw *ah = sc->sc_ah;
        struct ath_common *common = ath9k_hw_common(ah);
        struct ieee80211_conf *conf = &hw->conf;
 -      bool disable_radio = false;
++      bool reset_channel = false;
  
 +      ath9k_ps_wakeup(sc);
        mutex_lock(&sc->mutex);
  
        /*
  
 +      ath9k_ps_wakeup(sc);
        mutex_lock(&sc->mutex);
  
        /*
-@@ -1639,13 +1600,8 @@ static int ath9k_config(struct ieee80211
+@@ -1639,13 +1601,14 @@ static int ath9k_config(struct ieee80211
         */
        if (changed & IEEE80211_CONF_CHANGE_IDLE) {
                sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE);
         */
        if (changed & IEEE80211_CONF_CHANGE_IDLE) {
                sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE);
 -              }
 +              if (sc->ps_idle)
 +                      ath_cancel_work(sc);
 -              }
 +              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;
        }
  
        /*
        }
  
        /*
-@@ -1678,7 +1634,6 @@ static int ath9k_config(struct ieee80211
+@@ -1676,9 +1639,8 @@ static int ath9k_config(struct ieee80211
+               }
+       }
  
  
-       if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
+-      if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
++      if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) {
                struct ieee80211_channel *curchan = hw->conf.channel;
 -              struct ath9k_channel old_chan;
                int pos = curchan->hw_value;
                int old_pos = -1;
                unsigned long flags;
                struct ieee80211_channel *curchan = hw->conf.channel;
 -              struct ath9k_channel old_chan;
                int pos = curchan->hw_value;
                int old_pos = -1;
                unsigned long flags;
-@@ -1704,11 +1659,8 @@ static int ath9k_config(struct ieee80211
+@@ -1704,11 +1666,8 @@ static int ath9k_config(struct ieee80211
                 * Preserve the current channel values, before updating
                 * the same channel
                 */
                 * Preserve the current channel values, before updating
                 * the same channel
                 */
  
                ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos],
                                          curchan, conf->channel_type);
  
                ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos],
                                          curchan, conf->channel_type);
-@@ -1752,18 +1704,12 @@ static int ath9k_config(struct ieee80211
+@@ -1752,18 +1711,12 @@ static int ath9k_config(struct ieee80211
                ath_dbg(common, ATH_DBG_CONFIG,
                        "Set power: %d\n", conf->power_level);
                sc->config.txpowlimit = 2 * conf->power_level;
                ath_dbg(common, ATH_DBG_CONFIG,
                        "Set power: %d\n", conf->power_level);
                sc->config.txpowlimit = 2 * conf->power_level;
  
        return 0;
  }
  
        return 0;
  }
-@@ -2331,9 +2277,6 @@ static void ath9k_flush(struct ieee80211
+@@ -2331,9 +2284,6 @@ static void ath9k_flush(struct ieee80211
                return;
        }
  
                return;
        }
  
        for (j = 0; j < timeout; j++) {
                bool npend = false;
  
        for (j = 0; j < timeout; j++) {
                bool npend = false;
  
-@@ -2351,21 +2294,22 @@ static void ath9k_flush(struct ieee80211
+@@ -2351,21 +2301,22 @@ static void ath9k_flush(struct ieee80211
                }
  
                if (!npend)
                }
  
                if (!npend)
index ae65b60e1be8a80143a9b467ed07131e9bf91257..523b380cefa6def7ee5a019fb5a5dff6cf8b9b1d 100644 (file)
@@ -90,9 +90,9 @@
  {
        struct ath_softc *sc = hw->priv;
        struct ath_hw *ah = sc->sc_ah;
  {
        struct ath_softc *sc = hw->priv;
        struct ath_hw *ah = sc->sc_ah;
-@@ -1616,9 +1616,11 @@ static int ath9k_config(struct ieee80211
+@@ -1623,9 +1623,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 ath9k_channel *hchan;
                int pos = curchan->hw_value;
                struct ieee80211_channel *curchan = hw->conf.channel;
 +              struct ath9k_channel *hchan;
                int pos = curchan->hw_value;
  
                if (ah->curchan)
                        old_pos = ah->curchan - &ah->channels[0];
  
                if (ah->curchan)
                        old_pos = ah->curchan - &ah->channels[0];
-@@ -1667,7 +1669,23 @@ static int ath9k_config(struct ieee80211
+@@ -1674,7 +1676,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));
                }
  
index adc5292f80929f1fc2e3da5131fdb572996006dd..48dc438b0943c6fe53839680fc60dc74206c5b30 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1691,6 +1691,8 @@ int ath9k_config(struct ieee80211_hw *hw
+@@ -1698,6 +1698,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
                 * channel is only available after the hardware reset. Copy it to
                /*
                 * The most recent snapshot of channel->noisefloor for the old
                 * channel is only available after the hardware reset. Copy it to
-@@ -1706,6 +1708,7 @@ int ath9k_config(struct ieee80211_hw *hw
+@@ -1713,6 +1715,7 @@ int ath9k_config(struct ieee80211_hw *hw
                sc->config.txpowlimit = 2 * conf->power_level;
                ath9k_cmn_update_txpow(ah, sc->curtxpow,
                                       sc->config.txpowlimit, &sc->curtxpow);
                sc->config.txpowlimit = 2 * conf->power_level;
                ath9k_cmn_update_txpow(ah, sc->curtxpow,
                                       sc->config.txpowlimit, &sc->curtxpow);