aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2011-08-26 10:10:40 -0400
committerStanislaw Gruszka <sgruszka@redhat.com>2011-11-15 06:26:43 -0500
commit2d09b0624a1048f6424b2c7ff60ad3a42d8036ff (patch)
tree2c747dce8f64e4591eb082d9e7f426db7f5a6bca /drivers/net
parent2eb058162ea8b72d5d8965520d05bcdc160010b3 (diff)
iwlegacy: s/INDEX/IDX/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945-rs.c36
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945.c82
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-calib.c22
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-hw.h4
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-rs.c36
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-sta.c4
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-tx.c4
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965.c8
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-commands.h60
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-fh.h2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-legacy-rs.h90
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-power.h10
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-rx.c8
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-tx.c4
-rw-r--r--drivers/net/wireless/iwlegacy/iwl3945-base.c10
15 files changed, 190 insertions, 190 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
index 92fa4366ab89..4d83c6292246 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
@@ -64,27 +64,27 @@ struct il3945_tpt_entry {
64}; 64};
65 65
66static struct il3945_tpt_entry il3945_tpt_table_a[] = { 66static struct il3945_tpt_entry il3945_tpt_table_a[] = {
67 {-60, RATE_54M_INDEX}, 67 {-60, RATE_54M_IDX},
68 {-64, RATE_48M_INDEX}, 68 {-64, RATE_48M_IDX},
69 {-72, RATE_36M_INDEX}, 69 {-72, RATE_36M_IDX},
70 {-80, RATE_24M_INDEX}, 70 {-80, RATE_24M_IDX},
71 {-84, RATE_18M_INDEX}, 71 {-84, RATE_18M_IDX},
72 {-85, RATE_12M_INDEX}, 72 {-85, RATE_12M_IDX},
73 {-87, RATE_9M_INDEX}, 73 {-87, RATE_9M_IDX},
74 {-89, RATE_6M_INDEX} 74 {-89, RATE_6M_IDX}
75}; 75};
76 76
77static struct il3945_tpt_entry il3945_tpt_table_g[] = { 77static struct il3945_tpt_entry il3945_tpt_table_g[] = {
78 {-60, RATE_54M_INDEX}, 78 {-60, RATE_54M_IDX},
79 {-64, RATE_48M_INDEX}, 79 {-64, RATE_48M_IDX},
80 {-68, RATE_36M_INDEX}, 80 {-68, RATE_36M_IDX},
81 {-80, RATE_24M_INDEX}, 81 {-80, RATE_24M_IDX},
82 {-84, RATE_18M_INDEX}, 82 {-84, RATE_18M_IDX},
83 {-85, RATE_12M_INDEX}, 83 {-85, RATE_12M_IDX},
84 {-86, RATE_11M_INDEX}, 84 {-86, RATE_11M_IDX},
85 {-88, RATE_5M_INDEX}, 85 {-88, RATE_5M_IDX},
86 {-90, RATE_2M_INDEX}, 86 {-90, RATE_2M_IDX},
87 {-92, RATE_1M_INDEX} 87 {-92, RATE_1M_IDX}
88}; 88};
89 89
90#define RATE_MAX_WINDOW 62 90#define RATE_MAX_WINDOW 62
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945.c b/drivers/net/wireless/iwlegacy/iwl-3945.c
index 728a90c33183..3908bff8e0ac 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945.c
+++ b/drivers/net/wireless/iwlegacy/iwl-3945.c
@@ -52,16 +52,16 @@
52#include "iwl-3945-debugfs.h" 52#include "iwl-3945-debugfs.h"
53 53
54#define IL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \ 54#define IL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \
55 [RATE_##r##M_INDEX] = { RATE_##r##M_PLCP, \ 55 [RATE_##r##M_IDX] = { RATE_##r##M_PLCP, \
56 RATE_##r##M_IEEE, \ 56 RATE_##r##M_IEEE, \
57 RATE_##ip##M_INDEX, \ 57 RATE_##ip##M_IDX, \
58 RATE_##in##M_INDEX, \ 58 RATE_##in##M_IDX, \
59 RATE_##rp##M_INDEX, \ 59 RATE_##rp##M_IDX, \
60 RATE_##rn##M_INDEX, \ 60 RATE_##rn##M_IDX, \
61 RATE_##pp##M_INDEX, \ 61 RATE_##pp##M_IDX, \
62 RATE_##np##M_INDEX, \ 62 RATE_##np##M_IDX, \
63 RATE_##r##M_INDEX_TABLE, \ 63 RATE_##r##M_IDX_TABLE, \
64 RATE_##ip##M_INDEX_TABLE } 64 RATE_##ip##M_IDX_TABLE }
65 65
66/* 66/*
67 * Parameter order: 67 * Parameter order:
@@ -246,16 +246,16 @@ int il3945_rs_next_rate(struct il_priv *il, int rate)
246 246
247 switch (il->band) { 247 switch (il->band) {
248 case IEEE80211_BAND_5GHZ: 248 case IEEE80211_BAND_5GHZ:
249 if (rate == RATE_12M_INDEX) 249 if (rate == RATE_12M_IDX)
250 next_rate = RATE_9M_INDEX; 250 next_rate = RATE_9M_IDX;
251 else if (rate == RATE_6M_INDEX) 251 else if (rate == RATE_6M_IDX)
252 next_rate = RATE_6M_INDEX; 252 next_rate = RATE_6M_IDX;
253 break; 253 break;
254 case IEEE80211_BAND_2GHZ: 254 case IEEE80211_BAND_2GHZ:
255 if (!(il->_3945.sta_supp_rates & IL_OFDM_RATES_MASK) && 255 if (!(il->_3945.sta_supp_rates & IL_OFDM_RATES_MASK) &&
256 il_is_associated(il)) { 256 il_is_associated(il)) {
257 if (rate == RATE_11M_INDEX) 257 if (rate == RATE_11M_IDX)
258 next_rate = RATE_5M_INDEX; 258 next_rate = RATE_5M_IDX;
259 } 259 }
260 break; 260 break;
261 261
@@ -307,7 +307,7 @@ static void il3945_rx_reply_tx(struct il_priv *il,
307 struct il_rx_pkt *pkt = rxb_addr(rxb); 307 struct il_rx_pkt *pkt = rxb_addr(rxb);
308 u16 sequence = le16_to_cpu(pkt->hdr.sequence); 308 u16 sequence = le16_to_cpu(pkt->hdr.sequence);
309 int txq_id = SEQ_TO_QUEUE(sequence); 309 int txq_id = SEQ_TO_QUEUE(sequence);
310 int index = SEQ_TO_INDEX(sequence); 310 int index = SEQ_TO_IDX(sequence);
311 struct il_tx_queue *txq = &il->txq[txq_id]; 311 struct il_tx_queue *txq = &il->txq[txq_id];
312 struct ieee80211_tx_info *info; 312 struct ieee80211_tx_info *info;
313 struct il3945_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; 313 struct il3945_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
@@ -1133,7 +1133,7 @@ static int il3945_is_temp_calib_needed(struct il_priv *il)
1133 1133
1134#define IL_MAX_GAIN_ENTRIES 78 1134#define IL_MAX_GAIN_ENTRIES 78
1135#define IL_CCK_FROM_OFDM_POWER_DIFF -5 1135#define IL_CCK_FROM_OFDM_POWER_DIFF -5
1136#define IL_CCK_FROM_OFDM_INDEX_DIFF (10) 1136#define IL_CCK_FROM_OFDM_IDX_DIFF (10)
1137 1137
1138/* radio and DSP power table, each step is 1/2 dB. 1138/* radio and DSP power table, each step is 1/2 dB.
1139 * 1st number is for RF analog gain, 2nd number is for DSP pre-DAC gain. */ 1139 * 1st number is for RF analog gain, 2nd number is for DSP pre-DAC gain. */
@@ -1330,7 +1330,7 @@ static void il3945_hw_reg_set_scan_power(struct il_priv *il, u32 scan_tbl_index,
1330 /* use this channel group's 6Mbit clipping/saturation pwr, 1330 /* use this channel group's 6Mbit clipping/saturation pwr,
1331 * but cap at regulatory scan power restriction (set during init 1331 * but cap at regulatory scan power restriction (set during init
1332 * based on eeprom channel data) for this channel. */ 1332 * based on eeprom channel data) for this channel. */
1333 power = min(ch_info->scan_power, clip_pwrs[RATE_6M_INDEX_TABLE]); 1333 power = min(ch_info->scan_power, clip_pwrs[RATE_6M_IDX_TABLE]);
1334 1334
1335 power = min(power, il->tx_power_user_lmt); 1335 power = min(power, il->tx_power_user_lmt);
1336 scan_power_info->requested_power = power; 1336 scan_power_info->requested_power = power;
@@ -1342,7 +1342,7 @@ static void il3945_hw_reg_set_scan_power(struct il_priv *il, u32 scan_tbl_index,
1342 * *index*. */ 1342 * *index*. */
1343 power_index = ch_info->power_info[rate_index].power_table_index 1343 power_index = ch_info->power_info[rate_index].power_table_index
1344 - (power - ch_info->power_info 1344 - (power - ch_info->power_info
1345 [RATE_6M_INDEX_TABLE].requested_power) * 2; 1345 [RATE_6M_IDX_TABLE].requested_power) * 2;
1346 1346
1347 /* store reference index that we use when adjusting *all* scan 1347 /* store reference index that we use when adjusting *all* scan
1348 * powers. So we can accommodate user (all channel) or spectrum 1348 * powers. So we can accommodate user (all channel) or spectrum
@@ -1466,7 +1466,7 @@ static int il3945_hw_reg_set_new_power(struct il_priv *il,
1466 power_info = ch_info->power_info; 1466 power_info = ch_info->power_info;
1467 1467
1468 /* update OFDM Txpower settings */ 1468 /* update OFDM Txpower settings */
1469 for (i = RATE_6M_INDEX_TABLE; i <= RATE_54M_INDEX_TABLE; 1469 for (i = RATE_6M_IDX_TABLE; i <= RATE_54M_IDX_TABLE;
1470 i++, ++power_info) { 1470 i++, ++power_info) {
1471 int delta_idx; 1471 int delta_idx;
1472 1472
@@ -1490,15 +1490,15 @@ static int il3945_hw_reg_set_new_power(struct il_priv *il,
1490 * ... all CCK power settings for a given channel are the *same*. */ 1490 * ... all CCK power settings for a given channel are the *same*. */
1491 if (power_changed) { 1491 if (power_changed) {
1492 power = 1492 power =
1493 ch_info->power_info[RATE_12M_INDEX_TABLE]. 1493 ch_info->power_info[RATE_12M_IDX_TABLE].
1494 requested_power + IL_CCK_FROM_OFDM_POWER_DIFF; 1494 requested_power + IL_CCK_FROM_OFDM_POWER_DIFF;
1495 1495
1496 /* do all CCK rates' il3945_channel_power_info structures */ 1496 /* do all CCK rates' il3945_channel_power_info structures */
1497 for (i = RATE_1M_INDEX_TABLE; i <= RATE_11M_INDEX_TABLE; i++) { 1497 for (i = RATE_1M_IDX_TABLE; i <= RATE_11M_IDX_TABLE; i++) {
1498 power_info->requested_power = power; 1498 power_info->requested_power = power;
1499 power_info->base_power_index = 1499 power_info->base_power_index =
1500 ch_info->power_info[RATE_12M_INDEX_TABLE]. 1500 ch_info->power_info[RATE_12M_IDX_TABLE].
1501 base_power_index + IL_CCK_FROM_OFDM_INDEX_DIFF; 1501 base_power_index + IL_CCK_FROM_OFDM_IDX_DIFF;
1502 ++power_info; 1502 ++power_info;
1503 } 1503 }
1504 } 1504 }
@@ -1597,7 +1597,7 @@ static int il3945_hw_reg_comp_txpower_temp(struct il_priv *il)
1597 for (scan_tbl_index = 0; 1597 for (scan_tbl_index = 0;
1598 scan_tbl_index < IL_NUM_SCAN_RATES; scan_tbl_index++) { 1598 scan_tbl_index < IL_NUM_SCAN_RATES; scan_tbl_index++) {
1599 s32 actual_index = (scan_tbl_index == 0) ? 1599 s32 actual_index = (scan_tbl_index == 0) ?
1600 RATE_1M_INDEX_TABLE : RATE_6M_INDEX_TABLE; 1600 RATE_1M_IDX_TABLE : RATE_6M_IDX_TABLE;
1601 il3945_hw_reg_set_scan_power(il, scan_tbl_index, 1601 il3945_hw_reg_set_scan_power(il, scan_tbl_index,
1602 actual_index, clip_pwrs, 1602 actual_index, clip_pwrs,
1603 ch_info, a_band); 1603 ch_info, a_band);
@@ -2012,19 +2012,19 @@ static void il3945_hw_reg_init_channel_groups(struct il_priv *il)
2012 for (rate_index = 0; 2012 for (rate_index = 0;
2013 rate_index < RATE_COUNT_3945; rate_index++, clip_pwrs++) { 2013 rate_index < RATE_COUNT_3945; rate_index++, clip_pwrs++) {
2014 switch (rate_index) { 2014 switch (rate_index) {
2015 case RATE_36M_INDEX_TABLE: 2015 case RATE_36M_IDX_TABLE:
2016 if (i == 0) /* B/G */ 2016 if (i == 0) /* B/G */
2017 *clip_pwrs = satur_pwr; 2017 *clip_pwrs = satur_pwr;
2018 else /* A */ 2018 else /* A */
2019 *clip_pwrs = satur_pwr - 5; 2019 *clip_pwrs = satur_pwr - 5;
2020 break; 2020 break;
2021 case RATE_48M_INDEX_TABLE: 2021 case RATE_48M_IDX_TABLE:
2022 if (i == 0) 2022 if (i == 0)
2023 *clip_pwrs = satur_pwr - 7; 2023 *clip_pwrs = satur_pwr - 7;
2024 else 2024 else
2025 *clip_pwrs = satur_pwr - 10; 2025 *clip_pwrs = satur_pwr - 10;
2026 break; 2026 break;
2027 case RATE_54M_INDEX_TABLE: 2027 case RATE_54M_IDX_TABLE:
2028 if (i == 0) 2028 if (i == 0)
2029 *clip_pwrs = satur_pwr - 9; 2029 *clip_pwrs = satur_pwr - 9;
2030 else 2030 else
@@ -2139,13 +2139,13 @@ int il3945_txpower_set_from_eeprom(struct il_priv *il)
2139 } 2139 }
2140 2140
2141 /* set tx power for CCK rates, based on OFDM 12 Mbit settings*/ 2141 /* set tx power for CCK rates, based on OFDM 12 Mbit settings*/
2142 pwr_info = &ch_info->power_info[RATE_12M_INDEX_TABLE]; 2142 pwr_info = &ch_info->power_info[RATE_12M_IDX_TABLE];
2143 power = pwr_info->requested_power + 2143 power = pwr_info->requested_power +
2144 IL_CCK_FROM_OFDM_POWER_DIFF; 2144 IL_CCK_FROM_OFDM_POWER_DIFF;
2145 pwr_index = pwr_info->power_table_index + 2145 pwr_index = pwr_info->power_table_index +
2146 IL_CCK_FROM_OFDM_INDEX_DIFF; 2146 IL_CCK_FROM_OFDM_IDX_DIFF;
2147 base_pwr_index = pwr_info->base_power_index + 2147 base_pwr_index = pwr_info->base_power_index +
2148 IL_CCK_FROM_OFDM_INDEX_DIFF; 2148 IL_CCK_FROM_OFDM_IDX_DIFF;
2149 2149
2150 /* stay within table range */ 2150 /* stay within table range */
2151 pwr_index = il3945_hw_reg_fix_power_index(pwr_index); 2151 pwr_index = il3945_hw_reg_fix_power_index(pwr_index);
@@ -2169,7 +2169,7 @@ int il3945_txpower_set_from_eeprom(struct il_priv *il)
2169 for (scan_tbl_index = 0; 2169 for (scan_tbl_index = 0;
2170 scan_tbl_index < IL_NUM_SCAN_RATES; scan_tbl_index++) { 2170 scan_tbl_index < IL_NUM_SCAN_RATES; scan_tbl_index++) {
2171 s32 actual_index = (scan_tbl_index == 0) ? 2171 s32 actual_index = (scan_tbl_index == 0) ?
2172 RATE_1M_INDEX_TABLE : RATE_6M_INDEX_TABLE; 2172 RATE_1M_IDX_TABLE : RATE_6M_IDX_TABLE;
2173 il3945_hw_reg_set_scan_power(il, scan_tbl_index, 2173 il3945_hw_reg_set_scan_power(il, scan_tbl_index,
2174 actual_index, clip_pwrs, ch_info, a_band); 2174 actual_index, clip_pwrs, ch_info, a_band);
2175 } 2175 }
@@ -2326,17 +2326,17 @@ int il3945_init_hw_rate_table(struct il_priv *il)
2326 D_RATE("Select A mode rate scale\n"); 2326 D_RATE("Select A mode rate scale\n");
2327 /* If one of the following CCK rates is used, 2327 /* If one of the following CCK rates is used,
2328 * have it fall back to the 6M OFDM rate */ 2328 * have it fall back to the 6M OFDM rate */
2329 for (i = RATE_1M_INDEX_TABLE; 2329 for (i = RATE_1M_IDX_TABLE;
2330 i <= RATE_11M_INDEX_TABLE; i++) 2330 i <= RATE_11M_IDX_TABLE; i++)
2331 table[i].next_rate_index = 2331 table[i].next_rate_index =
2332 il3945_rates[IL_FIRST_OFDM_RATE].table_rs_index; 2332 il3945_rates[IL_FIRST_OFDM_RATE].table_rs_index;
2333 2333
2334 /* Don't fall back to CCK rates */ 2334 /* Don't fall back to CCK rates */
2335 table[RATE_12M_INDEX_TABLE].next_rate_index = 2335 table[RATE_12M_IDX_TABLE].next_rate_index =
2336 RATE_9M_INDEX_TABLE; 2336 RATE_9M_IDX_TABLE;
2337 2337
2338 /* Don't drop out of OFDM rates */ 2338 /* Don't drop out of OFDM rates */
2339 table[RATE_6M_INDEX_TABLE].next_rate_index = 2339 table[RATE_6M_IDX_TABLE].next_rate_index =
2340 il3945_rates[IL_FIRST_OFDM_RATE].table_rs_index; 2340 il3945_rates[IL_FIRST_OFDM_RATE].table_rs_index;
2341 break; 2341 break;
2342 2342
@@ -2349,14 +2349,14 @@ int il3945_init_hw_rate_table(struct il_priv *il)
2349 il_is_associated(il)) { 2349 il_is_associated(il)) {
2350 2350
2351 index = IL_FIRST_CCK_RATE; 2351 index = IL_FIRST_CCK_RATE;
2352 for (i = RATE_6M_INDEX_TABLE; 2352 for (i = RATE_6M_IDX_TABLE;
2353 i <= RATE_54M_INDEX_TABLE; i++) 2353 i <= RATE_54M_IDX_TABLE; i++)
2354 table[i].next_rate_index = 2354 table[i].next_rate_index =
2355 il3945_rates[index].table_rs_index; 2355 il3945_rates[index].table_rs_index;
2356 2356
2357 index = RATE_11M_INDEX_TABLE; 2357 index = RATE_11M_IDX_TABLE;
2358 /* CCK shouldn't fall back to OFDM... */ 2358 /* CCK shouldn't fall back to OFDM... */
2359 table[index].next_rate_index = RATE_5M_INDEX_TABLE; 2359 table[index].next_rate_index = RATE_5M_IDX_TABLE;
2360 } 2360 }
2361 break; 2361 break;
2362 2362
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-calib.c b/drivers/net/wireless/iwlegacy/iwl-4965-calib.c
index bb3bc15c3a36..d622b2781088 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-calib.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-calib.c
@@ -374,30 +374,30 @@ static void il4965_prepare_legacy_sensitivity_tbl(struct il_priv *il,
374 struct il_sensitivity_data *data, 374 struct il_sensitivity_data *data,
375 __le16 *tbl) 375 __le16 *tbl)
376{ 376{
377 tbl[HD_AUTO_CORR32_X4_TH_ADD_MIN_INDEX] = 377 tbl[HD_AUTO_CORR32_X4_TH_ADD_MIN_IDX] =
378 cpu_to_le16((u16)data->auto_corr_ofdm); 378 cpu_to_le16((u16)data->auto_corr_ofdm);
379 tbl[HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_INDEX] = 379 tbl[HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_IDX] =
380 cpu_to_le16((u16)data->auto_corr_ofdm_mrc); 380 cpu_to_le16((u16)data->auto_corr_ofdm_mrc);
381 tbl[HD_AUTO_CORR32_X1_TH_ADD_MIN_INDEX] = 381 tbl[HD_AUTO_CORR32_X1_TH_ADD_MIN_IDX] =
382 cpu_to_le16((u16)data->auto_corr_ofdm_x1); 382 cpu_to_le16((u16)data->auto_corr_ofdm_x1);
383 tbl[HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_INDEX] = 383 tbl[HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_IDX] =
384 cpu_to_le16((u16)data->auto_corr_ofdm_mrc_x1); 384 cpu_to_le16((u16)data->auto_corr_ofdm_mrc_x1);
385 385
386 tbl[HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX] = 386 tbl[HD_AUTO_CORR40_X4_TH_ADD_MIN_IDX] =
387 cpu_to_le16((u16)data->auto_corr_cck); 387 cpu_to_le16((u16)data->auto_corr_cck);
388 tbl[HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX] = 388 tbl[HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_IDX] =
389 cpu_to_le16((u16)data->auto_corr_cck_mrc); 389 cpu_to_le16((u16)data->auto_corr_cck_mrc);
390 390
391 tbl[HD_MIN_ENERGY_CCK_DET_INDEX] = 391 tbl[HD_MIN_ENERGY_CCK_DET_IDX] =
392 cpu_to_le16((u16)data->nrg_th_cck); 392 cpu_to_le16((u16)data->nrg_th_cck);
393 tbl[HD_MIN_ENERGY_OFDM_DET_INDEX] = 393 tbl[HD_MIN_ENERGY_OFDM_DET_IDX] =
394 cpu_to_le16((u16)data->nrg_th_ofdm); 394 cpu_to_le16((u16)data->nrg_th_ofdm);
395 395
396 tbl[HD_BARKER_CORR_TH_ADD_MIN_INDEX] = 396 tbl[HD_BARKER_CORR_TH_ADD_MIN_IDX] =
397 cpu_to_le16(data->barker_corr_th_min); 397 cpu_to_le16(data->barker_corr_th_min);
398 tbl[HD_BARKER_CORR_TH_ADD_MIN_MRC_INDEX] = 398 tbl[HD_BARKER_CORR_TH_ADD_MIN_MRC_IDX] =
399 cpu_to_le16(data->barker_corr_th_min_mrc); 399 cpu_to_le16(data->barker_corr_th_min_mrc);
400 tbl[HD_OFDM_ENERGY_TH_IN_INDEX] = 400 tbl[HD_OFDM_ENERGY_TH_IN_IDX] =
401 cpu_to_le16(data->nrg_th_cca); 401 cpu_to_le16(data->nrg_th_cca);
402 402
403 D_CALIB("ofdm: ac %u mrc %u x1 %u mrc_x1 %u thresh %u\n", 403 D_CALIB("ofdm: ac %u mrc %u x1 %u mrc_x1 %u thresh %u\n",
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-hw.h b/drivers/net/wireless/iwlegacy/iwl-4965-hw.h
index 83748c7ae93f..2c1b000e2369 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-hw.h
@@ -433,8 +433,8 @@ static inline int il4965_hw_valid_rtc_data_addr(u32 addr)
433 * present during factory calibration). A 5 Ghz EEPROM index of "40" 433 * present during factory calibration). A 5 Ghz EEPROM index of "40"
434 * corresponds to the 49th entry in the table used by the driver. 434 * corresponds to the 49th entry in the table used by the driver.
435 */ 435 */
436#define MIN_TX_GAIN_INDEX (0) /* highest gain, lowest idx, 2.4 */ 436#define MIN_TX_GAIN_IDX (0) /* highest gain, lowest idx, 2.4 */
437#define MIN_TX_GAIN_INDEX_52GHZ_EXT (-9) /* highest gain, lowest idx, 5 */ 437#define MIN_TX_GAIN_IDX_52GHZ_EXT (-9) /* highest gain, lowest idx, 5 */
438 438
439/** 439/**
440 * 2.4 GHz gain table 440 * 2.4 GHz gain table
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-rs.c b/drivers/net/wireless/iwlegacy/iwl-4965-rs.c
index e31ee20b06fc..7478e9167e73 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-rs.c
@@ -56,13 +56,13 @@
56#define RATE_SCALE_FLUSH_INTVL (3*HZ) 56#define RATE_SCALE_FLUSH_INTVL (3*HZ)
57 57
58static u8 rs_ht_to_legacy[] = { 58static u8 rs_ht_to_legacy[] = {
59 RATE_6M_INDEX, RATE_6M_INDEX, 59 RATE_6M_IDX, RATE_6M_IDX,
60 RATE_6M_INDEX, RATE_6M_INDEX, 60 RATE_6M_IDX, RATE_6M_IDX,
61 RATE_6M_INDEX, 61 RATE_6M_IDX,
62 RATE_6M_INDEX, RATE_9M_INDEX, 62 RATE_6M_IDX, RATE_9M_IDX,
63 RATE_12M_INDEX, RATE_18M_INDEX, 63 RATE_12M_IDX, RATE_18M_IDX,
64 RATE_24M_INDEX, RATE_36M_INDEX, 64 RATE_24M_IDX, RATE_36M_IDX,
65 RATE_48M_INDEX, RATE_54M_INDEX 65 RATE_48M_IDX, RATE_54M_IDX
66}; 66};
67 67
68static const u8 ant_toggle_lookup[] = { 68static const u8 ant_toggle_lookup[] = {
@@ -77,16 +77,16 @@ static const u8 ant_toggle_lookup[] = {
77}; 77};
78 78
79#define IL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np) \ 79#define IL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np) \
80 [RATE_##r##M_INDEX] = { RATE_##r##M_PLCP, \ 80 [RATE_##r##M_IDX] = { RATE_##r##M_PLCP, \
81 RATE_SISO_##s##M_PLCP, \ 81 RATE_SISO_##s##M_PLCP, \
82 RATE_MIMO2_##s##M_PLCP,\ 82 RATE_MIMO2_##s##M_PLCP,\
83 RATE_##r##M_IEEE, \ 83 RATE_##r##M_IEEE, \
84 RATE_##ip##M_INDEX, \ 84 RATE_##ip##M_IDX, \
85 RATE_##in##M_INDEX, \ 85 RATE_##in##M_IDX, \
86 RATE_##rp##M_INDEX, \ 86 RATE_##rp##M_IDX, \
87 RATE_##rn##M_INDEX, \ 87 RATE_##rn##M_IDX, \
88 RATE_##pp##M_INDEX, \ 88 RATE_##pp##M_IDX, \
89 RATE_##np##M_INDEX } 89 RATE_##np##M_IDX }
90 90
91/* 91/*
92 * Parameter order: 92 * Parameter order:
@@ -125,7 +125,7 @@ static int il4965_hwrate_to_plcp_idx(u32 rate_n_flags)
125 125
126 idx += IL_FIRST_OFDM_RATE; 126 idx += IL_FIRST_OFDM_RATE;
127 /* skip 9M not supported in ht*/ 127 /* skip 9M not supported in ht*/
128 if (idx >= RATE_9M_INDEX) 128 if (idx >= RATE_9M_IDX)
129 idx += 1; 129 idx += 1;
130 if (idx >= IL_FIRST_OFDM_RATE && idx <= IL_LAST_OFDM_RATE) 130 if (idx >= IL_FIRST_OFDM_RATE && idx <= IL_LAST_OFDM_RATE)
131 return idx; 131 return idx;
@@ -218,7 +218,7 @@ static const struct il_rate_mcs_info il_rate_mcs[RATE_COUNT] = {
218 { "60", "64QAM 5/6"}, 218 { "60", "64QAM 5/6"},
219}; 219};
220 220
221#define MCS_INDEX_PER_STREAM (8) 221#define MCS_IDX_PER_STREAM (8)
222 222
223static inline u8 il4965_rs_extract_rate(u32 rate_n_flags) 223static inline u8 il4965_rs_extract_rate(u32 rate_n_flags)
224{ 224{
@@ -856,7 +856,7 @@ il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband,
856 /* For HT packets, map MCS to PLCP */ 856 /* For HT packets, map MCS to PLCP */
857 if (mac_flags & IEEE80211_TX_RC_MCS) { 857 if (mac_flags & IEEE80211_TX_RC_MCS) {
858 mac_index &= RATE_MCS_CODE_MSK; /* Remove # of streams */ 858 mac_index &= RATE_MCS_CODE_MSK; /* Remove # of streams */
859 if (mac_index >= (RATE_9M_INDEX - IL_FIRST_OFDM_RATE)) 859 if (mac_index >= (RATE_9M_IDX - IL_FIRST_OFDM_RATE))
860 mac_index++; 860 mac_index++;
861 /* 861 /*
862 * mac80211 HT index is always zero-indexed; we need to move 862 * mac80211 HT index is always zero-indexed; we need to move
@@ -2276,7 +2276,7 @@ il4965_rs_get_rate(void *il_r, struct ieee80211_sta *sta, void *il_sta,
2276 rate_idx = (rate_idx > 0) ? (rate_idx - 1) : 0; 2276 rate_idx = (rate_idx > 0) ? (rate_idx - 1) : 0;
2277 if (il4965_rs_extract_rate(lq_sta->last_rate_n_flags) >= 2277 if (il4965_rs_extract_rate(lq_sta->last_rate_n_flags) >=
2278 RATE_MIMO2_6M_PLCP) 2278 RATE_MIMO2_6M_PLCP)
2279 rate_idx = rate_idx + MCS_INDEX_PER_STREAM; 2279 rate_idx = rate_idx + MCS_IDX_PER_STREAM;
2280 info->control.rates[0].flags = IEEE80211_TX_RC_MCS; 2280 info->control.rates[0].flags = IEEE80211_TX_RC_MCS;
2281 if (lq_sta->last_rate_n_flags & RATE_MCS_SGI_MSK) 2281 if (lq_sta->last_rate_n_flags & RATE_MCS_SGI_MSK)
2282 info->control.rates[0].flags |= 2282 info->control.rates[0].flags |=
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-sta.c b/drivers/net/wireless/iwlegacy/iwl-4965-sta.c
index 278517c9083c..c50d63918773 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-sta.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-sta.c
@@ -50,9 +50,9 @@ il4965_sta_alloc_lq(struct il_priv *il, u8 sta_id)
50 /* Set up the rate scaling to start at selected rate, fall back 50 /* Set up the rate scaling to start at selected rate, fall back
51 * all the way down to 1M in IEEE order, and then spin on 1M */ 51 * all the way down to 1M in IEEE order, and then spin on 1M */
52 if (il->band == IEEE80211_BAND_5GHZ) 52 if (il->band == IEEE80211_BAND_5GHZ)
53 r = RATE_6M_INDEX; 53 r = RATE_6M_IDX;
54 else 54 else
55 r = RATE_1M_INDEX; 55 r = RATE_1M_IDX;
56 56
57 if (r >= IL_FIRST_CCK_RATE && r <= IL_LAST_CCK_RATE) 57 if (r >= IL_FIRST_CCK_RATE && r <= IL_LAST_CCK_RATE)
58 rate_flags |= RATE_MCS_CCK_MSK; 58 rate_flags |= RATE_MCS_CCK_MSK;
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
index 9671e10ff354..8f18d36f08ad 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
@@ -423,7 +423,7 @@ int il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
423 */ 423 */
424 out_cmd->hdr.cmd = REPLY_TX; 424 out_cmd->hdr.cmd = REPLY_TX;
425 out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) | 425 out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) |
426 INDEX_TO_SEQ(q->write_ptr))); 426 IDX_TO_SEQ(q->write_ptr)));
427 427
428 /* Copy MAC header from skb into command buffer */ 428 /* Copy MAC header from skb into command buffer */
429 memcpy(tx_cmd->hdr, hdr, hdr_len); 429 memcpy(tx_cmd->hdr, hdr, hdr_len);
@@ -1172,7 +1172,7 @@ static int il4965_tx_status_reply_compressed_ba(struct il_priv *il,
1172 ba_resp->seq_ctl); 1172 ba_resp->seq_ctl);
1173 1173
1174 /* Calculate shift to align block-ack bits with our Tx win bits */ 1174 /* Calculate shift to align block-ack bits with our Tx win bits */
1175 sh = agg->start_idx - SEQ_TO_INDEX(seq_ctl >> 4); 1175 sh = agg->start_idx - SEQ_TO_IDX(seq_ctl >> 4);
1176 if (sh < 0) /* tbw something is wrong with indices */ 1176 if (sh < 0) /* tbw something is wrong with indices */
1177 sh += 0x100; 1177 sh += 0x100;
1178 1178
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965.c b/drivers/net/wireless/iwlegacy/iwl-4965.c
index f62475de7591..58bdf9302987 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965.c
@@ -632,9 +632,9 @@ static s32 get_min_power_index(s32 rate_power_index, u32 band)
632{ 632{
633 if (!band) { 633 if (!band) {
634 if ((rate_power_index & 7) <= 4) 634 if ((rate_power_index & 7) <= 4)
635 return MIN_TX_GAIN_INDEX_52GHZ_EXT; 635 return MIN_TX_GAIN_IDX_52GHZ_EXT;
636 } 636 }
637 return MIN_TX_GAIN_INDEX; 637 return MIN_TX_GAIN_IDX;
638} 638}
639 639
640struct gain_entry { 640struct gain_entry {
@@ -1654,7 +1654,7 @@ static int il4965_tx_status_reply_tx(struct il_priv *il,
1654 u16 sc; 1654 u16 sc;
1655 status = le16_to_cpu(frame_status[i].status); 1655 status = le16_to_cpu(frame_status[i].status);
1656 seq = le16_to_cpu(frame_status[i].sequence); 1656 seq = le16_to_cpu(frame_status[i].sequence);
1657 idx = SEQ_TO_INDEX(seq); 1657 idx = SEQ_TO_IDX(seq);
1658 txq_id = SEQ_TO_QUEUE(seq); 1658 txq_id = SEQ_TO_QUEUE(seq);
1659 1659
1660 if (status & (AGG_TX_STATE_FEW_BYTES_MSK | 1660 if (status & (AGG_TX_STATE_FEW_BYTES_MSK |
@@ -1777,7 +1777,7 @@ static void il4965_rx_reply_tx(struct il_priv *il,
1777 struct il_rx_pkt *pkt = rxb_addr(rxb); 1777 struct il_rx_pkt *pkt = rxb_addr(rxb);
1778 u16 sequence = le16_to_cpu(pkt->hdr.sequence); 1778 u16 sequence = le16_to_cpu(pkt->hdr.sequence);
1779 int txq_id = SEQ_TO_QUEUE(sequence); 1779 int txq_id = SEQ_TO_QUEUE(sequence);
1780 int index = SEQ_TO_INDEX(sequence); 1780 int index = SEQ_TO_IDX(sequence);
1781 struct il_tx_queue *txq = &il->txq[txq_id]; 1781 struct il_tx_queue *txq = &il->txq[txq_id];
1782 struct ieee80211_hdr *hdr; 1782 struct ieee80211_hdr *hdr;
1783 struct ieee80211_tx_info *info; 1783 struct ieee80211_tx_info *info;
diff --git a/drivers/net/wireless/iwlegacy/iwl-commands.h b/drivers/net/wireless/iwlegacy/iwl-commands.h
index aed11019f094..002f1d7f475b 100644
--- a/drivers/net/wireless/iwlegacy/iwl-commands.h
+++ b/drivers/net/wireless/iwlegacy/iwl-commands.h
@@ -168,8 +168,8 @@ enum {
168 168
169#define SEQ_TO_QUEUE(s) (((s) >> 8) & 0x1f) 169#define SEQ_TO_QUEUE(s) (((s) >> 8) & 0x1f)
170#define QUEUE_TO_SEQ(q) (((q) & 0x1f) << 8) 170#define QUEUE_TO_SEQ(q) (((q) & 0x1f) << 8)
171#define SEQ_TO_INDEX(s) ((s) & 0xff) 171#define SEQ_TO_IDX(s) ((s) & 0xff)
172#define INDEX_TO_SEQ(i) ((i) & 0xff) 172#define IDX_TO_SEQ(i) ((i) & 0xff)
173#define SEQ_HUGE_FRAME cpu_to_le16(0x4000) 173#define SEQ_HUGE_FRAME cpu_to_le16(0x4000)
174#define SEQ_RX_FRAME cpu_to_le16(0x8000) 174#define SEQ_RX_FRAME cpu_to_le16(0x8000)
175 175
@@ -3116,10 +3116,10 @@ struct il_missed_beacon_notif {
3116 * maximum sensitivity): 3116 * maximum sensitivity):
3117 * 3117 *
3118 * START / MIN / MAX 3118 * START / MIN / MAX
3119 * HD_AUTO_CORR32_X1_TH_ADD_MIN_INDEX 90 / 85 / 120 3119 * HD_AUTO_CORR32_X1_TH_ADD_MIN_IDX 90 / 85 / 120
3120 * HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_INDEX 170 / 170 / 210 3120 * HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_IDX 170 / 170 / 210
3121 * HD_AUTO_CORR32_X4_TH_ADD_MIN_INDEX 105 / 105 / 140 3121 * HD_AUTO_CORR32_X4_TH_ADD_MIN_IDX 105 / 105 / 140
3122 * HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_INDEX 220 / 220 / 270 3122 * HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_IDX 220 / 220 / 270
3123 * 3123 *
3124 * If actual rate of OFDM false alarms (+ plcp_errors) is too high 3124 * If actual rate of OFDM false alarms (+ plcp_errors) is too high
3125 * (greater than 50 for each 204.8 msecs listening), reduce sensitivity 3125 * (greater than 50 for each 204.8 msecs listening), reduce sensitivity
@@ -3156,26 +3156,26 @@ struct il_missed_beacon_notif {
3156 * (notice that the start points for CCK are at maximum sensitivity): 3156 * (notice that the start points for CCK are at maximum sensitivity):
3157 * 3157 *
3158 * START / MIN / MAX 3158 * START / MIN / MAX
3159 * HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX 125 / 125 / 200 3159 * HD_AUTO_CORR40_X4_TH_ADD_MIN_IDX 125 / 125 / 200
3160 * HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX 200 / 200 / 400 3160 * HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_IDX 200 / 200 / 400
3161 * HD_MIN_ENERGY_CCK_DET_INDEX 100 / 0 / 100 3161 * HD_MIN_ENERGY_CCK_DET_IDX 100 / 0 / 100
3162 * 3162 *
3163 * If actual rate of CCK false alarms (+ plcp_errors) is too high 3163 * If actual rate of CCK false alarms (+ plcp_errors) is too high
3164 * (greater than 50 for each 204.8 msecs listening), method for reducing 3164 * (greater than 50 for each 204.8 msecs listening), method for reducing
3165 * sensitivity is: 3165 * sensitivity is:
3166 * 3166 *
3167 * 1) *Add* 3 to value in HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX, 3167 * 1) *Add* 3 to value in HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_IDX,
3168 * up to max 400. 3168 * up to max 400.
3169 * 3169 *
3170 * 2) If current value in HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX is < 160, 3170 * 2) If current value in HD_AUTO_CORR40_X4_TH_ADD_MIN_IDX is < 160,
3171 * sensitivity has been reduced a significant amount; bring it up to 3171 * sensitivity has been reduced a significant amount; bring it up to
3172 * a moderate 161. Otherwise, *add* 3, up to max 200. 3172 * a moderate 161. Otherwise, *add* 3, up to max 200.
3173 * 3173 *
3174 * 3) a) If current value in HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX is > 160, 3174 * 3) a) If current value in HD_AUTO_CORR40_X4_TH_ADD_MIN_IDX is > 160,
3175 * sensitivity has been reduced only a moderate or small amount; 3175 * sensitivity has been reduced only a moderate or small amount;
3176 * *subtract* 2 from value in HD_MIN_ENERGY_CCK_DET_INDEX, 3176 * *subtract* 2 from value in HD_MIN_ENERGY_CCK_DET_IDX,
3177 * down to min 0. Otherwise (if gain has been significantly reduced), 3177 * down to min 0. Otherwise (if gain has been significantly reduced),
3178 * don't change the HD_MIN_ENERGY_CCK_DET_INDEX value. 3178 * don't change the HD_MIN_ENERGY_CCK_DET_IDX value.
3179 * 3179 *
3180 * b) Save a snapshot of the "silence reference". 3180 * b) Save a snapshot of the "silence reference".
3181 * 3181 *
@@ -3191,13 +3191,13 @@ struct il_missed_beacon_notif {
3191 * 3191 *
3192 * Method for increasing sensitivity: 3192 * Method for increasing sensitivity:
3193 * 3193 *
3194 * 1) *Subtract* 3 from value in HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX, 3194 * 1) *Subtract* 3 from value in HD_AUTO_CORR40_X4_TH_ADD_MIN_IDX,
3195 * down to min 125. 3195 * down to min 125.
3196 * 3196 *
3197 * 2) *Subtract* 3 from value in HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX, 3197 * 2) *Subtract* 3 from value in HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_IDX,
3198 * down to min 200. 3198 * down to min 200.
3199 * 3199 *
3200 * 3) *Add* 2 to value in HD_MIN_ENERGY_CCK_DET_INDEX, up to max 100. 3200 * 3) *Add* 2 to value in HD_MIN_ENERGY_CCK_DET_IDX, up to max 100.
3201 * 3201 *
3202 * If actual rate of CCK false alarms (+ plcp_errors) is within good range 3202 * If actual rate of CCK false alarms (+ plcp_errors) is within good range
3203 * (between 5 and 50 for each 204.8 msecs listening): 3203 * (between 5 and 50 for each 204.8 msecs listening):
@@ -3206,13 +3206,13 @@ struct il_missed_beacon_notif {
3206 * 3206 *
3207 * 2) If previous beacon had too many CCK false alarms (+ plcp_errors), 3207 * 2) If previous beacon had too many CCK false alarms (+ plcp_errors),
3208 * give some extra margin to energy threshold by *subtracting* 8 3208 * give some extra margin to energy threshold by *subtracting* 8
3209 * from value in HD_MIN_ENERGY_CCK_DET_INDEX. 3209 * from value in HD_MIN_ENERGY_CCK_DET_IDX.
3210 * 3210 *
3211 * For all cases (too few, too many, good range), make sure that the CCK 3211 * For all cases (too few, too many, good range), make sure that the CCK
3212 * detection threshold (energy) is below the energy level for robust 3212 * detection threshold (energy) is below the energy level for robust
3213 * detection over the past 10 beacon periods, the "Max cck energy". 3213 * detection over the past 10 beacon periods, the "Max cck energy".
3214 * Lower values mean higher energy; this means making sure that the value 3214 * Lower values mean higher energy; this means making sure that the value
3215 * in HD_MIN_ENERGY_CCK_DET_INDEX is at or *above* "Max cck energy". 3215 * in HD_MIN_ENERGY_CCK_DET_IDX is at or *above* "Max cck energy".
3216 * 3216 *
3217 */ 3217 */
3218 3218
@@ -3220,17 +3220,17 @@ struct il_missed_beacon_notif {
3220 * Table entries in SENSITIVITY_CMD (struct il_sensitivity_cmd) 3220 * Table entries in SENSITIVITY_CMD (struct il_sensitivity_cmd)
3221 */ 3221 */
3222#define HD_TABLE_SIZE (11) /* number of entries */ 3222#define HD_TABLE_SIZE (11) /* number of entries */
3223#define HD_MIN_ENERGY_CCK_DET_INDEX (0) /* table indexes */ 3223#define HD_MIN_ENERGY_CCK_DET_IDX (0) /* table indexes */
3224#define HD_MIN_ENERGY_OFDM_DET_INDEX (1) 3224#define HD_MIN_ENERGY_OFDM_DET_IDX (1)
3225#define HD_AUTO_CORR32_X1_TH_ADD_MIN_INDEX (2) 3225#define HD_AUTO_CORR32_X1_TH_ADD_MIN_IDX (2)
3226#define HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_INDEX (3) 3226#define HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_IDX (3)
3227#define HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX (4) 3227#define HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_IDX (4)
3228#define HD_AUTO_CORR32_X4_TH_ADD_MIN_INDEX (5) 3228#define HD_AUTO_CORR32_X4_TH_ADD_MIN_IDX (5)
3229#define HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_INDEX (6) 3229#define HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_IDX (6)
3230#define HD_BARKER_CORR_TH_ADD_MIN_INDEX (7) 3230#define HD_BARKER_CORR_TH_ADD_MIN_IDX (7)
3231#define HD_BARKER_CORR_TH_ADD_MIN_MRC_INDEX (8) 3231#define HD_BARKER_CORR_TH_ADD_MIN_MRC_IDX (8)
3232#define HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX (9) 3232#define HD_AUTO_CORR40_X4_TH_ADD_MIN_IDX (9)
3233#define HD_OFDM_ENERGY_TH_IN_INDEX (10) 3233#define HD_OFDM_ENERGY_TH_IN_IDX (10)
3234 3234
3235/* Control field in struct il_sensitivity_cmd */ 3235/* Control field in struct il_sensitivity_cmd */
3236#define SENSITIVITY_CMD_CONTROL_DEFAULT_TABLE cpu_to_le16(0) 3236#define SENSITIVITY_CMD_CONTROL_DEFAULT_TABLE cpu_to_le16(0)
diff --git a/drivers/net/wireless/iwlegacy/iwl-fh.h b/drivers/net/wireless/iwlegacy/iwl-fh.h
index 0ae36df1c293..e993e3ea5b33 100644
--- a/drivers/net/wireless/iwlegacy/iwl-fh.h
+++ b/drivers/net/wireless/iwlegacy/iwl-fh.h
@@ -162,7 +162,7 @@
162 * RBs), should be 8 after preparing the first 8 RBs (for example), and must 162 * RBs), should be 8 after preparing the first 8 RBs (for example), and must
163 * wrap back to 0 at the end of the circular buffer (but don't wrap before 163 * wrap back to 0 at the end of the circular buffer (but don't wrap before
164 * "read" index has advanced past 1! See below). 164 * "read" index has advanced past 1! See below).
165 * NOTE: 4965 EXPECTS THE WRITE INDEX TO BE INCREMENTED IN MULTIPLES OF 8. 165 * NOTE: 4965 EXPECTS THE WRITE IDX TO BE INCREMENTED IN MULTIPLES OF 8.
166 * 166 *
167 * As the 4965 fills RBs (referenced from contiguous RBDs within the circular 167 * As the 4965 fills RBs (referenced from contiguous RBDs within the circular
168 * buffer), it updates the Rx status buffer in host DRAM, 2) described above, 168 * buffer), it updates the Rx status buffer in host DRAM, 2) described above,
diff --git a/drivers/net/wireless/iwlegacy/iwl-legacy-rs.h b/drivers/net/wireless/iwlegacy/iwl-legacy-rs.h
index 6670f2eb71ae..f3ee0dd67f57 100644
--- a/drivers/net/wireless/iwlegacy/iwl-legacy-rs.h
+++ b/drivers/net/wireless/iwlegacy/iwl-legacy-rs.h
@@ -59,64 +59,64 @@ struct il3945_rate_info {
59 * struct il_rate_info il_rates[RATE_COUNT]; 59 * struct il_rate_info il_rates[RATE_COUNT];
60 */ 60 */
61enum { 61enum {
62 RATE_1M_INDEX = 0, 62 RATE_1M_IDX = 0,
63 RATE_2M_INDEX, 63 RATE_2M_IDX,
64 RATE_5M_INDEX, 64 RATE_5M_IDX,
65 RATE_11M_INDEX, 65 RATE_11M_IDX,
66 RATE_6M_INDEX, 66 RATE_6M_IDX,
67 RATE_9M_INDEX, 67 RATE_9M_IDX,
68 RATE_12M_INDEX, 68 RATE_12M_IDX,
69 RATE_18M_INDEX, 69 RATE_18M_IDX,
70 RATE_24M_INDEX, 70 RATE_24M_IDX,
71 RATE_36M_INDEX, 71 RATE_36M_IDX,
72 RATE_48M_INDEX, 72 RATE_48M_IDX,
73 RATE_54M_INDEX, 73 RATE_54M_IDX,
74 RATE_60M_INDEX, 74 RATE_60M_IDX,
75 RATE_COUNT, 75 RATE_COUNT,
76 RATE_COUNT_LEGACY = RATE_COUNT - 1, /* Excluding 60M */ 76 RATE_COUNT_LEGACY = RATE_COUNT - 1, /* Excluding 60M */
77 RATE_COUNT_3945 = RATE_COUNT - 1, 77 RATE_COUNT_3945 = RATE_COUNT - 1,
78 RATE_INVM_INDEX = RATE_COUNT, 78 RATE_INVM_IDX = RATE_COUNT,
79 RATE_INVALID = RATE_COUNT, 79 RATE_INVALID = RATE_COUNT,
80}; 80};
81 81
82enum { 82enum {
83 RATE_6M_INDEX_TABLE = 0, 83 RATE_6M_IDX_TABLE = 0,
84 RATE_9M_INDEX_TABLE, 84 RATE_9M_IDX_TABLE,
85 RATE_12M_INDEX_TABLE, 85 RATE_12M_IDX_TABLE,
86 RATE_18M_INDEX_TABLE, 86 RATE_18M_IDX_TABLE,
87 RATE_24M_INDEX_TABLE, 87 RATE_24M_IDX_TABLE,
88 RATE_36M_INDEX_TABLE, 88 RATE_36M_IDX_TABLE,
89 RATE_48M_INDEX_TABLE, 89 RATE_48M_IDX_TABLE,
90 RATE_54M_INDEX_TABLE, 90 RATE_54M_IDX_TABLE,
91 RATE_1M_INDEX_TABLE, 91 RATE_1M_IDX_TABLE,
92 RATE_2M_INDEX_TABLE, 92 RATE_2M_IDX_TABLE,
93 RATE_5M_INDEX_TABLE, 93 RATE_5M_IDX_TABLE,
94 RATE_11M_INDEX_TABLE, 94 RATE_11M_IDX_TABLE,
95 RATE_INVM_INDEX_TABLE = RATE_INVM_INDEX - 1, 95 RATE_INVM_IDX_TABLE = RATE_INVM_IDX - 1,
96}; 96};
97 97
98enum { 98enum {
99 IL_FIRST_OFDM_RATE = RATE_6M_INDEX, 99 IL_FIRST_OFDM_RATE = RATE_6M_IDX,
100 IL39_LAST_OFDM_RATE = RATE_54M_INDEX, 100 IL39_LAST_OFDM_RATE = RATE_54M_IDX,
101 IL_LAST_OFDM_RATE = RATE_60M_INDEX, 101 IL_LAST_OFDM_RATE = RATE_60M_IDX,
102 IL_FIRST_CCK_RATE = RATE_1M_INDEX, 102 IL_FIRST_CCK_RATE = RATE_1M_IDX,
103 IL_LAST_CCK_RATE = RATE_11M_INDEX, 103 IL_LAST_CCK_RATE = RATE_11M_IDX,
104}; 104};
105 105
106/* #define vs. enum to keep from defaulting to 'large integer' */ 106/* #define vs. enum to keep from defaulting to 'large integer' */
107#define RATE_6M_MASK (1 << RATE_6M_INDEX) 107#define RATE_6M_MASK (1 << RATE_6M_IDX)
108#define RATE_9M_MASK (1 << RATE_9M_INDEX) 108#define RATE_9M_MASK (1 << RATE_9M_IDX)
109#define RATE_12M_MASK (1 << RATE_12M_INDEX) 109#define RATE_12M_MASK (1 << RATE_12M_IDX)
110#define RATE_18M_MASK (1 << RATE_18M_INDEX) 110#define RATE_18M_MASK (1 << RATE_18M_IDX)
111#define RATE_24M_MASK (1 << RATE_24M_INDEX) 111#define RATE_24M_MASK (1 << RATE_24M_IDX)
112#define RATE_36M_MASK (1 << RATE_36M_INDEX) 112#define RATE_36M_MASK (1 << RATE_36M_IDX)
113#define RATE_48M_MASK (1 << RATE_48M_INDEX) 113#define RATE_48M_MASK (1 << RATE_48M_IDX)
114#define RATE_54M_MASK (1 << RATE_54M_INDEX) 114#define RATE_54M_MASK (1 << RATE_54M_IDX)
115#define RATE_60M_MASK (1 << RATE_60M_INDEX) 115#define RATE_60M_MASK (1 << RATE_60M_IDX)
116#define RATE_1M_MASK (1 << RATE_1M_INDEX) 116#define RATE_1M_MASK (1 << RATE_1M_IDX)
117#define RATE_2M_MASK (1 << RATE_2M_INDEX) 117#define RATE_2M_MASK (1 << RATE_2M_IDX)
118#define RATE_5M_MASK (1 << RATE_5M_INDEX) 118#define RATE_5M_MASK (1 << RATE_5M_IDX)
119#define RATE_11M_MASK (1 << RATE_11M_INDEX) 119#define RATE_11M_MASK (1 << RATE_11M_IDX)
120 120
121/* uCode API values for legacy bit rates, both OFDM and CCK */ 121/* uCode API values for legacy bit rates, both OFDM and CCK */
122enum { 122enum {
diff --git a/drivers/net/wireless/iwlegacy/iwl-power.h b/drivers/net/wireless/iwlegacy/iwl-power.h
index e149f789063f..e4a0ef270819 100644
--- a/drivers/net/wireless/iwlegacy/iwl-power.h
+++ b/drivers/net/wireless/iwlegacy/iwl-power.h
@@ -31,11 +31,11 @@
31#include "iwl-commands.h" 31#include "iwl-commands.h"
32 32
33enum il_power_level { 33enum il_power_level {
34 IL_POWER_INDEX_1, 34 IL_POWER_IDX_1,
35 IL_POWER_INDEX_2, 35 IL_POWER_IDX_2,
36 IL_POWER_INDEX_3, 36 IL_POWER_IDX_3,
37 IL_POWER_INDEX_4, 37 IL_POWER_IDX_4,
38 IL_POWER_INDEX_5, 38 IL_POWER_IDX_5,
39 IL_POWER_NUM 39 IL_POWER_NUM
40}; 40};
41 41
diff --git a/drivers/net/wireless/iwlegacy/iwl-rx.c b/drivers/net/wireless/iwlegacy/iwl-rx.c
index a6bee8432798..5c0d1317d149 100644
--- a/drivers/net/wireless/iwlegacy/iwl-rx.c
+++ b/drivers/net/wireless/iwlegacy/iwl-rx.c
@@ -62,7 +62,7 @@
62 * WRITE = READ. 62 * WRITE = READ.
63 * 63 *
64 * During initialization, the host sets up the READ queue position to the first 64 * During initialization, the host sets up the READ queue position to the first
65 * INDEX position, and WRITE to the last (READ - 1 wrapped) 65 * IDX position, and WRITE to the last (READ - 1 wrapped)
66 * 66 *
67 * When the firmware places a packet in a buffer, it will advance the READ index 67 * When the firmware places a packet in a buffer, it will advance the READ index
68 * and fire the RX interrupt. The driver can then query the READ index and 68 * and fire the RX interrupt. The driver can then query the READ index and
@@ -74,13 +74,13 @@
74 * iwl->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled 74 * iwl->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled
75 * to replenish the iwl->rxq->rx_free. 75 * to replenish the iwl->rxq->rx_free.
76 * + In il_rx_replenish (scheduled) if 'processed' != 'read' then the 76 * + In il_rx_replenish (scheduled) if 'processed' != 'read' then the
77 * iwl->rxq is replenished and the READ INDEX is updated (updating the 77 * iwl->rxq is replenished and the READ IDX is updated (updating the
78 * 'processed' and 'read' driver indexes as well) 78 * 'processed' and 'read' driver indexes as well)
79 * + A received packet is processed and handed to the kernel network stack, 79 * + A received packet is processed and handed to the kernel network stack,
80 * detached from the iwl->rxq. The driver 'processed' index is updated. 80 * detached from the iwl->rxq. The driver 'processed' index is updated.
81 * + The Host/Firmware iwl->rxq is replenished at tasklet time from the rx_free 81 * + The Host/Firmware iwl->rxq is replenished at tasklet time from the rx_free
82 * list. If there are no allocated buffers in iwl->rxq->rx_free, the READ 82 * list. If there are no allocated buffers in iwl->rxq->rx_free, the READ
83 * INDEX is not incremented and iwl->status(RX_STALLED) is set. If there 83 * IDX is not incremented and iwl->status(RX_STALLED) is set. If there
84 * were enough free buffers and RX_STALLED is set it is cleared. 84 * were enough free buffers and RX_STALLED is set it is cleared.
85 * 85 *
86 * 86 *
@@ -96,7 +96,7 @@
96 * 96 *
97 * -- enable interrupts -- 97 * -- enable interrupts --
98 * ISR - il_rx() Detach il_rx_bufs from pool up to the 98 * ISR - il_rx() Detach il_rx_bufs from pool up to the
99 * READ INDEX, detaching the SKB from the pool. 99 * READ IDX, detaching the SKB from the pool.
100 * Moves the packet buffer from queue to rx_used. 100 * Moves the packet buffer from queue to rx_used.
101 * Calls il_rx_queue_restock to refill any empty 101 * Calls il_rx_queue_restock to refill any empty
102 * slots. 102 * slots.
diff --git a/drivers/net/wireless/iwlegacy/iwl-tx.c b/drivers/net/wireless/iwlegacy/iwl-tx.c
index b9c417ce52b3..45114b495b3e 100644
--- a/drivers/net/wireless/iwlegacy/iwl-tx.c
+++ b/drivers/net/wireless/iwlegacy/iwl-tx.c
@@ -500,7 +500,7 @@ int il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
500 500
501 out_cmd->hdr.flags = 0; 501 out_cmd->hdr.flags = 0;
502 out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(il->cmd_queue) | 502 out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(il->cmd_queue) |
503 INDEX_TO_SEQ(q->write_ptr)); 503 IDX_TO_SEQ(q->write_ptr));
504 if (cmd->flags & CMD_SIZE_HUGE) 504 if (cmd->flags & CMD_SIZE_HUGE)
505 out_cmd->hdr.sequence |= SEQ_HUGE_FRAME; 505 out_cmd->hdr.sequence |= SEQ_HUGE_FRAME;
506 len = sizeof(struct il_device_cmd); 506 len = sizeof(struct il_device_cmd);
@@ -598,7 +598,7 @@ il_tx_cmd_complete(struct il_priv *il, struct il_rx_buf *rxb)
598 struct il_rx_pkt *pkt = rxb_addr(rxb); 598 struct il_rx_pkt *pkt = rxb_addr(rxb);
599 u16 sequence = le16_to_cpu(pkt->hdr.sequence); 599 u16 sequence = le16_to_cpu(pkt->hdr.sequence);
600 int txq_id = SEQ_TO_QUEUE(sequence); 600 int txq_id = SEQ_TO_QUEUE(sequence);
601 int index = SEQ_TO_INDEX(sequence); 601 int index = SEQ_TO_IDX(sequence);
602 int cmd_index; 602 int cmd_index;
603 bool huge = !!(pkt->hdr.sequence & SEQ_HUGE_FRAME); 603 bool huge = !!(pkt->hdr.sequence & SEQ_HUGE_FRAME);
604 struct il_device_cmd *cmd; 604 struct il_device_cmd *cmd;
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c
index 1fc9bfbc891e..017b29720423 100644
--- a/drivers/net/wireless/iwlegacy/iwl3945-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c
@@ -563,7 +563,7 @@ static int il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
563 */ 563 */
564 out_cmd->hdr.cmd = REPLY_TX; 564 out_cmd->hdr.cmd = REPLY_TX;
565 out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) | 565 out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) |
566 INDEX_TO_SEQ(q->write_ptr))); 566 IDX_TO_SEQ(q->write_ptr)));
567 567
568 /* Copy MAC header from skb into command buffer */ 568 /* Copy MAC header from skb into command buffer */
569 memcpy(tx_cmd->hdr, hdr, hdr_len); 569 memcpy(tx_cmd->hdr, hdr, hdr_len);
@@ -903,7 +903,7 @@ static void il3945_setup_rx_handlers(struct il_priv *il)
903 * WRITE = READ. 903 * WRITE = READ.
904 * 904 *
905 * During initialization, the host sets up the READ queue position to the first 905 * During initialization, the host sets up the READ queue position to the first
906 * INDEX position, and WRITE to the last (READ - 1 wrapped) 906 * IDX position, and WRITE to the last (READ - 1 wrapped)
907 * 907 *
908 * When the firmware places a packet in a buffer, it will advance the READ index 908 * When the firmware places a packet in a buffer, it will advance the READ index
909 * and fire the RX interrupt. The driver can then query the READ index and 909 * and fire the RX interrupt. The driver can then query the READ index and
@@ -915,13 +915,13 @@ static void il3945_setup_rx_handlers(struct il_priv *il)
915 * iwl->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled 915 * iwl->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled
916 * to replenish the iwl->rxq->rx_free. 916 * to replenish the iwl->rxq->rx_free.
917 * + In il3945_rx_replenish (scheduled) if 'processed' != 'read' then the 917 * + In il3945_rx_replenish (scheduled) if 'processed' != 'read' then the
918 * iwl->rxq is replenished and the READ INDEX is updated (updating the 918 * iwl->rxq is replenished and the READ IDX is updated (updating the
919 * 'processed' and 'read' driver indexes as well) 919 * 'processed' and 'read' driver indexes as well)
920 * + A received packet is processed and handed to the kernel network stack, 920 * + A received packet is processed and handed to the kernel network stack,
921 * detached from the iwl->rxq. The driver 'processed' index is updated. 921 * detached from the iwl->rxq. The driver 'processed' index is updated.
922 * + The Host/Firmware iwl->rxq is replenished at tasklet time from the rx_free 922 * + The Host/Firmware iwl->rxq is replenished at tasklet time from the rx_free
923 * list. If there are no allocated buffers in iwl->rxq->rx_free, the READ 923 * list. If there are no allocated buffers in iwl->rxq->rx_free, the READ
924 * INDEX is not incremented and iwl->status(RX_STALLED) is set. If there 924 * IDX is not incremented and iwl->status(RX_STALLED) is set. If there
925 * were enough free buffers and RX_STALLED is set it is cleared. 925 * were enough free buffers and RX_STALLED is set it is cleared.
926 * 926 *
927 * 927 *
@@ -936,7 +936,7 @@ static void il3945_setup_rx_handlers(struct il_priv *il)
936 * 936 *
937 * -- enable interrupts -- 937 * -- enable interrupts --
938 * ISR - il3945_rx() Detach il_rx_bufs from pool up to the 938 * ISR - il3945_rx() Detach il_rx_bufs from pool up to the
939 * READ INDEX, detaching the SKB from the pool. 939 * READ IDX, detaching the SKB from the pool.
940 * Moves the packet buffer from queue to rx_used. 940 * Moves the packet buffer from queue to rx_used.
941 * Calls il3945_rx_queue_restock to refill any empty 941 * Calls il3945_rx_queue_restock to refill any empty
942 * slots. 942 * slots.