aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZefir Kurtisi <zefir.kurtisi@neratec.com>2013-04-03 12:31:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-04-08 15:28:38 -0400
commit73e4937d489072a26a0077c72c7d50ef2d0bf02b (patch)
tree80821e582a2f3ee98cfb86b0ce1038398ccb1c7d
parente39282ee1b0f639fd9eebd3547803f1694e8c370 (diff)
ath9k: add support for DFS master mode
These are the remaining knobs in ath9k to support DFS: * mark AR9280 and AR9580 as DFS tested * synchronize DFS regulatory domain to reg notifyer * set required RX filter flags for radar detection * process radar PHY errors at DFS detector * notify DFS master on radar detection DFS support requires CONFIG_ATH9K_DFS_CERTIFIED to be set. Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/dfs.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c25
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c7
5 files changed, 36 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/dfs.c b/drivers/net/wireless/ath/ath9k/dfs.c
index ecc81792f2dc..508f8b33f0ef 100644
--- a/drivers/net/wireless/ath/ath9k/dfs.c
+++ b/drivers/net/wireless/ath/ath9k/dfs.c
@@ -193,9 +193,7 @@ void ath9k_dfs_process_phyerr(struct ath_softc *sc, void *data,
193 DFS_STAT_INC(sc, pulses_processed); 193 DFS_STAT_INC(sc, pulses_processed);
194 if (pd != NULL && pd->add_pulse(pd, &pe)) { 194 if (pd != NULL && pd->add_pulse(pd, &pe)) {
195 DFS_STAT_INC(sc, radar_detected); 195 DFS_STAT_INC(sc, radar_detected);
196 /* 196 ieee80211_radar_detected(sc->hw);
197 * TODO: forward radar event to DFS management layer
198 */
199 } 197 }
200 } 198 }
201} 199}
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 4fa2bb167050..3473a797651a 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2380,8 +2380,11 @@ static bool ath9k_hw_dfs_tested(struct ath_hw *ah)
2380{ 2380{
2381 2381
2382 switch (ah->hw_version.macVersion) { 2382 switch (ah->hw_version.macVersion) {
2383 /* for temporary testing DFS with 9280 */
2384 case AR_SREV_VERSION_9280:
2383 /* AR9580 will likely be our first target to get testing on */ 2385 /* AR9580 will likely be our first target to get testing on */
2384 case AR_SREV_VERSION_9580: 2386 case AR_SREV_VERSION_9580:
2387 return true;
2385 default: 2388 default:
2386 return false; 2389 return false;
2387 } 2390 }
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 385c59a735a8..3be2eb0da84a 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -319,6 +319,10 @@ static void ath9k_reg_notifier(struct wiphy *wiphy,
319 ath9k_ps_wakeup(sc); 319 ath9k_ps_wakeup(sc);
320 ath9k_hw_set_txpowerlimit(ah, sc->config.txpowlimit, false); 320 ath9k_hw_set_txpowerlimit(ah, sc->config.txpowlimit, false);
321 sc->curtxpow = ath9k_hw_regulatory(ah)->power_limit; 321 sc->curtxpow = ath9k_hw_regulatory(ah)->power_limit;
322 /* synchronize DFS detector if regulatory domain changed */
323 if (sc->dfs_detector != NULL)
324 sc->dfs_detector->set_dfs_domain(sc->dfs_detector,
325 request->dfs_region);
322 ath9k_ps_restore(sc); 326 ath9k_ps_restore(sc);
323 } 327 }
324} 328}
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 24650fd41694..2d251483da22 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1245,10 +1245,27 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1245 if (old_pos >= 0) 1245 if (old_pos >= 0)
1246 ath_update_survey_nf(sc, old_pos); 1246 ath_update_survey_nf(sc, old_pos);
1247 1247
1248 /* perform spectral scan if requested. */ 1248 /*
1249 if (sc->scanning && sc->spectral_mode == SPECTRAL_CHANSCAN) 1249 * Enable radar pulse detection if on a DFS channel. Spectral
1250 ath9k_spectral_scan_trigger(hw); 1250 * scanning and radar detection can not be used concurrently.
1251 1251 */
1252 if (hw->conf.radar_enabled) {
1253 u32 rxfilter;
1254
1255 /* set HW specific DFS configuration */
1256 ath9k_hw_set_radar_params(ah);
1257 rxfilter = ath9k_hw_getrxfilter(ah);
1258 rxfilter |= ATH9K_RX_FILTER_PHYRADAR |
1259 ATH9K_RX_FILTER_PHYERR;
1260 ath9k_hw_setrxfilter(ah, rxfilter);
1261 ath_dbg(common, DFS, "DFS enabled at freq %d\n",
1262 curchan->center_freq);
1263 } else {
1264 /* perform spectral scan if requested. */
1265 if (sc->scanning &&
1266 sc->spectral_mode == SPECTRAL_CHANSCAN)
1267 ath9k_spectral_scan_trigger(hw);
1268 }
1252 } 1269 }
1253 1270
1254 if (changed & IEEE80211_CONF_CHANGE_POWER) { 1271 if (changed & IEEE80211_CONF_CHANGE_POWER) {
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index ee156e543147..ee7ca5aecdb0 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -381,6 +381,10 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
381 rfilt = ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST 381 rfilt = ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
382 | ATH9K_RX_FILTER_MCAST; 382 | ATH9K_RX_FILTER_MCAST;
383 383
384 /* if operating on a DFS channel, enable radar pulse detection */
385 if (sc->hw->conf.radar_enabled)
386 rfilt |= ATH9K_RX_FILTER_PHYRADAR | ATH9K_RX_FILTER_PHYERR;
387
384 if (sc->rx.rxfilter & FIF_PROBE_REQ) 388 if (sc->rx.rxfilter & FIF_PROBE_REQ)
385 rfilt |= ATH9K_RX_FILTER_PROBEREQ; 389 rfilt |= ATH9K_RX_FILTER_PROBEREQ;
386 390
@@ -1228,6 +1232,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
1228 unlikely(tsf_lower - rs.rs_tstamp > 0x10000000)) 1232 unlikely(tsf_lower - rs.rs_tstamp > 0x10000000))
1229 rxs->mactime += 0x100000000ULL; 1233 rxs->mactime += 0x100000000ULL;
1230 1234
1235 if (rs.rs_phyerr == ATH9K_PHYERR_RADAR)
1236 ath9k_dfs_process_phyerr(sc, hdr, &rs, rxs->mactime);
1237
1231 if (rs.rs_status & ATH9K_RXERR_PHY) { 1238 if (rs.rs_status & ATH9K_RXERR_PHY) {
1232 if (ath_process_fft(sc, hdr, &rs, rxs->mactime)) { 1239 if (ath_process_fft(sc, hdr, &rs, rxs->mactime)) {
1233 RX_STAT_INC(rx_spectral); 1240 RX_STAT_INC(rx_spectral);