mac80211: make ath9k available even if PCI support is disabled
[openwrt.git] / package / mac80211 / patches / 300-pending_work.patch
index 40fd32d..15e6bd0 100644 (file)
@@ -1,86 +1,93 @@
---- a/drivers/net/wireless/ath/ath9k/main.c
-+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1048,6 +1048,8 @@ static int ath9k_start(struct ieee80211_
-               "Starting driver with initial channel: %d MHz\n",
-               curchan->center_freq);
-+      ath9k_ps_wakeup(sc);
+--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
++++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+@@ -829,7 +829,7 @@ static bool ar9002_hw_init_cal(struct at
+       if (AR_SREV_9271(ah)) {
+               if (!ar9285_hw_cl_cal(ah, chan))
+                       return false;
+-      } else if (AR_SREV_9285_12_OR_LATER(ah)) {
++      } else if (AR_SREV_9285(ah) && AR_SREV_9285_12_OR_LATER(ah)) {
+               if (!ar9285_hw_clc(ah, chan))
+                       return false;
+       } else {
+--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+@@ -1381,3 +1381,25 @@ void ar9003_hw_bb_watchdog_dbg_info(stru
+               "==== BB update: done ====\n\n");
+ }
+ EXPORT_SYMBOL(ar9003_hw_bb_watchdog_dbg_info);
 +
-       mutex_lock(&sc->mutex);
-       /* setup initial channel */
-@@ -1143,6 +1145,8 @@ static int ath9k_start(struct ieee80211_
- mutex_unlock:
-       mutex_unlock(&sc->mutex);
-+      ath9k_ps_restore(sc);
++void ar9003_hw_disable_phy_restart(struct ath_hw *ah)
++{
++      u32 val;
 +
-       return r;
- }
++      /* While receiving unsupported rate frame rx state machine
++       * gets into a state 0xb and if phy_restart happens in that
++       * state, BB would go hang. If RXSM is in 0xb state after
++       * first bb panic, ensure to disable the phy_restart.
++       */
++      if (!((MS(ah->bb_watchdog_last_status,
++                AR_PHY_WATCHDOG_RX_OFDM_SM) == 0xb) ||
++          ah->bb_hang_rx_ofdm))
++              return;
++
++      ah->bb_hang_rx_ofdm = true;
++      val = REG_READ(ah, AR_PHY_RESTART);
++      val &= ~AR_PHY_RESTART_ENA;
++
++      REG_WRITE(ah, AR_PHY_RESTART, val);
++}
++EXPORT_SYMBOL(ar9003_hw_disable_phy_restart);
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -1555,9 +1555,12 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+       if (ah->btcoex_hw.enabled)
+               ath9k_hw_btcoex_enable(ah);
  
---- a/net/mac80211/ibss.c
-+++ b/net/mac80211/ibss.c
-@@ -661,7 +661,6 @@ static void ieee80211_sta_find_ibss(stru
- static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
-                                       struct sk_buff *req)
- {
--      struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(req);
-       struct ieee80211_mgmt *mgmt = (void *)req->data;
-       struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
-       struct ieee80211_local *local = sdata->local;
-@@ -685,7 +684,7 @@ static void ieee80211_rx_mgmt_probe_req(
-              mgmt->bssid, tx_last_beacon);
- #endif /* CONFIG_MAC80211_IBSS_DEBUG */
+-      if (AR_SREV_9300_20_OR_LATER(ah))
++      if (AR_SREV_9300_20_OR_LATER(ah)) {
+               ar9003_hw_bb_watchdog_config(ah);
  
--      if (!tx_last_beacon && !(rx_status->rx_flags & IEEE80211_RX_RA_MATCH))
-+      if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da))
-               return;
++              ar9003_hw_disable_phy_restart(ah);
++      }
++
+       ath9k_hw_apply_gpio_override(ah);
  
