1Fix für defektes DFS von https://patchwork.kernel.org/patch/10986957/
 
    2Ermögliche selektiv das Aktivieren von DFS auch im Monitor Mode.
 
    5echo 1 > /sys/module/ath9k_hw/parameters/always_dfs
 
    6echo 1 > /sys/module/ath9k/parameters/always_dfs
 
    9echo 0 > /sys/module/ath9k/parameters/always_dfs
 
   10echo 0 > /sys/module/ath9k_hw/parameters/always_dfs
 
   13Credits: Till und Kai-Uwe
 
   15Index: on_firmware/openwrt/package/kernel/mac80211/patches/ath/498_always_enable_dfs.patch
 
   16===================================================================
 
   18+++ on_firmware/openwrt/package/kernel/mac80211/patches/ath/498_always_enable_dfs.patch
 
   20+--- a/drivers/net/wireless/ath/ath9k/channel.c 2016-01-15 13:00:08.000000000 +0100
 
   21++++ b/drivers/net/wireless/ath/ath9k/channel.c 2017-01-02 00:29:17.023553203 +0100
 
   23+   /* Enable radar pulse detection if on a DFS channel. Spectral
 
   24+    * scanning and radar detection can not be used concurrently.
 
   26+-  if (hw->conf.radar_enabled) {
 
   27++  if (hw->conf.radar_enabled || (ath9k_always_dfs == 1)) {
 
   28++      ath_dbg(common, DFS, "RADAR detection enabled (" __FILE__ ", l. %d)\n", __LINE__);
 
   31+       rxfilter = ath9k_hw_getrxfilter(ah);
 
   32+--- a/drivers/net/wireless/ath/ath9k/dfs.c 2016-01-15 13:00:08.000000000 +0100
 
   33++++ b/drivers/net/wireless/ath/ath9k/dfs.c 2017-01-02 00:30:52.159530173 +0100
 
   36+ ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe)
 
   38++  struct ath_hw *ah = sc->sc_ah;
 
   39++  struct ath_common *common = ath9k_hw_common(ah);
 
   41+   struct dfs_pattern_detector *pd = sc->dfs_detector;
 
   42+   DFS_STAT_INC(sc, pulses_processed);
 
   45+   if (!pd->add_pulse(pd, pe))
 
   47+   DFS_STAT_INC(sc, radar_detected);
 
   48++if (ath9k_always_dfs == 0) {
 
   49+   ieee80211_radar_detected(sc->hw);
 
   51++  ath_dbg(common, DFS, "RADAR detection enabled, radar_detected suppressed (" __FILE__ ", l. %d)\n", __LINE__);
 
   56+--- a/drivers/net/wireless/ath/ath9k/hw.c  2017-01-10 17:13:57.801668156 +0100
 
   57++++ b/drivers/net/wireless/ath/ath9k/hw.c  2017-01-10 17:15:50.755896588 +0100
 
   59+ MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards");
 
   60+ MODULE_LICENSE("Dual BSD/GPL");
 
   62++static int ath9k_hw_always_dfs = 0;
 
   63++module_param_named(always_dfs, ath9k_hw_always_dfs, int, 0644);
 
   64++MODULE_PARM_DESC(always_dfs, "Enable DFS messages in all modes");
 
   67+ static void ath9k_hw_set_clockrate(struct ath_hw *ah)
 
   69+   struct ath_common *common = ath9k_hw_common(ah);
 
   71+   if (AR_SREV_9565(ah) && common->bt_ant_diversity)
 
   72+       REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON);
 
   74+-  if (ah->hw->conf.radar_enabled) {
 
   75++  if (ah->hw->conf.radar_enabled || (ath9k_hw_always_dfs == 1)) {
 
   76++      ath_dbg(common, DFS, "RADAR detection enabled (" __FILE__ ", l. %d)\n", __LINE__);
 
   77+       /* set HW specific DFS configuration */
 
   78+       ah->radar_conf.ext_channel = IS_CHAN_HT40(chan);
 
   79+       ath9k_hw_set_radar_params(ah);
 
   80+--- a/drivers/net/wireless/ath/ath9k/recv.c    2016-01-15 13:00:08.000000000 +0100
 
   81++++ b/drivers/net/wireless/ath/ath9k/recv.c    2017-01-02 00:32:21.347509158 +0100
 
   83+       | ATH9K_RX_FILTER_MCAST;
 
   85+   /* if operating on a DFS channel, enable radar pulse detection */
 
   86+-  if (sc->hw->conf.radar_enabled)
 
   87++  if (sc->hw->conf.radar_enabled || (ath9k_always_dfs == 1)) {
 
   88++      ath_dbg(common, DFS, "RADAR detection enabled (" __FILE__ ", l. %d)\n", __LINE__);
 
   89+       rfilt |= ATH9K_RX_FILTER_PHYRADAR | ATH9K_RX_FILTER_PHYERR;
 
   92+   spin_lock_bh(&sc->chan_lock);
 
   94+--- a/drivers/net/wireless/ath/ath9k/init.c    2017-01-06 22:11:58.251673645 +0100
 
   95++++ b/drivers/net/wireless/ath/ath9k/init.c    2017-01-06 22:36:34.600625015 +0100
 
   97+ module_param_named(debug, ath9k_debug, uint, 0);
 
   98+ MODULE_PARM_DESC(debug, "Debugging mask");
 
  100++int ath9k_always_dfs = 0;
 
  101++module_param_named(always_dfs, ath9k_always_dfs, int, 0644);
 
  102++MODULE_PARM_DESC(always_dfs, "Enforce RADAR detection on all channels, disrupt DFS");
 
  104+ int ath9k_modparam_nohwcrypt;
 
  105+ module_param_named(nohwcrypt, ath9k_modparam_nohwcrypt, int, 0444);
 
  106+ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
 
  107+--- a/drivers/net/wireless/ath/ath9k/ath9k.h   2017-01-06 22:11:00.163648461 +0100
 
  108++++ b/drivers/net/wireless/ath/ath9k/ath9k.h   2017-01-06 22:11:49.267669620 +0100
 
  110+ extern int led_blink;
 
  111+ extern bool is_ath9k_unloaded;
 
  112+ extern int ath9k_use_chanctx;
 
  113++extern int ath9k_always_dfs;
 
  115+ /*************************/