diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-03-11 15:02:47 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-03-11 15:02:47 +0000 |
commit | 1e5b7c17b031359a37ed7772b92cc98aaaeac727 (patch) | |
tree | 5e2a88ef16da6f5c7c3b74ef607e5ba892252d5b /package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch | |
parent | ee1e8c2f2df3b03ef89e5a8b31ae9e2f9907ade1 (diff) | |
download | upstream-1e5b7c17b031359a37ed7772b92cc98aaaeac727.tar.gz upstream-1e5b7c17b031359a37ed7772b92cc98aaaeac727.tar.bz2 upstream-1e5b7c17b031359a37ed7772b92cc98aaaeac727.zip |
mac80211: update to wireless-testing 2015-03-09
Based on patch by Bryan Forbes <bryan@reigndropsfall.net>
Also update mt76 to update for API changes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 44655
Diffstat (limited to 'package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch')
-rw-r--r-- | package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch b/package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch new file mode 100644 index 0000000000..ed268eacf9 --- /dev/null +++ b/package/kernel/mac80211/patches/303-ath9k-add-DFS-support-for-extension-channel.patch @@ -0,0 +1,76 @@ +From: Zefir Kurtisi <zefir.kurtisi@neratec.com> +Date: Tue, 10 Mar 2015 17:49:30 +0100 +Subject: [PATCH] ath9k: add DFS support for extension channel + +In HT40 modes, pulse events on primary and extension +channel are processed individually. If valid, a pulse +event will be fed into the detector +* for primary frequency, or +* for extension frequency (+/-20MHz based on HT40-mode) +* or both + +With that, a 40MHz radar will result in two individual +radar events. + +Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> +--- + +--- a/drivers/net/wireless/ath/ath9k/dfs.c ++++ b/drivers/net/wireless/ath/ath9k/dfs.c +@@ -126,8 +126,19 @@ ath9k_postprocess_radar_event(struct ath + DFS_STAT_INC(sc, pulses_detected); + return true; + } +-#undef PRI_CH_RADAR_FOUND +-#undef EXT_CH_RADAR_FOUND ++ ++static void ++ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe) ++{ ++ struct dfs_pattern_detector *pd = sc->dfs_detector; ++ DFS_STAT_INC(sc, pulses_processed); ++ if (pd == NULL) ++ return; ++ if (!pd->add_pulse(pd, pe)) ++ return; ++ DFS_STAT_INC(sc, radar_detected); ++ ieee80211_radar_detected(sc->hw); ++} + + /* + * DFS: check PHY-error for radar pulse and feed the detector +@@ -176,18 +187,21 @@ void ath9k_dfs_process_phyerr(struct ath + ard.pulse_length_pri = vdata_end[-3]; + pe.freq = ah->curchan->channel; + pe.ts = mactime; +- if (ath9k_postprocess_radar_event(sc, &ard, &pe)) { +- struct dfs_pattern_detector *pd = sc->dfs_detector; +- ath_dbg(common, DFS, +- "ath9k_dfs_process_phyerr: channel=%d, ts=%llu, " +- "width=%d, rssi=%d, delta_ts=%llu\n", +- pe.freq, pe.ts, pe.width, pe.rssi, +- pe.ts - sc->dfs_prev_pulse_ts); +- sc->dfs_prev_pulse_ts = pe.ts; +- DFS_STAT_INC(sc, pulses_processed); +- if (pd != NULL && pd->add_pulse(pd, &pe)) { +- DFS_STAT_INC(sc, radar_detected); +- ieee80211_radar_detected(sc->hw); +- } ++ if (!ath9k_postprocess_radar_event(sc, &ard, &pe)) ++ return; ++ ++ ath_dbg(common, DFS, ++ "ath9k_dfs_process_phyerr: type=%d, freq=%d, ts=%llu, " ++ "width=%d, rssi=%d, delta_ts=%llu\n", ++ ard.pulse_bw_info, pe.freq, pe.ts, pe.width, pe.rssi, ++ pe.ts - sc->dfs_prev_pulse_ts); ++ sc->dfs_prev_pulse_ts = pe.ts; ++ if (ard.pulse_bw_info & PRI_CH_RADAR_FOUND) ++ ath9k_dfs_process_radar_pulse(sc, &pe); ++ if (ard.pulse_bw_info & EXT_CH_RADAR_FOUND) { ++ pe.freq += IS_CHAN_HT40PLUS(ah->curchan) ? 20 : -20; ++ ath9k_dfs_process_radar_pulse(sc, &pe); + } + } ++#undef PRI_CH_RADAR_FOUND ++#undef EXT_CH_RADAR_FOUND |