-       if (memcmp(mgmt->bssid, ifibss->bssid, ETH_ALEN) != 0 &&
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -659,18 +659,14 @@ minstrel_ht_update_caps(void *priv, stru
-       struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
-       struct ieee80211_local *local = hw_to_local(mp->hw);
-       u16 sta_cap = sta->ht_cap.cap;
-+      int n_supported = 0;
-       int ack_dur;
-       int stbc;
-       int i;
+       return 0;
+--- a/drivers/net/wireless/ath/ath9k/hw.h
++++ b/drivers/net/wireless/ath/ath9k/hw.h
+@@ -842,6 +842,7 @@ struct ath_hw {
  
-       /* fall back to the old minstrel for legacy stations */
--      if (!sta->ht_cap.ht_supported) {
--              msp->is_ht = false;
--              memset(&msp->legacy, 0, sizeof(msp->legacy));
--              msp->legacy.r = msp->ratelist;
--              msp->legacy.sample_table = msp->sample_table;
--              return mac80211_minstrel.rate_init(priv, sband, sta, &msp->legacy);
--      }
-+      if (!sta->ht_cap.ht_supported)
-+              goto use_legacy;
+       u32 bb_watchdog_last_status;
+       u32 bb_watchdog_timeout_ms; /* in ms, 0 to disable */
++      u8 bb_hang_rx_ofdm; /* true if bb hang due to rx_ofdm */
  
-       BUILD_BUG_ON(ARRAY_SIZE(minstrel_mcs_groups) !=
-               MINSTREL_MAX_STREAMS * MINSTREL_STREAM_GROUPS);
-@@ -725,7 +721,22 @@ minstrel_ht_update_caps(void *priv, stru
+       unsigned int paprd_target_power;
+       unsigned int paprd_training_power;
+@@ -990,6 +991,7 @@ void ar9002_hw_enable_wep_aggregation(st
+ void ar9003_hw_bb_watchdog_config(struct ath_hw *ah);
+ void ar9003_hw_bb_watchdog_read(struct ath_hw *ah);
+ void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah);
++void ar9003_hw_disable_phy_restart(struct ath_hw *ah);
+ void ar9003_paprd_enable(struct ath_hw *ah, bool val);
+ void ar9003_paprd_populate_single_table(struct ath_hw *ah,
+                                       struct ath9k_hw_cal_data *caldata,
+--- a/drivers/net/wireless/ath/ath9k/main.c
++++ b/drivers/net/wireless/ath/ath9k/main.c
+@@ -670,7 +670,8 @@ void ath9k_tasklet(unsigned long data)
+       u32 status = sc->intrstatus;
+       u32 rxmask;
  
-               mi->groups[i].supported =
-                       mcs->rx_mask[minstrel_mcs_groups[i].streams - 1];
-+
-+              if (mi->groups[i].supported)
-+                      n_supported++;
+-      if (status & ATH9K_INT_FATAL) {
++      if ((status & ATH9K_INT_FATAL) ||
++          (status & ATH9K_INT_BB_WATCHDOG)) {
+               ath_reset(sc, true);
+               return;
        }
-+
-+      if (!n_supported)
-+              goto use_legacy;
-+
-+      return;
-+
-+use_legacy:
-+      msp->is_ht = false;
-+      memset(&msp->legacy, 0, sizeof(msp->legacy));
-+      msp->legacy.r = msp->ratelist;
-+      msp->legacy.sample_table = msp->sample_table;
-+      return mac80211_minstrel.rate_init(priv, sband, sta, &msp->legacy);
- }
- static void
+@@ -737,6 +738,7 @@ irqreturn_t ath_isr(int irq, void *dev)
+ {
+ #define SCHED_INTR (                          \
+               ATH9K_INT_FATAL |               \
++              ATH9K_INT_BB_WATCHDOG |         \
+               ATH9K_INT_RXORN |               \
+               ATH9K_INT_RXEOL |               \
+               ATH9K_INT_RX |                  \
This page took 0.028356 seconds and 4 git commands to generate.