diff options
author | Christoph Hellwig <hch@lst.de> | 2008-01-27 19:41:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:04:35 -0500 |
commit | bb8c093bdea62f2ae371b98ebff81b0407852faf (patch) | |
tree | 7937a70c333356a85b344f883608eeaf93dd3d2b /drivers/net/wireless/iwlwifi/iwl-4965-rs.c | |
parent | 403ab56b1c2786b0e1d58c27f5ce667b529c7faa (diff) |
iwlwifi: cleanup namespace
Prefix all symbols with iwl3945_ or iwl4965_ and thus allow building
the driver into the kernel. Also remove all the useless default
statements in Kconfig while we're at it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-rs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 300 |
1 files changed, 150 insertions, 150 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c index 2163805158b9..8d3d9f72a8ce 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c | |||
@@ -65,11 +65,11 @@ static u8 rs_ht_to_legacy[] = { | |||
65 | IWL_RATE_48M_INDEX, IWL_RATE_54M_INDEX | 65 | IWL_RATE_48M_INDEX, IWL_RATE_54M_INDEX |
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct iwl_rate { | 68 | struct iwl4965_rate { |
69 | u32 rate_n_flags; | 69 | u32 rate_n_flags; |
70 | } __attribute__ ((packed)); | 70 | } __attribute__ ((packed)); |
71 | 71 | ||
72 | struct iwl_rate_scale_data { | 72 | struct iwl4965_rate_scale_data { |
73 | u64 data; | 73 | u64 data; |
74 | s32 success_counter; | 74 | s32 success_counter; |
75 | s32 success_ratio; | 75 | s32 success_ratio; |
@@ -78,19 +78,19 @@ struct iwl_rate_scale_data { | |||
78 | unsigned long stamp; | 78 | unsigned long stamp; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | struct iwl_scale_tbl_info { | 81 | struct iwl4965_scale_tbl_info { |
82 | enum iwl_table_type lq_type; | 82 | enum iwl4965_table_type lq_type; |
83 | enum iwl_antenna_type antenna_type; | 83 | enum iwl4965_antenna_type antenna_type; |
84 | u8 is_SGI; | 84 | u8 is_SGI; |
85 | u8 is_fat; | 85 | u8 is_fat; |
86 | u8 is_dup; | 86 | u8 is_dup; |
87 | u8 action; | 87 | u8 action; |
88 | s32 *expected_tpt; | 88 | s32 *expected_tpt; |
89 | struct iwl_rate current_rate; | 89 | struct iwl4965_rate current_rate; |
90 | struct iwl_rate_scale_data win[IWL_RATE_COUNT]; | 90 | struct iwl4965_rate_scale_data win[IWL_RATE_COUNT]; |
91 | }; | 91 | }; |
92 | 92 | ||
93 | struct iwl_rate_scale_priv { | 93 | struct iwl4965_rate_scale_priv { |
94 | u8 active_tbl; | 94 | u8 active_tbl; |
95 | u8 enable_counter; | 95 | u8 enable_counter; |
96 | u8 stay_in_tbl; | 96 | u8 stay_in_tbl; |
@@ -115,31 +115,31 @@ struct iwl_rate_scale_priv { | |||
115 | u16 active_siso_rate; | 115 | u16 active_siso_rate; |
116 | u16 active_mimo_rate; | 116 | u16 active_mimo_rate; |
117 | u16 active_rate_basic; | 117 | u16 active_rate_basic; |
118 | struct iwl_link_quality_cmd lq; | 118 | struct iwl4965_link_quality_cmd lq; |
119 | struct iwl_scale_tbl_info lq_info[LQ_SIZE]; | 119 | struct iwl4965_scale_tbl_info lq_info[LQ_SIZE]; |
120 | #ifdef CONFIG_MAC80211_DEBUGFS | 120 | #ifdef CONFIG_MAC80211_DEBUGFS |
121 | struct dentry *rs_sta_dbgfs_scale_table_file; | 121 | struct dentry *rs_sta_dbgfs_scale_table_file; |
122 | struct dentry *rs_sta_dbgfs_stats_table_file; | 122 | struct dentry *rs_sta_dbgfs_stats_table_file; |
123 | struct iwl_rate dbg_fixed; | 123 | struct iwl4965_rate dbg_fixed; |
124 | struct iwl_priv *drv; | 124 | struct iwl4965_priv *drv; |
125 | #endif | 125 | #endif |
126 | }; | 126 | }; |
127 | 127 | ||
128 | static void rs_rate_scale_perform(struct iwl_priv *priv, | 128 | static void rs_rate_scale_perform(struct iwl4965_priv *priv, |
129 | struct net_device *dev, | 129 | struct net_device *dev, |
130 | struct ieee80211_hdr *hdr, | 130 | struct ieee80211_hdr *hdr, |
131 | struct sta_info *sta); | 131 | struct sta_info *sta); |
132 | static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, | 132 | static void rs_fill_link_cmd(struct iwl4965_rate_scale_priv *lq_data, |
133 | struct iwl_rate *tx_mcs, | 133 | struct iwl4965_rate *tx_mcs, |
134 | struct iwl_link_quality_cmd *tbl); | 134 | struct iwl4965_link_quality_cmd *tbl); |
135 | 135 | ||
136 | 136 | ||
137 | #ifdef CONFIG_MAC80211_DEBUGFS | 137 | #ifdef CONFIG_MAC80211_DEBUGFS |
138 | static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv, | 138 | static void rs_dbgfs_set_mcs(struct iwl4965_rate_scale_priv *rs_priv, |
139 | struct iwl_rate *mcs, int index); | 139 | struct iwl4965_rate *mcs, int index); |
140 | #else | 140 | #else |
141 | static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv, | 141 | static void rs_dbgfs_set_mcs(struct iwl4965_rate_scale_priv *rs_priv, |
142 | struct iwl_rate *mcs, int index) | 142 | struct iwl4965_rate *mcs, int index) |
143 | {} | 143 | {} |
144 | #endif | 144 | #endif |
145 | static s32 expected_tpt_A[IWL_RATE_COUNT] = { | 145 | static s32 expected_tpt_A[IWL_RATE_COUNT] = { |
@@ -182,27 +182,27 @@ static s32 expected_tpt_mimo40MHzSGI[IWL_RATE_COUNT] = { | |||
182 | 0, 0, 0, 0, 131, 131, 191, 222, 242, 270, 284, 289, 293 | 182 | 0, 0, 0, 0, 131, 131, 191, 222, 242, 270, 284, 289, 293 |
183 | }; | 183 | }; |
184 | 184 | ||
185 | static int iwl_lq_sync_callback(struct iwl_priv *priv, | 185 | static int iwl4965_lq_sync_callback(struct iwl4965_priv *priv, |
186 | struct iwl_cmd *cmd, struct sk_buff *skb) | 186 | struct iwl4965_cmd *cmd, struct sk_buff *skb) |
187 | { | 187 | { |
188 | /*We didn't cache the SKB; let the caller free it */ | 188 | /*We didn't cache the SKB; let the caller free it */ |
189 | return 1; | 189 | return 1; |
190 | } | 190 | } |
191 | 191 | ||
192 | static inline u8 iwl_rate_get_rate(u32 rate_n_flags) | 192 | static inline u8 iwl4965_rate_get_rate(u32 rate_n_flags) |
193 | { | 193 | { |
194 | return (u8)(rate_n_flags & 0xFF); | 194 | return (u8)(rate_n_flags & 0xFF); |
195 | } | 195 | } |
196 | 196 | ||
197 | static int rs_send_lq_cmd(struct iwl_priv *priv, | 197 | static int rs_send_lq_cmd(struct iwl4965_priv *priv, |
198 | struct iwl_link_quality_cmd *lq, u8 flags) | 198 | struct iwl4965_link_quality_cmd *lq, u8 flags) |
199 | { | 199 | { |
200 | #ifdef CONFIG_IWL4965_DEBUG | 200 | #ifdef CONFIG_IWL4965_DEBUG |
201 | int i; | 201 | int i; |
202 | #endif | 202 | #endif |
203 | struct iwl_host_cmd cmd = { | 203 | struct iwl4965_host_cmd cmd = { |
204 | .id = REPLY_TX_LINK_QUALITY_CMD, | 204 | .id = REPLY_TX_LINK_QUALITY_CMD, |
205 | .len = sizeof(struct iwl_link_quality_cmd), | 205 | .len = sizeof(struct iwl4965_link_quality_cmd), |
206 | .meta.flags = flags, | 206 | .meta.flags = flags, |
207 | .data = lq, | 207 | .data = lq, |
208 | }; | 208 | }; |
@@ -225,16 +225,16 @@ static int rs_send_lq_cmd(struct iwl_priv *priv, | |||
225 | #endif | 225 | #endif |
226 | 226 | ||
227 | if (flags & CMD_ASYNC) | 227 | if (flags & CMD_ASYNC) |
228 | cmd.meta.u.callback = iwl_lq_sync_callback; | 228 | cmd.meta.u.callback = iwl4965_lq_sync_callback; |
229 | 229 | ||
230 | if (iwl_is_associated(priv) && priv->assoc_station_added && | 230 | if (iwl4965_is_associated(priv) && priv->assoc_station_added && |
231 | priv->lq_mngr.lq_ready) | 231 | priv->lq_mngr.lq_ready) |
232 | return iwl_send_cmd(priv, &cmd); | 232 | return iwl4965_send_cmd(priv, &cmd); |
233 | 233 | ||
234 | return 0; | 234 | return 0; |
235 | } | 235 | } |
236 | 236 | ||
237 | static void rs_rate_scale_clear_window(struct iwl_rate_scale_data *window) | 237 | static void rs_rate_scale_clear_window(struct iwl4965_rate_scale_data *window) |
238 | { | 238 | { |
239 | window->data = 0; | 239 | window->data = 0; |
240 | window->success_counter = 0; | 240 | window->success_counter = 0; |
@@ -244,10 +244,10 @@ static void rs_rate_scale_clear_window(struct iwl_rate_scale_data *window) | |||
244 | window->stamp = 0; | 244 | window->stamp = 0; |
245 | } | 245 | } |
246 | 246 | ||
247 | static int rs_collect_tx_data(struct iwl_rate_scale_data *windows, | 247 | static int rs_collect_tx_data(struct iwl4965_rate_scale_data *windows, |
248 | int scale_index, s32 tpt, u32 status) | 248 | int scale_index, s32 tpt, u32 status) |
249 | { | 249 | { |
250 | struct iwl_rate_scale_data *window = NULL; | 250 | struct iwl4965_rate_scale_data *window = NULL; |
251 | u64 mask; | 251 | u64 mask; |
252 | u8 win_size = IWL_RATE_MAX_WINDOW; | 252 | u8 win_size = IWL_RATE_MAX_WINDOW; |
253 | s32 fail_count; | 253 | s32 fail_count; |
@@ -295,24 +295,24 @@ static int rs_collect_tx_data(struct iwl_rate_scale_data *windows, | |||
295 | return 0; | 295 | return 0; |
296 | } | 296 | } |
297 | 297 | ||
298 | static void rs_mcs_from_tbl(struct iwl_rate *mcs_rate, | 298 | static void rs_mcs_from_tbl(struct iwl4965_rate *mcs_rate, |
299 | struct iwl_scale_tbl_info *tbl, | 299 | struct iwl4965_scale_tbl_info *tbl, |
300 | int index, u8 use_green) | 300 | int index, u8 use_green) |
301 | { | 301 | { |
302 | if (is_legacy(tbl->lq_type)) { | 302 | if (is_legacy(tbl->lq_type)) { |
303 | mcs_rate->rate_n_flags = iwl_rates[index].plcp; | 303 | mcs_rate->rate_n_flags = iwl4965_rates[index].plcp; |
304 | if (index >= IWL_FIRST_CCK_RATE && index <= IWL_LAST_CCK_RATE) | 304 | if (index >= IWL_FIRST_CCK_RATE && index <= IWL_LAST_CCK_RATE) |
305 | mcs_rate->rate_n_flags |= RATE_MCS_CCK_MSK; | 305 | mcs_rate->rate_n_flags |= RATE_MCS_CCK_MSK; |
306 | 306 | ||
307 | } else if (is_siso(tbl->lq_type)) { | 307 | } else if (is_siso(tbl->lq_type)) { |
308 | if (index > IWL_LAST_OFDM_RATE) | 308 | if (index > IWL_LAST_OFDM_RATE) |
309 | index = IWL_LAST_OFDM_RATE; | 309 | index = IWL_LAST_OFDM_RATE; |
310 | mcs_rate->rate_n_flags = iwl_rates[index].plcp_siso | | 310 | mcs_rate->rate_n_flags = iwl4965_rates[index].plcp_siso | |
311 | RATE_MCS_HT_MSK; | 311 | RATE_MCS_HT_MSK; |
312 | } else { | 312 | } else { |
313 | if (index > IWL_LAST_OFDM_RATE) | 313 | if (index > IWL_LAST_OFDM_RATE) |
314 | index = IWL_LAST_OFDM_RATE; | 314 | index = IWL_LAST_OFDM_RATE; |
315 | mcs_rate->rate_n_flags = iwl_rates[index].plcp_mimo | | 315 | mcs_rate->rate_n_flags = iwl4965_rates[index].plcp_mimo | |
316 | RATE_MCS_HT_MSK; | 316 | RATE_MCS_HT_MSK; |
317 | } | 317 | } |
318 | 318 | ||
@@ -349,14 +349,14 @@ static void rs_mcs_from_tbl(struct iwl_rate *mcs_rate, | |||
349 | } | 349 | } |
350 | } | 350 | } |
351 | 351 | ||
352 | static int rs_get_tbl_info_from_mcs(const struct iwl_rate *mcs_rate, | 352 | static int rs_get_tbl_info_from_mcs(const struct iwl4965_rate *mcs_rate, |
353 | int phymode, struct iwl_scale_tbl_info *tbl, | 353 | int phymode, struct iwl4965_scale_tbl_info *tbl, |
354 | int *rate_idx) | 354 | int *rate_idx) |
355 | { | 355 | { |
356 | int index; | 356 | int index; |
357 | u32 ant_msk; | 357 | u32 ant_msk; |
358 | 358 | ||
359 | index = iwl_rate_index_from_plcp(mcs_rate->rate_n_flags); | 359 | index = iwl4965_rate_index_from_plcp(mcs_rate->rate_n_flags); |
360 | 360 | ||
361 | if (index == IWL_RATE_INVALID) { | 361 | if (index == IWL_RATE_INVALID) { |
362 | *rate_idx = -1; | 362 | *rate_idx = -1; |
@@ -386,7 +386,7 @@ static int rs_get_tbl_info_from_mcs(const struct iwl_rate *mcs_rate, | |||
386 | } | 386 | } |
387 | *rate_idx = index; | 387 | *rate_idx = index; |
388 | 388 | ||
389 | } else if (iwl_rate_get_rate(mcs_rate->rate_n_flags) | 389 | } else if (iwl4965_rate_get_rate(mcs_rate->rate_n_flags) |
390 | <= IWL_RATE_SISO_60M_PLCP) { | 390 | <= IWL_RATE_SISO_60M_PLCP) { |
391 | tbl->lq_type = LQ_SISO; | 391 | tbl->lq_type = LQ_SISO; |
392 | 392 | ||
@@ -426,8 +426,8 @@ static int rs_get_tbl_info_from_mcs(const struct iwl_rate *mcs_rate, | |||
426 | return 0; | 426 | return 0; |
427 | } | 427 | } |
428 | 428 | ||
429 | static inline void rs_toggle_antenna(struct iwl_rate *new_rate, | 429 | static inline void rs_toggle_antenna(struct iwl4965_rate *new_rate, |
430 | struct iwl_scale_tbl_info *tbl) | 430 | struct iwl4965_scale_tbl_info *tbl) |
431 | { | 431 | { |
432 | if (tbl->antenna_type == ANT_AUX) { | 432 | if (tbl->antenna_type == ANT_AUX) { |
433 | tbl->antenna_type = ANT_MAIN; | 433 | tbl->antenna_type = ANT_MAIN; |
@@ -440,7 +440,7 @@ static inline void rs_toggle_antenna(struct iwl_rate *new_rate, | |||
440 | } | 440 | } |
441 | } | 441 | } |
442 | 442 | ||
443 | static inline u8 rs_use_green(struct iwl_priv *priv) | 443 | static inline u8 rs_use_green(struct iwl4965_priv *priv) |
444 | { | 444 | { |
445 | #ifdef CONFIG_IWL4965_HT | 445 | #ifdef CONFIG_IWL4965_HT |
446 | if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht) | 446 | if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht) |
@@ -459,9 +459,9 @@ static inline u8 rs_use_green(struct iwl_priv *priv) | |||
459 | * basic available rates. | 459 | * basic available rates. |
460 | * | 460 | * |
461 | */ | 461 | */ |
462 | static void rs_get_supported_rates(struct iwl_rate_scale_priv *lq_data, | 462 | static void rs_get_supported_rates(struct iwl4965_rate_scale_priv *lq_data, |
463 | struct ieee80211_hdr *hdr, | 463 | struct ieee80211_hdr *hdr, |
464 | enum iwl_table_type rate_type, | 464 | enum iwl4965_table_type rate_type, |
465 | u16 *data_rate) | 465 | u16 *data_rate) |
466 | { | 466 | { |
467 | if (is_legacy(rate_type)) | 467 | if (is_legacy(rate_type)) |
@@ -512,7 +512,7 @@ static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type) | |||
512 | 512 | ||
513 | low = index; | 513 | low = index; |
514 | while (low != IWL_RATE_INVALID) { | 514 | while (low != IWL_RATE_INVALID) { |
515 | low = iwl_rates[low].prev_rs; | 515 | low = iwl4965_rates[low].prev_rs; |
516 | if (low == IWL_RATE_INVALID) | 516 | if (low == IWL_RATE_INVALID) |
517 | break; | 517 | break; |
518 | if (rate_mask & (1 << low)) | 518 | if (rate_mask & (1 << low)) |
@@ -522,7 +522,7 @@ static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type) | |||
522 | 522 | ||
523 | high = index; | 523 | high = index; |
524 | while (high != IWL_RATE_INVALID) { | 524 | while (high != IWL_RATE_INVALID) { |
525 | high = iwl_rates[high].next_rs; | 525 | high = iwl4965_rates[high].next_rs; |
526 | if (high == IWL_RATE_INVALID) | 526 | if (high == IWL_RATE_INVALID) |
527 | break; | 527 | break; |
528 | if (rate_mask & (1 << high)) | 528 | if (rate_mask & (1 << high)) |
@@ -533,9 +533,9 @@ static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type) | |||
533 | return (high << 8) | low; | 533 | return (high << 8) | low; |
534 | } | 534 | } |
535 | 535 | ||
536 | static void rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data, | 536 | static void rs_get_lower_rate(struct iwl4965_rate_scale_priv *lq_data, |
537 | struct iwl_scale_tbl_info *tbl, u8 scale_index, | 537 | struct iwl4965_scale_tbl_info *tbl, u8 scale_index, |
538 | u8 ht_possible, struct iwl_rate *mcs_rate) | 538 | u8 ht_possible, struct iwl4965_rate *mcs_rate) |
539 | { | 539 | { |
540 | s32 low; | 540 | s32 low; |
541 | u16 rate_mask; | 541 | u16 rate_mask; |
@@ -596,17 +596,17 @@ static void rs_tx_status(void *priv_rate, | |||
596 | int status; | 596 | int status; |
597 | u8 retries; | 597 | u8 retries; |
598 | int rs_index, index = 0; | 598 | int rs_index, index = 0; |
599 | struct iwl_rate_scale_priv *lq; | 599 | struct iwl4965_rate_scale_priv *lq; |
600 | struct iwl_link_quality_cmd *table; | 600 | struct iwl4965_link_quality_cmd *table; |
601 | struct sta_info *sta; | 601 | struct sta_info *sta; |
602 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 602 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
603 | struct iwl_priv *priv = (struct iwl_priv *)priv_rate; | 603 | struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate; |
604 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 604 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
605 | struct iwl_rate_scale_data *window = NULL; | 605 | struct iwl4965_rate_scale_data *window = NULL; |
606 | struct iwl_rate_scale_data *search_win = NULL; | 606 | struct iwl4965_rate_scale_data *search_win = NULL; |
607 | struct iwl_rate tx_mcs; | 607 | struct iwl4965_rate tx_mcs; |
608 | struct iwl_scale_tbl_info tbl_type; | 608 | struct iwl4965_scale_tbl_info tbl_type; |
609 | struct iwl_scale_tbl_info *curr_tbl, *search_tbl; | 609 | struct iwl4965_scale_tbl_info *curr_tbl, *search_tbl; |
610 | u8 active_index = 0; | 610 | u8 active_index = 0; |
611 | u16 fc = le16_to_cpu(hdr->frame_control); | 611 | u16 fc = le16_to_cpu(hdr->frame_control); |
612 | s32 tpt = 0; | 612 | s32 tpt = 0; |
@@ -630,7 +630,7 @@ static void rs_tx_status(void *priv_rate, | |||
630 | return; | 630 | return; |
631 | } | 631 | } |
632 | 632 | ||
633 | lq = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv; | 633 | lq = (struct iwl4965_rate_scale_priv *)sta->rate_ctrl_priv; |
634 | 634 | ||
635 | if (!priv->lq_mngr.lq_ready) | 635 | if (!priv->lq_mngr.lq_ready) |
636 | return; | 636 | return; |
@@ -648,9 +648,9 @@ static void rs_tx_status(void *priv_rate, | |||
648 | lq->antenna = lq->valid_antenna; | 648 | lq->antenna = lq->valid_antenna; |
649 | curr_tbl = &(lq->lq_info[active_index]); | 649 | curr_tbl = &(lq->lq_info[active_index]); |
650 | search_tbl = &(lq->lq_info[(1 - active_index)]); | 650 | search_tbl = &(lq->lq_info[(1 - active_index)]); |
651 | window = (struct iwl_rate_scale_data *) | 651 | window = (struct iwl4965_rate_scale_data *) |
652 | &(curr_tbl->win[0]); | 652 | &(curr_tbl->win[0]); |
653 | search_win = (struct iwl_rate_scale_data *) | 653 | search_win = (struct iwl4965_rate_scale_data *) |
654 | &(search_tbl->win[0]); | 654 | &(search_tbl->win[0]); |
655 | 655 | ||
656 | tx_mcs.rate_n_flags = tx_resp->control.tx_rate; | 656 | tx_mcs.rate_n_flags = tx_resp->control.tx_rate; |
@@ -751,7 +751,7 @@ static void rs_tx_status(void *priv_rate, | |||
751 | } | 751 | } |
752 | 752 | ||
753 | static u8 rs_is_ant_connected(u8 valid_antenna, | 753 | static u8 rs_is_ant_connected(u8 valid_antenna, |
754 | enum iwl_antenna_type antenna_type) | 754 | enum iwl4965_antenna_type antenna_type) |
755 | { | 755 | { |
756 | if (antenna_type == ANT_AUX) | 756 | if (antenna_type == ANT_AUX) |
757 | return ((valid_antenna & 0x2) ? 1:0); | 757 | return ((valid_antenna & 0x2) ? 1:0); |
@@ -764,7 +764,7 @@ static u8 rs_is_ant_connected(u8 valid_antenna, | |||
764 | } | 764 | } |
765 | 765 | ||
766 | static u8 rs_is_other_ant_connected(u8 valid_antenna, | 766 | static u8 rs_is_other_ant_connected(u8 valid_antenna, |
767 | enum iwl_antenna_type antenna_type) | 767 | enum iwl4965_antenna_type antenna_type) |
768 | { | 768 | { |
769 | if (antenna_type == ANT_AUX) | 769 | if (antenna_type == ANT_AUX) |
770 | return rs_is_ant_connected(valid_antenna, ANT_MAIN); | 770 | return rs_is_ant_connected(valid_antenna, ANT_MAIN); |
@@ -775,7 +775,7 @@ static u8 rs_is_other_ant_connected(u8 valid_antenna, | |||
775 | } | 775 | } |
776 | 776 | ||
777 | static void rs_set_stay_in_table(u8 is_legacy, | 777 | static void rs_set_stay_in_table(u8 is_legacy, |
778 | struct iwl_rate_scale_priv *lq_data) | 778 | struct iwl4965_rate_scale_priv *lq_data) |
779 | { | 779 | { |
780 | IWL_DEBUG_HT("we are staying in the same table\n"); | 780 | IWL_DEBUG_HT("we are staying in the same table\n"); |
781 | lq_data->stay_in_tbl = 1; | 781 | lq_data->stay_in_tbl = 1; |
@@ -793,8 +793,8 @@ static void rs_set_stay_in_table(u8 is_legacy, | |||
793 | lq_data->total_success = 0; | 793 | lq_data->total_success = 0; |
794 | } | 794 | } |
795 | 795 | ||
796 | static void rs_get_expected_tpt_table(struct iwl_rate_scale_priv *lq_data, | 796 | static void rs_get_expected_tpt_table(struct iwl4965_rate_scale_priv *lq_data, |
797 | struct iwl_scale_tbl_info *tbl) | 797 | struct iwl4965_scale_tbl_info *tbl) |
798 | { | 798 | { |
799 | if (is_legacy(tbl->lq_type)) { | 799 | if (is_legacy(tbl->lq_type)) { |
800 | if (!is_a_band(tbl->lq_type)) | 800 | if (!is_a_band(tbl->lq_type)) |
@@ -827,12 +827,12 @@ static void rs_get_expected_tpt_table(struct iwl_rate_scale_priv *lq_data, | |||
827 | } | 827 | } |
828 | 828 | ||
829 | #ifdef CONFIG_IWL4965_HT | 829 | #ifdef CONFIG_IWL4965_HT |
830 | static s32 rs_get_best_rate(struct iwl_priv *priv, | 830 | static s32 rs_get_best_rate(struct iwl4965_priv *priv, |
831 | struct iwl_rate_scale_priv *lq_data, | 831 | struct iwl4965_rate_scale_priv *lq_data, |
832 | struct iwl_scale_tbl_info *tbl, | 832 | struct iwl4965_scale_tbl_info *tbl, |
833 | u16 rate_mask, s8 index, s8 rate) | 833 | u16 rate_mask, s8 index, s8 rate) |
834 | { | 834 | { |
835 | struct iwl_scale_tbl_info *active_tbl = | 835 | struct iwl4965_scale_tbl_info *active_tbl = |
836 | &(lq_data->lq_info[lq_data->active_tbl]); | 836 | &(lq_data->lq_info[lq_data->active_tbl]); |
837 | s32 new_rate, high, low, start_hi; | 837 | s32 new_rate, high, low, start_hi; |
838 | s32 active_sr = active_tbl->win[index].success_ratio; | 838 | s32 active_sr = active_tbl->win[index].success_ratio; |
@@ -886,9 +886,9 @@ static inline u8 rs_is_both_ant_supp(u8 valid_antenna) | |||
886 | return (rs_is_ant_connected(valid_antenna, ANT_BOTH)); | 886 | return (rs_is_ant_connected(valid_antenna, ANT_BOTH)); |
887 | } | 887 | } |
888 | 888 | ||
889 | static int rs_switch_to_mimo(struct iwl_priv *priv, | 889 | static int rs_switch_to_mimo(struct iwl4965_priv *priv, |
890 | struct iwl_rate_scale_priv *lq_data, | 890 | struct iwl4965_rate_scale_priv *lq_data, |
891 | struct iwl_scale_tbl_info *tbl, int index) | 891 | struct iwl4965_scale_tbl_info *tbl, int index) |
892 | { | 892 | { |
893 | #ifdef CONFIG_IWL4965_HT | 893 | #ifdef CONFIG_IWL4965_HT |
894 | u16 rate_mask; | 894 | u16 rate_mask; |
@@ -943,9 +943,9 @@ static int rs_switch_to_mimo(struct iwl_priv *priv, | |||
943 | #endif /*CONFIG_IWL4965_HT */ | 943 | #endif /*CONFIG_IWL4965_HT */ |
944 | } | 944 | } |
945 | 945 | ||
946 | static int rs_switch_to_siso(struct iwl_priv *priv, | 946 | static int rs_switch_to_siso(struct iwl4965_priv *priv, |
947 | struct iwl_rate_scale_priv *lq_data, | 947 | struct iwl4965_rate_scale_priv *lq_data, |
948 | struct iwl_scale_tbl_info *tbl, int index) | 948 | struct iwl4965_scale_tbl_info *tbl, int index) |
949 | { | 949 | { |
950 | #ifdef CONFIG_IWL4965_HT | 950 | #ifdef CONFIG_IWL4965_HT |
951 | u16 rate_mask; | 951 | u16 rate_mask; |
@@ -999,18 +999,18 @@ static int rs_switch_to_siso(struct iwl_priv *priv, | |||
999 | #endif /*CONFIG_IWL4965_HT */ | 999 | #endif /*CONFIG_IWL4965_HT */ |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | static int rs_move_legacy_other(struct iwl_priv *priv, | 1002 | static int rs_move_legacy_other(struct iwl4965_priv *priv, |
1003 | struct iwl_rate_scale_priv *lq_data, | 1003 | struct iwl4965_rate_scale_priv *lq_data, |
1004 | int index) | 1004 | int index) |
1005 | { | 1005 | { |
1006 | int ret = 0; | 1006 | int ret = 0; |
1007 | struct iwl_scale_tbl_info *tbl = | 1007 | struct iwl4965_scale_tbl_info *tbl = |
1008 | &(lq_data->lq_info[lq_data->active_tbl]); | 1008 | &(lq_data->lq_info[lq_data->active_tbl]); |
1009 | struct iwl_scale_tbl_info *search_tbl = | 1009 | struct iwl4965_scale_tbl_info *search_tbl = |
1010 | &(lq_data->lq_info[(1 - lq_data->active_tbl)]); | 1010 | &(lq_data->lq_info[(1 - lq_data->active_tbl)]); |
1011 | struct iwl_rate_scale_data *window = &(tbl->win[index]); | 1011 | struct iwl4965_rate_scale_data *window = &(tbl->win[index]); |
1012 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1012 | u32 sz = (sizeof(struct iwl4965_scale_tbl_info) - |
1013 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1013 | (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT)); |
1014 | u8 start_action = tbl->action; | 1014 | u8 start_action = tbl->action; |
1015 | 1015 | ||
1016 | for (; ;) { | 1016 | for (; ;) { |
@@ -1083,19 +1083,19 @@ static int rs_move_legacy_other(struct iwl_priv *priv, | |||
1083 | 1083 | ||
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | static int rs_move_siso_to_other(struct iwl_priv *priv, | 1086 | static int rs_move_siso_to_other(struct iwl4965_priv *priv, |
1087 | struct iwl_rate_scale_priv *lq_data, | 1087 | struct iwl4965_rate_scale_priv *lq_data, |
1088 | int index) | 1088 | int index) |
1089 | { | 1089 | { |
1090 | int ret; | 1090 | int ret; |
1091 | u8 is_green = lq_data->is_green; | 1091 | u8 is_green = lq_data->is_green; |
1092 | struct iwl_scale_tbl_info *tbl = | 1092 | struct iwl4965_scale_tbl_info *tbl = |
1093 | &(lq_data->lq_info[lq_data->active_tbl]); | 1093 | &(lq_data->lq_info[lq_data->active_tbl]); |
1094 | struct iwl_scale_tbl_info *search_tbl = | 1094 | struct iwl4965_scale_tbl_info *search_tbl = |
1095 | &(lq_data->lq_info[(1 - lq_data->active_tbl)]); | 1095 | &(lq_data->lq_info[(1 - lq_data->active_tbl)]); |
1096 | struct iwl_rate_scale_data *window = &(tbl->win[index]); | 1096 | struct iwl4965_rate_scale_data *window = &(tbl->win[index]); |
1097 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1097 | u32 sz = (sizeof(struct iwl4965_scale_tbl_info) - |
1098 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1098 | (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT)); |
1099 | u8 start_action = tbl->action; | 1099 | u8 start_action = tbl->action; |
1100 | 1100 | ||
1101 | for (;;) { | 1101 | for (;;) { |
@@ -1173,18 +1173,18 @@ static int rs_move_siso_to_other(struct iwl_priv *priv, | |||
1173 | return 0; | 1173 | return 0; |
1174 | } | 1174 | } |
1175 | 1175 | ||
1176 | static int rs_move_mimo_to_other(struct iwl_priv *priv, | 1176 | static int rs_move_mimo_to_other(struct iwl4965_priv *priv, |
1177 | struct iwl_rate_scale_priv *lq_data, | 1177 | struct iwl4965_rate_scale_priv *lq_data, |
1178 | int index) | 1178 | int index) |
1179 | { | 1179 | { |
1180 | int ret; | 1180 | int ret; |
1181 | s8 is_green = lq_data->is_green; | 1181 | s8 is_green = lq_data->is_green; |
1182 | struct iwl_scale_tbl_info *tbl = | 1182 | struct iwl4965_scale_tbl_info *tbl = |
1183 | &(lq_data->lq_info[lq_data->active_tbl]); | 1183 | &(lq_data->lq_info[lq_data->active_tbl]); |
1184 | struct iwl_scale_tbl_info *search_tbl = | 1184 | struct iwl4965_scale_tbl_info *search_tbl = |
1185 | &(lq_data->lq_info[(1 - lq_data->active_tbl)]); | 1185 | &(lq_data->lq_info[(1 - lq_data->active_tbl)]); |
1186 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1186 | u32 sz = (sizeof(struct iwl4965_scale_tbl_info) - |
1187 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1187 | (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT)); |
1188 | u8 start_action = tbl->action; | 1188 | u8 start_action = tbl->action; |
1189 | 1189 | ||
1190 | for (;;) { | 1190 | for (;;) { |
@@ -1253,9 +1253,9 @@ static int rs_move_mimo_to_other(struct iwl_priv *priv, | |||
1253 | 1253 | ||
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | static void rs_stay_in_table(struct iwl_rate_scale_priv *lq_data) | 1256 | static void rs_stay_in_table(struct iwl4965_rate_scale_priv *lq_data) |
1257 | { | 1257 | { |
1258 | struct iwl_scale_tbl_info *tbl; | 1258 | struct iwl4965_scale_tbl_info *tbl; |
1259 | int i; | 1259 | int i; |
1260 | int active_tbl; | 1260 | int active_tbl; |
1261 | int flush_interval_passed = 0; | 1261 | int flush_interval_passed = 0; |
@@ -1305,7 +1305,7 @@ static void rs_stay_in_table(struct iwl_rate_scale_priv *lq_data) | |||
1305 | } | 1305 | } |
1306 | } | 1306 | } |
1307 | 1307 | ||
1308 | static void rs_rate_scale_perform(struct iwl_priv *priv, | 1308 | static void rs_rate_scale_perform(struct iwl4965_priv *priv, |
1309 | struct net_device *dev, | 1309 | struct net_device *dev, |
1310 | struct ieee80211_hdr *hdr, | 1310 | struct ieee80211_hdr *hdr, |
1311 | struct sta_info *sta) | 1311 | struct sta_info *sta) |
@@ -1314,7 +1314,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1314 | int high = IWL_RATE_INVALID; | 1314 | int high = IWL_RATE_INVALID; |
1315 | int index; | 1315 | int index; |
1316 | int i; | 1316 | int i; |
1317 | struct iwl_rate_scale_data *window = NULL; | 1317 | struct iwl4965_rate_scale_data *window = NULL; |
1318 | int current_tpt = IWL_INVALID_VALUE; | 1318 | int current_tpt = IWL_INVALID_VALUE; |
1319 | int low_tpt = IWL_INVALID_VALUE; | 1319 | int low_tpt = IWL_INVALID_VALUE; |
1320 | int high_tpt = IWL_INVALID_VALUE; | 1320 | int high_tpt = IWL_INVALID_VALUE; |
@@ -1322,10 +1322,10 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1322 | s8 scale_action = 0; | 1322 | s8 scale_action = 0; |
1323 | u16 fc, rate_mask; | 1323 | u16 fc, rate_mask; |
1324 | u8 update_lq = 0; | 1324 | u8 update_lq = 0; |
1325 | struct iwl_rate_scale_priv *lq_data; | 1325 | struct iwl4965_rate_scale_priv *lq_data; |
1326 | struct iwl_scale_tbl_info *tbl, *tbl1; | 1326 | struct iwl4965_scale_tbl_info *tbl, *tbl1; |
1327 | u16 rate_scale_index_msk = 0; | 1327 | u16 rate_scale_index_msk = 0; |
1328 | struct iwl_rate mcs_rate; | 1328 | struct iwl4965_rate mcs_rate; |
1329 | u8 is_green = 0; | 1329 | u8 is_green = 0; |
1330 | u8 active_tbl = 0; | 1330 | u8 active_tbl = 0; |
1331 | u8 done_search = 0; | 1331 | u8 done_search = 0; |
@@ -1348,7 +1348,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1348 | IWL_DEBUG_RATE("still rate scaling not ready\n"); | 1348 | IWL_DEBUG_RATE("still rate scaling not ready\n"); |
1349 | return; | 1349 | return; |
1350 | } | 1350 | } |
1351 | lq_data = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv; | 1351 | lq_data = (struct iwl4965_rate_scale_priv *)sta->rate_ctrl_priv; |
1352 | 1352 | ||
1353 | if (!lq_data->search_better_tbl) | 1353 | if (!lq_data->search_better_tbl) |
1354 | active_tbl = lq_data->active_tbl; | 1354 | active_tbl = lq_data->active_tbl; |
@@ -1445,7 +1445,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1445 | active_tbl = lq_data->active_tbl; | 1445 | active_tbl = lq_data->active_tbl; |
1446 | tbl = &(lq_data->lq_info[active_tbl]); | 1446 | tbl = &(lq_data->lq_info[active_tbl]); |
1447 | 1447 | ||
1448 | index = iwl_rate_index_from_plcp( | 1448 | index = iwl4965_rate_index_from_plcp( |
1449 | tbl->current_rate.rate_n_flags); | 1449 | tbl->current_rate.rate_n_flags); |
1450 | 1450 | ||
1451 | update_lq = 1; | 1451 | update_lq = 1; |
@@ -1559,7 +1559,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1559 | for (i = 0; i < IWL_RATE_COUNT; i++) | 1559 | for (i = 0; i < IWL_RATE_COUNT; i++) |
1560 | rs_rate_scale_clear_window(&(tbl->win[i])); | 1560 | rs_rate_scale_clear_window(&(tbl->win[i])); |
1561 | 1561 | ||
1562 | index = iwl_rate_index_from_plcp( | 1562 | index = iwl4965_rate_index_from_plcp( |
1563 | tbl->current_rate.rate_n_flags); | 1563 | tbl->current_rate.rate_n_flags); |
1564 | 1564 | ||
1565 | IWL_DEBUG_HT("Switch current mcs: %X index: %d\n", | 1565 | IWL_DEBUG_HT("Switch current mcs: %X index: %d\n", |
@@ -1615,21 +1615,21 @@ out: | |||
1615 | } | 1615 | } |
1616 | 1616 | ||
1617 | 1617 | ||
1618 | static void rs_initialize_lq(struct iwl_priv *priv, | 1618 | static void rs_initialize_lq(struct iwl4965_priv *priv, |
1619 | struct sta_info *sta) | 1619 | struct sta_info *sta) |
1620 | { | 1620 | { |
1621 | int i; | 1621 | int i; |
1622 | struct iwl_rate_scale_priv *lq; | 1622 | struct iwl4965_rate_scale_priv *lq; |
1623 | struct iwl_scale_tbl_info *tbl; | 1623 | struct iwl4965_scale_tbl_info *tbl; |
1624 | u8 active_tbl = 0; | 1624 | u8 active_tbl = 0; |
1625 | int rate_idx; | 1625 | int rate_idx; |
1626 | u8 use_green = rs_use_green(priv); | 1626 | u8 use_green = rs_use_green(priv); |
1627 | struct iwl_rate mcs_rate; | 1627 | struct iwl4965_rate mcs_rate; |
1628 | 1628 | ||
1629 | if (!sta || !sta->rate_ctrl_priv) | 1629 | if (!sta || !sta->rate_ctrl_priv) |
1630 | goto out; | 1630 | goto out; |
1631 | 1631 | ||
1632 | lq = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv; | 1632 | lq = (struct iwl4965_rate_scale_priv *)sta->rate_ctrl_priv; |
1633 | i = sta->last_txrate; | 1633 | i = sta->last_txrate; |
1634 | 1634 | ||
1635 | if ((lq->lq.sta_id == 0xff) && | 1635 | if ((lq->lq.sta_id == 0xff) && |
@@ -1646,7 +1646,7 @@ static void rs_initialize_lq(struct iwl_priv *priv, | |||
1646 | if ((i < 0) || (i >= IWL_RATE_COUNT)) | 1646 | if ((i < 0) || (i >= IWL_RATE_COUNT)) |
1647 | i = 0; | 1647 | i = 0; |
1648 | 1648 | ||
1649 | mcs_rate.rate_n_flags = iwl_rates[i].plcp ; | 1649 | mcs_rate.rate_n_flags = iwl4965_rates[i].plcp ; |
1650 | mcs_rate.rate_n_flags |= RATE_MCS_ANT_B_MSK; | 1650 | mcs_rate.rate_n_flags |= RATE_MCS_ANT_B_MSK; |
1651 | mcs_rate.rate_n_flags &= ~RATE_MCS_ANT_A_MSK; | 1651 | mcs_rate.rate_n_flags &= ~RATE_MCS_ANT_A_MSK; |
1652 | 1652 | ||
@@ -1676,8 +1676,8 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
1676 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 1676 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
1677 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1677 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1678 | struct sta_info *sta; | 1678 | struct sta_info *sta; |
1679 | struct iwl_priv *priv = (struct iwl_priv *)priv_rate; | 1679 | struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate; |
1680 | struct iwl_rate_scale_priv *lq; | 1680 | struct iwl4965_rate_scale_priv *lq; |
1681 | 1681 | ||
1682 | IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n"); | 1682 | IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n"); |
1683 | 1683 | ||
@@ -1690,17 +1690,17 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
1690 | return; | 1690 | return; |
1691 | } | 1691 | } |
1692 | 1692 | ||
1693 | lq = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv; | 1693 | lq = (struct iwl4965_rate_scale_priv *)sta->rate_ctrl_priv; |
1694 | i = sta->last_txrate; | 1694 | i = sta->last_txrate; |
1695 | 1695 | ||
1696 | if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && !lq->ibss_sta_added) { | 1696 | if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && !lq->ibss_sta_added) { |
1697 | u8 sta_id = iwl_hw_find_station(priv, hdr->addr1); | 1697 | u8 sta_id = iwl4965_hw_find_station(priv, hdr->addr1); |
1698 | DECLARE_MAC_BUF(mac); | 1698 | DECLARE_MAC_BUF(mac); |
1699 | 1699 | ||
1700 | if (sta_id == IWL_INVALID_STATION) { | 1700 | if (sta_id == IWL_INVALID_STATION) { |
1701 | IWL_DEBUG_RATE("LQ: ADD station %s\n", | 1701 | IWL_DEBUG_RATE("LQ: ADD station %s\n", |
1702 | print_mac(mac, hdr->addr1)); | 1702 | print_mac(mac, hdr->addr1)); |
1703 | sta_id = iwl_add_station(priv, | 1703 | sta_id = iwl4965_add_station_flags(priv, |
1704 | hdr->addr1, 0, CMD_ASYNC); | 1704 | hdr->addr1, 0, CMD_ASYNC); |
1705 | } | 1705 | } |
1706 | if ((sta_id != IWL_INVALID_STATION)) { | 1706 | if ((sta_id != IWL_INVALID_STATION)) { |
@@ -1725,12 +1725,12 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
1725 | 1725 | ||
1726 | static void *rs_alloc_sta(void *priv, gfp_t gfp) | 1726 | static void *rs_alloc_sta(void *priv, gfp_t gfp) |
1727 | { | 1727 | { |
1728 | struct iwl_rate_scale_priv *crl; | 1728 | struct iwl4965_rate_scale_priv *crl; |
1729 | int i, j; | 1729 | int i, j; |
1730 | 1730 | ||
1731 | IWL_DEBUG_RATE("create station rate scale window\n"); | 1731 | IWL_DEBUG_RATE("create station rate scale window\n"); |
1732 | 1732 | ||
1733 | crl = kzalloc(sizeof(struct iwl_rate_scale_priv), gfp); | 1733 | crl = kzalloc(sizeof(struct iwl4965_rate_scale_priv), gfp); |
1734 | 1734 | ||
1735 | if (crl == NULL) | 1735 | if (crl == NULL) |
1736 | return NULL; | 1736 | return NULL; |
@@ -1750,8 +1750,8 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, | |||
1750 | { | 1750 | { |
1751 | int i, j; | 1751 | int i, j; |
1752 | struct ieee80211_hw_mode *mode = local->oper_hw_mode; | 1752 | struct ieee80211_hw_mode *mode = local->oper_hw_mode; |
1753 | struct iwl_priv *priv = (struct iwl_priv *)priv_rate; | 1753 | struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate; |
1754 | struct iwl_rate_scale_priv *crl = priv_sta; | 1754 | struct iwl4965_rate_scale_priv *crl = priv_sta; |
1755 | 1755 | ||
1756 | crl->flush_timer = 0; | 1756 | crl->flush_timer = 0; |
1757 | crl->supp_rates = sta->supp_rates; | 1757 | crl->supp_rates = sta->supp_rates; |
@@ -1768,7 +1768,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, | |||
1768 | 1768 | ||
1769 | crl->ibss_sta_added = 0; | 1769 | crl->ibss_sta_added = 0; |
1770 | if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { | 1770 | if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { |
1771 | u8 sta_id = iwl_hw_find_station(priv, sta->addr); | 1771 | u8 sta_id = iwl4965_hw_find_station(priv, sta->addr); |
1772 | DECLARE_MAC_BUF(mac); | 1772 | DECLARE_MAC_BUF(mac); |
1773 | 1773 | ||
1774 | /* for IBSS the call are from tasklet */ | 1774 | /* for IBSS the call are from tasklet */ |
@@ -1778,7 +1778,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, | |||
1778 | if (sta_id == IWL_INVALID_STATION) { | 1778 | if (sta_id == IWL_INVALID_STATION) { |
1779 | IWL_DEBUG_RATE("LQ: ADD station %s\n", | 1779 | IWL_DEBUG_RATE("LQ: ADD station %s\n", |
1780 | print_mac(mac, sta->addr)); | 1780 | print_mac(mac, sta->addr)); |
1781 | sta_id = iwl_add_station(priv, | 1781 | sta_id = iwl4965_add_station_flags(priv, |
1782 | sta->addr, 0, CMD_ASYNC); | 1782 | sta->addr, 0, CMD_ASYNC); |
1783 | } | 1783 | } |
1784 | if ((sta_id != IWL_INVALID_STATION)) { | 1784 | if ((sta_id != IWL_INVALID_STATION)) { |
@@ -1832,17 +1832,17 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, | |||
1832 | rs_initialize_lq(priv, sta); | 1832 | rs_initialize_lq(priv, sta); |
1833 | } | 1833 | } |
1834 | 1834 | ||
1835 | static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, | 1835 | static void rs_fill_link_cmd(struct iwl4965_rate_scale_priv *lq_data, |
1836 | struct iwl_rate *tx_mcs, | 1836 | struct iwl4965_rate *tx_mcs, |
1837 | struct iwl_link_quality_cmd *lq_cmd) | 1837 | struct iwl4965_link_quality_cmd *lq_cmd) |
1838 | { | 1838 | { |
1839 | int index = 0; | 1839 | int index = 0; |
1840 | int rate_idx; | 1840 | int rate_idx; |
1841 | int repeat_rate = 0; | 1841 | int repeat_rate = 0; |
1842 | u8 ant_toggle_count = 0; | 1842 | u8 ant_toggle_count = 0; |
1843 | u8 use_ht_possible = 1; | 1843 | u8 use_ht_possible = 1; |
1844 | struct iwl_rate new_rate; | 1844 | struct iwl4965_rate new_rate; |
1845 | struct iwl_scale_tbl_info tbl_type = { 0 }; | 1845 | struct iwl4965_scale_tbl_info tbl_type = { 0 }; |
1846 | 1846 | ||
1847 | rs_dbgfs_set_mcs(lq_data, tx_mcs, index); | 1847 | rs_dbgfs_set_mcs(lq_data, tx_mcs, index); |
1848 | 1848 | ||
@@ -1935,7 +1935,7 @@ static void rs_free(void *priv_rate) | |||
1935 | 1935 | ||
1936 | static void rs_clear(void *priv_rate) | 1936 | static void rs_clear(void *priv_rate) |
1937 | { | 1937 | { |
1938 | struct iwl_priv *priv = (struct iwl_priv *) priv_rate; | 1938 | struct iwl4965_priv *priv = (struct iwl4965_priv *) priv_rate; |
1939 | 1939 | ||
1940 | IWL_DEBUG_RATE("enter\n"); | 1940 | IWL_DEBUG_RATE("enter\n"); |
1941 | 1941 | ||
@@ -1952,7 +1952,7 @@ static void rs_clear(void *priv_rate) | |||
1952 | 1952 | ||
1953 | static void rs_free_sta(void *priv, void *priv_sta) | 1953 | static void rs_free_sta(void *priv, void *priv_sta) |
1954 | { | 1954 | { |
1955 | struct iwl_rate_scale_priv *rs_priv = priv_sta; | 1955 | struct iwl4965_rate_scale_priv *rs_priv = priv_sta; |
1956 | 1956 | ||
1957 | IWL_DEBUG_RATE("enter\n"); | 1957 | IWL_DEBUG_RATE("enter\n"); |
1958 | kfree(rs_priv); | 1958 | kfree(rs_priv); |
@@ -1966,8 +1966,8 @@ static int open_file_generic(struct inode *inode, struct file *file) | |||
1966 | file->private_data = inode->i_private; | 1966 | file->private_data = inode->i_private; |
1967 | return 0; | 1967 | return 0; |
1968 | } | 1968 | } |
1969 | static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv, | 1969 | static void rs_dbgfs_set_mcs(struct iwl4965_rate_scale_priv *rs_priv, |
1970 | struct iwl_rate *mcs, int index) | 1970 | struct iwl4965_rate *mcs, int index) |
1971 | { | 1971 | { |
1972 | u32 base_rate; | 1972 | u32 base_rate; |
1973 | 1973 | ||
@@ -1991,7 +1991,7 @@ static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv, | |||
1991 | static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file, | 1991 | static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file, |
1992 | const char __user *user_buf, size_t count, loff_t *ppos) | 1992 | const char __user *user_buf, size_t count, loff_t *ppos) |
1993 | { | 1993 | { |
1994 | struct iwl_rate_scale_priv *rs_priv = file->private_data; | 1994 | struct iwl4965_rate_scale_priv *rs_priv = file->private_data; |
1995 | char buf[64]; | 1995 | char buf[64]; |
1996 | int buf_size; | 1996 | int buf_size; |
1997 | u32 parsed_rate; | 1997 | u32 parsed_rate; |
@@ -2028,7 +2028,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file, | |||
2028 | int desc = 0; | 2028 | int desc = 0; |
2029 | int i = 0; | 2029 | int i = 0; |
2030 | 2030 | ||
2031 | struct iwl_rate_scale_priv *rs_priv = file->private_data; | 2031 | struct iwl4965_rate_scale_priv *rs_priv = file->private_data; |
2032 | 2032 | ||
2033 | desc += sprintf(buff+desc, "sta_id %d\n", rs_priv->lq.sta_id); | 2033 | desc += sprintf(buff+desc, "sta_id %d\n", rs_priv->lq.sta_id); |
2034 | desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n", | 2034 | desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n", |
@@ -2076,7 +2076,7 @@ static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file, | |||
2076 | int desc = 0; | 2076 | int desc = 0; |
2077 | int i, j; | 2077 | int i, j; |
2078 | 2078 | ||
2079 | struct iwl_rate_scale_priv *rs_priv = file->private_data; | 2079 | struct iwl4965_rate_scale_priv *rs_priv = file->private_data; |
2080 | for (i = 0; i < LQ_SIZE; i++) { | 2080 | for (i = 0; i < LQ_SIZE; i++) { |
2081 | desc += sprintf(buff+desc, "%s type=%d SGI=%d FAT=%d DUP=%d\n" | 2081 | desc += sprintf(buff+desc, "%s type=%d SGI=%d FAT=%d DUP=%d\n" |
2082 | "rate=0x%X\n", | 2082 | "rate=0x%X\n", |
@@ -2105,7 +2105,7 @@ static const struct file_operations rs_sta_dbgfs_stats_table_ops = { | |||
2105 | static void rs_add_debugfs(void *priv, void *priv_sta, | 2105 | static void rs_add_debugfs(void *priv, void *priv_sta, |
2106 | struct dentry *dir) | 2106 | struct dentry *dir) |
2107 | { | 2107 | { |
2108 | struct iwl_rate_scale_priv *rs_priv = priv_sta; | 2108 | struct iwl4965_rate_scale_priv *rs_priv = priv_sta; |
2109 | rs_priv->rs_sta_dbgfs_scale_table_file = | 2109 | rs_priv->rs_sta_dbgfs_scale_table_file = |
2110 | debugfs_create_file("rate_scale_table", 0600, dir, | 2110 | debugfs_create_file("rate_scale_table", 0600, dir, |
2111 | rs_priv, &rs_sta_dbgfs_scale_table_ops); | 2111 | rs_priv, &rs_sta_dbgfs_scale_table_ops); |
@@ -2116,7 +2116,7 @@ static void rs_add_debugfs(void *priv, void *priv_sta, | |||
2116 | 2116 | ||
2117 | static void rs_remove_debugfs(void *priv, void *priv_sta) | 2117 | static void rs_remove_debugfs(void *priv, void *priv_sta) |
2118 | { | 2118 | { |
2119 | struct iwl_rate_scale_priv *rs_priv = priv_sta; | 2119 | struct iwl4965_rate_scale_priv *rs_priv = priv_sta; |
2120 | debugfs_remove(rs_priv->rs_sta_dbgfs_scale_table_file); | 2120 | debugfs_remove(rs_priv->rs_sta_dbgfs_scale_table_file); |
2121 | debugfs_remove(rs_priv->rs_sta_dbgfs_stats_table_file); | 2121 | debugfs_remove(rs_priv->rs_sta_dbgfs_stats_table_file); |
2122 | } | 2122 | } |
@@ -2139,11 +2139,11 @@ static struct rate_control_ops rs_ops = { | |||
2139 | #endif | 2139 | #endif |
2140 | }; | 2140 | }; |
2141 | 2141 | ||
2142 | int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | 2142 | int iwl4965_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) |
2143 | { | 2143 | { |
2144 | struct ieee80211_local *local = hw_to_local(hw); | 2144 | struct ieee80211_local *local = hw_to_local(hw); |
2145 | struct iwl_priv *priv = hw->priv; | 2145 | struct iwl4965_priv *priv = hw->priv; |
2146 | struct iwl_rate_scale_priv *rs_priv; | 2146 | struct iwl4965_rate_scale_priv *rs_priv; |
2147 | struct sta_info *sta; | 2147 | struct sta_info *sta; |
2148 | int count = 0, i; | 2148 | int count = 0, i; |
2149 | u32 samples = 0, success = 0, good = 0; | 2149 | u32 samples = 0, success = 0, good = 0; |
@@ -2176,7 +2176,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | |||
2176 | int active = rs_priv->active_tbl; | 2176 | int active = rs_priv->active_tbl; |
2177 | 2177 | ||
2178 | count += | 2178 | count += |
2179 | sprintf(&buf[count], " %2dMbs: ", iwl_rates[i].ieee / 2); | 2179 | sprintf(&buf[count], " %2dMbs: ", iwl4965_rates[i].ieee / 2); |
2180 | 2180 | ||
2181 | mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1)); | 2181 | mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1)); |
2182 | for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1) | 2182 | for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1) |
@@ -2187,7 +2187,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | |||
2187 | samples += rs_priv->lq_info[active].win[i].counter; | 2187 | samples += rs_priv->lq_info[active].win[i].counter; |
2188 | good += rs_priv->lq_info[active].win[i].success_counter; | 2188 | good += rs_priv->lq_info[active].win[i].success_counter; |
2189 | success += rs_priv->lq_info[active].win[i].success_counter * | 2189 | success += rs_priv->lq_info[active].win[i].success_counter * |
2190 | iwl_rates[i].ieee; | 2190 | iwl4965_rates[i].ieee; |
2191 | 2191 | ||
2192 | if (rs_priv->lq_info[active].win[i].stamp) { | 2192 | if (rs_priv->lq_info[active].win[i].stamp) { |
2193 | int delta = | 2193 | int delta = |
@@ -2201,7 +2201,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | |||
2201 | } else | 2201 | } else |
2202 | buf[count++] = '\n'; | 2202 | buf[count++] = '\n'; |
2203 | 2203 | ||
2204 | j = iwl_get_prev_ieee_rate(i); | 2204 | j = iwl4965_get_prev_ieee_rate(i); |
2205 | if (j == i) | 2205 | if (j == i) |
2206 | break; | 2206 | break; |
2207 | i = j; | 2207 | i = j; |
@@ -2210,7 +2210,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | |||
2210 | /* Display the average rate of all samples taken. | 2210 | /* Display the average rate of all samples taken. |
2211 | * | 2211 | * |
2212 | * NOTE: We multiple # of samples by 2 since the IEEE measurement | 2212 | * NOTE: We multiple # of samples by 2 since the IEEE measurement |
2213 | * added from iwl_rates is actually 2X the rate */ | 2213 | * added from iwl4965_rates is actually 2X the rate */ |
2214 | if (samples) | 2214 | if (samples) |
2215 | count += sprintf(&buf[count], | 2215 | count += sprintf(&buf[count], |
2216 | "\nAverage rate is %3d.%02dMbs over last %4dms\n" | 2216 | "\nAverage rate is %3d.%02dMbs over last %4dms\n" |
@@ -2227,19 +2227,19 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | |||
2227 | return count; | 2227 | return count; |
2228 | } | 2228 | } |
2229 | 2229 | ||
2230 | void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) | 2230 | void iwl4965_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) |
2231 | { | 2231 | { |
2232 | struct iwl_priv *priv = hw->priv; | 2232 | struct iwl4965_priv *priv = hw->priv; |
2233 | 2233 | ||
2234 | priv->lq_mngr.lq_ready = 1; | 2234 | priv->lq_mngr.lq_ready = 1; |
2235 | } | 2235 | } |
2236 | 2236 | ||
2237 | void iwl_rate_control_register(struct ieee80211_hw *hw) | 2237 | void iwl4965_rate_control_register(struct ieee80211_hw *hw) |
2238 | { | 2238 | { |
2239 | ieee80211_rate_control_register(&rs_ops); | 2239 | ieee80211_rate_control_register(&rs_ops); |
2240 | } | 2240 | } |
2241 | 2241 | ||
2242 | void iwl_rate_control_unregister(struct ieee80211_hw *hw) | 2242 | void iwl4965_rate_control_unregister(struct ieee80211_hw *hw) |
2243 | { | 2243 | { |
2244 | ieee80211_rate_control_unregister(&rs_ops); | 2244 | ieee80211_rate_control_unregister(&rs_ops); |
2245 | } | 2245 | } |