From: Felix Fietkau Date: Sat, 28 May 2011 16:45:17 +0000 (+0000) Subject: ath9k: merge a few bugfixes X-Git-Tag: reboot~16683 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c7cdee0230c999197b017fb4aadd49f5eb7dc0b8;p=openwrt%2Fstaging%2Fchunkeey.git ath9k: merge a few bugfixes SVN-Revision: 27025 --- diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch new file mode 100644 index 0000000000..15e6bd0dca --- /dev/null +++ b/package/mac80211/patches/300-pending_work.patch @@ -0,0 +1,93 @@ +--- 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); ++ ++void ar9003_hw_disable_phy_restart(struct ath_hw *ah) ++{ ++ u32 val; ++ ++ /* 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); + +- if (AR_SREV_9300_20_OR_LATER(ah)) ++ if (AR_SREV_9300_20_OR_LATER(ah)) { + ar9003_hw_bb_watchdog_config(ah); + ++ ar9003_hw_disable_phy_restart(ah); ++ } ++ + ath9k_hw_apply_gpio_override(ah); + + 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 { + + 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 */ + + 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; + +- if (status & ATH9K_INT_FATAL) { ++ if ((status & ATH9K_INT_FATAL) || ++ (status & ATH9K_INT_BB_WATCHDOG)) { + ath_reset(sc, true); + return; + } +@@ -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 | \ diff --git a/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch b/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch index 6982671300..6d872e9059 100644 --- a/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch +++ b/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -1480,15 +1480,6 @@ static int ath9k_add_interface(struct ie +@@ -1482,15 +1482,6 @@ static int ath9k_add_interface(struct ie } } @@ -16,7 +16,7 @@ ath_dbg(common, ATH_DBG_CONFIG, "Attach a VIF of type: %d\n", vif->type); -@@ -1514,15 +1505,6 @@ static int ath9k_change_interface(struct +@@ -1516,15 +1507,6 @@ static int ath9k_change_interface(struct mutex_lock(&sc->mutex); ath9k_ps_wakeup(sc); diff --git a/package/mac80211/patches/572-ath9k_tx_last_beacon.patch b/package/mac80211/patches/572-ath9k_tx_last_beacon.patch index f8aad94b79..8b2950d654 100644 --- a/package/mac80211/patches/572-ath9k_tx_last_beacon.patch +++ b/package/mac80211/patches/572-ath9k_tx_last_beacon.patch @@ -54,7 +54,7 @@ --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -2314,6 +2314,48 @@ static bool ath9k_tx_frames_pending(stru +@@ -2316,6 +2316,48 @@ static bool ath9k_tx_frames_pending(stru return false; } @@ -103,7 +103,7 @@ struct ieee80211_ops ath9k_ops = { .tx = ath9k_tx, .start = ath9k_start, -@@ -2338,4 +2380,5 @@ struct ieee80211_ops ath9k_ops = { +@@ -2340,4 +2382,5 @@ struct ieee80211_ops ath9k_ops = { .set_coverage_class = ath9k_set_coverage_class, .flush = ath9k_flush, .tx_frames_pending = ath9k_tx_frames_pending,