diff options
author | Janusz Dziedzic <janusz.dziedzic@tieto.com> | 2013-10-14 05:06:03 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-10-18 14:03:54 -0400 |
commit | 95a5992e43046104ca92c6fb93a80d140d1aa7ce (patch) | |
tree | 93b8e4ae338541cde10736c96fa72081fef914e2 /drivers/net/wireless | |
parent | 1dfba3060fe7ee03ccec25a91d35085142dfc295 (diff) |
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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/init.c | 4 |
3 files changed, 13 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c index 491305c81fce..c839a78812d4 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c +++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | #include "dfs_pattern_detector.h" | 20 | #include "dfs_pattern_detector.h" |
21 | #include "dfs_pri_detector.h" | 21 | #include "dfs_pri_detector.h" |
22 | #include "ath9k.h" | 22 | #include "../ath.h" |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * tolerated deviation of radar time stamp in usecs on both sides | 25 | * 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) | |||
143 | { | 143 | { |
144 | u32 sz, i; | 144 | u32 sz, i; |
145 | struct channel_detector *cd; | 145 | struct channel_detector *cd; |
146 | struct ath_common *common = ath9k_hw_common(dpd->ah); | ||
147 | 146 | ||
148 | cd = kmalloc(sizeof(*cd), GFP_ATOMIC); | 147 | cd = kmalloc(sizeof(*cd), GFP_ATOMIC); |
149 | if (cd == NULL) | 148 | if (cd == NULL) |
@@ -167,7 +166,7 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq) | |||
167 | return cd; | 166 | return cd; |
168 | 167 | ||
169 | fail: | 168 | fail: |
170 | ath_dbg(common, DFS, | 169 | ath_dbg(dpd->common, DFS, |
171 | "failed to allocate channel_detector for freq=%d\n", freq); | 170 | "failed to allocate channel_detector for freq=%d\n", freq); |
172 | channel_detector_exit(dpd, cd); | 171 | channel_detector_exit(dpd, cd); |
173 | return NULL; | 172 | return NULL; |
@@ -242,7 +241,7 @@ dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event) | |||
242 | struct pri_detector *pd = cd->detectors[i]; | 241 | struct pri_detector *pd = cd->detectors[i]; |
243 | struct pri_sequence *ps = pd->add_pulse(pd, event); | 242 | struct pri_sequence *ps = pd->add_pulse(pd, event); |
244 | if (ps != NULL) { | 243 | if (ps != NULL) { |
245 | ath_dbg(ath9k_hw_common(dpd->ah), DFS, | 244 | ath_dbg(dpd->common, DFS, |
246 | "DFS: radar found on freq=%d: id=%d, pri=%d, " | 245 | "DFS: radar found on freq=%d: id=%d, pri=%d, " |
247 | "count=%d, count_false=%d\n", | 246 | "count=%d, count_false=%d\n", |
248 | event->freq, pd->rs->type_id, | 247 | event->freq, pd->rs->type_id, |
@@ -288,10 +287,10 @@ static struct dfs_pattern_detector default_dpd = { | |||
288 | }; | 287 | }; |
289 | 288 | ||
290 | struct dfs_pattern_detector * | 289 | struct dfs_pattern_detector * |
291 | dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region) | 290 | dfs_pattern_detector_init(struct ath_common *common, |
291 | enum nl80211_dfs_regions region) | ||
292 | { | 292 | { |
293 | struct dfs_pattern_detector *dpd; | 293 | struct dfs_pattern_detector *dpd; |
294 | struct ath_common *common = ath9k_hw_common(ah); | ||
295 | 294 | ||
296 | dpd = kmalloc(sizeof(*dpd), GFP_KERNEL); | 295 | dpd = kmalloc(sizeof(*dpd), GFP_KERNEL); |
297 | if (dpd == NULL) | 296 | if (dpd == NULL) |
@@ -300,7 +299,7 @@ dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region) | |||
300 | *dpd = default_dpd; | 299 | *dpd = default_dpd; |
301 | INIT_LIST_HEAD(&dpd->channel_detectors); | 300 | INIT_LIST_HEAD(&dpd->channel_detectors); |
302 | 301 | ||
303 | dpd->ah = ah; | 302 | dpd->common = common; |
304 | if (dpd->set_dfs_domain(dpd, region)) | 303 | if (dpd->set_dfs_domain(dpd, region)) |
305 | return dpd; | 304 | return dpd; |
306 | 305 | ||
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h index 90a5abcc4265..b09946fed938 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h +++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h | |||
@@ -81,7 +81,7 @@ struct dfs_pattern_detector { | |||
81 | u8 num_radar_types; | 81 | u8 num_radar_types; |
82 | u64 last_pulse_ts; | 82 | u64 last_pulse_ts; |
83 | /* needed for ath_dbg() */ | 83 | /* needed for ath_dbg() */ |
84 | struct ath_hw *ah; | 84 | struct ath_common *common; |
85 | 85 | ||
86 | const struct radar_detector_specs *radar_spec; | 86 | const struct radar_detector_specs *radar_spec; |
87 | struct list_head channel_detectors; | 87 | struct list_head channel_detectors; |
@@ -94,10 +94,12 @@ struct dfs_pattern_detector { | |||
94 | */ | 94 | */ |
95 | #if defined(CONFIG_ATH9K_DFS_CERTIFIED) | 95 | #if defined(CONFIG_ATH9K_DFS_CERTIFIED) |
96 | extern struct dfs_pattern_detector * | 96 | extern struct dfs_pattern_detector * |
97 | dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region); | 97 | dfs_pattern_detector_init(struct ath_common *common, |
98 | enum nl80211_dfs_regions region); | ||
98 | #else | 99 | #else |
99 | static inline struct dfs_pattern_detector * | 100 | static inline struct dfs_pattern_detector * |
100 | dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region) | 101 | dfs_pattern_detector_init(struct ath_common *common, |
102 | enum nl80211_dfs_regions region) | ||
101 | { | 103 | { |
102 | return NULL; | 104 | return NULL; |
103 | } | 105 | } |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 7df728f36330..ba02ef2ab8a6 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -680,7 +680,8 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, | |||
680 | sc->sc_ah = ah; | 680 | sc->sc_ah = ah; |
681 | pCap = &ah->caps; | 681 | pCap = &ah->caps; |
682 | 682 | ||
683 | sc->dfs_detector = dfs_pattern_detector_init(ah, NL80211_DFS_UNSET); | 683 | common = ath9k_hw_common(ah); |
684 | sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET); | ||
684 | 685 | ||
685 | if (!pdata) { | 686 | if (!pdata) { |
686 | ah->ah_flags |= AH_USE_EEPROM; | 687 | ah->ah_flags |= AH_USE_EEPROM; |
@@ -694,7 +695,6 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, | |||
694 | ah->external_reset = pdata->external_reset; | 695 | ah->external_reset = pdata->external_reset; |
695 | } | 696 | } |
696 | 697 | ||
697 | common = ath9k_hw_common(ah); | ||
698 | common->ops = &ah->reg_ops; | 698 | common->ops = &ah->reg_ops; |
699 | common->bus_ops = bus_ops; | 699 | common->bus_ops = bus_ops; |
700 | common->ah = ah; | 700 | common->ah = ah; |