diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-12-20 04:53:29 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:58:34 -0500 |
commit | 84e3196ff867c623056eea02c11a45e046490d89 (patch) | |
tree | a2f5c1d69a63b22f202713a501762a777e04d19a /drivers/net/wireless/rt2x00/rt2x00lib.h | |
parent | 7d7f19ccb777946df0a8fb7c83189ba2ae08b02e (diff) |
rt2x00: Move link tuning into seperate file
Move link and antenna tuning into a seperate file named rt2x00link.c,
this makes the interface to the link tuner a lot cleaner.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00lib.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00lib.h | 81 |
1 files changed, 77 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h index 86cd26fbf769..fccaffde6f55 100644 --- a/drivers/net/wireless/rt2x00/rt2x00lib.h +++ b/drivers/net/wireless/rt2x00/rt2x00lib.h | |||
@@ -63,7 +63,6 @@ static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value) | |||
63 | int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev); | 63 | int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev); |
64 | void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev); | 64 | void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev); |
65 | void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state); | 65 | void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state); |
66 | void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev); | ||
67 | 66 | ||
68 | /* | 67 | /* |
69 | * Initialization handlers. | 68 | * Initialization handlers. |
@@ -154,6 +153,81 @@ void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev); | |||
154 | int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev); | 153 | int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev); |
155 | void rt2x00queue_free(struct rt2x00_dev *rt2x00dev); | 154 | void rt2x00queue_free(struct rt2x00_dev *rt2x00dev); |
156 | 155 | ||
156 | /** | ||
157 | * rt2x00link_update_stats - Update link statistics from RX frame | ||
158 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | ||
159 | * @skb: Received frame | ||
160 | * @rxdesc: Received frame descriptor | ||
161 | * | ||
162 | * Update link statistics based on the information from the | ||
163 | * received frame descriptor. | ||
164 | */ | ||
165 | void rt2x00link_update_stats(struct rt2x00_dev *rt2x00dev, | ||
166 | struct sk_buff *skb, | ||
167 | struct rxdone_entry_desc *rxdesc); | ||
168 | |||
169 | /** | ||
170 | * rt2x00link_calculate_signal - Calculate signal quality | ||
171 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | ||
172 | * @rssi: RX Frame RSSI | ||
173 | * | ||
174 | * Calculate the signal quality of a frame based on the rssi | ||
175 | * measured during the receiving of the frame and the global | ||
176 | * link quality statistics measured since the start of the | ||
177 | * link tuning. The result is a value between 0 and 100 which | ||
178 | * is an indication of the signal quality. | ||
179 | */ | ||
180 | int rt2x00link_calculate_signal(struct rt2x00_dev *rt2x00dev, int rssi); | ||
181 | |||
182 | /** | ||
183 | * rt2x00link_start_tuner - Start periodic link tuner work | ||
184 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | ||
185 | * | ||
186 | * This start the link tuner periodic work, this work will | ||
187 | * be executed periodically until &rt2x00link_stop_tuner has | ||
188 | * been called. | ||
189 | */ | ||
190 | void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev); | ||
191 | |||
192 | /** | ||
193 | * rt2x00link_stop_tuner - Stop periodic link tuner work | ||
194 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | ||
195 | * | ||
196 | * After this function completed the link tuner will not | ||
197 | * be running until &rt2x00link_start_tuner is called. | ||
198 | */ | ||
199 | void rt2x00link_stop_tuner(struct rt2x00_dev *rt2x00dev); | ||
200 | |||
201 | /** | ||
202 | * rt2x00link_reset_tuner - Reset periodic link tuner work | ||
203 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | ||
204 | * @antenna: Should the antenna tuning also be reset | ||
205 | * | ||
206 | * The VGC limit configured in the hardware will be reset to 0 | ||
207 | * which forces the driver to rediscover the correct value for | ||
208 | * the current association. This is needed when configuration | ||
209 | * options have changed which could drastically change the | ||
210 | * SNR level or link quality (i.e. changing the antenna setting). | ||
211 | * | ||
212 | * Resetting the link tuner will also cause the periodic work counter | ||
213 | * to be reset. Any driver which has a fixed limit on the number | ||
214 | * of rounds the link tuner is supposed to work will accept the | ||
215 | * tuner actions again if this limit was previously reached. | ||
216 | * | ||
217 | * If @antenna is set to true a the software antenna diversity | ||
218 | * tuning will also be reset. | ||
219 | */ | ||
220 | void rt2x00link_reset_tuner(struct rt2x00_dev *rt2x00dev, bool antenna); | ||
221 | |||
222 | /** | ||
223 | * rt2x00link_register - Initialize link tuning functionality | ||
224 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | ||
225 | * | ||
226 | * Initialize work structure and all link tuning related | ||
227 | * paramters. This will not start the link tuning process itself. | ||
228 | */ | ||
229 | void rt2x00link_register(struct rt2x00_dev *rt2x00dev); | ||
230 | |||
157 | /* | 231 | /* |
158 | * Firmware handlers. | 232 | * Firmware handlers. |
159 | */ | 233 | */ |
@@ -179,7 +253,7 @@ void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev); | |||
179 | void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, | 253 | void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, |
180 | enum rt2x00_dump_type type, struct sk_buff *skb); | 254 | enum rt2x00_dump_type type, struct sk_buff *skb); |
181 | void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev, | 255 | void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev, |
182 | enum cipher cipher, enum rx_crypto status); | 256 | struct rxdone_entry_desc *rxdesc); |
183 | #else | 257 | #else |
184 | static inline void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) | 258 | static inline void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) |
185 | { | 259 | { |
@@ -196,8 +270,7 @@ static inline void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, | |||
196 | } | 270 | } |
197 | 271 | ||
198 | static inline void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev, | 272 | static inline void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev, |
199 | enum cipher cipher, | 273 | struct rxdone_entry_desc *rxdesc) |
200 | enum rx_crypto status) | ||
201 | { | 274 | { |
202 | } | 275 | } |
203 | #endif /* CONFIG_RT2X00_LIB_DEBUGFS */ | 276 | #endif /* CONFIG_RT2X00_LIB_DEBUGFS */ |