提交 46bc8d4b 编写于 作者: S Stanislaw Gruszka

iwlegacy: rename priv to il

Make code shorter.
Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
上级 e2ebc833
......@@ -29,22 +29,22 @@
#include "iwl-3945-debugfs.h"
static int il3945_statistics_flag(struct il_priv *priv, char *buf, int bufsz)
static int il3945_statistics_flag(struct il_priv *il, char *buf, int bufsz)
{
int p = 0;
p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n",
le32_to_cpu(priv->_3945.statistics.flag));
if (le32_to_cpu(priv->_3945.statistics.flag) &
le32_to_cpu(il->_3945.statistics.flag));
if (le32_to_cpu(il->_3945.statistics.flag) &
UCODE_STATISTICS_CLEAR_MSK)
p += scnprintf(buf + p, bufsz - p,
"\tStatistics have been cleared\n");
p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n",
(le32_to_cpu(priv->_3945.statistics.flag) &
(le32_to_cpu(il->_3945.statistics.flag) &
UCODE_STATISTICS_FREQUENCY_MSK)
? "2.4 GHz" : "5.2 GHz");
p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n",
(le32_to_cpu(priv->_3945.statistics.flag) &
(le32_to_cpu(il->_3945.statistics.flag) &
UCODE_STATISTICS_NARROW_BAND_MSK)
? "enabled" : "disabled");
return p;
......@@ -54,7 +54,7 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct il_priv *priv = file->private_data;
struct il_priv *il = file->private_data;
int pos = 0;
char *buf;
int bufsz = sizeof(struct iwl39_statistics_rx_phy) * 40 +
......@@ -66,12 +66,12 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file,
struct iwl39_statistics_rx_non_phy *general, *accum_general;
struct iwl39_statistics_rx_non_phy *delta_general, *max_general;
if (!il_is_alive(priv))
if (!il_is_alive(il))
return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n");
IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM;
}
......@@ -80,20 +80,20 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file,
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
ofdm = &priv->_3945.statistics.rx.ofdm;
cck = &priv->_3945.statistics.rx.cck;
general = &priv->_3945.statistics.rx.general;
accum_ofdm = &priv->_3945.accum_statistics.rx.ofdm;
accum_cck = &priv->_3945.accum_statistics.rx.cck;
accum_general = &priv->_3945.accum_statistics.rx.general;
delta_ofdm = &priv->_3945.delta_statistics.rx.ofdm;
delta_cck = &priv->_3945.delta_statistics.rx.cck;
delta_general = &priv->_3945.delta_statistics.rx.general;
max_ofdm = &priv->_3945.max_delta.rx.ofdm;
max_cck = &priv->_3945.max_delta.rx.cck;
max_general = &priv->_3945.max_delta.rx.general;
ofdm = &il->_3945.statistics.rx.ofdm;
cck = &il->_3945.statistics.rx.cck;
general = &il->_3945.statistics.rx.general;
accum_ofdm = &il->_3945.accum_statistics.rx.ofdm;
accum_cck = &il->_3945.accum_statistics.rx.cck;
accum_general = &il->_3945.accum_statistics.rx.general;
delta_ofdm = &il->_3945.delta_statistics.rx.ofdm;
delta_cck = &il->_3945.delta_statistics.rx.cck;
delta_general = &il->_3945.delta_statistics.rx.general;
max_ofdm = &il->_3945.max_delta.rx.ofdm;
max_cck = &il->_3945.max_delta.rx.cck;
max_general = &il->_3945.max_delta.rx.general;
pos += il3945_statistics_flag(priv, buf, bufsz);
pos += il3945_statistics_flag(il, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
"acumulative delta max\n",
"Statistics_Rx - OFDM:");
......@@ -329,19 +329,19 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct il_priv *priv = file->private_data;
struct il_priv *il = file->private_data;
int pos = 0;
char *buf;
int bufsz = (sizeof(struct iwl39_statistics_tx) * 48) + 250;
ssize_t ret;
struct iwl39_statistics_tx *tx, *accum_tx, *delta_tx, *max_tx;
if (!il_is_alive(priv))
if (!il_is_alive(il))
return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n");
IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM;
}
......@@ -350,11 +350,11 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file,
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
tx = &priv->_3945.statistics.tx;
accum_tx = &priv->_3945.accum_statistics.tx;
delta_tx = &priv->_3945.delta_statistics.tx;
max_tx = &priv->_3945.max_delta.tx;
pos += il3945_statistics_flag(priv, buf, bufsz);
tx = &il->_3945.statistics.tx;
accum_tx = &il->_3945.accum_statistics.tx;
delta_tx = &il->_3945.delta_statistics.tx;
max_tx = &il->_3945.max_delta.tx;
pos += il3945_statistics_flag(il, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
"acumulative delta max\n",
"Statistics_Tx:");
......@@ -425,7 +425,7 @@ ssize_t il3945_ucode_general_stats_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct il_priv *priv = file->private_data;
struct il_priv *il = file->private_data;
int pos = 0;
char *buf;
int bufsz = sizeof(struct iwl39_statistics_general) * 10 + 300;
......@@ -435,12 +435,12 @@ ssize_t il3945_ucode_general_stats_read(struct file *file,
struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg;
struct iwl39_statistics_div *div, *accum_div, *delta_div, *max_div;
if (!il_is_alive(priv))
if (!il_is_alive(il))
return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n");
IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM;
}
......@@ -449,19 +449,19 @@ ssize_t il3945_ucode_general_stats_read(struct file *file,
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
general = &priv->_3945.statistics.general;
dbg = &priv->_3945.statistics.general.dbg;
div = &priv->_3945.statistics.general.div;
accum_general = &priv->_3945.accum_statistics.general;
delta_general = &priv->_3945.delta_statistics.general;
max_general = &priv->_3945.max_delta.general;
accum_dbg = &priv->_3945.accum_statistics.general.dbg;
delta_dbg = &priv->_3945.delta_statistics.general.dbg;
max_dbg = &priv->_3945.max_delta.general.dbg;
accum_div = &priv->_3945.accum_statistics.general.div;
delta_div = &priv->_3945.delta_statistics.general.div;
max_div = &priv->_3945.max_delta.general.div;
pos += il3945_statistics_flag(priv, buf, bufsz);
general = &il->_3945.statistics.general;
dbg = &il->_3945.statistics.general.dbg;
div = &il->_3945.statistics.general.div;
accum_general = &il->_3945.accum_statistics.general;
delta_general = &il->_3945.delta_statistics.general;
max_general = &il->_3945.max_delta.general;
accum_dbg = &il->_3945.accum_statistics.general.dbg;
delta_dbg = &il->_3945.delta_statistics.general.dbg;
max_dbg = &il->_3945.max_delta.general.dbg;
accum_div = &il->_3945.accum_statistics.general.div;
delta_div = &il->_3945.delta_statistics.general.div;
max_div = &il->_3945.max_delta.general.div;
pos += il3945_statistics_flag(il, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
"acumulative delta max\n",
"Statistics_General:");
......
......@@ -44,7 +44,7 @@
/* Send led command */
static int il3945_send_led_cmd(struct il_priv *priv,
static int il3945_send_led_cmd(struct il_priv *il,
struct il_led_cmd *led_cmd)
{
struct il_host_cmd cmd = {
......@@ -55,7 +55,7 @@ static int il3945_send_led_cmd(struct il_priv *priv,
.callback = NULL,
};
return il_send_cmd(priv, &cmd);
return il_send_cmd(il, &cmd);
}
const struct il_led_ops il3945_led_ops = {
......
......@@ -153,7 +153,7 @@ static int il3945_rate_scale_flush_windows(struct il3945_rs_sta *rs_sta)
int unflushed = 0;
int i;
unsigned long flags;
struct il_priv *priv __maybe_unused = rs_sta->priv;
struct il_priv *il __maybe_unused = rs_sta->il;
/*
* For each rate, if we have collected data on that rate
......@@ -167,7 +167,7 @@ static int il3945_rate_scale_flush_windows(struct il3945_rs_sta *rs_sta)
spin_lock_irqsave(&rs_sta->lock, flags);
if (time_after(jiffies, rs_sta->win[i].stamp +
IL_RATE_WIN_FLUSH)) {
IL_DEBUG_RATE(priv, "flushing %d samples of rate "
IL_DEBUG_RATE(il, "flushing %d samples of rate "
"index %d\n",
rs_sta->win[i].counter, i);
il3945_clear_window(&rs_sta->win[i]);
......@@ -186,12 +186,12 @@ static int il3945_rate_scale_flush_windows(struct il3945_rs_sta *rs_sta)
static void il3945_bg_rate_scale_flush(unsigned long data)
{
struct il3945_rs_sta *rs_sta = (void *)data;
struct il_priv *priv __maybe_unused = rs_sta->priv;
struct il_priv *il __maybe_unused = rs_sta->il;
int unflushed = 0;
unsigned long flags;
u32 packet_count, duration, pps;
IL_DEBUG_RATE(priv, "enter\n");
IL_DEBUG_RATE(il, "enter\n");
unflushed = il3945_rate_scale_flush_windows(rs_sta);
......@@ -206,7 +206,7 @@ static void il3945_bg_rate_scale_flush(unsigned long data)
duration =
jiffies_to_msecs(jiffies - rs_sta->last_partial_flush);
IL_DEBUG_RATE(priv, "Tx'd %d packets in %dms\n",
IL_DEBUG_RATE(il, "Tx'd %d packets in %dms\n",
packet_count, duration);
/* Determine packets per second */
......@@ -226,7 +226,7 @@ static void il3945_bg_rate_scale_flush(unsigned long data)
rs_sta->flush_time = msecs_to_jiffies(duration);
IL_DEBUG_RATE(priv, "new flush period: %d msec ave %d\n",
IL_DEBUG_RATE(il, "new flush period: %d msec ave %d\n",
duration, packet_count);
mod_timer(&rs_sta->rate_scale_flush, jiffies +
......@@ -244,7 +244,7 @@ static void il3945_bg_rate_scale_flush(unsigned long data)
spin_unlock_irqrestore(&rs_sta->lock, flags);
IL_DEBUG_RATE(priv, "leave\n");
IL_DEBUG_RATE(il, "leave\n");
}
/**
......@@ -260,10 +260,10 @@ static void il3945_collect_tx_data(struct il3945_rs_sta *rs_sta,
{
unsigned long flags;
s32 fail_count;
struct il_priv *priv __maybe_unused = rs_sta->priv;
struct il_priv *il __maybe_unused = rs_sta->il;
if (!retries) {
IL_DEBUG_RATE(priv, "leave: retries == 0 -- should be at least 1\n");
IL_DEBUG_RATE(il, "leave: retries == 0 -- should be at least 1\n");
return;
}
......@@ -332,24 +332,24 @@ static void il3945_collect_tx_data(struct il3945_rs_sta *rs_sta,
/*
* Called after adding a new station to initialize rate scaling
*/
void il3945_rs_rate_init(struct il_priv *priv, struct ieee80211_sta *sta, u8 sta_id)
void il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id)
{
struct ieee80211_hw *hw = priv->hw;
struct ieee80211_conf *conf = &priv->hw->conf;
struct ieee80211_hw *hw = il->hw;
struct ieee80211_conf *conf = &il->hw->conf;
struct il3945_sta_priv *psta;
struct il3945_rs_sta *rs_sta;
struct ieee80211_supported_band *sband;
int i;
IL_DEBUG_INFO(priv, "enter\n");
if (sta_id == priv->contexts[IL_RXON_CTX_BSS].bcast_sta_id)
IL_DEBUG_INFO(il, "enter\n");
if (sta_id == il->contexts[IL_RXON_CTX_BSS].bcast_sta_id)
goto out;
psta = (struct il3945_sta_priv *) sta->drv_priv;
rs_sta = &psta->rs_sta;
sband = hw->wiphy->bands[conf->channel->band];
rs_sta->priv = priv;
rs_sta->il = il;
rs_sta->start_rate = IL_RATE_INVALID;
......@@ -379,18 +379,18 @@ void il3945_rs_rate_init(struct il_priv *priv, struct ieee80211_sta *sta, u8 sta
}
}
priv->_3945.sta_supp_rates = sta->supp_rates[sband->band];
il->_3945.sta_supp_rates = sta->supp_rates[sband->band];
/* For 5 GHz band it start at IL_FIRST_OFDM_RATE */
if (sband->band == IEEE80211_BAND_5GHZ) {
rs_sta->last_txrate_idx += IL_FIRST_OFDM_RATE;
priv->_3945.sta_supp_rates = priv->_3945.sta_supp_rates <<
il->_3945.sta_supp_rates = il->_3945.sta_supp_rates <<
IL_FIRST_OFDM_RATE;
}
out:
priv->stations[sta_id].used &= ~IL_STA_UCODE_INPROGRESS;
il->stations[sta_id].used &= ~IL_STA_UCODE_INPROGRESS;
IL_DEBUG_INFO(priv, "leave\n");
IL_DEBUG_INFO(il, "leave\n");
}
static void *il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
......@@ -399,7 +399,7 @@ static void *il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
}
/* rate scale requires free function to be implemented */
static void il3945_rs_free(void *priv)
static void il3945_rs_free(void *il)
{
return;
}
......@@ -408,24 +408,24 @@ static void *il3945_rs_alloc_sta(void *il_priv, struct ieee80211_sta *sta, gfp_t
{
struct il3945_rs_sta *rs_sta;
struct il3945_sta_priv *psta = (void *) sta->drv_priv;
struct il_priv *priv __maybe_unused = il_priv;
struct il_priv *il __maybe_unused = il_priv;
IL_DEBUG_RATE(priv, "enter\n");
IL_DEBUG_RATE(il, "enter\n");
rs_sta = &psta->rs_sta;
spin_lock_init(&rs_sta->lock);
init_timer(&rs_sta->rate_scale_flush);
IL_DEBUG_RATE(priv, "leave\n");
IL_DEBUG_RATE(il, "leave\n");
return rs_sta;
}
static void il3945_rs_free_sta(void *il_priv, struct ieee80211_sta *sta,
void *priv_sta)
void *il_sta)
{
struct il3945_rs_sta *rs_sta = priv_sta;
struct il3945_rs_sta *rs_sta = il_sta;
/*
* Be careful not to use any members of il3945_rs_sta (like trying
......@@ -442,18 +442,18 @@ static void il3945_rs_free_sta(void *il_priv, struct ieee80211_sta *sta,
* NOTE: Uses il_priv->retry_rate for the # of retries attempted by
* the hardware for each rate.
*/
static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta, void *priv_sta,
static void il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta, void *il_sta,
struct sk_buff *skb)
{
s8 retries = 0, current_count;
int scale_rate_index, first_index, last_index;
unsigned long flags;
struct il_priv *priv = (struct il_priv *)priv_rate;
struct il3945_rs_sta *rs_sta = priv_sta;
struct il_priv *il = (struct il_priv *)il_rate;
struct il3945_rs_sta *rs_sta = il_sta;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
IL_DEBUG_RATE(priv, "enter\n");
IL_DEBUG_RATE(il, "enter\n");
retries = info->status.rates[0].count;
/* Sanity Check for retries */
......@@ -462,18 +462,18 @@ static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band
first_index = sband->bitrates[info->status.rates[0].idx].hw_value;
if ((first_index < 0) || (first_index >= IL_RATE_COUNT_3945)) {
IL_DEBUG_RATE(priv, "leave: Rate out of bounds: %d\n", first_index);
IL_DEBUG_RATE(il, "leave: Rate out of bounds: %d\n", first_index);
return;
}
if (!priv_sta) {
IL_DEBUG_RATE(priv, "leave: No STA priv data to update!\n");
if (!il_sta) {
IL_DEBUG_RATE(il, "leave: No STA il data to update!\n");
return;
}
/* Treat uninitialized rate scaling data same as non-existing. */
if (!rs_sta->priv) {
IL_DEBUG_RATE(priv, "leave: STA priv data uninitialized!\n");
if (!rs_sta->il) {
IL_DEBUG_RATE(il, "leave: STA il data uninitialized!\n");
return;
}
......@@ -487,19 +487,19 @@ static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band
* Update the window for each rate. We determine which rates
* were Tx'd based on the total number of retries vs. the number
* of retries configured for each rate -- currently set to the
* priv value 'retry_rate' vs. rate specific
* il value 'retry_rate' vs. rate specific
*
* On exit from this while loop last_index indicates the rate
* at which the frame was finally transmitted (or failed if no
* ACK)
*/
while (retries > 1) {
if ((retries - 1) < priv->retry_rate) {
if ((retries - 1) < il->retry_rate) {
current_count = (retries - 1);
last_index = scale_rate_index;
} else {
current_count = priv->retry_rate;
last_index = il3945_rs_next_rate(priv,
current_count = il->retry_rate;
last_index = il3945_rs_next_rate(il,
scale_rate_index);
}
......@@ -508,7 +508,7 @@ static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band
il3945_collect_tx_data(rs_sta,
&rs_sta->win[scale_rate_index],
0, current_count, scale_rate_index);
IL_DEBUG_RATE(priv, "Update rate %d for %d retries.\n",
IL_DEBUG_RATE(il, "Update rate %d for %d retries.\n",
scale_rate_index, current_count);
retries -= current_count;
......@@ -518,7 +518,7 @@ static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band
/* Update the last index window with success/failure based on ACK */
IL_DEBUG_RATE(priv, "Update rate %d with %s.\n",
IL_DEBUG_RATE(il, "Update rate %d with %s.\n",
last_index,
(info->flags & IEEE80211_TX_STAT_ACK) ?
"success" : "failure");
......@@ -543,7 +543,7 @@ static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band
spin_unlock_irqrestore(&rs_sta->lock, flags);
IL_DEBUG_RATE(priv, "leave\n");
IL_DEBUG_RATE(il, "leave\n");
}
static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
......@@ -551,7 +551,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
{
u8 high = IL_RATE_INVALID;
u8 low = IL_RATE_INVALID;
struct il_priv *priv __maybe_unused = rs_sta->priv;
struct il_priv *il __maybe_unused = rs_sta->il;
/* 802.11A walks to the next literal adjacent rate in
* the rate table */
......@@ -591,7 +591,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
break;
if (rate_mask & (1 << low))
break;
IL_DEBUG_RATE(priv, "Skipping masked lower rate: %d\n", low);
IL_DEBUG_RATE(il, "Skipping masked lower rate: %d\n", low);
}
high = index;
......@@ -604,7 +604,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
break;
if (rate_mask & (1 << high))
break;
IL_DEBUG_RATE(priv, "Skipping masked higher rate: %d\n", high);
IL_DEBUG_RATE(il, "Skipping masked higher rate: %d\n", high);
}
return (high << 8) | low;
......@@ -626,8 +626,8 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
* rate table and must reference the driver allocated rate table
*
*/
static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
void *priv_sta, struct ieee80211_tx_rate_control *txrc)
static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
void *il_sta, struct ieee80211_tx_rate_control *txrc)
{
struct ieee80211_supported_band *sband = txrc->sband;
struct sk_buff *skb = txrc->skb;
......@@ -635,7 +635,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
u8 high = IL_RATE_INVALID;
u16 high_low;
int index;
struct il3945_rs_sta *rs_sta = priv_sta;
struct il3945_rs_sta *rs_sta = il_sta;
struct il3945_rate_scale_data *window = NULL;
int current_tpt = IL_INVALID_VALUE;
int low_tpt = IL_INVALID_VALUE;
......@@ -645,18 +645,18 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
unsigned long flags;
u16 rate_mask;
s8 max_rate_idx = -1;
struct il_priv *priv __maybe_unused = (struct il_priv *)priv_r;
struct il_priv *il __maybe_unused = (struct il_priv *)il_r;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
IL_DEBUG_RATE(priv, "enter\n");
IL_DEBUG_RATE(il, "enter\n");
/* Treat uninitialized rate scaling data same as non-existing. */
if (rs_sta && !rs_sta->priv) {
IL_DEBUG_RATE(priv, "Rate scaling information not initialized yet.\n");
priv_sta = NULL;
if (rs_sta && !rs_sta->il) {
IL_DEBUG_RATE(il, "Rate scaling information not initialized yet.\n");
il_sta = NULL;
}
if (rate_control_send_low(sta, priv_sta, txrc))
if (rate_control_send_low(sta, il_sta, txrc))
return;
rate_mask = sta->supp_rates[sband->band];
......@@ -699,7 +699,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
(window->success_counter < IL_RATE_MIN_SUCCESS_TH))) {
spin_unlock_irqrestore(&rs_sta->lock, flags);
IL_DEBUG_RATE(priv, "Invalid average_tpt on rate %d: "
IL_DEBUG_RATE(il, "Invalid average_tpt on rate %d: "
"counter: %d, success_counter: %d, "
"expected_tpt is %sNULL\n",
index,
......@@ -737,7 +737,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
/* Low success ratio , need to drop the rate */
if ((window->success_ratio < IL_RATE_DECREASE_TH) || !current_tpt) {
IL_DEBUG_RATE(priv, "decrease rate because of low success_ratio\n");
IL_DEBUG_RATE(il, "decrease rate because of low success_ratio\n");
scale_action = -1;
/* No throughput measured yet for adjacent rates,
* try increase */
......@@ -756,7 +756,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
(high_tpt != IL_INVALID_VALUE) &&
(low_tpt < current_tpt) && (high_tpt < current_tpt)) {
IL_DEBUG_RATE(priv, "No action -- low [%d] & high [%d] < "
IL_DEBUG_RATE(il, "No action -- low [%d] & high [%d] < "
"current_tpt [%d]\n",
low_tpt, high_tpt, current_tpt);
scale_action = 0;
......@@ -771,13 +771,13 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
window->success_ratio >= IL_RATE_INCREASE_TH)
scale_action = 1;
else {
IL_DEBUG_RATE(priv,
IL_DEBUG_RATE(il,
"decrease rate because of high tpt\n");
scale_action = 0;
}
} else if (low_tpt != IL_INVALID_VALUE) {
if (low_tpt > current_tpt) {
IL_DEBUG_RATE(priv,
IL_DEBUG_RATE(il,
"decrease rate because of low tpt\n");
scale_action = -1;
} else if (window->success_ratio >= IL_RATE_INCREASE_TH) {
......@@ -816,7 +816,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
break;
}
IL_DEBUG_RATE(priv, "Selected %d (action %d) - low %d high %d\n",
IL_DEBUG_RATE(il, "Selected %d (action %d) - low %d high %d\n",
index, scale_action, low, high);
out:
......@@ -831,7 +831,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
info->control.rates[0].idx = rs_sta->last_txrate_idx;
}
IL_DEBUG_RATE(priv, "leave: %d\n", index);
IL_DEBUG_RATE(il, "leave: %d\n", index);
}
#ifdef CONFIG_MAC80211_DEBUGFS
......@@ -878,10 +878,10 @@ static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
.llseek = default_llseek,
};
static void il3945_add_debugfs(void *priv, void *priv_sta,
static void il3945_add_debugfs(void *il, void *il_sta,
struct dentry *dir)
{
struct il3945_rs_sta *lq_sta = priv_sta;
struct il3945_rs_sta *lq_sta = il_sta;
lq_sta->rs_sta_dbgfs_stats_table_file =
debugfs_create_file("rate_stats_table", 0600, dir,
......@@ -889,9 +889,9 @@ static void il3945_add_debugfs(void *priv, void *priv_sta,
}
static void il3945_remove_debugfs(void *priv, void *priv_sta)
static void il3945_remove_debugfs(void *il, void *il_sta)
{
struct il3945_rs_sta *lq_sta = priv_sta;
struct il3945_rs_sta *lq_sta = il_sta;
debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file);
}
#endif
......@@ -901,9 +901,9 @@ static void il3945_remove_debugfs(void *priv, void *priv_sta)
* the station is added. Since mac80211 calls this function before a
* station is added we ignore it.
*/
static void il3945_rs_rate_init_stub(void *priv_r,
static void il3945_rs_rate_init_stub(void *il_r,
struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta, void *priv_sta)
struct ieee80211_sta *sta, void *il_sta)
{
}
......@@ -925,21 +925,21 @@ static struct rate_control_ops rs_ops = {
};
void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
{
struct il_priv *priv = hw->priv;
struct il_priv *il = hw->priv;
s32 rssi = 0;
unsigned long flags;
struct il3945_rs_sta *rs_sta;
struct ieee80211_sta *sta;
struct il3945_sta_priv *psta;
IL_DEBUG_RATE(priv, "enter\n");
IL_DEBUG_RATE(il, "enter\n");
rcu_read_lock();
sta = ieee80211_find_sta(priv->contexts[IL_RXON_CTX_BSS].vif,
priv->stations[sta_id].sta.sta.addr);
sta = ieee80211_find_sta(il->contexts[IL_RXON_CTX_BSS].vif,
il->stations[sta_id].sta.sta.addr);
if (!sta) {
IL_DEBUG_RATE(priv, "Unable to find station to initialize rate scaling.\n");
IL_DEBUG_RATE(il, "Unable to find station to initialize rate scaling.\n");
rcu_read_unlock();
return;
}
......@@ -950,10 +950,10 @@ void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
spin_lock_irqsave(&rs_sta->lock, flags);
rs_sta->tgg = 0;
switch (priv->band) {
switch (il->band) {
case IEEE80211_BAND_2GHZ:
/* TODO: this always does G, not a regression */
if (priv->contexts[IL_RXON_CTX_BSS].active.flags &
if (il->contexts[IL_RXON_CTX_BSS].active.flags &
RXON_FLG_TGG_PROTECT_MSK) {
rs_sta->tgg = 1;
rs_sta->expected_tpt = il3945_expected_tpt_g_prot;
......@@ -971,15 +971,15 @@ void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
spin_unlock_irqrestore(&rs_sta->lock, flags);
rssi = priv->_3945.last_rx_rssi;
rssi = il->_3945.last_rx_rssi;
if (rssi == 0)
rssi = IL_MIN_RSSI_VAL;
IL_DEBUG_RATE(priv, "Network RSSI: %d\n", rssi);
IL_DEBUG_RATE(il, "Network RSSI: %d\n", rssi);
rs_sta->start_rate = il3945_get_rate_index_by_rssi(rssi, priv->band);
rs_sta->start_rate = il3945_get_rate_index_by_rssi(rssi, il->band);
IL_DEBUG_RATE(priv, "leave: rssi %d assign rate index: "
IL_DEBUG_RATE(il, "leave: rssi %d assign rate index: "
"%d (plcp 0x%x)\n", rssi, rs_sta->start_rate,
il3945_rates[rs_sta->start_rate].plcp);
rcu_read_unlock();
......
......@@ -85,7 +85,7 @@ struct il3945_rate_scale_data {
struct il3945_rs_sta {
spinlock_t lock;
struct il_priv *priv;
struct il_priv *il;
s32 *expected_tpt;
unsigned long last_partial_flush;
unsigned long last_flush;
......@@ -207,12 +207,12 @@ struct il3945_ibss_seq {
*****************************************************************************/
extern int il3945_calc_db_from_ratio(int sig_ratio);
extern void il3945_rx_replenish(void *data);
extern void il3945_rx_queue_reset(struct il_priv *priv, struct il_rx_queue *rxq);
extern unsigned int il3945_fill_beacon_frame(struct il_priv *priv,
extern void il3945_rx_queue_reset(struct il_priv *il, struct il_rx_queue *rxq);
extern unsigned int il3945_fill_beacon_frame(struct il_priv *il,
struct ieee80211_hdr *hdr, int left);
extern int il3945_dump_nic_event_log(struct il_priv *priv, bool full_log,
extern int il3945_dump_nic_event_log(struct il_priv *il, bool full_log,
char **buf, bool display);
extern void il3945_dump_nic_error_log(struct il_priv *priv);
extern void il3945_dump_nic_error_log(struct il_priv *il);
/******************************************************************************
*
......@@ -230,44 +230,44 @@ extern void il3945_dump_nic_error_log(struct il_priv *priv);
* il3945_mac_ <-- mac80211 callback
*
****************************************************************************/
extern void il3945_hw_rx_handler_setup(struct il_priv *priv);
extern void il3945_hw_setup_deferred_work(struct il_priv *priv);
extern void il3945_hw_cancel_deferred_work(struct il_priv *priv);
extern int il3945_hw_rxq_stop(struct il_priv *priv);
extern int il3945_hw_set_hw_params(struct il_priv *priv);
extern int il3945_hw_nic_init(struct il_priv *priv);
extern int il3945_hw_nic_stop_master(struct il_priv *priv);
extern void il3945_hw_txq_ctx_free(struct il_priv *priv);
extern void il3945_hw_txq_ctx_stop(struct il_priv *priv);
extern int il3945_hw_nic_reset(struct il_priv *priv);
extern int il3945_hw_txq_attach_buf_to_tfd(struct il_priv *priv,
extern void il3945_hw_rx_handler_setup(struct il_priv *il);
extern void il3945_hw_setup_deferred_work(struct il_priv *il);
extern void il3945_hw_cancel_deferred_work(struct il_priv *il);
extern int il3945_hw_rxq_stop(struct il_priv *il);
extern int il3945_hw_set_hw_params(struct il_priv *il);
extern int il3945_hw_nic_init(struct il_priv *il);
extern int il3945_hw_nic_stop_master(struct il_priv *il);
extern void il3945_hw_txq_ctx_free(struct il_priv *il);
extern void il3945_hw_txq_ctx_stop(struct il_priv *il);
extern int il3945_hw_nic_reset(struct il_priv *il);
extern int il3945_hw_txq_attach_buf_to_tfd(struct il_priv *il,
struct il_tx_queue *txq,
dma_addr_t addr, u16 len,
u8 reset, u8 pad);
extern void il3945_hw_txq_free_tfd(struct il_priv *priv,
extern void il3945_hw_txq_free_tfd(struct il_priv *il,
struct il_tx_queue *txq);
extern int il3945_hw_get_temperature(struct il_priv *priv);
extern int il3945_hw_tx_queue_init(struct il_priv *priv,
extern int il3945_hw_get_temperature(struct il_priv *il);
extern int il3945_hw_tx_queue_init(struct il_priv *il,
struct il_tx_queue *txq);
extern unsigned int il3945_hw_get_beacon_cmd(struct il_priv *priv,
extern unsigned int il3945_hw_get_beacon_cmd(struct il_priv *il,
struct il3945_frame *frame, u8 rate);
void il3945_hw_build_tx_cmd_rate(struct il_priv *priv,
void il3945_hw_build_tx_cmd_rate(struct il_priv *il,
struct il_device_cmd *cmd,
struct ieee80211_tx_info *info,
struct ieee80211_hdr *hdr,
int sta_id, int tx_id);
extern int il3945_hw_reg_send_txpower(struct il_priv *priv);
extern int il3945_hw_reg_set_txpower(struct il_priv *priv, s8 power);
extern void il3945_hw_rx_statistics(struct il_priv *priv,
extern int il3945_hw_reg_send_txpower(struct il_priv *il);
extern int il3945_hw_reg_set_txpower(struct il_priv *il, s8 power);
extern void il3945_hw_rx_statistics(struct il_priv *il,
struct il_rx_mem_buffer *rxb);
void il3945_reply_statistics(struct il_priv *priv,
void il3945_reply_statistics(struct il_priv *il,
struct il_rx_mem_buffer *rxb);
extern void il3945_disable_events(struct il_priv *priv);
extern int il4965_get_temperature(const struct il_priv *priv);
extern void il3945_post_associate(struct il_priv *priv);
extern void il3945_config_ap(struct il_priv *priv);
extern void il3945_disable_events(struct il_priv *il);
extern int il4965_get_temperature(const struct il_priv *il);
extern void il3945_post_associate(struct il_priv *il);
extern void il3945_config_ap(struct il_priv *il);
extern int il3945_commit_rxon(struct il_priv *priv,
extern int il3945_commit_rxon(struct il_priv *il,
struct il_rxon_context *ctx);
/**
......@@ -278,26 +278,26 @@ extern int il3945_commit_rxon(struct il_priv *priv,
* not yet been merged into a single common layer for managing the
* station tables.
*/
extern u8 il3945_hw_find_station(struct il_priv *priv, const u8 *bssid);
extern u8 il3945_hw_find_station(struct il_priv *il, const u8 *bssid);
extern struct ieee80211_ops il3945_hw_ops;
/*
* Forward declare iwl-3945.c functions for iwl3945-base.c
*/
extern __le32 il3945_get_antenna_flags(const struct il_priv *priv);
extern int il3945_init_hw_rate_table(struct il_priv *priv);
extern void il3945_reg_txpower_periodic(struct il_priv *priv);
extern int il3945_txpower_set_from_eeprom(struct il_priv *priv);
extern __le32 il3945_get_antenna_flags(const struct il_priv *il);
extern int il3945_init_hw_rate_table(struct il_priv *il);
extern void il3945_reg_txpower_periodic(struct il_priv *il);
extern int il3945_txpower_set_from_eeprom(struct il_priv *il);
extern const struct il_channel_info *il3945_get_channel_info(
const struct il_priv *priv, enum ieee80211_band band, u16 channel);
const struct il_priv *il, enum ieee80211_band band, u16 channel);
extern int il3945_rs_next_rate(struct il_priv *priv, int rate);
extern int il3945_rs_next_rate(struct il_priv *il, int rate);
/* scanning */
int il3945_request_scan(struct il_priv *priv, struct ieee80211_vif *vif);
void il3945_post_scan(struct il_priv *priv);
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];
......
......@@ -66,10 +66,10 @@
#include "iwl-core.h"
#include "iwl-commands.h"
void il4965_chain_noise_calibration(struct il_priv *priv, void *stat_resp);
void il4965_sensitivity_calibration(struct il_priv *priv, void *resp);
void il4965_init_sensitivity(struct il_priv *priv);
void il4965_reset_run_time_calib(struct il_priv *priv);
void il4965_calib_free_results(struct il_priv *priv);
void il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp);
void il4965_sensitivity_calibration(struct il_priv *il, void *resp);
void il4965_init_sensitivity(struct il_priv *il);
void il4965_reset_run_time_calib(struct il_priv *il);
void il4965_calib_free_results(struct il_priv *il);
#endif /* __il_4965_calib_h__ */
......@@ -33,12 +33,12 @@ static const char *fmt_table = " %-30s %10u %10u %10u %10u\n";
static const char *fmt_header =
"%-32s current cumulative delta max\n";
static int il4965_statistics_flag(struct il_priv *priv, char *buf, int bufsz)
static int il4965_statistics_flag(struct il_priv *il, char *buf, int bufsz)
{
int p = 0;
u32 flag;
flag = le32_to_cpu(priv->_4965.statistics.flag);
flag = le32_to_cpu(il->_4965.statistics.flag);
p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", flag);
if (flag & UCODE_STATISTICS_CLEAR_MSK)
......@@ -57,7 +57,7 @@ static int il4965_statistics_flag(struct il_priv *priv, char *buf, int bufsz)
ssize_t il4965_ucode_rx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct il_priv *priv = file->private_data;
struct il_priv *il = file->private_data;
int pos = 0;
char *buf;
int bufsz = sizeof(struct statistics_rx_phy) * 40 +
......@@ -70,12 +70,12 @@ ssize_t il4965_ucode_rx_stats_read(struct file *file, char __user *user_buf,
struct statistics_rx_non_phy *delta_general, *max_general;
struct statistics_rx_ht_phy *ht, *accum_ht, *delta_ht, *max_ht;
if (!il_is_alive(priv))
if (!il_is_alive(il))
return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n");
IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM;
}
......@@ -84,24 +84,24 @@ ssize_t il4965_ucode_rx_stats_read(struct file *file, char __user *user_buf,
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
ofdm = &priv->_4965.statistics.rx.ofdm;
cck = &priv->_4965.statistics.rx.cck;
general = &priv->_4965.statistics.rx.general;
ht = &priv->_4965.statistics.rx.ofdm_ht;
accum_ofdm = &priv->_4965.accum_statistics.rx.ofdm;
accum_cck = &priv->_4965.accum_statistics.rx.cck;
accum_general = &priv->_4965.accum_statistics.rx.general;
accum_ht = &priv->_4965.accum_statistics.rx.ofdm_ht;
delta_ofdm = &priv->_4965.delta_statistics.rx.ofdm;
delta_cck = &priv->_4965.delta_statistics.rx.cck;
delta_general = &priv->_4965.delta_statistics.rx.general;
delta_ht = &priv->_4965.delta_statistics.rx.ofdm_ht;
max_ofdm = &priv->_4965.max_delta.rx.ofdm;
max_cck = &priv->_4965.max_delta.rx.cck;
max_general = &priv->_4965.max_delta.rx.general;
max_ht = &priv->_4965.max_delta.rx.ofdm_ht;
ofdm = &il->_4965.statistics.rx.ofdm;
cck = &il->_4965.statistics.rx.cck;
general = &il->_4965.statistics.rx.general;
ht = &il->_4965.statistics.rx.ofdm_ht;
accum_ofdm = &il->_4965.accum_statistics.rx.ofdm;
accum_cck = &il->_4965.accum_statistics.rx.cck;
accum_general = &il->_4965.accum_statistics.rx.general;
accum_ht = &il->_4965.accum_statistics.rx.ofdm_ht;
delta_ofdm = &il->_4965.delta_statistics.rx.ofdm;
delta_cck = &il->_4965.delta_statistics.rx.cck;
delta_general = &il->_4965.delta_statistics.rx.general;
delta_ht = &il->_4965.delta_statistics.rx.ofdm_ht;
max_ofdm = &il->_4965.max_delta.rx.ofdm;
max_cck = &il->_4965.max_delta.rx.cck;
max_general = &il->_4965.max_delta.rx.general;
max_ht = &il->_4965.max_delta.rx.ofdm_ht;
pos += il4965_statistics_flag(priv, buf, bufsz);
pos += il4965_statistics_flag(il, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos,
fmt_header, "Statistics_Rx - OFDM:");
pos += scnprintf(buf + pos, bufsz - pos,
......@@ -489,19 +489,19 @@ ssize_t il4965_ucode_tx_stats_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct il_priv *priv = file->private_data;
struct il_priv *il = file->private_data;
int pos = 0;
char *buf;
int bufsz = (sizeof(struct statistics_tx) * 48) + 250;
ssize_t ret;
struct statistics_tx *tx, *accum_tx, *delta_tx, *max_tx;
if (!il_is_alive(priv))
if (!il_is_alive(il))
return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n");
IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM;
}
......@@ -509,12 +509,12 @@ ssize_t il4965_ucode_tx_stats_read(struct file *file,
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
tx = &priv->_4965.statistics.tx;
accum_tx = &priv->_4965.accum_statistics.tx;
delta_tx = &priv->_4965.delta_statistics.tx;
max_tx = &priv->_4965.max_delta.tx;
tx = &il->_4965.statistics.tx;
accum_tx = &il->_4965.accum_statistics.tx;
delta_tx = &il->_4965.delta_statistics.tx;
max_tx = &il->_4965.max_delta.tx;
pos += il4965_statistics_flag(priv, buf, bufsz);
pos += il4965_statistics_flag(il, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos,
fmt_header, "Statistics_Tx:");
pos += scnprintf(buf + pos, bufsz - pos,
......@@ -664,7 +664,7 @@ ssize_t
il4965_ucode_general_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct il_priv *priv = file->private_data;
struct il_priv *il = file->private_data;
int pos = 0;
char *buf;
int bufsz = sizeof(struct statistics_general) * 10 + 300;
......@@ -674,12 +674,12 @@ il4965_ucode_general_stats_read(struct file *file, char __user *user_buf,
struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg;
struct statistics_div *div, *accum_div, *delta_div, *max_div;
if (!il_is_alive(priv))
if (!il_is_alive(il))
return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n");
IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM;
}
......@@ -687,20 +687,20 @@ il4965_ucode_general_stats_read(struct file *file, char __user *user_buf,
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
general = &priv->_4965.statistics.general.common;
dbg = &priv->_4965.statistics.general.common.dbg;
div = &priv->_4965.statistics.general.common.div;
accum_general = &priv->_4965.accum_statistics.general.common;
accum_dbg = &priv->_4965.accum_statistics.general.common.dbg;
accum_div = &priv->_4965.accum_statistics.general.common.div;
delta_general = &priv->_4965.delta_statistics.general.common;
max_general = &priv->_4965.max_delta.general.common;
delta_dbg = &priv->_4965.delta_statistics.general.common.dbg;
max_dbg = &priv->_4965.max_delta.general.common.dbg;
delta_div = &priv->_4965.delta_statistics.general.common.div;
max_div = &priv->_4965.max_delta.general.common.div;
general = &il->_4965.statistics.general.common;
dbg = &il->_4965.statistics.general.common.dbg;
div = &il->_4965.statistics.general.common.div;
accum_general = &il->_4965.accum_statistics.general.common;
accum_dbg = &il->_4965.accum_statistics.general.common.dbg;
accum_div = &il->_4965.accum_statistics.general.common.div;
delta_general = &il->_4965.delta_statistics.general.common;
max_general = &il->_4965.max_delta.general.common;
delta_dbg = &il->_4965.delta_statistics.general.common.dbg;
max_dbg = &il->_4965.max_delta.general.common.dbg;
delta_div = &il->_4965.delta_statistics.general.common.div;
max_div = &il->_4965.max_delta.general.common.div;
pos += il4965_statistics_flag(priv, buf, bufsz);
pos += il4965_statistics_flag(il, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos,
fmt_header, "Statistics_General:");
pos += scnprintf(buf + pos, bufsz - pos,
......
......@@ -87,23 +87,23 @@
* EEPROM chip, not a single event, so even reads could conflict if they
* weren't arbitrated by the semaphore.
*/
int il4965_eeprom_acquire_semaphore(struct il_priv *priv)
int il4965_eeprom_acquire_semaphore(struct il_priv *il)
{
u16 count;
int ret;
for (count = 0; count < EEPROM_SEM_RETRY_LIMIT; count++) {
/* Request semaphore */
il_set_bit(priv, CSR_HW_IF_CONFIG_REG,
il_set_bit(il, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM);
/* See if we got it */
ret = il_poll_bit(priv, CSR_HW_IF_CONFIG_REG,
ret = il_poll_bit(il, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
EEPROM_SEM_TIMEOUT);
if (ret >= 0) {
IL_DEBUG_IO(priv,
IL_DEBUG_IO(il,
"Acquired semaphore after %d tries.\n",
count+1);
return ret;
......@@ -113,42 +113,42 @@ int il4965_eeprom_acquire_semaphore(struct il_priv *priv)
return ret;
}
void il4965_eeprom_release_semaphore(struct il_priv *priv)
void il4965_eeprom_release_semaphore(struct il_priv *il)
{
il_clear_bit(priv, CSR_HW_IF_CONFIG_REG,
il_clear_bit(il, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM);
}
int il4965_eeprom_check_version(struct il_priv *priv)
int il4965_eeprom_check_version(struct il_priv *il)
{
u16 eeprom_ver;
u16 calib_ver;
eeprom_ver = il_eeprom_query16(priv, EEPROM_VERSION);
calib_ver = il_eeprom_query16(priv,
eeprom_ver = il_eeprom_query16(il, EEPROM_VERSION);
calib_ver = il_eeprom_query16(il,
EEPROM_4965_CALIB_VERSION_OFFSET);
if (eeprom_ver < priv->cfg->eeprom_ver ||
calib_ver < priv->cfg->eeprom_calib_ver)
if (eeprom_ver < il->cfg->eeprom_ver ||
calib_ver < il->cfg->eeprom_calib_ver)
goto err;
IL_INFO(priv, "device EEPROM VER=0x%x, CALIB=0x%x\n",
IL_INFO(il, "device EEPROM VER=0x%x, CALIB=0x%x\n",
eeprom_ver, calib_ver);
return 0;
err:
IL_ERR(priv, "Unsupported (too old) EEPROM VER=0x%x < 0x%x "
IL_ERR(il, "Unsupported (too old) EEPROM VER=0x%x < 0x%x "
"CALIB=0x%x < 0x%x\n",
eeprom_ver, priv->cfg->eeprom_ver,
calib_ver, priv->cfg->eeprom_calib_ver);
eeprom_ver, il->cfg->eeprom_ver,
calib_ver, il->cfg->eeprom_calib_ver);
return -EINVAL;
}
void il4965_eeprom_get_mac(const struct il_priv *priv, u8 *mac)
void il4965_eeprom_get_mac(const struct il_priv *il, u8 *mac)
{
const u8 *addr = il_eeprom_query_addr(priv,
const u8 *addr = il_eeprom_query_addr(il,
EEPROM_MAC_ADDRESS);
memcpy(mac, addr, ETH_ALEN);
}
......@@ -44,7 +44,7 @@
/* Send led command */
static int
il4965_send_led_cmd(struct il_priv *priv, struct il_led_cmd *led_cmd)
il4965_send_led_cmd(struct il_priv *il, struct il_led_cmd *led_cmd)
{
struct il_host_cmd cmd = {
.id = REPLY_LEDS_CMD,
......@@ -55,17 +55,17 @@ il4965_send_led_cmd(struct il_priv *priv, struct il_led_cmd *led_cmd)
};
u32 reg;
reg = il_read32(priv, CSR_LED_REG);
reg = il_read32(il, CSR_LED_REG);
if (reg != (reg & CSR_LED_BSM_CTRL_MSK))
il_write32(priv, CSR_LED_REG, reg & CSR_LED_BSM_CTRL_MSK);
il_write32(il, CSR_LED_REG, reg & CSR_LED_BSM_CTRL_MSK);
return il_send_cmd(priv, &cmd);
return il_send_cmd(il, &cmd);
}
/* Set led register off */
void il4965_led_enable(struct il_priv *priv)
void il4965_led_enable(struct il_priv *il)
{
il_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_ON);
il_write32(il, CSR_LED_REG, CSR_LED_REG_TRUN_ON);
}
const struct il_led_ops il4965_led_ops = {
......
......@@ -28,6 +28,6 @@
#define __il_4965_led_h__
extern const struct il_led_ops il4965_led_ops;
void il4965_led_enable(struct il_priv *priv);
void il4965_led_enable(struct il_priv *il);
#endif /* __il_4965_led_h__ */
......@@ -41,7 +41,7 @@
#include "iwl-4965-hw.h"
#include "iwl-4965.h"
void il4965_rx_missed_beacon_notif(struct il_priv *priv,
void il4965_rx_missed_beacon_notif(struct il_priv *il,
struct il_rx_mem_buffer *rxb)
{
......@@ -50,22 +50,22 @@ void il4965_rx_missed_beacon_notif(struct il_priv *priv,
missed_beacon = &pkt->u.missed_beacon;
if (le32_to_cpu(missed_beacon->consecutive_missed_beacons) >
priv->missed_beacon_threshold) {
IL_DEBUG_CALIB(priv,
il->missed_beacon_threshold) {
IL_DEBUG_CALIB(il,
"missed bcn cnsq %d totl %d rcd %d expctd %d\n",
le32_to_cpu(missed_beacon->consecutive_missed_beacons),
le32_to_cpu(missed_beacon->total_missed_becons),
le32_to_cpu(missed_beacon->num_recvd_beacons),
le32_to_cpu(missed_beacon->num_expected_beacons));
if (!test_bit(STATUS_SCANNING, &priv->status))
il4965_init_sensitivity(priv);
if (!test_bit(STATUS_SCANNING, &il->status))
il4965_init_sensitivity(il);
}
}
/* Calculate noise level, based on measurements during network silence just
* before arriving beacon. This measurement can be done only if we know
* exactly when to expect beacons, therefore only when we're associated. */
static void il4965_rx_calc_noise(struct il_priv *priv)
static void il4965_rx_calc_noise(struct il_priv *il)
{
struct statistics_rx_non_phy *rx_info;
int num_active_rx = 0;
......@@ -73,7 +73,7 @@ static void il4965_rx_calc_noise(struct il_priv *priv)
int bcn_silence_a, bcn_silence_b, bcn_silence_c;
int last_rx_noise;
rx_info = &(priv->_4965.statistics.rx.general);
rx_info = &(il->_4965.statistics.rx.general);
bcn_silence_a =
le32_to_cpu(rx_info->beacon_silence_rssi_a) & IN_BAND_FILTER;
bcn_silence_b =
......@@ -100,7 +100,7 @@ static void il4965_rx_calc_noise(struct il_priv *priv)
else
last_rx_noise = IL_NOISE_MEAS_NOT_AVAILABLE;
IL_DEBUG_CALIB(priv, "inband silence a %u, b %u, c %u, dBm %d\n",
IL_DEBUG_CALIB(il, "inband silence a %u, b %u, c %u, dBm %d\n",
bcn_silence_a, bcn_silence_b, bcn_silence_c,
last_rx_noise);
}
......@@ -111,7 +111,7 @@ static void il4965_rx_calc_noise(struct il_priv *priv)
* FIXME: This function is for debugging, do not deal with
* the case of counters roll-over.
*/
static void il4965_accumulative_statistics(struct il_priv *priv,
static void il4965_accumulative_statistics(struct il_priv *il,
__le32 *stats)
{
int i, size;
......@@ -121,15 +121,15 @@ static void il4965_accumulative_statistics(struct il_priv *priv,
struct statistics_general_common *general, *accum_general;
struct statistics_tx *tx, *accum_tx;
prev_stats = (__le32 *)&priv->_4965.statistics;
accum_stats = (u32 *)&priv->_4965.accum_statistics;
prev_stats = (__le32 *)&il->_4965.statistics;
accum_stats = (u32 *)&il->_4965.accum_statistics;
size = sizeof(struct il_notif_statistics);
general = &priv->_4965.statistics.general.common;
accum_general = &priv->_4965.accum_statistics.general.common;
tx = &priv->_4965.statistics.tx;
accum_tx = &priv->_4965.accum_statistics.tx;
delta = (u32 *)&priv->_4965.delta_statistics;
max_delta = (u32 *)&priv->_4965.max_delta;
general = &il->_4965.statistics.general.common;
accum_general = &il->_4965.accum_statistics.general.common;
tx = &il->_4965.statistics.tx;
accum_tx = &il->_4965.accum_statistics.tx;
delta = (u32 *)&il->_4965.delta_statistics;
max_delta = (u32 *)&il->_4965.max_delta;
for (i = sizeof(__le32); i < size;
i += sizeof(__le32), stats++, prev_stats++, delta++,
......@@ -151,65 +151,65 @@ static void il4965_accumulative_statistics(struct il_priv *priv,
#define REG_RECALIB_PERIOD (60)
void il4965_rx_statistics(struct il_priv *priv,
void il4965_rx_statistics(struct il_priv *il,
struct il_rx_mem_buffer *rxb)
{
int change;
struct il_rx_packet *pkt = rxb_addr(rxb);
IL_DEBUG_RX(priv,
IL_DEBUG_RX(il,
"Statistics notification received (%d vs %d).\n",
(int)sizeof(struct il_notif_statistics),
le32_to_cpu(pkt->len_n_flags) &
FH_RSCSR_FRAME_SIZE_MSK);
change = ((priv->_4965.statistics.general.common.temperature !=
change = ((il->_4965.statistics.general.common.temperature !=
pkt->u.stats.general.common.temperature) ||
((priv->_4965.statistics.flag &
((il->_4965.statistics.flag &
STATISTICS_REPLY_FLG_HT40_MODE_MSK) !=
(pkt->u.stats.flag &
STATISTICS_REPLY_FLG_HT40_MODE_MSK)));
#ifdef CONFIG_IWLWIFI_LEGACY_DEBUGFS
il4965_accumulative_statistics(priv, (__le32 *)&pkt->u.stats);
il4965_accumulative_statistics(il, (__le32 *)&pkt->u.stats);
#endif
/* TODO: reading some of statistics is unneeded */
memcpy(&priv->_4965.statistics, &pkt->u.stats,
sizeof(priv->_4965.statistics));
memcpy(&il->_4965.statistics, &pkt->u.stats,
sizeof(il->_4965.statistics));
set_bit(STATUS_STATISTICS, &priv->status);
set_bit(STATUS_STATISTICS, &il->status);
/* Reschedule the statistics timer to occur in
* REG_RECALIB_PERIOD seconds to ensure we get a
* thermal update even if the uCode doesn't give
* us one */
mod_timer(&priv->statistics_periodic, jiffies +
mod_timer(&il->statistics_periodic, jiffies +
msecs_to_jiffies(REG_RECALIB_PERIOD * 1000));
if (unlikely(!test_bit(STATUS_SCANNING, &priv->status)) &&
if (unlikely(!test_bit(STATUS_SCANNING, &il->status)) &&
(pkt->hdr.cmd == STATISTICS_NOTIFICATION)) {
il4965_rx_calc_noise(priv);
queue_work(priv->workqueue, &priv->run_time_calib_work);
il4965_rx_calc_noise(il);
queue_work(il->workqueue, &il->run_time_calib_work);
}
if (priv->cfg->ops->lib->temp_ops.temperature && change)
priv->cfg->ops->lib->temp_ops.temperature(priv);
if (il->cfg->ops->lib->temp_ops.temperature && change)
il->cfg->ops->lib->temp_ops.temperature(il);
}
void il4965_reply_statistics(struct il_priv *priv,
void il4965_reply_statistics(struct il_priv *il,
struct il_rx_mem_buffer *rxb)
{
struct il_rx_packet *pkt = rxb_addr(rxb);
if (le32_to_cpu(pkt->u.stats.flag) & UCODE_STATISTICS_CLEAR_MSK) {
#ifdef CONFIG_IWLWIFI_LEGACY_DEBUGFS
memset(&priv->_4965.accum_statistics, 0,
memset(&il->_4965.accum_statistics, 0,
sizeof(struct il_notif_statistics));
memset(&priv->_4965.delta_statistics, 0,
memset(&il->_4965.delta_statistics, 0,
sizeof(struct il_notif_statistics));
memset(&priv->_4965.max_delta, 0,
memset(&il->_4965.max_delta, 0,
sizeof(struct il_notif_statistics));
#endif
IL_DEBUG_RX(priv, "Statistics have been cleared\n");
IL_DEBUG_RX(il, "Statistics have been cleared\n");
}
il4965_rx_statistics(priv, rxb);
il4965_rx_statistics(il, rxb);
}
......@@ -48,22 +48,22 @@
* it's a pretty good bet that everything between them is good, too.
*/
static int
il4965_verify_inst_sparse(struct il_priv *priv, __le32 *image, u32 len)
il4965_verify_inst_sparse(struct il_priv *il, __le32 *image, u32 len)
{
u32 val;
int ret = 0;
u32 errcnt = 0;
u32 i;
IL_DEBUG_INFO(priv, "ucode inst image size is %u\n", len);
IL_DEBUG_INFO(il, "ucode inst image size is %u\n", len);
for (i = 0; i < len; i += 100, image += 100/sizeof(u32)) {
/* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */
il_write_direct32(priv, HBUS_TARG_MEM_RADDR,
il_write_direct32(il, HBUS_TARG_MEM_RADDR,
i + IWL4965_RTC_INST_LOWER_BOUND);
val = _il_read_direct32(priv, HBUS_TARG_MEM_RDAT);
val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) {
ret = -EIO;
errcnt++;
......@@ -79,7 +79,7 @@ il4965_verify_inst_sparse(struct il_priv *priv, __le32 *image, u32 len)
* il4965_verify_inst_full - verify runtime uCode image in card vs. host,
* looking at all data.
*/
static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
static int il4965_verify_inst_full(struct il_priv *il, __le32 *image,
u32 len)
{
u32 val;
......@@ -87,9 +87,9 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
int ret = 0;
u32 errcnt;
IL_DEBUG_INFO(priv, "ucode inst image size is %u\n", len);
IL_DEBUG_INFO(il, "ucode inst image size is %u\n", len);
il_write_direct32(priv, HBUS_TARG_MEM_RADDR,
il_write_direct32(il, HBUS_TARG_MEM_RADDR,
IWL4965_RTC_INST_LOWER_BOUND);
errcnt = 0;
......@@ -97,9 +97,9 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
/* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */
val = _il_read_direct32(priv, HBUS_TARG_MEM_RDAT);
val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) {
IL_ERR(priv, "uCode INST section is invalid at "
IL_ERR(il, "uCode INST section is invalid at "
"offset 0x%x, is 0x%x, s/b 0x%x\n",
save_len - len, val, le32_to_cpu(*image));
ret = -EIO;
......@@ -110,7 +110,7 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
}
if (!errcnt)
IL_DEBUG_INFO(priv,
IL_DEBUG_INFO(il,
"ucode image in INSTRUCTION memory is good\n");
return ret;
......@@ -120,47 +120,47 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
* il4965_verify_ucode - determine which instruction image is in SRAM,
* and verify its contents
*/
int il4965_verify_ucode(struct il_priv *priv)
int il4965_verify_ucode(struct il_priv *il)
{
__le32 *image;
u32 len;
int ret;
/* Try bootstrap */
image = (__le32 *)priv->ucode_boot.v_addr;
len = priv->ucode_boot.len;
ret = il4965_verify_inst_sparse(priv, image, len);
image = (__le32 *)il->ucode_boot.v_addr;
len = il->ucode_boot.len;
ret = il4965_verify_inst_sparse(il, image, len);
if (!ret) {
IL_DEBUG_INFO(priv, "Bootstrap uCode is good in inst SRAM\n");
IL_DEBUG_INFO(il, "Bootstrap uCode is good in inst SRAM\n");
return 0;
}
/* Try initialize */
image = (__le32 *)priv->ucode_init.v_addr;
len = priv->ucode_init.len;
ret = il4965_verify_inst_sparse(priv, image, len);
image = (__le32 *)il->ucode_init.v_addr;
len = il->ucode_init.len;
ret = il4965_verify_inst_sparse(il, image, len);
if (!ret) {
IL_DEBUG_INFO(priv, "Initialize uCode is good in inst SRAM\n");
IL_DEBUG_INFO(il, "Initialize uCode is good in inst SRAM\n");
return 0;
}
/* Try runtime/protocol */
image = (__le32 *)priv->ucode_code.v_addr;
len = priv->ucode_code.len;
ret = il4965_verify_inst_sparse(priv, image, len);
image = (__le32 *)il->ucode_code.v_addr;
len = il->ucode_code.len;
ret = il4965_verify_inst_sparse(il, image, len);
if (!ret) {
IL_DEBUG_INFO(priv, "Runtime uCode is good in inst SRAM\n");
IL_DEBUG_INFO(il, "Runtime uCode is good in inst SRAM\n");
return 0;
}
IL_ERR(priv, "NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n");
IL_ERR(il, "NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n");
/* Since nothing seems to match, show first several data entries in
* instruction SRAM, so maybe visual inspection will give a clue.
* Selection of bootstrap image (vs. other images) is arbitrary. */
image = (__le32 *)priv->ucode_boot.v_addr;
len = priv->ucode_boot.len;
ret = il4965_verify_inst_full(priv, image, len);
image = (__le32 *)il->ucode_boot.v_addr;
len = il->ucode_boot.len;
ret = il4965_verify_inst_full(il, image, len);
return ret;
}
......@@ -37,7 +37,7 @@ extern u32 iwlegacy_debug_level;
#define IL_INFO(p, f, a...) dev_info(&((p)->pci_dev->dev), f, ## a)
#define IL_CRIT(p, f, a...) dev_crit(&((p)->pci_dev->dev), f, ## a)
#define il_print_hex_error(priv, p, len) \
#define il_print_hex_error(il, p, len) \
do { \
print_hex_dump(KERN_ERR, "iwl data: ", \
DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
......@@ -60,9 +60,9 @@ do { \
__func__ , ## args); \
} while (0)
#define il_print_hex_dump(priv, level, p, len) \
#define il_print_hex_dump(il, level, p, len) \
do { \
if (il_get_debug_level(priv) & level) \
if (il_get_debug_level(il) & level) \
print_hex_dump(KERN_DEBUG, "iwl data: ", \
DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
} while (0)
......@@ -70,21 +70,21 @@ do { \
#else
#define IL_DEBUG(__priv, level, fmt, args...)
#define IL_DEBUG_LIMIT(__priv, level, fmt, args...)
static inline void il_print_hex_dump(struct il_priv *priv, int level,
static inline void il_print_hex_dump(struct il_priv *il, int level,
const void *p, u32 len)
{}
#endif /* CONFIG_IWLWIFI_LEGACY_DEBUG */
#ifdef CONFIG_IWLWIFI_LEGACY_DEBUGFS
int il_dbgfs_register(struct il_priv *priv, const char *name);
void il_dbgfs_unregister(struct il_priv *priv);
int il_dbgfs_register(struct il_priv *il, const char *name);
void il_dbgfs_unregister(struct il_priv *il);
#else
static inline int
il_dbgfs_register(struct il_priv *priv, const char *name)
il_dbgfs_register(struct il_priv *il, const char *name)
{
return 0;
}
static inline void il_dbgfs_unregister(struct il_priv *priv)
static inline void il_dbgfs_unregister(struct il_priv *il)
{
}
#endif /* CONFIG_IWLWIFI_LEGACY_DEBUGFS */
......
......@@ -325,20 +325,20 @@ struct il_eeprom_calib_info {
struct il_eeprom_ops {
const u32 regulatory_bands[7];
int (*acquire_semaphore) (struct il_priv *priv);
void (*release_semaphore) (struct il_priv *priv);
int (*acquire_semaphore) (struct il_priv *il);
void (*release_semaphore) (struct il_priv *il);
};
int il_eeprom_init(struct il_priv *priv);
void il_eeprom_free(struct il_priv *priv);
const u8 *il_eeprom_query_addr(const struct il_priv *priv,
int il_eeprom_init(struct il_priv *il);
void il_eeprom_free(struct il_priv *il);
const u8 *il_eeprom_query_addr(const struct il_priv *il,
size_t offset);
u16 il_eeprom_query16(const struct il_priv *priv, size_t offset);
int il_init_channel_map(struct il_priv *priv);
void il_free_channel_map(struct il_priv *priv);
u16 il_eeprom_query16(const struct il_priv *il, size_t offset);
int il_init_channel_map(struct il_priv *il);
void il_free_channel_map(struct il_priv *il);
const struct il_channel_info *il_get_channel_info(
const struct il_priv *priv,
const struct il_priv *il,
enum ieee80211_band band, u16 channel);
#endif /* __il_eeprom_h__ */
......@@ -108,28 +108,28 @@ il_set_swq_id(struct il_tx_queue *txq, u8 ac, u8 hwq)
txq->swq_id = (hwq << 2) | ac;
}
static inline void il_wake_queue(struct il_priv *priv,
static inline void il_wake_queue(struct il_priv *il,
struct il_tx_queue *txq)
{
u8 queue = txq->swq_id;
u8 ac = queue & 3;
u8 hwq = (queue >> 2) & 0x1f;
if (test_and_clear_bit(hwq, priv->queue_stopped))
if (atomic_dec_return(&priv->queue_stop_count[ac]) <= 0)
ieee80211_wake_queue(priv->hw, ac);
if (test_and_clear_bit(hwq, il->queue_stopped))
if (atomic_dec_return(&il->queue_stop_count[ac]) <= 0)
ieee80211_wake_queue(il->hw, ac);
}
static inline void il_stop_queue(struct il_priv *priv,
static inline void il_stop_queue(struct il_priv *il,
struct il_tx_queue *txq)
{
u8 queue = txq->swq_id;
u8 ac = queue & 3;
u8 hwq = (queue >> 2) & 0x1f;
if (!test_and_set_bit(hwq, priv->queue_stopped))
if (atomic_inc_return(&priv->queue_stop_count[ac]) > 0)
ieee80211_stop_queue(priv->hw, ac);
if (!test_and_set_bit(hwq, il->queue_stopped))
if (atomic_inc_return(&il->queue_stop_count[ac]) > 0)
ieee80211_stop_queue(il->hw, ac);
}
#ifdef ieee80211_stop_queue
......@@ -144,39 +144,39 @@ static inline void il_stop_queue(struct il_priv *priv,
#define ieee80211_wake_queue DO_NOT_USE_ieee80211_wake_queue
static inline void il_disable_interrupts(struct il_priv *priv)
static inline void il_disable_interrupts(struct il_priv *il)
{
clear_bit(STATUS_INT_ENABLED, &priv->status);
clear_bit(STATUS_INT_ENABLED, &il->status);
/* disable interrupts from uCode/NIC to host */
il_write32(priv, CSR_INT_MASK, 0x00000000);
il_write32(il, CSR_INT_MASK, 0x00000000);
/* acknowledge/clear/reset any interrupts still pending
* from uCode or flow handler (Rx/Tx DMA) */
il_write32(priv, CSR_INT, 0xffffffff);
il_write32(priv, CSR_FH_INT_STATUS, 0xffffffff);
IL_DEBUG_ISR(priv, "Disabled interrupts\n");
il_write32(il, CSR_INT, 0xffffffff);
il_write32(il, CSR_FH_INT_STATUS, 0xffffffff);
IL_DEBUG_ISR(il, "Disabled interrupts\n");
}
static inline void il_enable_rfkill_int(struct il_priv *priv)
static inline void il_enable_rfkill_int(struct il_priv *il)
{
IL_DEBUG_ISR(priv, "Enabling rfkill interrupt\n");
il_write32(priv, CSR_INT_MASK, CSR_INT_BIT_RF_KILL);
IL_DEBUG_ISR(il, "Enabling rfkill interrupt\n");
il_write32(il, CSR_INT_MASK, CSR_INT_BIT_RF_KILL);
}
static inline void il_enable_interrupts(struct il_priv *priv)
static inline void il_enable_interrupts(struct il_priv *il)
{
IL_DEBUG_ISR(priv, "Enabling interrupts\n");
set_bit(STATUS_INT_ENABLED, &priv->status);
il_write32(priv, CSR_INT_MASK, priv->inta_mask);
IL_DEBUG_ISR(il, "Enabling interrupts\n");
set_bit(STATUS_INT_ENABLED, &il->status);
il_write32(il, CSR_INT_MASK, il->inta_mask);
}
/**
* il_beacon_time_mask_low - mask of lower 32 bit of beacon time
* @priv -- pointer to il_priv data structure
* @il -- pointer to il_priv data structure
* @tsf_bits -- number of bits need to shift for masking)
*/
static inline u32 il_beacon_time_mask_low(struct il_priv *priv,
static inline u32 il_beacon_time_mask_low(struct il_priv *il,
u16 tsf_bits)
{
return (1 << tsf_bits) - 1;
......@@ -184,10 +184,10 @@ static inline u32 il_beacon_time_mask_low(struct il_priv *priv,
/**
* il_beacon_time_mask_high - mask of higher 32 bit of beacon time
* @priv -- pointer to il_priv data structure
* @il -- pointer to il_priv data structure
* @tsf_bits -- number of bits need to shift for masking)
*/
static inline u32 il_beacon_time_mask_high(struct il_priv *priv,
static inline u32 il_beacon_time_mask_high(struct il_priv *il,
u16 tsf_bits)
{
return ((1 << (32 - tsf_bits)) - 1) << tsf_bits;
......
......@@ -50,7 +50,7 @@ enum il_led_mode {
IL_LED_BLINK,
};
void il_leds_init(struct il_priv *priv);
void il_leds_exit(struct il_priv *priv);
void il_leds_init(struct il_priv *il);
void il_leds_exit(struct il_priv *il);
#endif /* __il_leds_h__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册