aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-12-11 18:51:12 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-13 15:23:31 -0500
commit6da5a720bab3866ba23a37841f6a61d96e498a3f (patch)
tree3307786efb42fde60c3fc81da13e59752cf34038 /drivers
parentdf3c8b2b10b47429d2f3fe79d00daa38a3381aad (diff)
ath9k_hw: clean up SREV version checks
There's no need to have separate callbacks for pre-AR9003 vs AR9003 SREV version checks, so just merge those into one function. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_hw.c19
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_hw.c13
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c21
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h2
4 files changed, 13 insertions, 42 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
index 7d5cb204f93..fdb5a835fdc 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
@@ -26,24 +26,6 @@ MODULE_PARM_DESC(nohwcrypt, "Force new ANI for AR5008, AR9001, AR9002");
26 26
27/* General hardware code for the A5008/AR9001/AR9002 hadware families */ 27/* General hardware code for the A5008/AR9001/AR9002 hadware families */
28 28
29static bool ar9002_hw_macversion_supported(u32 macversion)
30{
31 switch (macversion) {
32 case AR_SREV_VERSION_5416_PCI:
33 case AR_SREV_VERSION_5416_PCIE:
34 case AR_SREV_VERSION_9160:
35 case AR_SREV_VERSION_9100:
36 case AR_SREV_VERSION_9280:
37 case AR_SREV_VERSION_9285:
38 case AR_SREV_VERSION_9287:
39 case AR_SREV_VERSION_9271:
40 return true;
41 default:
42 break;
43 }
44 return false;
45}
46
47static void ar9002_hw_init_mode_regs(struct ath_hw *ah) 29static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
48{ 30{
49 if (AR_SREV_9271(ah)) { 31 if (AR_SREV_9271(ah)) {
@@ -565,7 +547,6 @@ void ar9002_hw_attach_ops(struct ath_hw *ah)
565 547
566 priv_ops->init_mode_regs = ar9002_hw_init_mode_regs; 548 priv_ops->init_mode_regs = ar9002_hw_init_mode_regs;
567 priv_ops->init_mode_gain_regs = ar9002_hw_init_mode_gain_regs; 549 priv_ops->init_mode_gain_regs = ar9002_hw_init_mode_gain_regs;
568 priv_ops->macversion_supported = ar9002_hw_macversion_supported;
569 550
570 ops->config_pci_powersave = ar9002_hw_configpcipowersave; 551 ops->config_pci_powersave = ar9002_hw_configpcipowersave;
571 552
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index 21a5bfe354a..6137634e46c 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -21,18 +21,6 @@
21 21
22/* General hardware code for the AR9003 hadware family */ 22/* General hardware code for the AR9003 hadware family */
23 23
24static bool ar9003_hw_macversion_supported(u32 macversion)
25{
26 switch (macversion) {
27 case AR_SREV_VERSION_9300:
28 case AR_SREV_VERSION_9485:
29 return true;
30 default:
31 break;
32 }
33 return false;
34}
35
36/* 24/*
37 * The AR9003 family uses a new INI format (pre, core, post 25 * The AR9003 family uses a new INI format (pre, core, post
38 * arrays per subsystem). This provides support for the 26 * arrays per subsystem). This provides support for the
@@ -322,7 +310,6 @@ void ar9003_hw_attach_ops(struct ath_hw *ah)
322 310
323 priv_ops->init_mode_regs = ar9003_hw_init_mode_regs; 311 priv_ops->init_mode_regs = ar9003_hw_init_mode_regs;
324 priv_ops->init_mode_gain_regs = ar9003_hw_init_mode_gain_regs; 312 priv_ops->init_mode_gain_regs = ar9003_hw_init_mode_gain_regs;
325 priv_ops->macversion_supported = ar9003_hw_macversion_supported;
326 313
327 ops->config_pci_powersave = ar9003_hw_configpcipowersave; 314 ops->config_pci_powersave = ar9003_hw_configpcipowersave;
328 315
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 36e0cab21bb..a4389485e51 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -54,13 +54,6 @@ static void ath9k_hw_init_mode_regs(struct ath_hw *ah)
54 ath9k_hw_private_ops(ah)->init_mode_regs(ah); 54 ath9k_hw_private_ops(ah)->init_mode_regs(ah);
55} 55}
56 56
57static bool ath9k_hw_macversion_supported(struct ath_hw *ah)
58{
59 struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
60
61 return priv_ops->macversion_supported(ah->hw_version.macVersion);
62}
63
64static u32 ath9k_hw_compute_pll_control(struct ath_hw *ah, 57static u32 ath9k_hw_compute_pll_control(struct ath_hw *ah,
65 struct ath9k_channel *chan) 58 struct ath9k_channel *chan)
66{ 59{
@@ -534,7 +527,19 @@ static int __ath9k_hw_init(struct ath_hw *ah)
534 else 527 else
535 ah->config.max_txtrig_level = MAX_TX_FIFO_THRESHOLD; 528 ah->config.max_txtrig_level = MAX_TX_FIFO_THRESHOLD;
536 529
537 if (!ath9k_hw_macversion_supported(ah)) { 530 switch (ah->hw_version.macVersion) {
531 case AR_SREV_VERSION_5416_PCI:
532 case AR_SREV_VERSION_5416_PCIE:
533 case AR_SREV_VERSION_9160:
534 case AR_SREV_VERSION_9100:
535 case AR_SREV_VERSION_9280:
536 case AR_SREV_VERSION_9285:
537 case AR_SREV_VERSION_9287:
538 case AR_SREV_VERSION_9271:
539 case AR_SREV_VERSION_9300:
540 case AR_SREV_VERSION_9485:
541 break;
542 default:
538 ath_err(common, 543 ath_err(common,
539 "Mac Chip Rev 0x%02x.%x is not supported by this driver\n", 544 "Mac Chip Rev 0x%02x.%x is not supported by this driver\n",
540 ah->hw_version.macVersion, ah->hw_version.macRev); 545 ah->hw_version.macVersion, ah->hw_version.macRev);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 910d3c62a6d..e99b39514e8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -532,7 +532,6 @@ struct ath_hw_radar_conf {
532 * 532 *
533 * @init_mode_regs: Initializes mode registers 533 * @init_mode_regs: Initializes mode registers
534 * @init_mode_gain_regs: Initialize TX/RX gain registers 534 * @init_mode_gain_regs: Initialize TX/RX gain registers
535 * @macversion_supported: If this specific mac revision is supported
536 * 535 *
537 * @rf_set_freq: change frequency 536 * @rf_set_freq: change frequency
538 * @spur_mitigate_freq: spur mitigation 537 * @spur_mitigate_freq: spur mitigation
@@ -554,7 +553,6 @@ struct ath_hw_private_ops {
554 553
555 void (*init_mode_regs)(struct ath_hw *ah); 554 void (*init_mode_regs)(struct ath_hw *ah);
556 void (*init_mode_gain_regs)(struct ath_hw *ah); 555 void (*init_mode_gain_regs)(struct ath_hw *ah);
557 bool (*macversion_supported)(u32 macversion);
558 void (*setup_calibration)(struct ath_hw *ah, 556 void (*setup_calibration)(struct ath_hw *ah,
559 struct ath9k_cal_list *currCal); 557 struct ath9k_cal_list *currCal);
560 558