ath9k: dfs kill ath9k specyfic code
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>
Mon, 14 Oct 2013 09:06:03 +0000 (11:06 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 18 Oct 2013 18:03:54 +0000 (14:03 -0400)
Kill of using ath9k_hw_common() function
in dfs detector code.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h
drivers/net/wireless/ath/ath9k/init.c

index 491305c81fcecd36f5bc9bae0d7b66afd1a7e45e..c839a78812d4b94d6936ee1fb4a4eec2642cada2 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "dfs_pattern_detector.h"
 #include "dfs_pri_detector.h"
-#include "ath9k.h"
+#include "../ath.h"
 
 /*
  * tolerated deviation of radar time stamp in usecs on both sides
@@ -143,7 +143,6 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq)
 {
        u32 sz, i;
        struct channel_detector *cd;
-       struct ath_common *common = ath9k_hw_common(dpd->ah);
 
        cd = kmalloc(sizeof(*cd), GFP_ATOMIC);
        if (cd == NULL)
@@ -167,7 +166,7 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq)
        return cd;
 
 fail:
-       ath_dbg(common, DFS,
+       ath_dbg(dpd->common, DFS,
                "failed to allocate channel_detector for freq=%d\n", freq);
        channel_detector_exit(dpd, cd);
        return NULL;
@@ -242,7 +241,7 @@ dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event)
                struct pri_detector *pd = cd->detectors[i];
                struct pri_sequence *ps = pd->add_pulse(pd, event);
                if (ps != NULL) {
-                       ath_dbg(ath9k_hw_common(dpd->ah), DFS,
+                       ath_dbg(dpd->common, DFS,
                                "DFS: radar found on freq=%d: id=%d, pri=%d, "
                                "count=%d, count_false=%d\n",
                                event->freq, pd->rs->type_id,
@@ -288,10 +287,10 @@ static struct dfs_pattern_detector default_dpd = {
 };
 
 struct dfs_pattern_detector *
-dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region)
+dfs_pattern_detector_init(struct ath_common *common,
+                         enum nl80211_dfs_regions region)
 {
        struct dfs_pattern_detector *dpd;
-       struct ath_common *common = ath9k_hw_common(ah);
 
        dpd = kmalloc(sizeof(*dpd), GFP_KERNEL);
        if (dpd == NULL)
@@ -300,7 +299,7 @@ dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region)
        *dpd = default_dpd;
        INIT_LIST_HEAD(&dpd->channel_detectors);
 
-       dpd->ah = ah;
+       dpd->common = common;
        if (dpd->set_dfs_domain(dpd, region))
                return dpd;
 
index 90a5abcc4265aeeddcaa012058de9e3c6838d415..b09946fed9382bdd39a63f006f5696000b483e8b 100644 (file)
@@ -81,7 +81,7 @@ struct dfs_pattern_detector {
        u8 num_radar_types;
        u64 last_pulse_ts;
        /* needed for ath_dbg() */
-       struct ath_hw *ah;
+       struct ath_common *common;
 
        const struct radar_detector_specs *radar_spec;
        struct list_head channel_detectors;
@@ -94,10 +94,12 @@ struct dfs_pattern_detector {
  */
 #if defined(CONFIG_ATH9K_DFS_CERTIFIED)
 extern struct dfs_pattern_detector *
-dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region);
+dfs_pattern_detector_init(struct ath_common *common,
+                         enum nl80211_dfs_regions region);
 #else
 static inline struct dfs_pattern_detector *
-dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region)
+dfs_pattern_detector_init(struct ath_common *common,
+                         enum nl80211_dfs_regions region)
 {
        return NULL;
 }
index 7df728f363301d0e477ceb7277cb2f32c86db6d8..ba02ef2ab8a6f60b560d48dc57481fb923116a3c 100644 (file)
@@ -680,7 +680,8 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
        sc->sc_ah = ah;
        pCap = &ah->caps;
 
-       sc->dfs_detector = dfs_pattern_detector_init(ah, NL80211_DFS_UNSET);
+       common = ath9k_hw_common(ah);
+       sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET);
 
        if (!pdata) {
                ah->ah_flags |= AH_USE_EEPROM;
@@ -694,7 +695,6 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
                ah->external_reset = pdata->external_reset;
        }
 
-       common = ath9k_hw_common(ah);
        common->ops = &ah->reg_ops;
        common->bus_ops = bus_ops;
        common->ah = ah;