aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945-hw.h6
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945-rs.c110
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945.c314
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-hw.h36
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-lib.c4
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-rs.c290
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-sta.c14
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-tx.c34
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965.c84
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965.h4
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-commands.h42
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-csr.h6
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-dev.h34
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-eeprom.c30
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-eeprom.h2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-fh.h30
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-helpers.h16
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-led.c2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-legacy-rs.h6
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-prph.h18
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-rx.c22
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-sta.c14
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-sta.h2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-tx.c36
-rw-r--r--drivers/net/wireless/iwlegacy/iwl3945-base.c44
-rw-r--r--drivers/net/wireless/iwlegacy/iwl4965-base.c36
26 files changed, 618 insertions, 618 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-hw.h b/drivers/net/wireless/iwlegacy/iwl-3945-hw.h
index fcb466a2f06..53e5fb4373d 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945-hw.h
+++ b/drivers/net/wireless/iwlegacy/iwl-3945-hw.h
@@ -81,7 +81,7 @@
/*
* Mapping of a Tx power level, at factory calibration temperature,
- * to a radio/DSP gain table index.
+ * to a radio/DSP gain table idx.
* One for each of 5 "sample" power levels in each band.
* v_det is measured at the factory, using the 3945's built-in power amplifier
* (PA) output voltage detector. This same detector is used during Tx of
@@ -91,13 +91,13 @@
* DO NOT ALTER THIS STRUCTURE!!!
*/
struct il3945_eeprom_txpower_sample {
- u8 gain_index; /* index into power (gain) setup table ... */
+ u8 gain_idx; /* idx into power (gain) setup table ... */
s8 power; /* ... for this pwr level for this chnl group */
u16 v_det; /* PA output voltage */
} __packed;
/*
- * Mappings of Tx power levels -> nominal radio/DSP gain table indexes.
+ * Mappings of Tx power levels -> nominal radio/DSP gain table idxes.
* One for each channel group (a.k.a. "band") (1 for BG, 4 for A).
* Tx power setup code interpolates between the 5 "sample" power levels
* to determine the nominal setup for a requested power level.
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
index 4d83c629224..f84ed5ecc67 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
@@ -60,7 +60,7 @@ static s32 il3945_expected_tpt_b[RATE_COUNT_3945] = {
struct il3945_tpt_entry {
s8 min_rssi;
- u8 index;
+ u8 idx;
};
static struct il3945_tpt_entry il3945_tpt_table_a[] = {
@@ -98,9 +98,9 @@ static struct il3945_tpt_entry il3945_tpt_table_g[] = {
#define RATE_DECREASE_TH 1920
#define RATE_RETRY_TH 15
-static u8 il3945_get_rate_index_by_rssi(s32 rssi, enum ieee80211_band band)
+static u8 il3945_get_rate_idx_by_rssi(s32 rssi, enum ieee80211_band band)
{
- u32 index = 0;
+ u32 idx = 0;
u32 table_size = 0;
struct il3945_tpt_entry *tpt_table = NULL;
@@ -123,12 +123,12 @@ static u8 il3945_get_rate_index_by_rssi(s32 rssi, enum ieee80211_band band)
break;
}
- while (index < table_size && rssi < tpt_table[index].min_rssi)
- index++;
+ while (idx < table_size && rssi < tpt_table[idx].min_rssi)
+ idx++;
- index = min(index, (table_size - 1));
+ idx = min(idx, (table_size - 1));
- return tpt_table[index].index;
+ return tpt_table[idx].idx;
}
static void il3945_clear_win(struct il3945_rate_scale_data *win)
@@ -168,7 +168,7 @@ static int il3945_rate_scale_flush_wins(struct il3945_rs_sta *rs_sta)
if (time_after(jiffies, rs_sta->win[i].stamp +
RATE_WIN_FLUSH)) {
D_RATE("flushing %d samples of rate "
- "index %d\n",
+ "idx %d\n",
rs_sta->win[i].counter, i);
il3945_clear_win(&rs_sta->win[i]);
} else
@@ -256,7 +256,7 @@ static void il3945_bg_rate_scale_flush(unsigned long data)
*/
static void il3945_collect_tx_data(struct il3945_rs_sta *rs_sta,
struct il3945_rate_scale_data *win,
- int success, int retries, int index)
+ int success, int retries, int idx)
{
unsigned long flags;
s32 fail_count;
@@ -318,7 +318,7 @@ static void il3945_collect_tx_data(struct il3945_rs_sta *rs_sta,
if (fail_count >= RATE_MIN_FAILURE_TH ||
win->success_counter >= RATE_MIN_SUCCESS_TH)
win->average_tpt = ((win->success_ratio *
- rs_sta->expected_tpt[index] + 64) / 128);
+ rs_sta->expected_tpt[idx] + 64) / 128);
else
win->average_tpt = IL_INVALID_VALUE;
@@ -447,7 +447,7 @@ static void il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *
struct sk_buff *skb)
{
s8 retries = 0, current_count;
- int scale_rate_index, first_index, last_index;
+ int scale_rate_idx, first_idx, last_idx;
unsigned long flags;
struct il_priv *il = (struct il_priv *)il_rate;
struct il3945_rs_sta *rs_sta = il_sta;
@@ -460,9 +460,9 @@ static void il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *
if (retries > RATE_RETRY_TH)
retries = RATE_RETRY_TH;
- first_index = sband->bitrates[info->status.rates[0].idx].hw_value;
- if (first_index < 0 || first_index >= RATE_COUNT_3945) {
- D_RATE("leave: Rate out of bounds: %d\n", first_index);
+ first_idx = sband->bitrates[info->status.rates[0].idx].hw_value;
+ if (first_idx < 0 || first_idx >= RATE_COUNT_3945) {
+ D_RATE("leave: Rate out of bounds: %d\n", first_idx);
return;
}
@@ -480,8 +480,8 @@ static void il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *
rs_sta->tx_packets++;
- scale_rate_index = first_index;
- last_index = first_index;
+ scale_rate_idx = first_idx;
+ last_idx = first_idx;
/*
* Update the win for each rate. We determine which rates
@@ -489,42 +489,42 @@ static void il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *
* of retries configured for each rate -- currently set to the
* il value 'retry_rate' vs. rate specific
*
- * On exit from this while loop last_index indicates the rate
+ * On exit from this while loop last_idx indicates the rate
* at which the frame was finally transmitted (or failed if no
* ACK)
*/
while (retries > 1) {
if ((retries - 1) < il->retry_rate) {
current_count = (retries - 1);
- last_index = scale_rate_index;
+ last_idx = scale_rate_idx;
} else {
current_count = il->retry_rate;
- last_index = il3945_rs_next_rate(il,
- scale_rate_index);
+ last_idx = il3945_rs_next_rate(il,
+ scale_rate_idx);
}
/* Update this rate accounting for as many retries
* as was used for it (per current_count) */
il3945_collect_tx_data(rs_sta,
- &rs_sta->win[scale_rate_index],
- 0, current_count, scale_rate_index);
+ &rs_sta->win[scale_rate_idx],
+ 0, current_count, scale_rate_idx);
D_RATE("Update rate %d for %d retries.\n",
- scale_rate_index, current_count);
+ scale_rate_idx, current_count);
retries -= current_count;
- scale_rate_index = last_index;
+ scale_rate_idx = last_idx;
}
- /* Update the last index win with success/failure based on ACK */
+ /* Update the last idx win with success/failure based on ACK */
D_RATE("Update rate %d with %s.\n",
- last_index,
+ last_idx,
(info->flags & IEEE80211_TX_STAT_ACK) ?
"success" : "failure");
il3945_collect_tx_data(rs_sta,
- &rs_sta->win[last_index],
- info->flags & IEEE80211_TX_STAT_ACK, 1, last_index);
+ &rs_sta->win[last_idx],
+ info->flags & IEEE80211_TX_STAT_ACK, 1, last_idx);
/* We updated the rate scale win -- if its been more than
* flush_time since the last run, schedule the flush
@@ -547,7 +547,7 @@ static void il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *
}
static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
- u8 index, u16 rate_mask, enum ieee80211_band band)
+ u8 idx, u16 rate_mask, enum ieee80211_band band)
{
u8 high = RATE_INVALID;
u8 low = RATE_INVALID;
@@ -560,7 +560,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
u32 mask;
/* Find the previous rate that is in the rate mask */
- i = index - 1;
+ i = idx - 1;
for (mask = (1 << i); i >= 0; i--, mask >>= 1) {
if (rate_mask & mask) {
low = i;
@@ -569,7 +569,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
}
/* Find the next rate that is in the rate mask */
- i = index + 1;
+ i = idx + 1;
for (mask = (1 << i); i < RATE_COUNT_3945;
i++, mask <<= 1) {
if (rate_mask & mask) {
@@ -581,7 +581,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
return (high << 8) | low;
}
- low = index;
+ low = idx;
while (low != RATE_INVALID) {
if (rs_sta->tgg)
low = il3945_rates[low].prev_rs_tgg;
@@ -594,7 +594,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
D_RATE("Skipping masked lower rate: %d\n", low);
}
- high = index;
+ high = idx;
while (high != RATE_INVALID) {
if (rs_sta->tgg)
high = il3945_rates[high].next_rs_tgg;
@@ -622,7 +622,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
* the entire A/B/G spectrum vs. being limited to just one particular
* hw_mode.
*
- * As such, we can't convert the index obtained below into the hw_mode's
+ * As such, we can't convert the idx obtained below into the hw_mode's
* rate table and must reference the driver allocated rate table
*
*/
@@ -634,7 +634,7 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
u8 low = RATE_INVALID;
u8 high = RATE_INVALID;
u16 high_low;
- int index;
+ int idx;
struct il3945_rs_sta *rs_sta = il_sta;
struct il3945_rate_scale_data *win = NULL;
int current_tpt = IL_INVALID_VALUE;
@@ -668,7 +668,7 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
if (max_rate_idx < 0 || max_rate_idx >= RATE_COUNT)
max_rate_idx = -1;
- index = min(rs_sta->last_txrate_idx & 0xffff, RATE_COUNT_3945 - 1);
+ idx = min(rs_sta->last_txrate_idx & 0xffff, RATE_COUNT_3945 - 1);
if (sband->band == IEEE80211_BAND_5GHZ)
rate_mask = rate_mask << IL_FIRST_OFDM_RATE;
@@ -679,19 +679,19 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
* to rssi value
*/
if (rs_sta->start_rate != RATE_INVALID) {
- if (rs_sta->start_rate < index &&
+ if (rs_sta->start_rate < idx &&
(rate_mask & (1 << rs_sta->start_rate)))
- index = rs_sta->start_rate;
+ idx = rs_sta->start_rate;
rs_sta->start_rate = RATE_INVALID;
}
/* force user max rate if set by user */
- if (max_rate_idx != -1 && max_rate_idx < index) {
+ if (max_rate_idx != -1 && max_rate_idx < idx) {
if (rate_mask & (1 << max_rate_idx))
- index = max_rate_idx;
+ idx = max_rate_idx;
}
- win = &(rs_sta->win[index]);
+ win = &(rs_sta->win[idx]);
fail_count = win->counter - win->success_counter;
@@ -702,7 +702,7 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
D_RATE("Invalid average_tpt on rate %d: "
"counter: %d, success_counter: %d, "
"expected_tpt is %sNULL\n",
- index,
+ idx,
win->counter,
win->success_counter,
rs_sta->expected_tpt ? "not " : "");
@@ -715,7 +715,7 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
current_tpt = win->average_tpt;
- high_low = il3945_get_adjacent_rate(rs_sta, index, rate_mask,
+ high_low = il3945_get_adjacent_rate(rs_sta, idx, rate_mask,
sband->band);
low = high_low & 0xff;
high = (high_low >> 8) & 0xff;
@@ -800,13 +800,13 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
/* Decrese rate */
if (low != RATE_INVALID)
- index = low;
+ idx = low;
break;
case 1:
/* Increase rate */
if (high != RATE_INVALID)
- index = high;
+ idx = high;
break;
@@ -817,21 +817,21 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
}
D_RATE("Selected %d (action %d) - low %d high %d\n",
- index, scale_action, low, high);
+ idx, scale_action, low, high);
out:
if (sband->band == IEEE80211_BAND_5GHZ) {
- if (WARN_ON_ONCE(index < IL_FIRST_OFDM_RATE))
- index = IL_FIRST_OFDM_RATE;
- rs_sta->last_txrate_idx = index;
- info->control.rates[0].idx = index - IL_FIRST_OFDM_RATE;
+ if (WARN_ON_ONCE(idx < IL_FIRST_OFDM_RATE))
+ idx = IL_FIRST_OFDM_RATE;
+ rs_sta->last_txrate_idx = idx;
+ info->control.rates[0].idx = idx - IL_FIRST_OFDM_RATE;
} else {
- rs_sta->last_txrate_idx = index;
+ rs_sta->last_txrate_idx = idx;
info->control.rates[0].idx = rs_sta->last_txrate_idx;
}
- D_RATE("leave: %d\n", index);
+ D_RATE("leave: %d\n", idx);
}
#ifdef CONFIG_MAC80211_DEBUGFS
@@ -855,7 +855,7 @@ static ssize_t il3945_sta_dbgfs_stats_table_read(struct file *file,
if (!buff)
return -ENOMEM;
- desc += sprintf(buff + desc, "tx packets=%d last rate index=%d\n"
+ desc += sprintf(buff + desc, "tx packets=%d last rate idx=%d\n"
"rate=0x%X flush time %d\n",
lq_sta->tx_packets,
lq_sta->last_txrate_idx,
@@ -977,9 +977,9 @@ void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
D_RATE("Network RSSI: %d\n", rssi);
- rs_sta->start_rate = il3945_get_rate_index_by_rssi(rssi, il->band);
+ rs_sta->start_rate = il3945_get_rate_idx_by_rssi(rssi, il->band);
- D_RATE("leave: rssi %d assign rate index: "
+ D_RATE("leave: rssi %d assign rate idx: "
"%d (plcp 0x%x)\n", rssi, rs_sta->start_rate,
il3945_rates[rs_sta->start_rate].plcp);
rcu_read_unlock();
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945.c b/drivers/net/wireless/iwlegacy/iwl-3945.c
index 3908bff8e0a..96a76280494 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945.c
+++ b/drivers/net/wireless/iwlegacy/iwl-3945.c
@@ -86,12 +86,12 @@ const struct il3945_rate_info il3945_rates[RATE_COUNT_3945] = {
IL_DECLARE_RATE_INFO(54, 48, INV, 48, INV, 48, INV),/* 54mbps */
};
-static inline u8 il3945_get_prev_ieee_rate(u8 rate_index)
+static inline u8 il3945_get_prev_ieee_rate(u8 rate_idx)
{
- u8 rate = il3945_rates[rate_index].prev_ieee;
+ u8 rate = il3945_rates[rate_idx].prev_ieee;
if (rate == RATE_INVALID)
- rate = rate_index;
+ rate = rate_idx;
return rate;
}
@@ -270,12 +270,12 @@ int il3945_rs_next_rate(struct il_priv *il, int rate)
/**
* il3945_tx_queue_reclaim - Reclaim Tx queue entries already Tx'd
*
- * When FW advances 'R' index, all entries between old and new 'R' index
+ * When FW advances 'R' idx, all entries between old and new 'R' idx
* need to be reclaimed. As result, some free space forms. If there is
* enough free space (> low mark), wake the stack that feeds us.
*/
static void il3945_tx_queue_reclaim(struct il_priv *il,
- int txq_id, int index)
+ int txq_id, int idx)
{
struct il_tx_queue *txq = &il->txq[txq_id];
struct il_queue *q = &txq->q;
@@ -283,8 +283,8 @@ static void il3945_tx_queue_reclaim(struct il_priv *il,
BUG_ON(txq_id == IL39_CMD_QUEUE_NUM);
- for (index = il_queue_inc_wrap(index, q->n_bd);
- q->read_ptr != index;
+ for (idx = il_queue_inc_wrap(idx, q->n_bd);
+ q->read_ptr != idx;
q->read_ptr = il_queue_inc_wrap(q->read_ptr, q->n_bd)) {
tx_info = &txq->txb[txq->q.read_ptr];
@@ -307,7 +307,7 @@ static void il3945_rx_reply_tx(struct il_priv *il,
struct il_rx_pkt *pkt = rxb_addr(rxb);
u16 sequence = le16_to_cpu(pkt->hdr.sequence);
int txq_id = SEQ_TO_QUEUE(sequence);
- int index = SEQ_TO_IDX(sequence);
+ int idx = SEQ_TO_IDX(sequence);
struct il_tx_queue *txq = &il->txq[txq_id];
struct ieee80211_tx_info *info;
struct il3945_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
@@ -315,10 +315,10 @@ static void il3945_rx_reply_tx(struct il_priv *il,
int rate_idx;
int fail;
- if (index >= txq->q.n_bd || il_queue_used(&txq->q, index) == 0) {
- IL_ERR("Read index for DMA queue txq_id (%d) index %d "
+ if (idx >= txq->q.n_bd || il_queue_used(&txq->q, idx) == 0) {
+ IL_ERR("Read idx for DMA queue txq_id (%d) idx %d "
"is out of range [0-%d] %d %d\n", txq_id,
- index, txq->q.n_bd, txq->q.write_ptr,
+ idx, txq->q.n_bd, txq->q.write_ptr,
txq->q.read_ptr);
return;
}
@@ -345,8 +345,8 @@ static void il3945_rx_reply_tx(struct il_priv *il,
txq_id, il3945_get_tx_fail_reason(status), status,
tx_resp->rate, tx_resp->failure_frame);
- D_TX_REPLY("Tx queue reclaim %d\n", index);
- il3945_tx_queue_reclaim(il, txq_id, index);
+ D_TX_REPLY("Tx queue reclaim %d\n", idx);
+ il3945_tx_queue_reclaim(il, txq_id, idx);
if (status & TX_ABORT_REQUIRED_MSK)
IL_ERR("TODO: Implement Tx ABORT REQUIRED!!!\n");
@@ -616,15 +616,15 @@ int il3945_hw_txq_attach_buf_to_tfd(struct il_priv *il,
}
/**
- * il3945_hw_txq_free_tfd - Free one TFD, those at index [txq->q.read_ptr]
+ * il3945_hw_txq_free_tfd - Free one TFD, those at idx [txq->q.read_ptr]
*
- * Does NOT advance any indexes
+ * Does NOT advance any idxes
*/
void il3945_hw_txq_free_tfd(struct il_priv *il, struct il_tx_queue *txq)
{
struct il3945_tfd *tfd_tmp = (struct il3945_tfd *)txq->tfds;
- int index = txq->q.read_ptr;
- struct il3945_tfd *tfd = &tfd_tmp[index];
+ int idx = txq->q.read_ptr;
+ struct il3945_tfd *tfd = &tfd_tmp[idx];
struct pci_dev *dev = il->pci_dev;
int i;
int counter;
@@ -640,8 +640,8 @@ void il3945_hw_txq_free_tfd(struct il_priv *il, struct il_tx_queue *txq)
/* Unmap tx_cmd */
if (counter)
pci_unmap_single(dev,
- dma_unmap_addr(&txq->meta[index], mapping),
- dma_unmap_len(&txq->meta[index], len),
+ dma_unmap_addr(&txq->meta[idx], mapping),
+ dma_unmap_len(&txq->meta[idx], len),
PCI_DMA_TODEVICE);
/* unmap chunks if any */
@@ -675,7 +675,7 @@ void il3945_hw_build_tx_cmd_rate(struct il_priv *il,
int sta_id, int tx_id)
{
u16 hw_value = ieee80211_get_tx_rate(il->hw, info)->hw_value;
- u16 rate_index = min(hw_value & 0xffff, RATE_COUNT_3945);
+ u16 rate_idx = min(hw_value & 0xffff, RATE_COUNT_3945);
u16 rate_mask;
int rate;
u8 rts_retry_limit;
@@ -684,7 +684,7 @@ void il3945_hw_build_tx_cmd_rate(struct il_priv *il,
__le16 fc = hdr->frame_control;
struct il3945_tx_cmd *tx_cmd = (struct il3945_tx_cmd *)cmd->cmd.payload;
- rate = il3945_rates[rate_index].plcp;
+ rate = il3945_rates[rate_idx].plcp;
tx_flags = tx_cmd->tx_flags;
/* We need to figure out how to get the sta->supp_rates while
@@ -1040,7 +1040,7 @@ void il3945_hw_txq_ctx_stop(struct il_priv *il)
/**
* il3945_hw_reg_adjust_power_by_temp
- * return index delta into power gain settings table
+ * return idx delta into power gain settings table
*/
static int il3945_hw_reg_adjust_power_by_temp(int new_reading, int old_reading)
{
@@ -1298,13 +1298,13 @@ static struct il3945_tx_power power_gain_table[2][IL_MAX_GAIN_ENTRIES] = {
{3, 120} } /* 5.x GHz, lowest power */
};
-static inline u8 il3945_hw_reg_fix_power_index(int index)
+static inline u8 il3945_hw_reg_fix_power_idx(int idx)
{
- if (index < 0)
+ if (idx < 0)
return 0;
- if (index >= IL_MAX_GAIN_ENTRIES)
+ if (idx >= IL_MAX_GAIN_ENTRIES)
return IL_MAX_GAIN_ENTRIES - 1;
- return (u8) index;
+ return (u8) idx;
}
/* Kick off thermal recalibration check every 60 seconds */
@@ -1316,16 +1316,16 @@ static inline u8 il3945_hw_reg_fix_power_index(int index)
* Set (in our channel info database) the direct scan Tx power for 1 Mbit (CCK)
* or 6 Mbit (OFDM) rates.
*/
-static void il3945_hw_reg_set_scan_power(struct il_priv *il, u32 scan_tbl_index,
- s32 rate_index, const s8 *clip_pwrs,
+static void il3945_hw_reg_set_scan_power(struct il_priv *il, u32 scan_tbl_idx,
+ s32 rate_idx, const s8 *clip_pwrs,
struct il_channel_info *ch_info,
- int band_index)
+ int band_idx)
{
struct il3945_scan_power_info *scan_power_info;
s8 power;
- u8 power_index;
+ u8 power_idx;
- scan_power_info = &ch_info->scan_pwr_info[scan_tbl_index];
+ scan_power_info = &ch_info->scan_pwr_info[scan_tbl_idx];
/* use this channel group's 6Mbit clipping/saturation pwr,
* but cap at regulatory scan power restriction (set during init
@@ -1337,30 +1337,30 @@ static void il3945_hw_reg_set_scan_power(struct il_priv *il, u32 scan_tbl_index,
/* find difference between new scan *power* and current "normal"
* Tx *power* for 6Mb. Use this difference (x2) to adjust the
- * current "normal" temperature-compensated Tx power *index* for
+ * current "normal" temperature-compensated Tx power *idx* for
* this rate (1Mb or 6Mb) to yield new temp-compensated scan power
- * *index*. */
- power_index = ch_info->power_info[rate_index].power_table_index
+ * *idx*. */
+ power_idx = ch_info->power_info[rate_idx].power_table_idx
- (power - ch_info->power_info
[RATE_6M_IDX_TABLE].requested_power) * 2;
- /* store reference index that we use when adjusting *all* scan
+ /* store reference idx that we use when adjusting *all* scan
* powers. So we can accommodate user (all channel) or spectrum
* management (single channel) power changes "between" temperature
* feedback compensation procedures.
- * don't force fit this reference index into gain table; it may be a
+ * don't force fit this reference idx into gain table; it may be a
* negative number. This will help avoid errors when we're at
* the lower bounds (highest gains, for warmest temperatures)
* of the table. */
/* don't exceed table bounds for "real" setting */
- power_index = il3945_hw_reg_fix_power_index(power_index);
+ power_idx = il3945_hw_reg_fix_power_idx(power_idx);
- scan_power_info->power_table_index = power_index;
+ scan_power_info->power_table_idx = power_idx;
scan_power_info->tpc.tx_gain =
- power_gain_table[band_index][power_index].tx_gain;
+ power_gain_table[band_idx][power_idx].tx_gain;
scan_power_info->tpc.dsp_atten =
- power_gain_table[band_index][power_index].dsp_atten;
+ power_gain_table[band_idx][power_idx].dsp_atten;
}
/**
@@ -1438,7 +1438,7 @@ static int il3945_send_tx_power(struct il_priv *il)
* il3945_hw_reg_set_new_power - Configures power tables at new levels
* @ch_info: Channel to update. Uses power_info.requested_power.
*
- * Replace requested_power and base_power_index ch_info fields for
+ * Replace requested_power and base_power_idx ch_info fields for
* one channel.
*
* Called if user or spectrum management changes power preferences.
@@ -1460,7 +1460,7 @@ static int il3945_hw_reg_set_new_power(struct il_priv *il,
int power;
/* Get this chnlgrp's rate-to-max/clip-powers table */
- clip_pwrs = il->_3945.clip_groups[ch_info->group_index].clip_powers;
+ clip_pwrs = il->_3945.clip_groups[ch_info->group_idx].clip_powers;
/* Get this channel's rate-to-current-power settings table */
power_info = ch_info->power_info;
@@ -1476,9 +1476,9 @@ static int il3945_hw_reg_set_new_power(struct il_priv *il,
continue;
/* find difference between old and new requested powers,
- * update base (non-temp-compensated) power index */
+ * update base (non-temp-compensated) power idx */
delta_idx = (power - power_info->requested_power) * 2;
- power_info->base_power_index -= delta_idx;
+ power_info->base_power_idx -= delta_idx;
/* save new requested power value */
power_info->requested_power = power;
@@ -1496,9 +1496,9 @@ static int il3945_hw_reg_set_new_power(struct il_priv *il,
/* do all CCK rates' il3945_channel_power_info structures */
for (i = RATE_1M_IDX_TABLE; i <= RATE_11M_IDX_TABLE; i++) {
power_info->requested_power = power;
- power_info->base_power_index =
+ power_info->base_power_idx =
ch_info->power_info[RATE_12M_IDX_TABLE].
- base_power_index + IL_CCK_FROM_OFDM_IDX_DIFF;
+ base_power_idx + IL_CCK_FROM_OFDM_IDX_DIFF;
++power_info;
}
}
@@ -1537,7 +1537,7 @@ static int il3945_hw_reg_get_ch_txpower_limit(struct il_channel_info *ch_info)
* Compensate txpower settings of *all* channels for temperature.
* This only accounts for the difference between current temperature
* and the factory calibration temperatures, and bases the new settings
- * on the channel's base_power_index.
+ * on the channel's base_power_idx.
*
* If RxOn is "associated", this sends the new Txpower to NIC!
*/
@@ -1545,11 +1545,11 @@ static int il3945_hw_reg_comp_txpower_temp(struct il_priv *il)
{
struct il_channel_info *ch_info = NULL;
struct il3945_eeprom *eeprom = (struct il3945_eeprom *)il->eeprom;
- int delta_index;
+ int delta_idx;
const s8 *clip_pwrs; /* array of h/w max power levels for each rate */
u8 a_band;
- u8 rate_index;
- u8 scan_tbl_index;
+ u8 rate_idx;
+ u8 scan_tbl_idx;
u8 i;
int ref_temp;
int temperature = il->temperature;
@@ -1565,41 +1565,41 @@ static int il3945_hw_reg_comp_txpower_temp(struct il_priv *il)
a_band = il_is_channel_a_band(ch_info);
/* Get this chnlgrp's factory calibration temperature */
- ref_temp = (s16)eeprom->groups[ch_info->group_index].
+ ref_temp = (s16)eeprom->groups[ch_info->group_idx].
temperature;
- /* get power index adjustment based on current and factory
+ /* get power idx adjustment based on current and factory
* temps */
- delta_index = il3945_hw_reg_adjust_power_by_temp(temperature,
+ delta_idx = il3945_hw_reg_adjust_power_by_temp(temperature,
ref_temp);
/* set tx power value for all rates, OFDM and CCK */
- for (rate_index = 0; rate_index < RATE_COUNT_3945;
- rate_index++) {
+ for (rate_idx = 0; rate_idx < RATE_COUNT_3945;
+ rate_idx++) {
int power_idx =
- ch_info->power_info[rate_index].base_power_index;
+ ch_info->power_info[rate_idx].base_power_idx;
/* temperature compensate */
- power_idx += delta_index;
+ power_idx += delta_idx;
/* stay within table range */
- power_idx = il3945_hw_reg_fix_power_index(power_idx);
- ch_info->power_info[rate_index].
- power_table_index = (u8) power_idx;
- ch_info->power_info[rate_index].tpc =
+ power_idx = il3945_hw_reg_fix_power_idx(power_idx);
+ ch_info->power_info[rate_idx].
+ power_table_idx = (u8) power_idx;
+ ch_info->power_info[rate_idx].tpc =
power_gain_table[a_band][power_idx];
}
/* Get this chnlgrp's rate-to-max/clip-powers table */
- clip_pwrs = il->_3945.clip_groups[ch_info->group_index].clip_powers;
+ clip_pwrs = il->_3945.clip_groups[ch_info->group_idx].clip_powers;
/* set scan tx power, 1Mbit for CCK, 6Mbit for OFDM */
- for (scan_tbl_index = 0;
- scan_tbl_index < IL_NUM_SCAN_RATES; scan_tbl_index++) {
- s32 actual_index = (scan_tbl_index == 0) ?
+ for (scan_tbl_idx = 0;
+ scan_tbl_idx < IL_NUM_SCAN_RATES; scan_tbl_idx++) {
+ s32 actual_idx = (scan_tbl_idx == 0) ?
RATE_1M_IDX_TABLE : RATE_6M_IDX_TABLE;
- il3945_hw_reg_set_scan_power(il, scan_tbl_index,
- actual_index, clip_pwrs,
+ il3945_hw_reg_set_scan_power(il, scan_tbl_idx,
+ actual_idx, clip_pwrs,
ch_info, a_band);
}
}
@@ -1878,7 +1878,7 @@ static void il3945_bg_reg_txpower_periodic(struct work_struct *work)
}
/**
- * il3945_hw_reg_get_ch_grp_index - find the channel-group index (0-4)
+ * il3945_hw_reg_get_ch_grp_idx - find the channel-group idx (0-4)
* for the channel.
*
* This function is used when initializing channel-info structs.
@@ -1888,48 +1888,48 @@ static void il3945_bg_reg_txpower_periodic(struct work_struct *work)
* on A-band, EEPROM's "group frequency" entries represent the top
* channel in each group 1-4. Group 5 All B/G channels are in group 0.
*/
-static u16 il3945_hw_reg_get_ch_grp_index(struct il_priv *il,
+static u16 il3945_hw_reg_get_ch_grp_idx(struct il_priv *il,
const struct il_channel_info *ch_info)
{
struct il3945_eeprom *eeprom = (struct il3945_eeprom *)il->eeprom;
struct il3945_eeprom_txpower_group *ch_grp = &eeprom->groups[0];
u8 group;
- u16 group_index = 0; /* based on factory calib frequencies */
+ u16 group_idx = 0; /* based on factory calib frequencies */
u8 grp_channel;
- /* Find the group index for the channel ... don't use index 1(?) */
+ /* Find the group idx for the channel ... don't use idx 1(?) */
if (il_is_channel_a_band(ch_info)) {
for (group = 1; group < 5; group++) {
grp_channel = ch_grp[group].group_channel;
if (ch_info->channel <= grp_channel) {
- group_index = group;
+ group_idx = group;
break;
}
}
/* group 4 has a few channels *above* its factory cal freq */
if (group == 5)
- group_index = 4;
+ group_idx = 4;
} else
- group_index = 0; /* 2.4 GHz, group 0 */
+ group_idx = 0; /* 2.4 GHz, group 0 */
D_POWER("Chnl %d mapped to grp %d\n", ch_info->channel,
- group_index);
- return group_index;
+ group_idx);
+ return group_idx;
}
/**
- * il3945_hw_reg_get_matched_power_index - Interpolate to get nominal index
+ * il3945_hw_reg_get_matched_power_idx - Interpolate to get nominal idx
*
- * Interpolate to get nominal (i.e. at factory calibration temperature) index
+ * Interpolate to get nominal (i.e. at factory calibration temperature) idx
* into radio/DSP gain settings table for requested power.
*/
-static int il3945_hw_reg_get_matched_power_index(struct il_priv *il,
+static int il3945_hw_reg_get_matched_power_idx(struct il_priv *il,
s8 requested_power,
- s32 setting_index, s32 *new_index)
+ s32 setting_idx, s32 *new_idx)
{
const struct il3945_eeprom_txpower_group *chnl_grp = NULL;
struct il3945_eeprom *eeprom = (struct il3945_eeprom *)il->eeprom;
- s32 index0, index1;
+ s32 idx0, idx1;
s32 power = 2 * requested_power;
s32 i;
const struct il3945_eeprom_txpower_sample *samples;
@@ -1937,45 +1937,45 @@ static int il3945_hw_reg_get_matched_power_index(struct il_priv *il,
s32 res;
s32 denominator;
- chnl_grp = &eeprom->groups[setting_index];
+ chnl_grp = &eeprom->groups[setting_idx];
samples = chnl_grp->samples;
for (i = 0; i < 5; i++) {
if (power == samples[i].power) {
- *new_index = samples[i].gain_index;
+ *new_idx = samples[i].gain_idx;
return 0;
}
}
if (power > samples[1].power) {
- index0 = 0;
- index1 = 1;
+ idx0 = 0;
+ idx1 = 1;
} else if (power > samples[2].power) {
- index0 = 1;
- index1 = 2;
+ idx0 = 1;
+ idx1 = 2;
} else if (power > samples[3].power) {
- index0 = 2;
- index1 = 3;
+ idx0 = 2;
+ idx1 = 3;
} else {
- index0 = 3;
- index1 = 4;
+ idx0 = 3;
+ idx1 = 4;
}
- denominator = (s32) samples[index1].power - (s32) samples[index0].power;
+ denominator = (s32) samples[idx1].power - (s32) samples[idx0].power;
if (denominator == 0)