aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c27
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.h8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c6
5 files changed, 31 insertions, 30 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 8e3660ebba7d..e2123aba202c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -481,7 +481,7 @@ static u32 rate_n_flags_from_tbl(struct iwl4965_scale_tbl_info *tbl,
481 u32 rate_n_flags = 0; 481 u32 rate_n_flags = 0;
482 482
483 if (is_legacy(tbl->lq_type)) { 483 if (is_legacy(tbl->lq_type)) {
484 rate_n_flags = iwl4965_rates[index].plcp; 484 rate_n_flags = iwl_rates[index].plcp;
485 if (index >= IWL_FIRST_CCK_RATE && index <= IWL_LAST_CCK_RATE) 485 if (index >= IWL_FIRST_CCK_RATE && index <= IWL_LAST_CCK_RATE)
486 rate_n_flags |= RATE_MCS_CCK_MSK; 486 rate_n_flags |= RATE_MCS_CCK_MSK;
487 487
@@ -493,11 +493,11 @@ static u32 rate_n_flags_from_tbl(struct iwl4965_scale_tbl_info *tbl,
493 rate_n_flags = RATE_MCS_HT_MSK; 493 rate_n_flags = RATE_MCS_HT_MSK;
494 494
495 if (is_siso(tbl->lq_type)) 495 if (is_siso(tbl->lq_type))
496 rate_n_flags |= iwl4965_rates[index].plcp_siso; 496 rate_n_flags |= iwl_rates[index].plcp_siso;
497 else if (is_mimo2(tbl->lq_type)) 497 else if (is_mimo2(tbl->lq_type))
498 rate_n_flags |= iwl4965_rates[index].plcp_mimo2; 498 rate_n_flags |= iwl_rates[index].plcp_mimo2;
499 else 499 else
500 rate_n_flags |= iwl4965_rates[index].plcp_mimo3; 500 rate_n_flags |= iwl_rates[index].plcp_mimo3;
501 } else { 501 } else {
502 IWL_ERROR("Invalid tbl->lq_type %d\n", tbl->lq_type); 502 IWL_ERROR("Invalid tbl->lq_type %d\n", tbl->lq_type);
503 } 503 }
@@ -697,7 +697,7 @@ static u16 rs_get_adjacent_rate(struct iwl_priv *priv, u8 index, u16 rate_mask,
697 697
698 low = index; 698 low = index;
699 while (low != IWL_RATE_INVALID) { 699 while (low != IWL_RATE_INVALID) {
700 low = iwl4965_rates[low].prev_rs; 700 low = iwl_rates[low].prev_rs;
701 if (low == IWL_RATE_INVALID) 701 if (low == IWL_RATE_INVALID)
702 break; 702 break;
703 if (rate_mask & (1 << low)) 703 if (rate_mask & (1 << low))
@@ -707,7 +707,7 @@ static u16 rs_get_adjacent_rate(struct iwl_priv *priv, u8 index, u16 rate_mask,
707 707
708 high = index; 708 high = index;
709 while (high != IWL_RATE_INVALID) { 709 while (high != IWL_RATE_INVALID) {
710 high = iwl4965_rates[high].next_rs; 710 high = iwl_rates[high].next_rs;
711 if (high == IWL_RATE_INVALID) 711 if (high == IWL_RATE_INVALID)
712 break; 712 break;
713 if (rate_mask & (1 << high)) 713 if (rate_mask & (1 << high))
@@ -2088,7 +2088,7 @@ static void rs_initialize_lq(struct iwl_priv *priv,
2088 i = 0; 2088 i = 0;
2089 2089
2090 /* FIXME:RS: This is also wrong in 4965 */ 2090 /* FIXME:RS: This is also wrong in 4965 */
2091 rate = iwl4965_rates[i].plcp; 2091 rate = iwl_rates[i].plcp;
2092 rate |= RATE_MCS_ANT_B_MSK; 2092 rate |= RATE_MCS_ANT_B_MSK;
2093 rate &= ~RATE_MCS_ANT_A_MSK; 2093 rate &= ~RATE_MCS_ANT_A_MSK;
2094 2094
@@ -2691,7 +2691,7 @@ int iwl4965_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
2691 int active = lq_sta->active_tbl; 2691 int active = lq_sta->active_tbl;
2692 2692
2693 cnt += 2693 cnt +=
2694 sprintf(&buf[cnt], " %2dMbs: ", iwl4965_rates[i].ieee / 2); 2694 sprintf(&buf[cnt], " %2dMbs: ", iwl_rates[i].ieee / 2);
2695 2695
2696 mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1)); 2696 mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1));
2697 for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1) 2697 for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1)
@@ -2702,7 +2702,7 @@ int iwl4965_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
2702 samples += lq_sta->lq_info[active].win[i].counter; 2702 samples += lq_sta->lq_info[active].win[i].counter;
2703 good += lq_sta->lq_info[active].win[i].success_counter; 2703 good += lq_sta->lq_info[active].win[i].success_counter;
2704 success += lq_sta->lq_info[active].win[i].success_counter * 2704 success += lq_sta->lq_info[active].win[i].success_counter *
2705 iwl4965_rates[i].ieee; 2705 iwl_rates[i].ieee;
2706 2706
2707 if (lq_sta->lq_info[active].win[i].stamp) { 2707 if (lq_sta->lq_info[active].win[i].stamp) {
2708 int delta = 2708 int delta =
@@ -2722,10 +2722,11 @@ int iwl4965_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
2722 i = j; 2722 i = j;
2723 } 2723 }
2724 2724
2725 /* Display the average rate of all samples taken. 2725 /*
2726 * 2726 * Display the average rate of all samples taken.
2727 * NOTE: We multiply # of samples by 2 since the IEEE measurement 2727 * NOTE: We multiply # of samples by 2 since the IEEE measurement
2728 * added from iwl4965_rates is actually 2X the rate */ 2728 * added from iwl_rates is actually 2X the rate.
2729 */
2729 if (samples) 2730 if (samples)
2730 cnt += sprintf(&buf[cnt], 2731 cnt += sprintf(&buf[cnt],
2731 "\nAverage rate is %3d.%02dMbs over last %4dms\n" 2732 "\nAverage rate is %3d.%02dMbs over last %4dms\n"
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.h b/drivers/net/wireless/iwlwifi/iwl-4965-rs.h
index 7ea2041a22e0..1dd4124227a5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.h
@@ -29,7 +29,7 @@
29 29
30#include "iwl-dev.h" 30#include "iwl-dev.h"
31 31
32struct iwl4965_rate_info { 32struct iwl_rate_info {
33 u8 plcp; /* uCode API: IWL_RATE_6M_PLCP, etc. */ 33 u8 plcp; /* uCode API: IWL_RATE_6M_PLCP, etc. */
34 u8 plcp_siso; /* uCode API: IWL_RATE_SISO_6M_PLCP, etc. */ 34 u8 plcp_siso; /* uCode API: IWL_RATE_SISO_6M_PLCP, etc. */
35 u8 plcp_mimo2; /* uCode API: IWL_RATE_MIMO2_6M_PLCP, etc. */ 35 u8 plcp_mimo2; /* uCode API: IWL_RATE_MIMO2_6M_PLCP, etc. */
@@ -45,7 +45,7 @@ struct iwl4965_rate_info {
45 45
46/* 46/*
47 * These serve as indexes into 47 * These serve as indexes into
48 * struct iwl4965_rate_info iwl4965_rates[IWL_RATE_COUNT]; 48 * struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
49 */ 49 */
50enum { 50enum {
51 IWL_RATE_1M_INDEX = 0, 51 IWL_RATE_1M_INDEX = 0,
@@ -240,7 +240,7 @@ enum {
240#define TID_MAX_TIME_DIFF ((TID_QUEUE_MAX_SIZE - 1) * TID_QUEUE_CELL_SPACING) 240#define TID_MAX_TIME_DIFF ((TID_QUEUE_MAX_SIZE - 1) * TID_QUEUE_CELL_SPACING)
241#define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y)) 241#define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y))
242 242
243extern const struct iwl4965_rate_info iwl4965_rates[IWL_RATE_COUNT]; 243extern const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
244 244
245enum iwl_table_type { 245enum iwl_table_type {
246 LQ_NONE, 246 LQ_NONE,
@@ -279,7 +279,7 @@ static inline u8 num_of_ant(u8 mask)
279 279
280static inline u8 iwl4965_get_prev_ieee_rate(u8 rate_index) 280static inline u8 iwl4965_get_prev_ieee_rate(u8 rate_index)
281{ 281{
282 u8 rate = iwl4965_rates[rate_index].prev_ieee; 282 u8 rate = iwl_rates[rate_index].prev_ieee;
283 283
284 if (rate == IWL_RATE_INVALID) 284 if (rate == IWL_RATE_INVALID)
285 rate = rate_index; 285 rate = rate_index;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 922b0a195e9a..1ec53a3848de 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -345,8 +345,8 @@ int iwl4965_hwrate_to_plcp_idx(u32 rate_n_flags)
345 345
346 /* 4965 legacy rate format, search for match in table */ 346 /* 4965 legacy rate format, search for match in table */
347 } else { 347 } else {
348 for (idx = 0; idx < ARRAY_SIZE(iwl4965_rates); idx++) 348 for (idx = 0; idx < ARRAY_SIZE(iwl_rates); idx++)
349 if (iwl4965_rates[idx].plcp == (rate_n_flags & 0xFF)) 349 if (iwl_rates[idx].plcp == (rate_n_flags & 0xFF))
350 return idx; 350 return idx;
351 } 351 }
352 352
@@ -1951,7 +1951,7 @@ void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv,
1951 u16 rate_flags = 0; 1951 u16 rate_flags = 0;
1952 int rate_idx = min(ctrl->tx_rate->hw_value & 0xffff, IWL_RATE_COUNT - 1); 1952 int rate_idx = min(ctrl->tx_rate->hw_value & 0xffff, IWL_RATE_COUNT - 1);
1953 1953
1954 rate_plcp = iwl4965_rates[rate_idx].plcp; 1954 rate_plcp = iwl_rates[rate_idx].plcp;
1955 1955
1956 rts_retry_limit = (is_hcca) ? 1956 rts_retry_limit = (is_hcca) ?
1957 RTS_HCCA_RETRY_LIMIT : RTS_DFAULT_RETRY_LIMIT; 1957 RTS_HCCA_RETRY_LIMIT : RTS_DFAULT_RETRY_LIMIT;
@@ -2436,7 +2436,7 @@ static void iwl4965_add_radiotap(struct iwl_priv *priv,
2436 if (rate == -1) 2436 if (rate == -1)
2437 iwl4965_rt->rt_rate = 0; 2437 iwl4965_rt->rt_rate = 0;
2438 else 2438 else
2439 iwl4965_rt->rt_rate = iwl4965_rates[rate].ieee; 2439 iwl4965_rt->rt_rate = iwl_rates[rate].ieee;
2440 2440
2441 /* 2441 /*
2442 * "antenna number" 2442 * "antenna number"
@@ -2848,7 +2848,7 @@ static void iwl4965_dbg_report_frame(struct iwl_priv *priv,
2848 if (unlikely(rate_idx == -1)) 2848 if (unlikely(rate_idx == -1))
2849 bitrate = 0; 2849 bitrate = 0;
2850 else 2850 else
2851 bitrate = iwl4965_rates[rate_idx].ieee / 2; 2851 bitrate = iwl_rates[rate_idx].ieee / 2;
2852 2852
2853 /* print frame summary. 2853 /* print frame summary.
2854 * MAC addresses show just the last byte (for brevity), 2854 * MAC addresses show just the last byte (for brevity),
@@ -3473,7 +3473,7 @@ void iwl4965_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
3473 rate_flags |= RATE_MCS_ANT_B_MSK; /*FIXME:RS*/ 3473 rate_flags |= RATE_MCS_ANT_B_MSK; /*FIXME:RS*/
3474 3474
3475 link_cmd.rs_table[i].rate_n_flags = 3475 link_cmd.rs_table[i].rate_n_flags =
3476 iwl4965_hw_set_rate_n_flags(iwl4965_rates[r].plcp, rate_flags); 3476 iwl4965_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags);
3477 r = iwl4965_get_prev_ieee_rate(r); 3477 r = iwl4965_get_prev_ieee_rate(r);
3478 } 3478 }
3479 3479
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index b800031ecca5..8e411de9bda6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -67,7 +67,7 @@ MODULE_LICENSE("GPL");
67 * maps to IWL_RATE_INVALID 67 * maps to IWL_RATE_INVALID
68 * 68 *
69 */ 69 */
70const struct iwl4965_rate_info iwl4965_rates[IWL_RATE_COUNT] = { 70const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT] = {
71 IWL_DECLARE_RATE_INFO(1, INV, INV, 2, INV, 2, INV, 2), /* 1mbps */ 71 IWL_DECLARE_RATE_INFO(1, INV, INV, 2, INV, 2, INV, 2), /* 1mbps */
72 IWL_DECLARE_RATE_INFO(2, INV, 1, 5, 1, 5, 1, 5), /* 2mbps */ 72 IWL_DECLARE_RATE_INFO(2, INV, 1, 5, 1, 5, 1, 5), /* 2mbps */
73 IWL_DECLARE_RATE_INFO(5, INV, 2, 6, 2, 11, 2, 11), /*5.5mbps */ 73 IWL_DECLARE_RATE_INFO(5, INV, 2, 6, 2, 11, 2, 11), /*5.5mbps */
@@ -83,7 +83,7 @@ const struct iwl4965_rate_info iwl4965_rates[IWL_RATE_COUNT] = {
83 IWL_DECLARE_RATE_INFO(60, 60, 48, INV, 48, INV, 48, INV),/* 60mbps */ 83 IWL_DECLARE_RATE_INFO(60, 60, 48, INV, 48, INV, 48, INV),/* 60mbps */
84 /* FIXME:RS: ^^ should be INV (legacy) */ 84 /* FIXME:RS: ^^ should be INV (legacy) */
85}; 85};
86EXPORT_SYMBOL(iwl4965_rates); 86EXPORT_SYMBOL(iwl_rates);
87 87
88/* This function both allocates and initializes hw and priv. */ 88/* This function both allocates and initializes hw and priv. */
89struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg, 89struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg,
@@ -383,7 +383,7 @@ static void iwlcore_init_hw_rates(struct iwl_priv *priv,
383 int i; 383 int i;
384 384
385 for (i = 0; i < IWL_RATE_COUNT; i++) { 385 for (i = 0; i < IWL_RATE_COUNT; i++) {
386 rates[i].bitrate = iwl4965_rates[i].ieee * 5; 386 rates[i].bitrate = iwl_rates[i].ieee * 5;
387 rates[i].hw_value = i; /* Rate scaling will work on indexes */ 387 rates[i].hw_value = i; /* Rate scaling will work on indexes */
388 rates[i].hw_value_short = i; 388 rates[i].hw_value_short = i;
389 rates[i].flags = 0; 389 rates[i].flags = 0;
@@ -392,7 +392,7 @@ static void iwlcore_init_hw_rates(struct iwl_priv *priv,
392 * If CCK != 1M then set short preamble rate flag. 392 * If CCK != 1M then set short preamble rate flag.
393 */ 393 */
394 rates[i].flags |= 394 rates[i].flags |=
395 (iwl4965_rates[i].plcp == IWL_RATE_1M_PLCP) ? 395 (iwl_rates[i].plcp == IWL_RATE_1M_PLCP) ?
396 0 : IEEE80211_RATE_SHORT_PREAMBLE; 396 0 : IEEE80211_RATE_SHORT_PREAMBLE;
397 } 397 }
398 } 398 }
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 1c45b6f49d56..edde8142c13e 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -878,9 +878,9 @@ static u8 iwl4965_rate_get_lowest_plcp(struct iwl_priv *priv)
878 878
879 /* Find lowest valid rate */ 879 /* Find lowest valid rate */
880 for (i = IWL_RATE_1M_INDEX; i != IWL_RATE_INVALID; 880 for (i = IWL_RATE_1M_INDEX; i != IWL_RATE_INVALID;
881 i = iwl4965_rates[i].next_ieee) { 881 i = iwl_rates[i].next_ieee) {
882 if (rate_mask & (1 << i)) 882 if (rate_mask & (1 << i))
883 return iwl4965_rates[i].plcp; 883 return iwl_rates[i].plcp;
884 } 884 }
885 885
886 /* No valid rate was found. Assign the lowest one */ 886 /* No valid rate was found. Assign the lowest one */
@@ -939,7 +939,7 @@ static u16 iwl4965_supported_rate_to_ie(u8 *ie, u16 supported_rate,
939 for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) { 939 for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
940 if (bit & supported_rate) { 940 if (bit & supported_rate) {
941 ret_rates |= bit; 941 ret_rates |= bit;
942 rates[*cnt] = iwl4965_rates[i].ieee | 942 rates[*cnt] = iwl_rates[i].ieee |
943 ((bit & basic_rate) ? 0x80 : 0x00); 943 ((bit & basic_rate) ? 0x80 : 0x00);
944 (*cnt)++; 944 (*cnt)++;
945 (*left)--; 945 (*left)--;