ath9k: dfs kill ath9k specyfic code

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>
This commit is contained in:
Janusz Dziedzic 2013-10-14 11:06:03 +02:00 committed by John W. Linville
parent 1dfba3060f
commit 95a5992e43
3 changed files with 13 additions and 12 deletions

View File

@ -19,7 +19,7 @@
#include "dfs_pattern_detector.h" #include "dfs_pattern_detector.h"
#include "dfs_pri_detector.h" #include "dfs_pri_detector.h"
#include "ath9k.h" #include "../ath.h"
/* /*
* tolerated deviation of radar time stamp in usecs on both sides * 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; u32 sz, i;
struct channel_detector *cd; struct channel_detector *cd;
struct ath_common *common = ath9k_hw_common(dpd->ah);
cd = kmalloc(sizeof(*cd), GFP_ATOMIC); cd = kmalloc(sizeof(*cd), GFP_ATOMIC);
if (cd == NULL) if (cd == NULL)
@ -167,7 +166,7 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq)
return cd; return cd;
fail: fail:
ath_dbg(common, DFS, ath_dbg(dpd->common, DFS,
"failed to allocate channel_detector for freq=%d\n", freq); "failed to allocate channel_detector for freq=%d\n", freq);
channel_detector_exit(dpd, cd); channel_detector_exit(dpd, cd);
return NULL; 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_detector *pd = cd->detectors[i];
struct pri_sequence *ps = pd->add_pulse(pd, event); struct pri_sequence *ps = pd->add_pulse(pd, event);
if (ps != NULL) { 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, " "DFS: radar found on freq=%d: id=%d, pri=%d, "
"count=%d, count_false=%d\n", "count=%d, count_false=%d\n",
event->freq, pd->rs->type_id, event->freq, pd->rs->type_id,
@ -288,10 +287,10 @@ static struct dfs_pattern_detector default_dpd = {
}; };
struct dfs_pattern_detector * 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 dfs_pattern_detector *dpd;
struct ath_common *common = ath9k_hw_common(ah);
dpd = kmalloc(sizeof(*dpd), GFP_KERNEL); dpd = kmalloc(sizeof(*dpd), GFP_KERNEL);
if (dpd == NULL) if (dpd == NULL)
@ -300,7 +299,7 @@ dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region)
*dpd = default_dpd; *dpd = default_dpd;
INIT_LIST_HEAD(&dpd->channel_detectors); INIT_LIST_HEAD(&dpd->channel_detectors);
dpd->ah = ah; dpd->common = common;
if (dpd->set_dfs_domain(dpd, region)) if (dpd->set_dfs_domain(dpd, region))
return dpd; return dpd;

View File

@ -81,7 +81,7 @@ struct dfs_pattern_detector {
u8 num_radar_types; u8 num_radar_types;
u64 last_pulse_ts; u64 last_pulse_ts;
/* needed for ath_dbg() */ /* needed for ath_dbg() */
struct ath_hw *ah; struct ath_common *common;
const struct radar_detector_specs *radar_spec; const struct radar_detector_specs *radar_spec;
struct list_head channel_detectors; struct list_head channel_detectors;
@ -94,10 +94,12 @@ struct dfs_pattern_detector {
*/ */
#if defined(CONFIG_ATH9K_DFS_CERTIFIED) #if defined(CONFIG_ATH9K_DFS_CERTIFIED)
extern struct dfs_pattern_detector * 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 #else
static inline struct dfs_pattern_detector * 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; return NULL;
} }

View File

@ -680,7 +680,8 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
sc->sc_ah = ah; sc->sc_ah = ah;
pCap = &ah->caps; 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) { if (!pdata) {
ah->ah_flags |= AH_USE_EEPROM; 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; ah->external_reset = pdata->external_reset;
} }
common = ath9k_hw_common(ah);
common->ops = &ah->reg_ops; common->ops = &ah->reg_ops;
common->bus_ops = bus_ops; common->bus_ops = bus_ops;
common->ah = ah; common->ah = ah;