aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-10-25 11:19:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-10-27 14:16:18 -0400
commit935477ed7b537cf28b38f0c6b4471915d8c0e12a (patch)
tree91e02a74b1dea7e6e77b84a605b4448b130a5227 /drivers/net
parent6424b036e540c1c360d52b237a71bbfe51584321 (diff)
ath9k_hw: make support for PC-OEM cards optional
The initvals use up quite a bit of space, and PC-OEM support is typically not needed on embedded systems Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/Kconfig5
-rw-r--r--drivers/net/wireless/ath/ath9k/Makefile3
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_rtt.h36
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h17
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/reg.h33
7 files changed, 84 insertions, 19 deletions
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig
index 896e63281b3b..ca101d7cb99f 100644
--- a/drivers/net/wireless/ath/ath9k/Kconfig
+++ b/drivers/net/wireless/ath/ath9k/Kconfig
@@ -148,6 +148,11 @@ config ATH9K_CHANNEL_CONTEXT
148 for multi-channel concurrency. Enable this if P2P PowerSave support 148 for multi-channel concurrency. Enable this if P2P PowerSave support
149 is required. 149 is required.
150 150
151config ATH9K_PCOEM
152 bool "Atheros ath9k support for PC OEM cards" if EXPERT
153 depends on ATH9K
154 default y
155
151config ATH9K_HTC 156config ATH9K_HTC
152 tristate "Atheros HTC based wireless cards support" 157 tristate "Atheros HTC based wireless cards support"
153 depends on USB && MAC80211 158 depends on USB && MAC80211
diff --git a/drivers/net/wireless/ath/ath9k/Makefile b/drivers/net/wireless/ath/ath9k/Makefile
index 73704c1be736..22b934b07bd4 100644
--- a/drivers/net/wireless/ath/ath9k/Makefile
+++ b/drivers/net/wireless/ath/ath9k/Makefile
@@ -32,7 +32,6 @@ ath9k_hw-y:= \
32 ar5008_phy.o \ 32 ar5008_phy.o \
33 ar9002_calib.o \ 33 ar9002_calib.o \
34 ar9003_calib.o \ 34 ar9003_calib.o \
35 ar9003_rtt.o \
36 calib.o \ 35 calib.o \
37 eeprom.o \ 36 eeprom.o \
38 eeprom_def.o \ 37 eeprom_def.o \
@@ -50,6 +49,8 @@ ath9k_hw-$(CONFIG_ATH9K_WOW) += ar9003_wow.o
50ath9k_hw-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \ 49ath9k_hw-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \
51 ar9003_mci.o 50 ar9003_mci.o
52 51
52ath9k_hw-$(CONFIG_ATH9K_PCOEM) += ar9003_rtt.o
53
53ath9k_hw-$(CONFIG_ATH9K_DYNACK) += dynack.o 54ath9k_hw-$(CONFIG_ATH9K_DYNACK) += dynack.o
54 55
55obj-$(CONFIG_ATH9K_HW) += ath9k_hw.o 56obj-$(CONFIG_ATH9K_HW) += ath9k_hw.o
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_rtt.h b/drivers/net/wireless/ath/ath9k/ar9003_rtt.h
index a43b30d723a4..6290467a75a0 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_rtt.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_rtt.h
@@ -17,6 +17,7 @@
17#ifndef AR9003_RTT_H 17#ifndef AR9003_RTT_H
18#define AR9003_RTT_H 18#define AR9003_RTT_H
19 19
20#ifdef CONFIG_ATH9K_PCOEM
20void ar9003_hw_rtt_enable(struct ath_hw *ah); 21void ar9003_hw_rtt_enable(struct ath_hw *ah);
21void ar9003_hw_rtt_disable(struct ath_hw *ah); 22void ar9003_hw_rtt_disable(struct ath_hw *ah);
22void ar9003_hw_rtt_set_mask(struct ath_hw *ah, u32 rtt_mask); 23void ar9003_hw_rtt_set_mask(struct ath_hw *ah, u32 rtt_mask);
@@ -25,5 +26,40 @@ void ar9003_hw_rtt_load_hist(struct ath_hw *ah);
25void ar9003_hw_rtt_fill_hist(struct ath_hw *ah); 26void ar9003_hw_rtt_fill_hist(struct ath_hw *ah);
26void ar9003_hw_rtt_clear_hist(struct ath_hw *ah); 27void ar9003_hw_rtt_clear_hist(struct ath_hw *ah);
27bool ar9003_hw_rtt_restore(struct ath_hw *ah, struct ath9k_channel *chan); 28bool ar9003_hw_rtt_restore(struct ath_hw *ah, struct ath9k_channel *chan);
29#else
30static inline void ar9003_hw_rtt_enable(struct ath_hw *ah)
31{
32}
33
34static inline void ar9003_hw_rtt_disable(struct ath_hw *ah)
35{
36}
37
38static inline void ar9003_hw_rtt_set_mask(struct ath_hw *ah, u32 rtt_mask)
39{
40}
41
42static inline bool ar9003_hw_rtt_force_restore(struct ath_hw *ah)
43{
44 return false;
45}
46
47static inline void ar9003_hw_rtt_load_hist(struct ath_hw *ah)
48{
49}
50
51static inline void ar9003_hw_rtt_fill_hist(struct ath_hw *ah)
52{
53}
54
55static inline void ar9003_hw_rtt_clear_hist(struct ath_hw *ah)
56{
57}
58
59static inline bool ar9003_hw_rtt_restore(struct ath_hw *ah, struct ath9k_channel *chan)
60{
61 return false;
62}
63#endif
28 64
29#endif 65#endif
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 975074fc11bc..7a81f5b864c7 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -244,13 +244,20 @@ enum ath9k_hw_caps {
244 ATH9K_HW_CAP_2GHZ = BIT(11), 244 ATH9K_HW_CAP_2GHZ = BIT(11),
245 ATH9K_HW_CAP_5GHZ = BIT(12), 245 ATH9K_HW_CAP_5GHZ = BIT(12),
246 ATH9K_HW_CAP_APM = BIT(13), 246 ATH9K_HW_CAP_APM = BIT(13),
247#ifdef CONFIG_ATH9K_PCOEM
247 ATH9K_HW_CAP_RTT = BIT(14), 248 ATH9K_HW_CAP_RTT = BIT(14),
248 ATH9K_HW_CAP_MCI = BIT(15), 249 ATH9K_HW_CAP_MCI = BIT(15),
249 ATH9K_HW_CAP_DFS = BIT(16), 250 ATH9K_HW_WOW_DEVICE_CAPABLE = BIT(16),
250 ATH9K_HW_WOW_DEVICE_CAPABLE = BIT(17), 251 ATH9K_HW_CAP_BT_ANT_DIV = BIT(17),
251 ATH9K_HW_CAP_PAPRD = BIT(18), 252#else
252 ATH9K_HW_CAP_FCC_BAND_SWITCH = BIT(19), 253 ATH9K_HW_CAP_RTT = 0,
253 ATH9K_HW_CAP_BT_ANT_DIV = BIT(20), 254 ATH9K_HW_CAP_MCI = 0,
255 ATH9K_HW_WOW_DEVICE_CAPABLE = 0,
256 ATH9K_HW_CAP_BT_ANT_DIV = 0,
257#endif
258 ATH9K_HW_CAP_DFS = BIT(18),
259 ATH9K_HW_CAP_PAPRD = BIT(19),
260 ATH9K_HW_CAP_FCC_BAND_SWITCH = BIT(20),
254}; 261};
255 262
256/* 263/*
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 156a944134dc..57a17601b0b6 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -362,6 +362,9 @@ static void ath9k_init_pcoem_platform(struct ath_softc *sc)
362 struct ath9k_hw_capabilities *pCap = &ah->caps; 362 struct ath9k_hw_capabilities *pCap = &ah->caps;
363 struct ath_common *common = ath9k_hw_common(ah); 363 struct ath_common *common = ath9k_hw_common(ah);
364 364
365 if (!IS_ENABLED(CONFIG_ATH9K_PCOEM))
366 return;
367
365 if (common->bus_ops->ath_bus_type != ATH_PCI) 368 if (common->bus_ops->ath_bus_type != ATH_PCI)
366 return; 369 return;
367 370
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index c018dea0b2e8..e3f60d5c5263 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -30,6 +30,7 @@ static const struct pci_device_id ath_pci_id_table[] = {
30 { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ 30 { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */
31 { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ 31 { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */
32 32
33#ifdef CONFIG_ATH9K_PCOEM
33 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 34 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
34 0x002A, 35 0x002A,
35 PCI_VENDOR_ID_AZWAVE, 36 PCI_VENDOR_ID_AZWAVE,
@@ -82,6 +83,7 @@ static const struct pci_device_id ath_pci_id_table[] = {
82 PCI_VENDOR_ID_AZWAVE, 83 PCI_VENDOR_ID_AZWAVE,
83 0x2C37), 84 0x2C37),
84 .driver_data = ATH9K_PCI_BT_ANT_DIV }, 85 .driver_data = ATH9K_PCI_BT_ANT_DIV },
86#endif
85 87
86 { PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */ 88 { PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */
87 { PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */ 89 { PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */
@@ -102,6 +104,7 @@ static const struct pci_device_id ath_pci_id_table[] = {
102 104
103 { PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E AR9300 */ 105 { PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E AR9300 */
104 106
107#ifdef CONFIG_ATH9K_PCOEM
105 /* PCI-E CUS198 */ 108 /* PCI-E CUS198 */
106 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 109 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
107 0x0032, 110 0x0032,
@@ -294,10 +297,12 @@ static const struct pci_device_id ath_pci_id_table[] = {
294 PCI_VENDOR_ID_ASUSTEK, 297 PCI_VENDOR_ID_ASUSTEK,
295 0x850D), 298 0x850D),
296 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 299 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
300#endif
297 301
298 { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */ 302 { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */
299 { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */ 303 { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */
300 304
305#ifdef CONFIG_ATH9K_PCOEM
301 /* PCI-E CUS217 */ 306 /* PCI-E CUS217 */
302 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 307 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
303 0x0034, 308 0x0034,
@@ -657,6 +662,7 @@ static const struct pci_device_id ath_pci_id_table[] = {
657 /* PCI-E AR9565 (WB335) */ 662 /* PCI-E AR9565 (WB335) */
658 { PCI_VDEVICE(ATHEROS, 0x0036), 663 { PCI_VDEVICE(ATHEROS, 0x0036),
659 .driver_data = ATH9K_PCI_BT_ANT_DIV }, 664 .driver_data = ATH9K_PCI_BT_ANT_DIV },
665#endif
660 666
661 { 0 } 667 { 0 }
662}; 668};
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index 2a938f4feac5..1c0b1c1c5350 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -892,10 +892,21 @@
892 (AR_SREV_9330((_ah)) && \ 892 (AR_SREV_9330((_ah)) && \
893 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_12)) 893 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_12))
894 894
895#ifdef CONFIG_ATH9K_PCOEM
896#define AR_SREV_9462(_ah) \
897 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462))
895#define AR_SREV_9485(_ah) \ 898#define AR_SREV_9485(_ah) \
896 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9485)) 899 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9485))
900#define AR_SREV_9565(_ah) \
901 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565))
902#else
903#define AR_SREV_9462(_ah) 0
904#define AR_SREV_9485(_ah) 0
905#define AR_SREV_9565(_ah) 0
906#endif
907
897#define AR_SREV_9485_11_OR_LATER(_ah) \ 908#define AR_SREV_9485_11_OR_LATER(_ah) \
898 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9485) && \ 909 (AR_SREV_9485(_ah) && \
899 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9485_11)) 910 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9485_11))
900#define AR_SREV_9485_OR_LATER(_ah) \ 911#define AR_SREV_9485_OR_LATER(_ah) \
901 (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9485)) 912 (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9485))
@@ -915,34 +926,30 @@
915 (AR_SREV_9285_12_OR_LATER(_ah) && \ 926 (AR_SREV_9285_12_OR_LATER(_ah) && \
916 ((REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1)) 927 ((REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1))
917 928
918#define AR_SREV_9462(_ah) \
919 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462))
920#define AR_SREV_9462_20(_ah) \ 929#define AR_SREV_9462_20(_ah) \
921 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462) && \ 930 (AR_SREV_9462(_ah) && \
922 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9462_20)) 931 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9462_20))
923#define AR_SREV_9462_21(_ah) \ 932#define AR_SREV_9462_21(_ah) \
924 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462) && \ 933 (AR_SREV_9462(_ah) && \
925 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9462_21)) 934 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9462_21))
926#define AR_SREV_9462_20_OR_LATER(_ah) \ 935#define AR_SREV_9462_20_OR_LATER(_ah) \
927 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462) && \ 936 (AR_SREV_9462(_ah) && \
928 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_20)) 937 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_20))
929#define AR_SREV_9462_21_OR_LATER(_ah) \ 938#define AR_SREV_9462_21_OR_LATER(_ah) \
930 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462) && \ 939 (AR_SREV_9462(_ah) && \
931 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_21)) 940 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_21))
932 941
933#define AR_SREV_9565(_ah) \
934 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565))
935#define AR_SREV_9565_10(_ah) \ 942#define AR_SREV_9565_10(_ah) \
936 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \ 943 (AR_SREV_9565(_ah) && \
937 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_10)) 944 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_10))
938#define AR_SREV_9565_101(_ah) \ 945#define AR_SREV_9565_101(_ah) \
939 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \ 946 (AR_SREV_9565(_ah) && \
940 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_101)) 947 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_101))
941#define AR_SREV_9565_11(_ah) \ 948#define AR_SREV_9565_11(_ah) \
942 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \ 949 (AR_SREV_9565(_ah) && \
943 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_11)) 950 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_11))
944#define AR_SREV_9565_11_OR_LATER(_ah) \ 951#define AR_SREV_9565_11_OR_LATER(_ah) \
945 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \ 952 (AR_SREV_9565(_ah) && \
946 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9565_11)) 953 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9565_11))
947 954
948#define AR_SREV_9550(_ah) \ 955#define AR_SREV_9550(_ah) \