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-3945-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-3945-rs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-rs.c | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index e3a507513e8b..3e812743f6ad 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |||
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | #define RS_NAME "iwl-3945-rs" | 44 | #define RS_NAME "iwl-3945-rs" |
45 | 45 | ||
46 | struct iwl_rate_scale_data { | 46 | struct iwl3945_rate_scale_data { |
47 | u64 data; | 47 | u64 data; |
48 | s32 success_counter; | 48 | s32 success_counter; |
49 | s32 success_ratio; | 49 | s32 success_ratio; |
@@ -52,7 +52,7 @@ struct iwl_rate_scale_data { | |||
52 | unsigned long stamp; | 52 | unsigned long stamp; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | struct iwl_rate_scale_priv { | 55 | struct iwl3945_rate_scale_priv { |
56 | spinlock_t lock; | 56 | spinlock_t lock; |
57 | s32 *expected_tpt; | 57 | s32 *expected_tpt; |
58 | unsigned long last_partial_flush; | 58 | unsigned long last_partial_flush; |
@@ -65,31 +65,31 @@ struct iwl_rate_scale_priv { | |||
65 | u8 start_rate; | 65 | u8 start_rate; |
66 | u8 ibss_sta_added; | 66 | u8 ibss_sta_added; |
67 | struct timer_list rate_scale_flush; | 67 | struct timer_list rate_scale_flush; |
68 | struct iwl_rate_scale_data win[IWL_RATE_COUNT]; | 68 | struct iwl3945_rate_scale_data win[IWL_RATE_COUNT]; |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static s32 iwl_expected_tpt_g[IWL_RATE_COUNT] = { | 71 | static s32 iwl3945_expected_tpt_g[IWL_RATE_COUNT] = { |
72 | 7, 13, 35, 58, 0, 0, 76, 104, 130, 168, 191, 202 | 72 | 7, 13, 35, 58, 0, 0, 76, 104, 130, 168, 191, 202 |
73 | }; | 73 | }; |
74 | 74 | ||
75 | static s32 iwl_expected_tpt_g_prot[IWL_RATE_COUNT] = { | 75 | static s32 iwl3945_expected_tpt_g_prot[IWL_RATE_COUNT] = { |
76 | 7, 13, 35, 58, 0, 0, 0, 80, 93, 113, 123, 125 | 76 | 7, 13, 35, 58, 0, 0, 0, 80, 93, 113, 123, 125 |
77 | }; | 77 | }; |
78 | 78 | ||
79 | static s32 iwl_expected_tpt_a[IWL_RATE_COUNT] = { | 79 | static s32 iwl3945_expected_tpt_a[IWL_RATE_COUNT] = { |
80 | 0, 0, 0, 0, 40, 57, 72, 98, 121, 154, 177, 186 | 80 | 0, 0, 0, 0, 40, 57, 72, 98, 121, 154, 177, 186 |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static s32 iwl_expected_tpt_b[IWL_RATE_COUNT] = { | 83 | static s32 iwl3945_expected_tpt_b[IWL_RATE_COUNT] = { |
84 | 7, 13, 35, 58, 0, 0, 0, 0, 0, 0, 0, 0 | 84 | 7, 13, 35, 58, 0, 0, 0, 0, 0, 0, 0, 0 |
85 | }; | 85 | }; |
86 | 86 | ||
87 | struct iwl_tpt_entry { | 87 | struct iwl3945_tpt_entry { |
88 | s8 min_rssi; | 88 | s8 min_rssi; |
89 | u8 index; | 89 | u8 index; |
90 | }; | 90 | }; |
91 | 91 | ||
92 | static struct iwl_tpt_entry iwl_tpt_table_a[] = { | 92 | static struct iwl3945_tpt_entry iwl3945_tpt_table_a[] = { |
93 | {-60, IWL_RATE_54M_INDEX}, | 93 | {-60, IWL_RATE_54M_INDEX}, |
94 | {-64, IWL_RATE_48M_INDEX}, | 94 | {-64, IWL_RATE_48M_INDEX}, |
95 | {-72, IWL_RATE_36M_INDEX}, | 95 | {-72, IWL_RATE_36M_INDEX}, |
@@ -100,7 +100,7 @@ static struct iwl_tpt_entry iwl_tpt_table_a[] = { | |||
100 | {-89, IWL_RATE_6M_INDEX} | 100 | {-89, IWL_RATE_6M_INDEX} |
101 | }; | 101 | }; |
102 | 102 | ||
103 | static struct iwl_tpt_entry iwl_tpt_table_b[] = { | 103 | static struct iwl3945_tpt_entry iwl3945_tpt_table_b[] = { |
104 | {-86, IWL_RATE_11M_INDEX}, | 104 | {-86, IWL_RATE_11M_INDEX}, |
105 | {-88, IWL_RATE_5M_INDEX}, | 105 | {-88, IWL_RATE_5M_INDEX}, |
106 | {-90, IWL_RATE_2M_INDEX}, | 106 | {-90, IWL_RATE_2M_INDEX}, |
@@ -108,7 +108,7 @@ static struct iwl_tpt_entry iwl_tpt_table_b[] = { | |||
108 | 108 | ||
109 | }; | 109 | }; |
110 | 110 | ||
111 | static struct iwl_tpt_entry iwl_tpt_table_g[] = { | 111 | static struct iwl3945_tpt_entry iwl3945_tpt_table_g[] = { |
112 | {-60, IWL_RATE_54M_INDEX}, | 112 | {-60, IWL_RATE_54M_INDEX}, |
113 | {-64, IWL_RATE_48M_INDEX}, | 113 | {-64, IWL_RATE_48M_INDEX}, |
114 | {-68, IWL_RATE_36M_INDEX}, | 114 | {-68, IWL_RATE_36M_INDEX}, |
@@ -129,30 +129,30 @@ static struct iwl_tpt_entry iwl_tpt_table_g[] = { | |||
129 | #define IWL_RATE_MIN_SUCCESS_TH 8 | 129 | #define IWL_RATE_MIN_SUCCESS_TH 8 |
130 | #define IWL_RATE_DECREASE_TH 1920 | 130 | #define IWL_RATE_DECREASE_TH 1920 |
131 | 131 | ||
132 | static u8 iwl_get_rate_index_by_rssi(s32 rssi, u8 mode) | 132 | static u8 iwl3945_get_rate_index_by_rssi(s32 rssi, u8 mode) |
133 | { | 133 | { |
134 | u32 index = 0; | 134 | u32 index = 0; |
135 | u32 table_size = 0; | 135 | u32 table_size = 0; |
136 | struct iwl_tpt_entry *tpt_table = NULL; | 136 | struct iwl3945_tpt_entry *tpt_table = NULL; |
137 | 137 | ||
138 | if ((rssi < IWL_MIN_RSSI_VAL) || (rssi > IWL_MAX_RSSI_VAL)) | 138 | if ((rssi < IWL_MIN_RSSI_VAL) || (rssi > IWL_MAX_RSSI_VAL)) |
139 | rssi = IWL_MIN_RSSI_VAL; | 139 | rssi = IWL_MIN_RSSI_VAL; |
140 | 140 | ||
141 | switch (mode) { | 141 | switch (mode) { |
142 | case MODE_IEEE80211G: | 142 | case MODE_IEEE80211G: |
143 | tpt_table = iwl_tpt_table_g; | 143 | tpt_table = iwl3945_tpt_table_g; |
144 | table_size = ARRAY_SIZE(iwl_tpt_table_g); | 144 | table_size = ARRAY_SIZE(iwl3945_tpt_table_g); |
145 | break; | 145 | break; |
146 | 146 | ||
147 | case MODE_IEEE80211A: | 147 | case MODE_IEEE80211A: |
148 | tpt_table = iwl_tpt_table_a; | 148 | tpt_table = iwl3945_tpt_table_a; |
149 | table_size = ARRAY_SIZE(iwl_tpt_table_a); | 149 | table_size = ARRAY_SIZE(iwl3945_tpt_table_a); |
150 | break; | 150 | break; |
151 | 151 | ||
152 | default: | 152 | default: |
153 | case MODE_IEEE80211B: | 153 | case MODE_IEEE80211B: |
154 | tpt_table = iwl_tpt_table_b; | 154 | tpt_table = iwl3945_tpt_table_b; |
155 | table_size = ARRAY_SIZE(iwl_tpt_table_b); | 155 | table_size = ARRAY_SIZE(iwl3945_tpt_table_b); |
156 | break; | 156 | break; |
157 | } | 157 | } |
158 | 158 | ||
@@ -164,7 +164,7 @@ static u8 iwl_get_rate_index_by_rssi(s32 rssi, u8 mode) | |||
164 | return tpt_table[index].index; | 164 | return tpt_table[index].index; |
165 | } | 165 | } |
166 | 166 | ||
167 | static void iwl_clear_window(struct iwl_rate_scale_data *window) | 167 | static void iwl3945_clear_window(struct iwl3945_rate_scale_data *window) |
168 | { | 168 | { |
169 | window->data = 0; | 169 | window->data = 0; |
170 | window->success_counter = 0; | 170 | window->success_counter = 0; |
@@ -175,13 +175,13 @@ static void iwl_clear_window(struct iwl_rate_scale_data *window) | |||
175 | } | 175 | } |
176 | 176 | ||
177 | /** | 177 | /** |
178 | * iwl_rate_scale_flush_windows - flush out the rate scale windows | 178 | * iwl3945_rate_scale_flush_windows - flush out the rate scale windows |
179 | * | 179 | * |
180 | * Returns the number of windows that have gathered data but were | 180 | * Returns the number of windows that have gathered data but were |
181 | * not flushed. If there were any that were not flushed, then | 181 | * not flushed. If there were any that were not flushed, then |
182 | * reschedule the rate flushing routine. | 182 | * reschedule the rate flushing routine. |
183 | */ | 183 | */ |
184 | static int iwl_rate_scale_flush_windows(struct iwl_rate_scale_priv *rs_priv) | 184 | static int iwl3945_rate_scale_flush_windows(struct iwl3945_rate_scale_priv *rs_priv) |
185 | { | 185 | { |
186 | int unflushed = 0; | 186 | int unflushed = 0; |
187 | int i; | 187 | int i; |
@@ -202,7 +202,7 @@ static int iwl_rate_scale_flush_windows(struct iwl_rate_scale_priv *rs_priv) | |||
202 | IWL_DEBUG_RATE("flushing %d samples of rate " | 202 | IWL_DEBUG_RATE("flushing %d samples of rate " |
203 | "index %d\n", | 203 | "index %d\n", |
204 | rs_priv->win[i].counter, i); | 204 | rs_priv->win[i].counter, i); |
205 | iwl_clear_window(&rs_priv->win[i]); | 205 | iwl3945_clear_window(&rs_priv->win[i]); |
206 | } else | 206 | } else |
207 | unflushed++; | 207 | unflushed++; |
208 | spin_unlock_irqrestore(&rs_priv->lock, flags); | 208 | spin_unlock_irqrestore(&rs_priv->lock, flags); |
@@ -214,16 +214,16 @@ static int iwl_rate_scale_flush_windows(struct iwl_rate_scale_priv *rs_priv) | |||
214 | #define IWL_RATE_FLUSH_MAX 5000 /* msec */ | 214 | #define IWL_RATE_FLUSH_MAX 5000 /* msec */ |
215 | #define IWL_RATE_FLUSH_MIN 50 /* msec */ | 215 | #define IWL_RATE_FLUSH_MIN 50 /* msec */ |
216 | 216 | ||
217 | static void iwl_bg_rate_scale_flush(unsigned long data) | 217 | static void iwl3945_bg_rate_scale_flush(unsigned long data) |
218 | { | 218 | { |
219 | struct iwl_rate_scale_priv *rs_priv = (void *)data; | 219 | struct iwl3945_rate_scale_priv *rs_priv = (void *)data; |
220 | int unflushed = 0; | 220 | int unflushed = 0; |
221 | unsigned long flags; | 221 | unsigned long flags; |
222 | u32 packet_count, duration, pps; | 222 | u32 packet_count, duration, pps; |
223 | 223 | ||
224 | IWL_DEBUG_RATE("enter\n"); | 224 | IWL_DEBUG_RATE("enter\n"); |
225 | 225 | ||
226 | unflushed = iwl_rate_scale_flush_windows(rs_priv); | 226 | unflushed = iwl3945_rate_scale_flush_windows(rs_priv); |
227 | 227 | ||
228 | spin_lock_irqsave(&rs_priv->lock, flags); | 228 | spin_lock_irqsave(&rs_priv->lock, flags); |
229 | 229 | ||
@@ -277,14 +277,14 @@ static void iwl_bg_rate_scale_flush(unsigned long data) | |||
277 | } | 277 | } |
278 | 278 | ||
279 | /** | 279 | /** |
280 | * iwl_collect_tx_data - Update the success/failure sliding window | 280 | * iwl3945_collect_tx_data - Update the success/failure sliding window |
281 | * | 281 | * |
282 | * We keep a sliding window of the last 64 packets transmitted | 282 | * We keep a sliding window of the last 64 packets transmitted |
283 | * at this rate. window->data contains the bitmask of successful | 283 | * at this rate. window->data contains the bitmask of successful |
284 | * packets. | 284 | * packets. |
285 | */ | 285 | */ |
286 | static void iwl_collect_tx_data(struct iwl_rate_scale_priv *rs_priv, | 286 | static void iwl3945_collect_tx_data(struct iwl3945_rate_scale_priv *rs_priv, |
287 | struct iwl_rate_scale_data *window, | 287 | struct iwl3945_rate_scale_data *window, |
288 | int success, int retries) | 288 | int success, int retries) |
289 | { | 289 | { |
290 | unsigned long flags; | 290 | unsigned long flags; |
@@ -373,12 +373,12 @@ static void rs_clear(void *priv) | |||
373 | 373 | ||
374 | static void *rs_alloc_sta(void *priv, gfp_t gfp) | 374 | static void *rs_alloc_sta(void *priv, gfp_t gfp) |
375 | { | 375 | { |
376 | struct iwl_rate_scale_priv *rs_priv; | 376 | struct iwl3945_rate_scale_priv *rs_priv; |
377 | int i; | 377 | int i; |
378 | 378 | ||
379 | IWL_DEBUG_RATE("enter\n"); | 379 | IWL_DEBUG_RATE("enter\n"); |
380 | 380 | ||
381 | rs_priv = kzalloc(sizeof(struct iwl_rate_scale_priv), gfp); | 381 | rs_priv = kzalloc(sizeof(struct iwl3945_rate_scale_priv), gfp); |
382 | if (!rs_priv) { | 382 | if (!rs_priv) { |
383 | IWL_DEBUG_RATE("leave: ENOMEM\n"); | 383 | IWL_DEBUG_RATE("leave: ENOMEM\n"); |
384 | return NULL; | 384 | return NULL; |
@@ -389,7 +389,7 @@ static void *rs_alloc_sta(void *priv, gfp_t gfp) | |||
389 | rs_priv->start_rate = IWL_RATE_INVALID; | 389 | rs_priv->start_rate = IWL_RATE_INVALID; |
390 | 390 | ||
391 | /* default to just 802.11b */ | 391 | /* default to just 802.11b */ |
392 | rs_priv->expected_tpt = iwl_expected_tpt_b; | 392 | rs_priv->expected_tpt = iwl3945_expected_tpt_b; |
393 | 393 | ||
394 | rs_priv->last_partial_flush = jiffies; | 394 | rs_priv->last_partial_flush = jiffies; |
395 | rs_priv->last_flush = jiffies; | 395 | rs_priv->last_flush = jiffies; |
@@ -399,10 +399,10 @@ static void *rs_alloc_sta(void *priv, gfp_t gfp) | |||
399 | 399 | ||
400 | init_timer(&rs_priv->rate_scale_flush); | 400 | init_timer(&rs_priv->rate_scale_flush); |
401 | rs_priv->rate_scale_flush.data = (unsigned long)rs_priv; | 401 | rs_priv->rate_scale_flush.data = (unsigned long)rs_priv; |
402 | rs_priv->rate_scale_flush.function = &iwl_bg_rate_scale_flush; | 402 | rs_priv->rate_scale_flush.function = &iwl3945_bg_rate_scale_flush; |
403 | 403 | ||
404 | for (i = 0; i < IWL_RATE_COUNT; i++) | 404 | for (i = 0; i < IWL_RATE_COUNT; i++) |
405 | iwl_clear_window(&rs_priv->win[i]); | 405 | iwl3945_clear_window(&rs_priv->win[i]); |
406 | 406 | ||
407 | IWL_DEBUG_RATE("leave\n"); | 407 | IWL_DEBUG_RATE("leave\n"); |
408 | 408 | ||
@@ -411,7 +411,7 @@ static void *rs_alloc_sta(void *priv, gfp_t gfp) | |||
411 | 411 | ||
412 | static void rs_free_sta(void *priv, void *priv_sta) | 412 | static void rs_free_sta(void *priv, void *priv_sta) |
413 | { | 413 | { |
414 | struct iwl_rate_scale_priv *rs_priv = priv_sta; | 414 | struct iwl3945_rate_scale_priv *rs_priv = priv_sta; |
415 | 415 | ||
416 | IWL_DEBUG_RATE("enter\n"); | 416 | IWL_DEBUG_RATE("enter\n"); |
417 | del_timer_sync(&rs_priv->rate_scale_flush); | 417 | del_timer_sync(&rs_priv->rate_scale_flush); |
@@ -425,9 +425,9 @@ static void rs_free_sta(void *priv, void *priv_sta) | |||
425 | * for A and B mode we need to overright prev | 425 | * for A and B mode we need to overright prev |
426 | * value | 426 | * value |
427 | */ | 427 | */ |
428 | static int rs_adjust_next_rate(struct iwl_priv *priv, int rate) | 428 | static int rs_adjust_next_rate(struct iwl3945_priv *priv, int rate) |
429 | { | 429 | { |
430 | int next_rate = iwl_get_prev_ieee_rate(rate); | 430 | int next_rate = iwl3945_get_prev_ieee_rate(rate); |
431 | 431 | ||
432 | switch (priv->phymode) { | 432 | switch (priv->phymode) { |
433 | case MODE_IEEE80211A: | 433 | case MODE_IEEE80211A: |
@@ -449,7 +449,7 @@ static int rs_adjust_next_rate(struct iwl_priv *priv, int rate) | |||
449 | /** | 449 | /** |
450 | * rs_tx_status - Update rate control values based on Tx results | 450 | * rs_tx_status - Update rate control values based on Tx results |
451 | * | 451 | * |
452 | * NOTE: Uses iwl_priv->retry_rate for the # of retries attempted by | 452 | * NOTE: Uses iwl3945_priv->retry_rate for the # of retries attempted by |
453 | * the hardware for each rate. | 453 | * the hardware for each rate. |
454 | */ | 454 | */ |
455 | static void rs_tx_status(void *priv_rate, | 455 | static void rs_tx_status(void *priv_rate, |
@@ -462,9 +462,9 @@ static void rs_tx_status(void *priv_rate, | |||
462 | unsigned long flags; | 462 | unsigned long flags; |
463 | struct sta_info *sta; | 463 | struct sta_info *sta; |
464 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 464 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
465 | struct iwl_priv *priv = (struct iwl_priv *)priv_rate; | 465 | struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_rate; |
466 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 466 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
467 | struct iwl_rate_scale_priv *rs_priv; | 467 | struct iwl3945_rate_scale_priv *rs_priv; |
468 | 468 | ||
469 | IWL_DEBUG_RATE("enter\n"); | 469 | IWL_DEBUG_RATE("enter\n"); |
470 | 470 | ||
@@ -514,7 +514,7 @@ static void rs_tx_status(void *priv_rate, | |||
514 | 514 | ||
515 | /* Update this rate accounting for as many retries | 515 | /* Update this rate accounting for as many retries |
516 | * as was used for it (per current_count) */ | 516 | * as was used for it (per current_count) */ |
517 | iwl_collect_tx_data(rs_priv, | 517 | iwl3945_collect_tx_data(rs_priv, |
518 | &rs_priv->win[scale_rate_index], | 518 | &rs_priv->win[scale_rate_index], |
519 | 0, current_count); | 519 | 0, current_count); |
520 | IWL_DEBUG_RATE("Update rate %d for %d retries.\n", | 520 | IWL_DEBUG_RATE("Update rate %d for %d retries.\n", |
@@ -533,7 +533,7 @@ static void rs_tx_status(void *priv_rate, | |||
533 | last_index, | 533 | last_index, |
534 | (tx_resp->flags & IEEE80211_TX_STATUS_ACK) ? | 534 | (tx_resp->flags & IEEE80211_TX_STATUS_ACK) ? |
535 | "success" : "failure"); | 535 | "success" : "failure"); |
536 | iwl_collect_tx_data(rs_priv, | 536 | iwl3945_collect_tx_data(rs_priv, |
537 | &rs_priv->win[last_index], | 537 | &rs_priv->win[last_index], |
538 | tx_resp->flags & IEEE80211_TX_STATUS_ACK, 1); | 538 | tx_resp->flags & IEEE80211_TX_STATUS_ACK, 1); |
539 | 539 | ||
@@ -560,8 +560,8 @@ static void rs_tx_status(void *priv_rate, | |||
560 | return; | 560 | return; |
561 | } | 561 | } |
562 | 562 | ||
563 | static u16 iwl_get_adjacent_rate(struct iwl_rate_scale_priv *rs_priv, | 563 | static u16 iwl3945_get_adjacent_rate(struct iwl3945_rate_scale_priv *rs_priv, |
564 | u8 index, u16 rate_mask, int phymode) | 564 | u8 index, u16 rate_mask, int phymode) |
565 | { | 565 | { |
566 | u8 high = IWL_RATE_INVALID; | 566 | u8 high = IWL_RATE_INVALID; |
567 | u8 low = IWL_RATE_INVALID; | 567 | u8 low = IWL_RATE_INVALID; |
@@ -596,9 +596,9 @@ static u16 iwl_get_adjacent_rate(struct iwl_rate_scale_priv *rs_priv, | |||
596 | low = index; | 596 | low = index; |
597 | while (low != IWL_RATE_INVALID) { | 597 | while (low != IWL_RATE_INVALID) { |
598 | if (rs_priv->tgg) | 598 | if (rs_priv->tgg) |
599 | low = iwl_rates[low].prev_rs_tgg; | 599 | low = iwl3945_rates[low].prev_rs_tgg; |
600 | else | 600 | else |
601 | low = iwl_rates[low].prev_rs; | 601 | low = iwl3945_rates[low].prev_rs; |
602 | if (low == IWL_RATE_INVALID) | 602 | if (low == IWL_RATE_INVALID) |
603 | break; | 603 | break; |
604 | if (rate_mask & (1 << low)) | 604 | if (rate_mask & (1 << low)) |
@@ -609,9 +609,9 @@ static u16 iwl_get_adjacent_rate(struct iwl_rate_scale_priv *rs_priv, | |||
609 | high = index; | 609 | high = index; |
610 | while (high != IWL_RATE_INVALID) { | 610 | while (high != IWL_RATE_INVALID) { |
611 | if (rs_priv->tgg) | 611 | if (rs_priv->tgg) |
612 | high = iwl_rates[high].next_rs_tgg; | 612 | high = iwl3945_rates[high].next_rs_tgg; |
613 | else | 613 | else |
614 | high = iwl_rates[high].next_rs; | 614 | high = iwl3945_rates[high].next_rs; |
615 | if (high == IWL_RATE_INVALID) | 615 | if (high == IWL_RATE_INVALID) |
616 | break; | 616 | break; |
617 | if (rate_mask & (1 << high)) | 617 | if (rate_mask & (1 << high)) |
@@ -646,8 +646,8 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
646 | u8 high = IWL_RATE_INVALID; | 646 | u8 high = IWL_RATE_INVALID; |
647 | u16 high_low; | 647 | u16 high_low; |
648 | int index; | 648 | int index; |
649 | struct iwl_rate_scale_priv *rs_priv; | 649 | struct iwl3945_rate_scale_priv *rs_priv; |
650 | struct iwl_rate_scale_data *window = NULL; | 650 | struct iwl3945_rate_scale_data *window = NULL; |
651 | int current_tpt = IWL_INVALID_VALUE; | 651 | int current_tpt = IWL_INVALID_VALUE; |
652 | int low_tpt = IWL_INVALID_VALUE; | 652 | int low_tpt = IWL_INVALID_VALUE; |
653 | int high_tpt = IWL_INVALID_VALUE; | 653 | int high_tpt = IWL_INVALID_VALUE; |
@@ -658,7 +658,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
658 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 658 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
659 | struct sta_info *sta; | 659 | struct sta_info *sta; |
660 | u16 rate_mask; | 660 | u16 rate_mask; |
661 | struct iwl_priv *priv = (struct iwl_priv *)priv_rate; | 661 | struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_rate; |
662 | DECLARE_MAC_BUF(mac); | 662 | DECLARE_MAC_BUF(mac); |
663 | 663 | ||
664 | IWL_DEBUG_RATE("enter\n"); | 664 | IWL_DEBUG_RATE("enter\n"); |
@@ -682,12 +682,12 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
682 | 682 | ||
683 | if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && | 683 | if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && |
684 | !rs_priv->ibss_sta_added) { | 684 | !rs_priv->ibss_sta_added) { |
685 | u8 sta_id = iwl_hw_find_station(priv, hdr->addr1); | 685 | u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1); |
686 | 686 | ||
687 | if (sta_id == IWL_INVALID_STATION) { | 687 | if (sta_id == IWL_INVALID_STATION) { |
688 | IWL_DEBUG_RATE("LQ: ADD station %s\n", | 688 | IWL_DEBUG_RATE("LQ: ADD station %s\n", |
689 | print_mac(mac, hdr->addr1)); | 689 | print_mac(mac, hdr->addr1)); |
690 | sta_id = iwl_add_station(priv, | 690 | sta_id = iwl3945_add_station(priv, |
691 | hdr->addr1, 0, CMD_ASYNC); | 691 | hdr->addr1, 0, CMD_ASYNC); |
692 | } | 692 | } |
693 | if (sta_id != IWL_INVALID_STATION) | 693 | if (sta_id != IWL_INVALID_STATION) |
@@ -725,7 +725,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
725 | rs_priv->expected_tpt[index] + 64) / 128); | 725 | rs_priv->expected_tpt[index] + 64) / 128); |
726 | current_tpt = window->average_tpt; | 726 | current_tpt = window->average_tpt; |
727 | 727 | ||
728 | high_low = iwl_get_adjacent_rate(rs_priv, index, rate_mask, | 728 | high_low = iwl3945_get_adjacent_rate(rs_priv, index, rate_mask, |
729 | local->hw.conf.phymode); | 729 | local->hw.conf.phymode); |
730 | low = high_low & 0xff; | 730 | low = high_low & 0xff; |
731 | high = (high_low >> 8) & 0xff; | 731 | high = (high_low >> 8) & 0xff; |
@@ -830,11 +830,11 @@ static struct rate_control_ops rs_ops = { | |||
830 | .free_sta = rs_free_sta, | 830 | .free_sta = rs_free_sta, |
831 | }; | 831 | }; |
832 | 832 | ||
833 | int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | 833 | int iwl3945_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) |
834 | { | 834 | { |
835 | struct ieee80211_local *local = hw_to_local(hw); | 835 | struct ieee80211_local *local = hw_to_local(hw); |
836 | struct iwl_priv *priv = hw->priv; | 836 | struct iwl3945_priv *priv = hw->priv; |
837 | struct iwl_rate_scale_priv *rs_priv; | 837 | struct iwl3945_rate_scale_priv *rs_priv; |
838 | struct sta_info *sta; | 838 | struct sta_info *sta; |
839 | unsigned long flags; | 839 | unsigned long flags; |
840 | int count = 0, i; | 840 | int count = 0, i; |
@@ -860,7 +860,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | |||
860 | int j; | 860 | int j; |
861 | 861 | ||
862 | count += | 862 | count += |
863 | sprintf(&buf[count], " %2dMbs: ", iwl_rates[i].ieee / 2); | 863 | sprintf(&buf[count], " %2dMbs: ", iwl3945_rates[i].ieee / 2); |
864 | 864 | ||
865 | mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1)); | 865 | mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1)); |
866 | for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1) | 866 | for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1) |
@@ -869,7 +869,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | |||
869 | 869 | ||
870 | samples += rs_priv->win[i].counter; | 870 | samples += rs_priv->win[i].counter; |
871 | good += rs_priv->win[i].success_counter; | 871 | good += rs_priv->win[i].success_counter; |
872 | success += rs_priv->win[i].success_counter * iwl_rates[i].ieee; | 872 | success += rs_priv->win[i].success_counter * iwl3945_rates[i].ieee; |
873 | 873 | ||
874 | if (rs_priv->win[i].stamp) { | 874 | if (rs_priv->win[i].stamp) { |
875 | int delta = | 875 | int delta = |
@@ -882,7 +882,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | |||
882 | } else | 882 | } else |
883 | buf[count++] = '\n'; | 883 | buf[count++] = '\n'; |
884 | 884 | ||
885 | j = iwl_get_prev_ieee_rate(i); | 885 | j = iwl3945_get_prev_ieee_rate(i); |
886 | if (j == i) | 886 | if (j == i) |
887 | break; | 887 | break; |
888 | i = j; | 888 | i = j; |
@@ -893,7 +893,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | |||
893 | /* Display the average rate of all samples taken. | 893 | /* Display the average rate of all samples taken. |
894 | * | 894 | * |
895 | * NOTE: We multiple # of samples by 2 since the IEEE measurement | 895 | * NOTE: We multiple # of samples by 2 since the IEEE measurement |
896 | * added from iwl_rates is actually 2X the rate */ | 896 | * added from iwl3945_rates is actually 2X the rate */ |
897 | if (samples) | 897 | if (samples) |
898 | count += sprintf( | 898 | count += sprintf( |
899 | &buf[count], | 899 | &buf[count], |
@@ -907,13 +907,13 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) | |||
907 | return count; | 907 | return count; |
908 | } | 908 | } |
909 | 909 | ||
910 | void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) | 910 | void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) |
911 | { | 911 | { |
912 | struct iwl_priv *priv = hw->priv; | 912 | struct iwl3945_priv *priv = hw->priv; |
913 | s32 rssi = 0; | 913 | s32 rssi = 0; |
914 | unsigned long flags; | 914 | unsigned long flags; |
915 | struct ieee80211_local *local = hw_to_local(hw); | 915 | struct ieee80211_local *local = hw_to_local(hw); |
916 | struct iwl_rate_scale_priv *rs_priv; | 916 | struct iwl3945_rate_scale_priv *rs_priv; |
917 | struct sta_info *sta; | 917 | struct sta_info *sta; |
918 | 918 | ||
919 | IWL_DEBUG_RATE("enter\n"); | 919 | IWL_DEBUG_RATE("enter\n"); |
@@ -942,19 +942,19 @@ void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) | |||
942 | case MODE_IEEE80211G: | 942 | case MODE_IEEE80211G: |
943 | if (priv->active_rxon.flags & RXON_FLG_TGG_PROTECT_MSK) { | 943 | if (priv->active_rxon.flags & RXON_FLG_TGG_PROTECT_MSK) { |
944 | rs_priv->tgg = 1; | 944 | rs_priv->tgg = 1; |
945 | rs_priv->expected_tpt = iwl_expected_tpt_g_prot; | 945 | rs_priv->expected_tpt = iwl3945_expected_tpt_g_prot; |
946 | } else | 946 | } else |
947 | rs_priv->expected_tpt = iwl_expected_tpt_g; | 947 | rs_priv->expected_tpt = iwl3945_expected_tpt_g; |
948 | break; | 948 | break; |
949 | 949 | ||
950 | case MODE_IEEE80211A: | 950 | case MODE_IEEE80211A: |
951 | rs_priv->expected_tpt = iwl_expected_tpt_a; | 951 | rs_priv->expected_tpt = iwl3945_expected_tpt_a; |
952 | break; | 952 | break; |
953 | 953 | ||
954 | default: | 954 | default: |
955 | IWL_WARNING("Invalid phymode. Defaulting to 802.11b\n"); | 955 | IWL_WARNING("Invalid phymode. Defaulting to 802.11b\n"); |
956 | case MODE_IEEE80211B: | 956 | case MODE_IEEE80211B: |
957 | rs_priv->expected_tpt = iwl_expected_tpt_b; | 957 | rs_priv->expected_tpt = iwl3945_expected_tpt_b; |
958 | break; | 958 | break; |
959 | } | 959 | } |
960 | 960 | ||
@@ -967,19 +967,19 @@ void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) | |||
967 | 967 | ||
968 | IWL_DEBUG(IWL_DL_INFO | IWL_DL_RATE, "Network RSSI: %d\n", rssi); | 968 | IWL_DEBUG(IWL_DL_INFO | IWL_DL_RATE, "Network RSSI: %d\n", rssi); |
969 | 969 | ||
970 | rs_priv->start_rate = iwl_get_rate_index_by_rssi(rssi, priv->phymode); | 970 | rs_priv->start_rate = iwl3945_get_rate_index_by_rssi(rssi, priv->phymode); |
971 | 971 | ||
972 | IWL_DEBUG_RATE("leave: rssi %d assign rate index: " | 972 | IWL_DEBUG_RATE("leave: rssi %d assign rate index: " |
973 | "%d (plcp 0x%x)\n", rssi, rs_priv->start_rate, | 973 | "%d (plcp 0x%x)\n", rssi, rs_priv->start_rate, |
974 | iwl_rates[rs_priv->start_rate].plcp); | 974 | iwl3945_rates[rs_priv->start_rate].plcp); |
975 | } | 975 | } |
976 | 976 | ||
977 | void iwl_rate_control_register(struct ieee80211_hw *hw) | 977 | void iwl3945_rate_control_register(struct ieee80211_hw *hw) |
978 | { | 978 | { |
979 | ieee80211_rate_control_register(&rs_ops); | 979 | ieee80211_rate_control_register(&rs_ops); |
980 | } | 980 | } |
981 | 981 | ||
982 | void iwl_rate_control_unregister(struct ieee80211_hw *hw) | 982 | void iwl3945_rate_control_unregister(struct ieee80211_hw *hw) |
983 | { | 983 | { |
984 | ieee80211_rate_control_unregister(&rs_ops); | 984 | ieee80211_rate_control_unregister(&rs_ops); |
985 | } | 985 | } |