Commit 2eb05816 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka

iwlegacy: s/IL_RATE/RATE/

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
parent 6ce1dc45
This diff is collapsed.
......@@ -52,26 +52,26 @@
#include "iwl-3945-debugfs.h"
#define IL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \
[IL_RATE_##r##M_INDEX] = { IL_RATE_##r##M_PLCP, \
IL_RATE_##r##M_IEEE, \
IL_RATE_##ip##M_INDEX, \
IL_RATE_##in##M_INDEX, \
IL_RATE_##rp##M_INDEX, \
IL_RATE_##rn##M_INDEX, \
IL_RATE_##pp##M_INDEX, \
IL_RATE_##np##M_INDEX, \
IL_RATE_##r##M_INDEX_TABLE, \
IL_RATE_##ip##M_INDEX_TABLE }
[RATE_##r##M_INDEX] = { RATE_##r##M_PLCP, \
RATE_##r##M_IEEE, \
RATE_##ip##M_INDEX, \
RATE_##in##M_INDEX, \
RATE_##rp##M_INDEX, \
RATE_##rn##M_INDEX, \
RATE_##pp##M_INDEX, \
RATE_##np##M_INDEX, \
RATE_##r##M_INDEX_TABLE, \
RATE_##ip##M_INDEX_TABLE }
/*
* Parameter order:
* rate, prev rate, next rate, prev tgg rate, next tgg rate
*
* If there isn't a valid next or previous rate then INV is used which
* maps to IL_RATE_INVALID
* maps to RATE_INVALID
*
*/
const struct il3945_rate_info il3945_rates[IL_RATE_COUNT_3945] = {
const struct il3945_rate_info il3945_rates[RATE_COUNT_3945] = {
IL_DECLARE_RATE_INFO(1, INV, 2, INV, 2, INV, 2), /* 1mbps */
IL_DECLARE_RATE_INFO(2, 1, 5, 1, 5, 1, 5), /* 2mbps */
IL_DECLARE_RATE_INFO(5, 2, 6, 2, 11, 2, 11), /*5.5mbps */
......@@ -90,7 +90,7 @@ static inline u8 il3945_get_prev_ieee_rate(u8 rate_index)
{
u8 rate = il3945_rates[rate_index].prev_ieee;
if (rate == IL_RATE_INVALID)
if (rate == RATE_INVALID)
rate = rate_index;
return rate;
}
......@@ -194,7 +194,7 @@ static int il3945_hwrate_to_plcp_idx(u8 plcp)
{
int idx;
for (idx = 0; idx < IL_RATE_COUNT_3945; idx++)
for (idx = 0; idx < RATE_COUNT_3945; idx++)
if (il3945_rates[idx].plcp == plcp)
return idx;
return -1;
......@@ -246,16 +246,16 @@ int il3945_rs_next_rate(struct il_priv *il, int rate)
switch (il->band) {
case IEEE80211_BAND_5GHZ:
if (rate == IL_RATE_12M_INDEX)
next_rate = IL_RATE_9M_INDEX;
else if (rate == IL_RATE_6M_INDEX)
next_rate = IL_RATE_6M_INDEX;
if (rate == RATE_12M_INDEX)
next_rate = RATE_9M_INDEX;
else if (rate == RATE_6M_INDEX)
next_rate = RATE_6M_INDEX;
break;
case IEEE80211_BAND_2GHZ:
if (!(il->_3945.sta_supp_rates & IL_OFDM_RATES_MASK) &&
il_is_associated(il)) {
if (rate == IL_RATE_11M_INDEX)
next_rate = IL_RATE_5M_INDEX;
if (rate == RATE_11M_INDEX)
next_rate = RATE_5M_INDEX;
}
break;
......@@ -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, IL_RATE_COUNT_3945);
u16 rate_index = min(hw_value & 0xffff, RATE_COUNT_3945);
u16 rate_mask;
int rate;
u8 rts_retry_limit;
......@@ -689,7 +689,7 @@ void il3945_hw_build_tx_cmd_rate(struct il_priv *il,
/* We need to figure out how to get the sta->supp_rates while
* in this running context */
rate_mask = IL_RATES_MASK_3945;
rate_mask = RATES_MASK_3945;
/* Set retry limit on DATA packets and Probe Responses*/
if (ieee80211_is_probe_resp(fc))
......@@ -1330,7 +1330,7 @@ static void il3945_hw_reg_set_scan_power(struct il_priv *il, u32 scan_tbl_index,
/* use this channel group's 6Mbit clipping/saturation pwr,
* but cap at regulatory scan power restriction (set during init
* based on eeprom channel data) for this channel. */
power = min(ch_info->scan_power, clip_pwrs[IL_RATE_6M_INDEX_TABLE]);
power = min(ch_info->scan_power, clip_pwrs[RATE_6M_INDEX_TABLE]);
power = min(power, il->tx_power_user_lmt);
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,
* *index*. */
power_index = ch_info->power_info[rate_index].power_table_index
- (power - ch_info->power_info
[IL_RATE_6M_INDEX_TABLE].requested_power) * 2;
[RATE_6M_INDEX_TABLE].requested_power) * 2;
/* store reference index that we use when adjusting *all* scan
* 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,
power_info = ch_info->power_info;
/* update OFDM Txpower settings */
for (i = IL_RATE_6M_INDEX_TABLE; i <= IL_RATE_54M_INDEX_TABLE;
for (i = RATE_6M_INDEX_TABLE; i <= RATE_54M_INDEX_TABLE;
i++, ++power_info) {
int delta_idx;
......@@ -1490,14 +1490,14 @@ static int il3945_hw_reg_set_new_power(struct il_priv *il,
* ... all CCK power settings for a given channel are the *same*. */
if (power_changed) {
power =
ch_info->power_info[IL_RATE_12M_INDEX_TABLE].
ch_info->power_info[RATE_12M_INDEX_TABLE].
requested_power + IL_CCK_FROM_OFDM_POWER_DIFF;
/* do all CCK rates' il3945_channel_power_info structures */
for (i = IL_RATE_1M_INDEX_TABLE; i <= IL_RATE_11M_INDEX_TABLE; i++) {
for (i = RATE_1M_INDEX_TABLE; i <= RATE_11M_INDEX_TABLE; i++) {
power_info->requested_power = power;
power_info->base_power_index =
ch_info->power_info[IL_RATE_12M_INDEX_TABLE].
ch_info->power_info[RATE_12M_INDEX_TABLE].
base_power_index + IL_CCK_FROM_OFDM_INDEX_DIFF;
++power_info;
}
......@@ -1574,7 +1574,7 @@ static int il3945_hw_reg_comp_txpower_temp(struct il_priv *il)
ref_temp);
/* set tx power value for all rates, OFDM and CCK */
for (rate_index = 0; rate_index < IL_RATE_COUNT_3945;
for (rate_index = 0; rate_index < RATE_COUNT_3945;
rate_index++) {
int power_idx =
ch_info->power_info[rate_index].base_power_index;
......@@ -1597,7 +1597,7 @@ static int il3945_hw_reg_comp_txpower_temp(struct il_priv *il)
for (scan_tbl_index = 0;
scan_tbl_index < IL_NUM_SCAN_RATES; scan_tbl_index++) {
s32 actual_index = (scan_tbl_index == 0) ?
IL_RATE_1M_INDEX_TABLE : IL_RATE_6M_INDEX_TABLE;
RATE_1M_INDEX_TABLE : RATE_6M_INDEX_TABLE;
il3945_hw_reg_set_scan_power(il, scan_tbl_index,
actual_index, clip_pwrs,
ch_info, a_band);
......@@ -2010,21 +2010,21 @@ static void il3945_hw_reg_init_channel_groups(struct il_priv *il)
/* fill in channel group's nominal powers for each rate */
for (rate_index = 0;
rate_index < IL_RATE_COUNT_3945; rate_index++, clip_pwrs++) {
rate_index < RATE_COUNT_3945; rate_index++, clip_pwrs++) {
switch (rate_index) {
case IL_RATE_36M_INDEX_TABLE:
case RATE_36M_INDEX_TABLE:
if (i == 0) /* B/G */
*clip_pwrs = satur_pwr;
else /* A */
*clip_pwrs = satur_pwr - 5;
break;
case IL_RATE_48M_INDEX_TABLE:
case RATE_48M_INDEX_TABLE:
if (i == 0)
*clip_pwrs = satur_pwr - 7;
else
*clip_pwrs = satur_pwr - 10;
break;
case IL_RATE_54M_INDEX_TABLE:
case RATE_54M_INDEX_TABLE:
if (i == 0)
*clip_pwrs = satur_pwr - 9;
else
......@@ -2139,7 +2139,7 @@ int il3945_txpower_set_from_eeprom(struct il_priv *il)
}
/* set tx power for CCK rates, based on OFDM 12 Mbit settings*/
pwr_info = &ch_info->power_info[IL_RATE_12M_INDEX_TABLE];
pwr_info = &ch_info->power_info[RATE_12M_INDEX_TABLE];
power = pwr_info->requested_power +
IL_CCK_FROM_OFDM_POWER_DIFF;
pwr_index = pwr_info->power_table_index +
......@@ -2169,7 +2169,7 @@ int il3945_txpower_set_from_eeprom(struct il_priv *il)
for (scan_tbl_index = 0;
scan_tbl_index < IL_NUM_SCAN_RATES; scan_tbl_index++) {
s32 actual_index = (scan_tbl_index == 0) ?
IL_RATE_1M_INDEX_TABLE : IL_RATE_6M_INDEX_TABLE;
RATE_1M_INDEX_TABLE : RATE_6M_INDEX_TABLE;
il3945_hw_reg_set_scan_power(il, scan_tbl_index,
actual_index, clip_pwrs, ch_info, a_band);
}
......@@ -2289,7 +2289,7 @@ static int il3945_manage_ibss_station(struct il_priv *il,
il3945_sync_sta(il, vif_priv->ibss_bssid_sta_id,
(il->band == IEEE80211_BAND_5GHZ) ?
IL_RATE_6M_PLCP : IL_RATE_1M_PLCP);
RATE_6M_PLCP : RATE_1M_PLCP);
il3945_rate_scale_init(il->hw, vif_priv->ibss_bssid_sta_id);
return 0;
......@@ -2326,17 +2326,17 @@ int il3945_init_hw_rate_table(struct il_priv *il)
D_RATE("Select A mode rate scale\n");
/* If one of the following CCK rates is used,
* have it fall back to the 6M OFDM rate */
for (i = IL_RATE_1M_INDEX_TABLE;
i <= IL_RATE_11M_INDEX_TABLE; i++)
for (i = RATE_1M_INDEX_TABLE;
i <= RATE_11M_INDEX_TABLE; i++)
table[i].next_rate_index =
il3945_rates[IL_FIRST_OFDM_RATE].table_rs_index;
/* Don't fall back to CCK rates */
table[IL_RATE_12M_INDEX_TABLE].next_rate_index =
IL_RATE_9M_INDEX_TABLE;
table[RATE_12M_INDEX_TABLE].next_rate_index =
RATE_9M_INDEX_TABLE;
/* Don't drop out of OFDM rates */
table[IL_RATE_6M_INDEX_TABLE].next_rate_index =
table[RATE_6M_INDEX_TABLE].next_rate_index =
il3945_rates[IL_FIRST_OFDM_RATE].table_rs_index;
break;
......@@ -2349,14 +2349,14 @@ int il3945_init_hw_rate_table(struct il_priv *il)
il_is_associated(il)) {
index = IL_FIRST_CCK_RATE;
for (i = IL_RATE_6M_INDEX_TABLE;
i <= IL_RATE_54M_INDEX_TABLE; i++)
for (i = RATE_6M_INDEX_TABLE;
i <= RATE_54M_INDEX_TABLE; i++)
table[i].next_rate_index =
il3945_rates[index].table_rs_index;
index = IL_RATE_11M_INDEX_TABLE;
index = RATE_11M_INDEX_TABLE;
/* CCK shouldn't fall back to OFDM... */
table[index].next_rate_index = IL_RATE_5M_INDEX_TABLE;
table[index].next_rate_index = RATE_5M_INDEX_TABLE;
}
break;
......
......@@ -96,7 +96,7 @@ struct il3945_rs_sta {
u8 flush_pending;
u8 start_rate;
struct timer_list rate_scale_flush;
struct il3945_rate_scale_data win[IL_RATE_COUNT_3945];
struct il3945_rate_scale_data win[RATE_COUNT_3945];
#ifdef CONFIG_MAC80211_DEBUGFS
struct dentry *rs_sta_dbgfs_stats_table_file;
#endif
......@@ -300,7 +300,7 @@ int il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif);
void il3945_post_scan(struct il_priv *il);
/* rates */
extern const struct il3945_rate_info il3945_rates[IL_RATE_COUNT_3945];
extern const struct il3945_rate_info il3945_rates[RATE_COUNT_3945];
/* Requires full declaration of il_priv before including */
#include "iwl-io.h"
......
......@@ -423,7 +423,7 @@ int il4965_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band)
} else {
if (band == IEEE80211_BAND_5GHZ)
band_offset = IL_FIRST_OFDM_RATE;
for (idx = band_offset; idx < IL_RATE_COUNT_LEGACY; idx++)
for (idx = band_offset; idx < RATE_COUNT_LEGACY; idx++)
if (il_rates[idx].plcp == (rate_n_flags & 0xFF))
return idx - band_offset;
}
......@@ -870,14 +870,14 @@ int il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
RXON_FLG_CHANNEL_MODE_MSK)
>> RXON_FLG_CHANNEL_MODE_POS;
if (chan_mod == CHANNEL_MODE_PURE_40) {
rate = IL_RATE_6M_PLCP;
rate = RATE_6M_PLCP;
} else {
rate = IL_RATE_1M_PLCP;
rate = RATE_1M_PLCP;
rate_flags = RATE_MCS_CCK_MSK;
}
break;
case IEEE80211_BAND_5GHZ:
rate = IL_RATE_6M_PLCP;
rate = RATE_6M_PLCP;
break;
default:
IL_WARN("Invalid scan band\n");
......
This diff is collapsed.
......@@ -50,9 +50,9 @@ il4965_sta_alloc_lq(struct il_priv *il, u8 sta_id)
/* Set up the rate scaling to start at selected rate, fall back
* all the way down to 1M in IEEE order, and then spin on 1M */
if (il->band == IEEE80211_BAND_5GHZ)
r = IL_RATE_6M_INDEX;
r = RATE_6M_INDEX;
else
r = IL_RATE_1M_INDEX;
r = RATE_1M_INDEX;
if (r >= IL_FIRST_CCK_RATE && r <= IL_LAST_CCK_RATE)
rate_flags |= RATE_MCS_CCK_MSK;
......
......@@ -196,7 +196,7 @@ static void il4965_tx_cmd_build_rate(struct il_priv *il,
*/
rate_idx = info->control.rates[0].idx;
if ((info->control.rates[0].flags & IEEE80211_TX_RC_MCS) ||
rate_idx < 0 || rate_idx > IL_RATE_COUNT_LEGACY)
rate_idx < 0 || rate_idx > RATE_COUNT_LEGACY)
rate_idx = rate_lowest_index(&il->bands[info->band],
info->control.sta);
/* For 5 GHZ band, remap mac80211 rate indices into driver indices */
......
......@@ -2094,7 +2094,7 @@ struct il_link_quality_cmd {
* 4965 devices works its way through table when retrying Tx.
*/
struct {
__le32 rate_n_flags; /* RATE_MCS_*, IL_RATE_* */
__le32 rate_n_flags; /* RATE_MCS_*, RATE_* */
} rs_table[LINK_QUAL_MAX_RETRY_NUM];
__le32 reserved2;
} __packed;
......
......@@ -174,7 +174,7 @@ int il_init_geos(struct il_priv *il)
if (!channels)
return -ENOMEM;
rates = kzalloc((sizeof(struct ieee80211_rate) * IL_RATE_COUNT_LEGACY),
rates = kzalloc((sizeof(struct ieee80211_rate) * RATE_COUNT_LEGACY),
GFP_KERNEL);
if (!rates) {
kfree(channels);
......@@ -186,7 +186,7 @@ int il_init_geos(struct il_priv *il)
sband->channels = &channels[ARRAY_SIZE(il_eeprom_band_1)];
/* just OFDM */
sband->bitrates = &rates[IL_FIRST_OFDM_RATE];
sband->n_bitrates = IL_RATE_COUNT_LEGACY - IL_FIRST_OFDM_RATE;
sband->n_bitrates = RATE_COUNT_LEGACY - IL_FIRST_OFDM_RATE;
if (il->cfg->sku & IL_SKU_N)
il_init_ht_hw_capab(il, &sband->ht_cap,
......@@ -196,7 +196,7 @@ int il_init_geos(struct il_priv *il)
sband->channels = channels;
/* OFDM & CCK */
sband->bitrates = rates;
sband->n_bitrates = IL_RATE_COUNT_LEGACY;
sband->n_bitrates = RATE_COUNT_LEGACY;
if (il->cfg->sku & IL_SKU_N)
il_init_ht_hw_capab(il, &sband->ht_cap,
......@@ -454,8 +454,8 @@ il_check_rxon_cmd(struct il_priv *il, struct il_rxon_context *ctx)
}
/* make sure basic rates 6Mbps and 1Mbps are supported */
if ((rxon->ofdm_basic_rates & IL_RATE_6M_MASK) == 0 &&
(rxon->cck_basic_rates & IL_RATE_1M_MASK) == 0) {
if ((rxon->ofdm_basic_rates & RATE_6M_MASK) == 0 &&
(rxon->cck_basic_rates & RATE_1M_MASK) == 0) {
IL_WARN("neither 1 nor 6 are basic\n");
error = true;
}
......@@ -566,9 +566,9 @@ u8 il_get_lowest_plcp(struct il_priv *il,
* the beacon skb from mac80211.
*/
if (ctx->staging.flags & RXON_FLG_BAND_24G_MSK)
return IL_RATE_1M_PLCP;
return RATE_1M_PLCP;
else
return IL_RATE_6M_PLCP;
return RATE_6M_PLCP;
}
EXPORT_SYMBOL(il_get_lowest_plcp);
......@@ -835,7 +835,7 @@ void il_set_rate(struct il_priv *il)
for (i = 0; i < hw->n_bitrates; i++) {
rate = &(hw->bitrates[i]);
if (rate->hw_value < IL_RATE_COUNT_LEGACY)
if (rate->hw_value < RATE_COUNT_LEGACY)
il->active_rate |= (1 << rate->hw_value);
}
......
......@@ -28,10 +28,10 @@
#define __il_rs_h__
struct il_rate_info {
u8 plcp; /* uCode API: IL_RATE_6M_PLCP, etc. */
u8 plcp_siso; /* uCode API: IL_RATE_SISO_6M_PLCP, etc. */
u8 plcp_mimo2; /* uCode API: IL_RATE_MIMO2_6M_PLCP, etc. */
u8 ieee; /* MAC header: IL_RATE_6M_IEEE, etc. */
u8 plcp; /* uCode API: RATE_6M_PLCP, etc. */
u8 plcp_siso; /* uCode API: RATE_SISO_6M_PLCP, etc. */
u8 plcp_mimo2; /* uCode API: RATE_MIMO2_6M_PLCP, etc. */
u8 ieee; /* MAC header: RATE_6M_IEEE, etc. */
u8 prev_ieee; /* previous rate in IEEE speeds */
u8 next_ieee; /* next rate in IEEE speeds */
u8 prev_rs; /* previous rate used in rs algo */
......@@ -41,8 +41,8 @@ struct il_rate_info {
};
struct il3945_rate_info {
u8 plcp; /* uCode API: IL_RATE_6M_PLCP, etc. */
u8 ieee; /* MAC header: IL_RATE_6M_IEEE, etc. */
u8 plcp; /* uCode API: RATE_6M_PLCP, etc. */
u8 ieee; /* MAC header: RATE_6M_IEEE, etc. */
u8 prev_ieee; /* previous rate in IEEE speeds */
u8 next_ieee; /* next rate in IEEE speeds */
u8 prev_rs; /* previous rate used in rs algo */
......@@ -56,153 +56,153 @@ struct il3945_rate_info {
/*
* These serve as indexes into
* struct il_rate_info il_rates[IL_RATE_COUNT];
* struct il_rate_info il_rates[RATE_COUNT];
*/
enum {
IL_RATE_1M_INDEX = 0,
IL_RATE_2M_INDEX,
IL_RATE_5M_INDEX,
IL_RATE_11M_INDEX,
IL_RATE_6M_INDEX,
IL_RATE_9M_INDEX,
IL_RATE_12M_INDEX,
IL_RATE_18M_INDEX,
IL_RATE_24M_INDEX,
IL_RATE_36M_INDEX,
IL_RATE_48M_INDEX,
IL_RATE_54M_INDEX,
IL_RATE_60M_INDEX,
IL_RATE_COUNT,
IL_RATE_COUNT_LEGACY = IL_RATE_COUNT - 1, /* Excluding 60M */
IL_RATE_COUNT_3945 = IL_RATE_COUNT - 1,
IL_RATE_INVM_INDEX = IL_RATE_COUNT,
IL_RATE_INVALID = IL_RATE_COUNT,
RATE_1M_INDEX = 0,
RATE_2M_INDEX,
RATE_5M_INDEX,
RATE_11M_INDEX,
RATE_6M_INDEX,
RATE_9M_INDEX,
RATE_12M_INDEX,
RATE_18M_INDEX,
RATE_24M_INDEX,
RATE_36M_INDEX,
RATE_48M_INDEX,
RATE_54M_INDEX,
RATE_60M_INDEX,
RATE_COUNT,
RATE_COUNT_LEGACY = RATE_COUNT - 1, /* Excluding 60M */
RATE_COUNT_3945 = RATE_COUNT - 1,
RATE_INVM_INDEX = RATE_COUNT,
RATE_INVALID = RATE_COUNT,
};
enum {
IL_RATE_6M_INDEX_TABLE = 0,
IL_RATE_9M_INDEX_TABLE,
IL_RATE_12M_INDEX_TABLE,
IL_RATE_18M_INDEX_TABLE,
IL_RATE_24M_INDEX_TABLE,
IL_RATE_36M_INDEX_TABLE,
IL_RATE_48M_INDEX_TABLE,
IL_RATE_54M_INDEX_TABLE,
IL_RATE_1M_INDEX_TABLE,
IL_RATE_2M_INDEX_TABLE,
IL_RATE_5M_INDEX_TABLE,
IL_RATE_11M_INDEX_TABLE,
IL_RATE_INVM_INDEX_TABLE = IL_RATE_INVM_INDEX - 1,
RATE_6M_INDEX_TABLE = 0,
RATE_9M_INDEX_TABLE,
RATE_12M_INDEX_TABLE,
RATE_18M_INDEX_TABLE,
RATE_24M_INDEX_TABLE,
RATE_36M_INDEX_TABLE,
RATE_48M_INDEX_TABLE,
RATE_54M_INDEX_TABLE,
RATE_1M_INDEX_TABLE,
RATE_2M_INDEX_TABLE,
RATE_5M_INDEX_TABLE,
RATE_11M_INDEX_TABLE,
RATE_INVM_INDEX_TABLE = RATE_INVM_INDEX - 1,
};
enum {
IL_FIRST_OFDM_RATE = IL_RATE_6M_INDEX,
IL39_LAST_OFDM_RATE = IL_RATE_54M_INDEX,
IL_LAST_OFDM_RATE = IL_RATE_60M_INDEX,
IL_FIRST_CCK_RATE = IL_RATE_1M_INDEX,
IL_LAST_CCK_RATE = IL_RATE_11M_INDEX,
IL_FIRST_OFDM_RATE = RATE_6M_INDEX,
IL39_LAST_OFDM_RATE = RATE_54M_INDEX,
IL_LAST_OFDM_RATE = RATE_60M_INDEX,
IL_FIRST_CCK_RATE = RATE_1M_INDEX,
IL_LAST_CCK_RATE = RATE_11M_INDEX,
};
/* #define vs. enum to keep from defaulting to 'large integer' */
#define IL_RATE_6M_MASK (1 << IL_RATE_6M_INDEX)
#define IL_RATE_9M_MASK (1 << IL_RATE_9M_INDEX)
#define IL_RATE_12M_MASK (1 << IL_RATE_12M_INDEX)
#define IL_RATE_18M_MASK (1 << IL_RATE_18M_INDEX)
#define IL_RATE_24M_MASK (1 << IL_RATE_24M_INDEX)
#define IL_RATE_36M_MASK (1 << IL_RATE_36M_INDEX)
#define IL_RATE_48M_MASK (1 << IL_RATE_48M_INDEX)
#define IL_RATE_54M_MASK (1 << IL_RATE_54M_INDEX)
#define IL_RATE_60M_MASK (1 << IL_RATE_60M_INDEX)
#define IL_RATE_1M_MASK (1 << IL_RATE_1M_INDEX)
#define IL_RATE_2M_MASK (1 << IL_RATE_2M_INDEX)
#define IL_RATE_5M_MASK (1 << IL_RATE_5M_INDEX)
#define IL_RATE_11M_MASK (1 << IL_RATE_11M_INDEX)
#define RATE_6M_MASK (1 << RATE_6M_INDEX)
#define RATE_9M_MASK (1 << RATE_9M_INDEX)
#define RATE_12M_MASK (1 << RATE_12M_INDEX)
#define RATE_18M_MASK (1 << RATE_18M_INDEX)
#define RATE_24M_MASK (1 << RATE_24M_INDEX)
#define RATE_36M_MASK (1 << RATE_36M_INDEX)
#define RATE_48M_MASK (1 << RATE_48M_INDEX)
#define RATE_54M_MASK (1 << RATE_54M_INDEX)
#define RATE_60M_MASK (1 << RATE_60M_INDEX)
#define RATE_1M_MASK (1 << RATE_1M_INDEX)
#define RATE_2M_MASK (1 << RATE_2M_INDEX)
#define RATE_5M_MASK (1 << RATE_5M_INDEX)
#define RATE_11M_MASK (1 << RATE_11M_INDEX)
/* uCode API values for legacy bit rates, both OFDM and CCK */
enum {
IL_RATE_6M_PLCP = 13,
IL_RATE_9M_PLCP = 15,
IL_RATE_12M_PLCP = 5,
IL_RATE_18M_PLCP = 7,
IL_RATE_24M_PLCP = 9,
IL_RATE_36M_PLCP = 11,
IL_RATE_48M_PLCP = 1,
IL_RATE_54M_PLCP = 3,
IL_RATE_60M_PLCP = 3,/*FIXME:RS:should be removed*/
IL_RATE_1M_PLCP = 10,
IL_RATE_2M_PLCP = 20,
IL_RATE_5M_PLCP = 55,
IL_RATE_11M_PLCP = 110,
/*FIXME:RS:add IL_RATE_LEGACY_INVM_PLCP = 0,*/
RATE_6M_PLCP = 13,
RATE_9M_PLCP = 15,
RATE_12M_PLCP = 5,
RATE_18M_PLCP = 7,
RATE_24M_PLCP = 9,
RATE_36M_PLCP = 11,
RATE_48M_PLCP = 1,
RATE_54M_PLCP = 3,
RATE_60M_PLCP = 3,/*FIXME:RS:should be removed*/
RATE_1M_PLCP = 10,
RATE_2M_PLCP = 20,
RATE_5M_PLCP = 55,
RATE_11M_PLCP = 110,
/*FIXME:RS:add RATE_LEGACY_INVM_PLCP = 0,*/
};
/* uCode API values for OFDM high-throughput (HT) bit rates */
enum {
IL_RATE_SISO_6M_PLCP = 0,
IL_RATE_SISO_12M_PLCP = 1,
IL_RATE_SISO_18M_PLCP = 2,
IL_RATE_SISO_24M_PLCP = 3,
IL_RATE_SISO_36M_PLCP = 4,
IL_RATE_SISO_48M_PLCP = 5,
IL_RATE_SISO_54M_PLCP = 6,
IL_RATE_SISO_60M_PLCP = 7,
IL_RATE_MIMO2_6M_PLCP = 0x8,
IL_RATE_MIMO2_12M_PLCP = 0x9,
IL_RATE_MIMO2_18M_PLCP = 0xa,
IL_RATE_MIMO2_24M_PLCP = 0xb,
IL_RATE_MIMO2_36M_PLCP = 0xc,
IL_RATE_MIMO2_48M_PLCP = 0xd,
IL_RATE_MIMO2_54M_PLCP = 0xe,
IL_RATE_MIMO2_60M_PLCP = 0xf,
IL_RATE_SISO_INVM_PLCP,
IL_RATE_MIMO2_INVM_PLCP = IL_RATE_SISO_INVM_PLCP,
RATE_SISO_6M_PLCP = 0,
RATE_SISO_12M_PLCP = 1,
RATE_SISO_18M_PLCP = 2,
RATE_SISO_24M_PLCP = 3,
RATE_SISO_36M_PLCP = 4,
RATE_SISO_48M_PLCP = 5,
RATE_SISO_54M_PLCP = 6,
RATE_SISO_60M_PLCP = 7,
RATE_MIMO2_6M_PLCP = 0x8,
RATE_MIMO2_12M_PLCP = 0x9,
RATE_MIMO2_18M_PLCP = 0xa,
RATE_MIMO2_24M_PLCP = 0xb,
RATE_MIMO2_36M_PLCP = 0xc,
RATE_MIMO2_48M_PLCP = 0xd,
RATE_MIMO2_54M_PLCP = 0xe,
RATE_MIMO2_60M_PLCP = 0xf,
RATE_SISO_INVM_PLCP,
RATE_MIMO2_INVM_PLCP = RATE_SISO_INVM_PLCP,
};
/* MAC header values for bit rates */
enum {
IL_RATE_6M_IEEE = 12,
IL_RATE_9M_IEEE = 18,
IL_RATE_12M_IEEE = 24,
IL_RATE_18M_IEEE = 36,
IL_RATE_24M_IEEE = 48,
IL_RATE_36M_IEEE = 72,
IL_RATE_48M_IEEE = 96,
IL_RATE_54M_IEEE = 108,
IL_RATE_60M_IEEE = 120,
IL_RATE_1M_IEEE = 2,
IL_RATE_2M_IEEE = 4,
IL_RATE_5M_IEEE = 11,
IL_RATE_11M_IEEE = 22,
RATE_6M_IEEE = 12,
RATE_9M_IEEE = 18,
RATE_12M_IEEE = 24,
RATE_18M_IEEE = 36,
RATE_24M_IEEE = 48,
RATE_36M_IEEE = 72,
RATE_48M_IEEE = 96,
RATE_54M_IEEE = 108,
RATE_60M_IEEE = 120,
RATE_1M_IEEE = 2,
RATE_2M_IEEE = 4,
RATE_5M_IEEE = 11,
RATE_11M_IEEE = 22,
};
#define IL_CCK_BASIC_RATES_MASK \
(IL_RATE_1M_MASK | \
IL_RATE_2M_MASK)
(RATE_1M_MASK | \
RATE_2M_MASK)
#define IL_CCK_RATES_MASK \
(IL_CCK_BASIC_RATES_MASK | \
IL_RATE_5M_MASK | \
IL_RATE_11M_MASK)
RATE_5M_MASK | \
RATE_11M_MASK)
#define IL_OFDM_BASIC_RATES_MASK \
(IL_RATE_6M_MASK | \
IL_RATE_12M_MASK | \
IL_RATE_24M_MASK)
(RATE_6M_MASK | \
RATE_12M_MASK | \
RATE_24M_MASK)
#define IL_OFDM_RATES_MASK \
(IL_OFDM_BASIC_RATES_MASK | \
IL_RATE_9M_MASK | \
IL_RATE_18M_MASK | \
IL_RATE_36M_MASK | \
IL_RATE_48M_MASK | \
IL_RATE_54M_MASK)
RATE_9M_MASK | \
RATE_18M_MASK | \
RATE_36M_MASK | \
RATE_48M_MASK | \
RATE_54M_MASK)
#define IL_BASIC_RATES_MASK \
(IL_OFDM_BASIC_RATES_MASK | \
IL_CCK_BASIC_RATES_MASK)
#define IL_RATES_MASK ((1 << IL_RATE_COUNT) - 1)
#define IL_RATES_MASK_3945 ((1 << IL_RATE_COUNT_3945) - 1)
#define RATES_MASK ((1 << RATE_COUNT) - 1)
#define RATES_MASK_3945 ((1 << RATE_COUNT_3945) - 1)
#define IL_INVALID_VALUE -1
......@@ -221,10 +221,10 @@ enum {
/* Success ratio (ACKed / attempted tx frames) values (perfect is 128 * 100) */
#define IL_RS_GOOD_RATIO 12800 /* 100% */
#define IL_RATE_SCALE_SWITCH 10880 /* 85% */
#define IL_RATE_HIGH_TH 10880 /* 85% */
#define IL_RATE_INCREASE_TH 6400 /* 50% */
#define IL_RATE_DECREASE_TH 1920 /* 15% */
#define RATE_SCALE_SWITCH 10880 /* 85% */
#define RATE_HIGH_TH 10880 /* 85% */
#define RATE_INCREASE_TH 6400 /* 50% */
#define RATE_DECREASE_TH 1920 /* 15% */
/* possible actions when in legacy mode */
#define IL_LEGACY_SWITCH_ANTENNA1 0
......@@ -268,7 +268,7 @@ enum {
#define TID_MAX_TIME_DIFF ((TID_QUEUE_MAX_SIZE - 1) * TID_QUEUE_CELL_SPACING)
#define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y))
extern const struct il_rate_info il_rates[IL_RATE_COUNT];
extern const struct il_rate_info il_rates[RATE_COUNT];
enum il_table_type {
LQ_NONE,
......@@ -331,7 +331,7 @@ struct il_scale_tbl_info {
u8 max_search; /* maximun number of tables we can search */
s32 *expected_tpt; /* throughput metrics; expected_tpt_G, etc. */
u32 current_rate; /* rate_n_flags, uCode API format */
struct il_rate_scale_data win[IL_RATE_COUNT]; /* rate histories */
struct il_rate_scale_data win[RATE_COUNT]; /* rate histories */
};
struct il_traffic_load {
......@@ -371,7 +371,7 @@ struct il_lq_sta {
u8 is_dup;
enum ieee80211_band band;
/* The following are bitmaps of rates; IL_RATE_6M_MASK, etc. */
/* The following are bitmaps of rates; RATE_6M_MASK, etc. */
u32 supp_rates;
u16 active_legacy_rate;
u16 active_siso_rate;
......
......@@ -314,7 +314,7 @@ u8 il_prep_station(struct il_priv *il, struct il_rxon_context *ctx,
/* 3945 only */
rate = (il->band == IEEE80211_BAND_5GHZ) ?
IL_RATE_6M_PLCP : IL_RATE_1M_PLCP;
RATE_6M_PLCP : RATE_1M_PLCP;
/* Turn on both antennas for the station... */
station->sta.rate_n_flags = cpu_to_le16(rate | RATE_MCS_ANT_AB_MSK);
......
......@@ -1654,7 +1654,7 @@ static void il3945_init_hw_rates(struct il_priv *il,
{
int i;
for (i = 0; i < IL_RATE_COUNT_LEGACY; i++) {
for (i = 0; i < RATE_COUNT_LEGACY; i++) {
rates[i].bitrate = il3945_rates[i].ieee * 5;
rates[i].hw_value = i; /* Rate scaling will work on indexes */
rates[i].hw_value_short = i;
......@@ -2239,7 +2239,7 @@ static void il3945_alive_start(struct il_priv *il)
ieee80211_wake_queues(il->hw);
il->active_rate = IL_RATES_MASK_3945;
il->active_rate = RATES_MASK_3945;
il_power_update_mode(il, true);
......@@ -2642,11 +2642,11 @@ int il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
switch (il->scan_band) {
case IEEE80211_BAND_2GHZ:
scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;
scan->tx_cmd.rate = IL_RATE_1M_PLCP;
scan->tx_cmd.rate = RATE_1M_PLCP;
band = IEEE80211_BAND_2GHZ;
break;
case IEEE80211_BAND_5GHZ:
scan->tx_cmd.rate = IL_RATE_6M_PLCP;
scan->tx_cmd.rate = RATE_6M_PLCP;
band = IEEE80211_BAND_5GHZ;
break;
default:
......
......@@ -1757,7 +1757,7 @@ static void il4965_alive_start(struct il_priv *il)
ieee80211_wake_queues(il->hw);
il->active_rate = IL_RATES_MASK;
il->active_rate = RATES_MASK;
if (il_is_associated_ctx(ctx)) {
struct il_rxon_cmd *active_rxon =
......@@ -2711,7 +2711,7 @@ static void il4965_init_hw_rates(struct il_priv *il,
{
int i;
for (i = 0; i < IL_RATE_COUNT_LEGACY; i++) {
for (i = 0; i < RATE_COUNT_LEGACY; i++) {
rates[i].bitrate = il_rates[i].ieee * 5;
rates[i].hw_value = i; /* Rate scaling will work on indexes */
rates[i].hw_value_short = i;
......@@ -2721,7 +2721,7 @@ static void il4965_init_hw_rates(struct il_priv *il,
* If CCK != 1M then set short preamble rate flag.
*/
rates[i].flags |=
(il_rates[i].plcp == IL_RATE_1M_PLCP) ?
(il_rates[i].plcp == RATE_1M_PLCP) ?
0 : IEEE80211_RATE_SHORT_PREAMBLE;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment