aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c13
-rw-r--r--drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h8
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c4
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
169fail: 168fail:
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
290struct dfs_pattern_detector * 289struct dfs_pattern_detector *
291dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region) 290dfs_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)
96extern struct dfs_pattern_detector * 96extern struct dfs_pattern_detector *
97dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region); 97dfs_pattern_detector_init(struct ath_common *common,
98 enum nl80211_dfs_regions region);
98#else 99#else
99static inline struct dfs_pattern_detector * 100static inline struct dfs_pattern_detector *
100dfs_pattern_detector_init(struct ath_hw *ah, enum nl80211_dfs_regions region) 101dfs_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;