aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2011-07-21 13:36:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-22 09:51:15 -0400
commitc5f3f45c4934d7e7dc266092debe88628d2cbb5d (patch)
treeed1989172868b2e86f34064abcca1887b998bb9f /drivers/net/wireless/ath/ath5k
parentfabba0480637add5411b1dc59603cc71e3505a69 (diff)
ath5k: remove ath5k_hw_get_capability(), don't use VEOL on AR5210
There are only two capabilities we need, and both are trivial to find. ath5k_hw_hasbssidmask() is true on AR5212, but not on AR5210 or AR5211. ath5k_hw_hasveol() is true on AR5211 and AR5212, but not on AR5210, according to the HAL source. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k')
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h32
-rw-r--r--drivers/net/wireless/ath/ath5k/base.h9
-rw-r--r--drivers/net/wireless/ath/ath5k/caps.c45
3 files changed, 5 insertions, 81 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index c6fb44cea0bf..277d5cbe0068 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -972,35 +972,6 @@ enum ath5k_power_mode {
972#define AR5K_SOFTLED_ON 0 972#define AR5K_SOFTLED_ON 0
973#define AR5K_SOFTLED_OFF 1 973#define AR5K_SOFTLED_OFF 1
974 974
975/*
976 * Chipset capabilities -see ath5k_hw_get_capability-
977 * get_capability function is not yet fully implemented
978 * in ath5k so most of these don't work yet...
979 * TODO: Implement these & merge with _TUNE_ stuff above
980 */
981enum ath5k_capability_type {
982 AR5K_CAP_REG_DMN = 0, /* Used to get current reg. domain id */
983 AR5K_CAP_TKIP_MIC = 2, /* Can handle TKIP MIC in hardware */
984 AR5K_CAP_TKIP_SPLIT = 3, /* TKIP uses split keys */
985 AR5K_CAP_PHYCOUNTERS = 4, /* PHY error counters */
986 AR5K_CAP_DIVERSITY = 5, /* Supports fast diversity */
987 AR5K_CAP_NUM_TXQUEUES = 6, /* Used to get max number of hw txqueues */
988 AR5K_CAP_VEOL = 7, /* Supports virtual EOL */
989 AR5K_CAP_COMPRESSION = 8, /* Supports compression */
990 AR5K_CAP_BURST = 9, /* Supports packet bursting */
991 AR5K_CAP_FASTFRAME = 10, /* Supports fast frames */
992 AR5K_CAP_TXPOW = 11, /* Used to get global tx power limit */
993 AR5K_CAP_TPC = 12, /* Can do per-packet tx power control (needed for 802.11a) */
994 AR5K_CAP_BSSIDMASK = 13, /* Supports bssid mask */
995 AR5K_CAP_MCAST_KEYSRCH = 14, /* Supports multicast key search */
996 AR5K_CAP_TSF_ADJUST = 15, /* Supports beacon tsf adjust */
997 AR5K_CAP_XR = 16, /* Supports XR mode */
998 AR5K_CAP_WME_TKIPMIC = 17, /* Supports TKIP MIC when using WMM */
999 AR5K_CAP_CHAN_HALFRATE = 18, /* Supports half rate channels */
1000 AR5K_CAP_CHAN_QUARTERRATE = 19, /* Supports quarter rate channels */
1001 AR5K_CAP_RFSILENT = 20, /* Supports RFsilent */
1002};
1003
1004 975
1005/* XXX: we *may* move cap_range stuff to struct wiphy */ 976/* XXX: we *may* move cap_range stuff to struct wiphy */
1006struct ath5k_capabilities { 977struct ath5k_capabilities {
@@ -1506,9 +1477,6 @@ void ath5k_rfkill_hw_stop(struct ath5k_hw *ah);
1506 1477
1507/* Misc functions TODO: Cleanup */ 1478/* Misc functions TODO: Cleanup */
1508int ath5k_hw_set_capabilities(struct ath5k_hw *ah); 1479int ath5k_hw_set_capabilities(struct ath5k_hw *ah);
1509int ath5k_hw_get_capability(struct ath5k_hw *ah,
1510 enum ath5k_capability_type cap_type, u32 capability,
1511 u32 *result);
1512int ath5k_hw_enable_pspoll(struct ath5k_hw *ah, u8 *bssid, u16 assoc_id); 1480int ath5k_hw_enable_pspoll(struct ath5k_hw *ah, u8 *bssid, u16 assoc_id);
1513int ath5k_hw_disable_pspoll(struct ath5k_hw *ah); 1481int ath5k_hw_disable_pspoll(struct ath5k_hw *ah);
1514 1482
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index aa8aafca906c..a81f28d5bddc 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -81,9 +81,10 @@ struct ath5k_vif_iter_data {
81void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif); 81void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif);
82 82
83 83
84#define ath5k_hw_hasbssidmask(_ah) \ 84/* Check whether BSSID mask is supported */
85 (ath5k_hw_get_capability(_ah, AR5K_CAP_BSSIDMASK, 0, NULL) == 0) 85#define ath5k_hw_hasbssidmask(_ah) (ah->ah_version == AR5K_AR5212)
86#define ath5k_hw_hasveol(_ah) \ 86
87 (ath5k_hw_get_capability(_ah, AR5K_CAP_VEOL, 0, NULL) == 0) 87/* Check whether virtual EOL is supported */
88#define ath5k_hw_hasveol(_ah) (ah->ah_version != AR5K_AR5210)
88 89
89#endif 90#endif
diff --git a/drivers/net/wireless/ath/ath5k/caps.c b/drivers/net/wireless/ath/ath5k/caps.c
index c752982aec05..eefe670e28a7 100644
--- a/drivers/net/wireless/ath/ath5k/caps.c
+++ b/drivers/net/wireless/ath/ath5k/caps.c
@@ -112,51 +112,6 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
112 return 0; 112 return 0;
113} 113}
114 114
115/* Main function used by the driver part to check caps */
116int ath5k_hw_get_capability(struct ath5k_hw *ah,
117 enum ath5k_capability_type cap_type,
118 u32 capability, u32 *result)
119{
120 switch (cap_type) {
121 case AR5K_CAP_NUM_TXQUEUES:
122 if (result) {
123 if (ah->ah_version == AR5K_AR5210)
124 *result = AR5K_NUM_TX_QUEUES_NOQCU;
125 else
126 *result = AR5K_NUM_TX_QUEUES;
127 goto yes;
128 }
129 case AR5K_CAP_VEOL:
130 goto yes;
131 case AR5K_CAP_COMPRESSION:
132 if (ah->ah_version == AR5K_AR5212)
133 goto yes;
134 else
135 goto no;
136 case AR5K_CAP_BURST:
137 goto yes;
138 case AR5K_CAP_TPC:
139 goto yes;
140 case AR5K_CAP_BSSIDMASK:
141 if (ah->ah_version == AR5K_AR5212)
142 goto yes;
143 else
144 goto no;
145 case AR5K_CAP_XR:
146 if (ah->ah_version == AR5K_AR5212)
147 goto yes;
148 else
149 goto no;
150 default:
151 goto no;
152 }
153
154no:
155 return -EINVAL;
156yes:
157 return 0;
158}
159
160/* 115/*
161 * TODO: Following functions should be part of a new function 116 * TODO: Following functions should be part of a new function
162 * set_capability 117 * set_capability