aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksij Rempel <linux@rempel-privat.de>2014-11-06 02:53:28 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-11-11 16:31:14 -0500
commit963916dfe2907d91eb8a250d12d2b5ae5a1bb343 (patch)
tree145801b14f11c47cf30131edf19514c294f728ac
parentef948da55f20edbb68dac427b7e067c805c852f5 (diff)
ath9k: make ath9k_spectral_scan_ do not depend on ath_softc
last preparation before moving ath9k_spectral_scan_ to spectral.c Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/channel.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c26
-rw-r--r--drivers/net/wireless/ath/ath9k/spectral.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/spectral.h4
4 files changed, 22 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index 814178ad36a7..32ce931c2404 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -93,7 +93,7 @@ static int ath_set_channel(struct ath_softc *sc)
93 /* perform spectral scan if requested. */ 93 /* perform spectral scan if requested. */
94 if (test_bit(ATH_OP_SCANNING, &common->op_flags) && 94 if (test_bit(ATH_OP_SCANNING, &common->op_flags) &&
95 sc->spec_priv.spectral_mode == SPECTRAL_CHANSCAN) 95 sc->spec_priv.spectral_mode == SPECTRAL_CHANSCAN)
96 ath9k_spectral_scan_trigger(common); 96 ath9k_spectral_scan_trigger(common, &sc->spec_priv);
97 } 97 }
98 98
99 return 0; 99 return 0;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 567fb5170d1b..54e3e41a591c 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1337,10 +1337,10 @@ static void ath9k_disable_ps(struct ath_softc *sc)
1337 ath_dbg(common, PS, "PowerSave disabled\n"); 1337 ath_dbg(common, PS, "PowerSave disabled\n");
1338} 1338}
1339 1339
1340void ath9k_spectral_scan_trigger(struct ath_common *common) 1340void ath9k_spectral_scan_trigger(struct ath_common *common,
1341 struct ath_spec_scan_priv *spec_priv)
1341{ 1342{
1342 struct ath_softc *sc = common->priv; 1343 struct ath_hw *ah = spec_priv->ah;
1343 struct ath_hw *ah = sc->sc_ah;
1344 u32 rxfilter; 1344 u32 rxfilter;
1345 1345
1346 if (config_enabled(CONFIG_ATH9K_TX99)) 1346 if (config_enabled(CONFIG_ATH9K_TX99))
@@ -1362,16 +1362,16 @@ void ath9k_spectral_scan_trigger(struct ath_common *common)
1362 * configuration, otherwise the register will have its values reset 1362 * configuration, otherwise the register will have its values reset
1363 * (on my ar9220 to value 0x01002310) 1363 * (on my ar9220 to value 0x01002310)
1364 */ 1364 */
1365 ath9k_spectral_scan_config(common, sc->spec_priv.spectral_mode); 1365 ath9k_spectral_scan_config(common, spec_priv, spec_priv->spectral_mode);
1366 ath9k_hw_ops(ah)->spectral_scan_trigger(ah); 1366 ath9k_hw_ops(ah)->spectral_scan_trigger(ah);
1367 ath_ps_ops(common)->restore(common); 1367 ath_ps_ops(common)->restore(common);
1368} 1368}
1369 1369
1370int ath9k_spectral_scan_config(struct ath_common *common, 1370int ath9k_spectral_scan_config(struct ath_common *common,
1371 struct ath_spec_scan_priv *spec_priv,
1371 enum spectral_mode spectral_mode) 1372 enum spectral_mode spectral_mode)
1372{ 1373{
1373 struct ath_softc *sc = common->priv; 1374 struct ath_hw *ah = spec_priv->ah;
1374 struct ath_hw *ah = sc->sc_ah;
1375 1375
1376 if (!ath9k_hw_ops(ah)->spectral_scan_trigger) { 1376 if (!ath9k_hw_ops(ah)->spectral_scan_trigger) {
1377 ath_err(common, "spectrum analyzer not implemented on this hardware\n"); 1377 ath_err(common, "spectrum analyzer not implemented on this hardware\n");
@@ -1380,29 +1380,29 @@ int ath9k_spectral_scan_config(struct ath_common *common,
1380 1380
1381 switch (spectral_mode) { 1381 switch (spectral_mode) {
1382 case SPECTRAL_DISABLED: 1382 case SPECTRAL_DISABLED:
1383 sc->spec_priv.spec_config.enabled = 0; 1383 spec_priv->spec_config.enabled = 0;
1384 break; 1384 break;
1385 case SPECTRAL_BACKGROUND: 1385 case SPECTRAL_BACKGROUND:
1386 /* send endless samples. 1386 /* send endless samples.
1387 * TODO: is this really useful for "background"? 1387 * TODO: is this really useful for "background"?
1388 */ 1388 */
1389 sc->spec_priv.spec_config.endless = 1; 1389 spec_priv->spec_config.endless = 1;
1390 sc->spec_priv.spec_config.enabled = 1; 1390 spec_priv->spec_config.enabled = 1;
1391 break; 1391 break;
1392 case SPECTRAL_CHANSCAN: 1392 case SPECTRAL_CHANSCAN:
1393 case SPECTRAL_MANUAL: 1393 case SPECTRAL_MANUAL:
1394 sc->spec_priv.spec_config.endless = 0; 1394 spec_priv->spec_config.endless = 0;
1395 sc->spec_priv.spec_config.enabled = 1; 1395 spec_priv->spec_config.enabled = 1;
1396 break; 1396 break;
1397 default: 1397 default:
1398 return -1; 1398 return -1;
1399 } 1399 }
1400 1400
1401 ath_ps_ops(common)->wakeup(common); 1401 ath_ps_ops(common)->wakeup(common);
1402 ath9k_hw_ops(ah)->spectral_scan_config(ah, &sc->spec_priv.spec_config); 1402 ath9k_hw_ops(ah)->spectral_scan_config(ah, &spec_priv->spec_config);
1403 ath_ps_ops(common)->restore(common); 1403 ath_ps_ops(common)->restore(common);
1404 1404
1405 sc->spec_priv.spectral_mode = spectral_mode; 1405 spec_priv->spectral_mode = spectral_mode;
1406 1406
1407 return 0; 1407 return 0;
1408} 1408}
diff --git a/drivers/net/wireless/ath/ath9k/spectral.c b/drivers/net/wireless/ath/ath9k/spectral.c
index 4549dce60c16..756d63ea6205 100644
--- a/drivers/net/wireless/ath/ath9k/spectral.c
+++ b/drivers/net/wireless/ath/ath9k/spectral.c
@@ -253,18 +253,18 @@ static ssize_t write_file_spec_scan_ctl(struct file *file,
253 buf[len] = '\0'; 253 buf[len] = '\0';
254 254
255 if (strncmp("trigger", buf, 7) == 0) { 255 if (strncmp("trigger", buf, 7) == 0) {
256 ath9k_spectral_scan_trigger(common); 256 ath9k_spectral_scan_trigger(common, spec_priv);
257 } else if (strncmp("background", buf, 10) == 0) { 257 } else if (strncmp("background", buf, 10) == 0) {
258 ath9k_spectral_scan_config(common, SPECTRAL_BACKGROUND); 258 ath9k_spectral_scan_config(common, spec_priv, SPECTRAL_BACKGROUND);
259 ath_dbg(common, CONFIG, "spectral scan: background mode enabled\n"); 259 ath_dbg(common, CONFIG, "spectral scan: background mode enabled\n");
260 } else if (strncmp("chanscan", buf, 8) == 0) { 260 } else if (strncmp("chanscan", buf, 8) == 0) {
261 ath9k_spectral_scan_config(common, SPECTRAL_CHANSCAN); 261 ath9k_spectral_scan_config(common, spec_priv, SPECTRAL_CHANSCAN);
262 ath_dbg(common, CONFIG, "spectral scan: channel scan mode enabled\n"); 262 ath_dbg(common, CONFIG, "spectral scan: channel scan mode enabled\n");
263 } else if (strncmp("manual", buf, 6) == 0) { 263 } else if (strncmp("manual", buf, 6) == 0) {
264 ath9k_spectral_scan_config(common, SPECTRAL_MANUAL); 264 ath9k_spectral_scan_config(common, spec_priv, SPECTRAL_MANUAL);
265 ath_dbg(common, CONFIG, "spectral scan: manual mode enabled\n"); 265 ath_dbg(common, CONFIG, "spectral scan: manual mode enabled\n");
266 } else if (strncmp("disable", buf, 7) == 0) { 266 } else if (strncmp("disable", buf, 7) == 0) {
267 ath9k_spectral_scan_config(common, SPECTRAL_DISABLED); 267 ath9k_spectral_scan_config(common, spec_priv, SPECTRAL_DISABLED);
268 ath_dbg(common, CONFIG, "spectral scan: disabled\n"); 268 ath_dbg(common, CONFIG, "spectral scan: disabled\n");
269 } else { 269 } else {
270 return -EINVAL; 270 return -EINVAL;
diff --git a/drivers/net/wireless/ath/ath9k/spectral.h b/drivers/net/wireless/ath/ath9k/spectral.h
index 53660e60dd25..77582cf743ac 100644
--- a/drivers/net/wireless/ath/ath9k/spectral.h
+++ b/drivers/net/wireless/ath/ath9k/spectral.h
@@ -133,8 +133,10 @@ static inline u8 spectral_bitmap_weight(u8 *bins)
133void ath9k_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy); 133void ath9k_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy);
134void ath9k_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv); 134void ath9k_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv);
135 135
136void ath9k_spectral_scan_trigger(struct ath_common *common); 136void ath9k_spectral_scan_trigger(struct ath_common *common,
137 struct ath_spec_scan_priv *spec_priv);
137int ath9k_spectral_scan_config(struct ath_common *common, 138int ath9k_spectral_scan_config(struct ath_common *common,
139 struct ath_spec_scan_priv *spec_priv,
138 enum spectral_mode spectral_mode); 140 enum spectral_mode spectral_mode);
139 141
140#ifdef CONFIG_ATH9K_DEBUGFS 142#ifdef CONFIG_ATH9K_DEBUGFS