Commit 46bc8d4b authored by Stanislaw Gruszka's avatar Stanislaw Gruszka

iwlegacy: rename priv to il

Make code shorter.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
parent e2ebc833
...@@ -29,22 +29,22 @@ ...@@ -29,22 +29,22 @@
#include "iwl-3945-debugfs.h" #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; int p = 0;
p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n",
le32_to_cpu(priv->_3945.statistics.flag)); le32_to_cpu(il->_3945.statistics.flag));
if (le32_to_cpu(priv->_3945.statistics.flag) & if (le32_to_cpu(il->_3945.statistics.flag) &
UCODE_STATISTICS_CLEAR_MSK) UCODE_STATISTICS_CLEAR_MSK)
p += scnprintf(buf + p, bufsz - p, p += scnprintf(buf + p, bufsz - p,
"\tStatistics have been cleared\n"); "\tStatistics have been cleared\n");
p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\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) UCODE_STATISTICS_FREQUENCY_MSK)
? "2.4 GHz" : "5.2 GHz"); ? "2.4 GHz" : "5.2 GHz");
p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", 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) UCODE_STATISTICS_NARROW_BAND_MSK)
? "enabled" : "disabled"); ? "enabled" : "disabled");
return p; return p;
...@@ -54,7 +54,7 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file, ...@@ -54,7 +54,7 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct il_priv *priv = file->private_data; struct il_priv *il = file->private_data;
int pos = 0; int pos = 0;
char *buf; char *buf;
int bufsz = sizeof(struct iwl39_statistics_rx_phy) * 40 + int bufsz = sizeof(struct iwl39_statistics_rx_phy) * 40 +
...@@ -66,12 +66,12 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file, ...@@ -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 *general, *accum_general;
struct iwl39_statistics_rx_non_phy *delta_general, *max_general; struct iwl39_statistics_rx_non_phy *delta_general, *max_general;
if (!il_is_alive(priv)) if (!il_is_alive(il))
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n"); IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -80,20 +80,20 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file, ...@@ -80,20 +80,20 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file,
* the last statistics notification from uCode * the last statistics notification from uCode
* might not reflect the current uCode activity * might not reflect the current uCode activity
*/ */
ofdm = &priv->_3945.statistics.rx.ofdm; ofdm = &il->_3945.statistics.rx.ofdm;
cck = &priv->_3945.statistics.rx.cck; cck = &il->_3945.statistics.rx.cck;
general = &priv->_3945.statistics.rx.general; general = &il->_3945.statistics.rx.general;
accum_ofdm = &priv->_3945.accum_statistics.rx.ofdm; accum_ofdm = &il->_3945.accum_statistics.rx.ofdm;
accum_cck = &priv->_3945.accum_statistics.rx.cck; accum_cck = &il->_3945.accum_statistics.rx.cck;
accum_general = &priv->_3945.accum_statistics.rx.general; accum_general = &il->_3945.accum_statistics.rx.general;
delta_ofdm = &priv->_3945.delta_statistics.rx.ofdm; delta_ofdm = &il->_3945.delta_statistics.rx.ofdm;
delta_cck = &priv->_3945.delta_statistics.rx.cck; delta_cck = &il->_3945.delta_statistics.rx.cck;
delta_general = &priv->_3945.delta_statistics.rx.general; delta_general = &il->_3945.delta_statistics.rx.general;
max_ofdm = &priv->_3945.max_delta.rx.ofdm; max_ofdm = &il->_3945.max_delta.rx.ofdm;
max_cck = &priv->_3945.max_delta.rx.cck; max_cck = &il->_3945.max_delta.rx.cck;
max_general = &priv->_3945.max_delta.rx.general; 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" pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
"acumulative delta max\n", "acumulative delta max\n",
"Statistics_Rx - OFDM:"); "Statistics_Rx - OFDM:");
...@@ -329,19 +329,19 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file, ...@@ -329,19 +329,19 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct il_priv *priv = file->private_data; struct il_priv *il = file->private_data;
int pos = 0; int pos = 0;
char *buf; char *buf;
int bufsz = (sizeof(struct iwl39_statistics_tx) * 48) + 250; int bufsz = (sizeof(struct iwl39_statistics_tx) * 48) + 250;
ssize_t ret; ssize_t ret;
struct iwl39_statistics_tx *tx, *accum_tx, *delta_tx, *max_tx; struct iwl39_statistics_tx *tx, *accum_tx, *delta_tx, *max_tx;
if (!il_is_alive(priv)) if (!il_is_alive(il))
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n"); IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -350,11 +350,11 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file, ...@@ -350,11 +350,11 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file,
* the last statistics notification from uCode * the last statistics notification from uCode
* might not reflect the current uCode activity * might not reflect the current uCode activity
*/ */
tx = &priv->_3945.statistics.tx; tx = &il->_3945.statistics.tx;
accum_tx = &priv->_3945.accum_statistics.tx; accum_tx = &il->_3945.accum_statistics.tx;
delta_tx = &priv->_3945.delta_statistics.tx; delta_tx = &il->_3945.delta_statistics.tx;
max_tx = &priv->_3945.max_delta.tx; max_tx = &il->_3945.max_delta.tx;
pos += il3945_statistics_flag(priv, buf, bufsz); pos += il3945_statistics_flag(il, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
"acumulative delta max\n", "acumulative delta max\n",
"Statistics_Tx:"); "Statistics_Tx:");
...@@ -425,7 +425,7 @@ ssize_t il3945_ucode_general_stats_read(struct file *file, ...@@ -425,7 +425,7 @@ ssize_t il3945_ucode_general_stats_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct il_priv *priv = file->private_data; struct il_priv *il = file->private_data;
int pos = 0; int pos = 0;
char *buf; char *buf;
int bufsz = sizeof(struct iwl39_statistics_general) * 10 + 300; int bufsz = sizeof(struct iwl39_statistics_general) * 10 + 300;
...@@ -435,12 +435,12 @@ ssize_t il3945_ucode_general_stats_read(struct file *file, ...@@ -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 statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg;
struct iwl39_statistics_div *div, *accum_div, *delta_div, *max_div; struct iwl39_statistics_div *div, *accum_div, *delta_div, *max_div;
if (!il_is_alive(priv)) if (!il_is_alive(il))
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n"); IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -449,19 +449,19 @@ ssize_t il3945_ucode_general_stats_read(struct file *file, ...@@ -449,19 +449,19 @@ ssize_t il3945_ucode_general_stats_read(struct file *file,
* the last statistics notification from uCode * the last statistics notification from uCode
* might not reflect the current uCode activity * might not reflect the current uCode activity
*/ */
general = &priv->_3945.statistics.general; general = &il->_3945.statistics.general;
dbg = &priv->_3945.statistics.general.dbg; dbg = &il->_3945.statistics.general.dbg;
div = &priv->_3945.statistics.general.div; div = &il->_3945.statistics.general.div;
accum_general = &priv->_3945.accum_statistics.general; accum_general = &il->_3945.accum_statistics.general;
delta_general = &priv->_3945.delta_statistics.general; delta_general = &il->_3945.delta_statistics.general;
max_general = &priv->_3945.max_delta.general; max_general = &il->_3945.max_delta.general;
accum_dbg = &priv->_3945.accum_statistics.general.dbg; accum_dbg = &il->_3945.accum_statistics.general.dbg;
delta_dbg = &priv->_3945.delta_statistics.general.dbg; delta_dbg = &il->_3945.delta_statistics.general.dbg;
max_dbg = &priv->_3945.max_delta.general.dbg; max_dbg = &il->_3945.max_delta.general.dbg;
accum_div = &priv->_3945.accum_statistics.general.div; accum_div = &il->_3945.accum_statistics.general.div;
delta_div = &priv->_3945.delta_statistics.general.div; delta_div = &il->_3945.delta_statistics.general.div;
max_div = &priv->_3945.max_delta.general.div; max_div = &il->_3945.max_delta.general.div;
pos += il3945_statistics_flag(priv, buf, bufsz); pos += il3945_statistics_flag(il, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
"acumulative delta max\n", "acumulative delta max\n",
"Statistics_General:"); "Statistics_General:");
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
/* Send led command */ /* 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_led_cmd *led_cmd)
{ {
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
...@@ -55,7 +55,7 @@ static int il3945_send_led_cmd(struct il_priv *priv, ...@@ -55,7 +55,7 @@ static int il3945_send_led_cmd(struct il_priv *priv,
.callback = NULL, .callback = NULL,
}; };
return il_send_cmd(priv, &cmd); return il_send_cmd(il, &cmd);
} }
const struct il_led_ops il3945_led_ops = { const struct il_led_ops il3945_led_ops = {
......
This diff is collapsed.
This diff is collapsed.
...@@ -85,7 +85,7 @@ struct il3945_rate_scale_data { ...@@ -85,7 +85,7 @@ struct il3945_rate_scale_data {
struct il3945_rs_sta { struct il3945_rs_sta {
spinlock_t lock; spinlock_t lock;
struct il_priv *priv; struct il_priv *il;
s32 *expected_tpt; s32 *expected_tpt;
unsigned long last_partial_flush; unsigned long last_partial_flush;
unsigned long last_flush; unsigned long last_flush;
...@@ -207,12 +207,12 @@ struct il3945_ibss_seq { ...@@ -207,12 +207,12 @@ struct il3945_ibss_seq {
*****************************************************************************/ *****************************************************************************/
extern int il3945_calc_db_from_ratio(int sig_ratio); extern int il3945_calc_db_from_ratio(int sig_ratio);
extern void il3945_rx_replenish(void *data); extern void il3945_rx_replenish(void *data);
extern void il3945_rx_queue_reset(struct il_priv *priv, struct il_rx_queue *rxq); 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 *priv, extern unsigned int il3945_fill_beacon_frame(struct il_priv *il,
struct ieee80211_hdr *hdr, int left); 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); 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); ...@@ -230,44 +230,44 @@ extern void il3945_dump_nic_error_log(struct il_priv *priv);
* il3945_mac_ <-- mac80211 callback * il3945_mac_ <-- mac80211 callback
* *
****************************************************************************/ ****************************************************************************/
extern void il3945_hw_rx_handler_setup(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 *priv); extern void il3945_hw_setup_deferred_work(struct il_priv *il);
extern void il3945_hw_cancel_deferred_work(struct il_priv *priv); extern void il3945_hw_cancel_deferred_work(struct il_priv *il);
extern int il3945_hw_rxq_stop(struct il_priv *priv); extern int il3945_hw_rxq_stop(struct il_priv *il);
extern int il3945_hw_set_hw_params(struct il_priv *priv); extern int il3945_hw_set_hw_params(struct il_priv *il);
extern int il3945_hw_nic_init(struct il_priv *priv); extern int il3945_hw_nic_init(struct il_priv *il);
extern int il3945_hw_nic_stop_master(struct il_priv *priv); extern int il3945_hw_nic_stop_master(struct il_priv *il);
extern void il3945_hw_txq_ctx_free(struct il_priv *priv); extern void il3945_hw_txq_ctx_free(struct il_priv *il);
extern void il3945_hw_txq_ctx_stop(struct il_priv *priv); extern void il3945_hw_txq_ctx_stop(struct il_priv *il);
extern int il3945_hw_nic_reset(struct il_priv *priv); extern int il3945_hw_nic_reset(struct il_priv *il);
extern int il3945_hw_txq_attach_buf_to_tfd(struct il_priv *priv, extern int il3945_hw_txq_attach_buf_to_tfd(struct il_priv *il,
struct il_tx_queue *txq, struct il_tx_queue *txq,
dma_addr_t addr, u16 len, dma_addr_t addr, u16 len,
u8 reset, u8 pad); 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); struct il_tx_queue *txq);
extern int il3945_hw_get_temperature(struct il_priv *priv); extern int il3945_hw_get_temperature(struct il_priv *il);
extern int il3945_hw_tx_queue_init(struct il_priv *priv, extern int il3945_hw_tx_queue_init(struct il_priv *il,
struct il_tx_queue *txq); 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); 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 il_device_cmd *cmd,
struct ieee80211_tx_info *info, struct ieee80211_tx_info *info,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
int sta_id, int tx_id); int sta_id, int tx_id);
extern int il3945_hw_reg_send_txpower(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 *priv, s8 power); extern int il3945_hw_reg_set_txpower(struct il_priv *il, s8 power);
extern void il3945_hw_rx_statistics(struct il_priv *priv, extern void il3945_hw_rx_statistics(struct il_priv *il,
struct il_rx_mem_buffer *rxb); 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); struct il_rx_mem_buffer *rxb);
extern void il3945_disable_events(struct il_priv *priv); extern void il3945_disable_events(struct il_priv *il);
extern int il4965_get_temperature(const struct il_priv *priv); extern int il4965_get_temperature(const struct il_priv *il);
extern void il3945_post_associate(struct il_priv *priv); extern void il3945_post_associate(struct il_priv *il);
extern void il3945_config_ap(struct il_priv *priv); 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); struct il_rxon_context *ctx);
/** /**
...@@ -278,26 +278,26 @@ extern int il3945_commit_rxon(struct il_priv *priv, ...@@ -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 * not yet been merged into a single common layer for managing the
* station tables. * 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; extern struct ieee80211_ops il3945_hw_ops;
/* /*
* Forward declare iwl-3945.c functions for iwl3945-base.c * Forward declare iwl-3945.c functions for iwl3945-base.c
*/ */
extern __le32 il3945_get_antenna_flags(const 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 *priv); extern int il3945_init_hw_rate_table(struct il_priv *il);
extern void il3945_reg_txpower_periodic(struct il_priv *priv); extern void il3945_reg_txpower_periodic(struct il_priv *il);
extern int il3945_txpower_set_from_eeprom(struct il_priv *priv); extern int il3945_txpower_set_from_eeprom(struct il_priv *il);
extern const struct il_channel_info *il3945_get_channel_info( 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 */ /* scanning */
int il3945_request_scan(struct il_priv *priv, struct ieee80211_vif *vif); int il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif);
void il3945_post_scan(struct il_priv *priv); void il3945_post_scan(struct il_priv *il);
/* rates */ /* rates */
extern const struct il3945_rate_info il3945_rates[IL_RATE_COUNT_3945]; extern const struct il3945_rate_info il3945_rates[IL_RATE_COUNT_3945];
......
...@@ -66,10 +66,10 @@ ...@@ -66,10 +66,10 @@
#include "iwl-core.h" #include "iwl-core.h"
#include "iwl-commands.h" #include "iwl-commands.h"
void il4965_chain_noise_calibration(struct il_priv *priv, void *stat_resp); void il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp);
void il4965_sensitivity_calibration(struct il_priv *priv, void *resp); void il4965_sensitivity_calibration(struct il_priv *il, void *resp);
void il4965_init_sensitivity(struct il_priv *priv); void il4965_init_sensitivity(struct il_priv *il);
void il4965_reset_run_time_calib(struct il_priv *priv); void il4965_reset_run_time_calib(struct il_priv *il);
void il4965_calib_free_results(struct il_priv *priv); void il4965_calib_free_results(struct il_priv *il);
#endif /* __il_4965_calib_h__ */ #endif /* __il_4965_calib_h__ */
...@@ -33,12 +33,12 @@ static const char *fmt_table = " %-30s %10u %10u %10u %10u\n"; ...@@ -33,12 +33,12 @@ static const char *fmt_table = " %-30s %10u %10u %10u %10u\n";
static const char *fmt_header = static const char *fmt_header =
"%-32s current cumulative delta max\n"; "%-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; int p = 0;
u32 flag; 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); p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", flag);
if (flag & UCODE_STATISTICS_CLEAR_MSK) if (flag & UCODE_STATISTICS_CLEAR_MSK)
...@@ -57,7 +57,7 @@ static int il4965_statistics_flag(struct il_priv *priv, char *buf, int bufsz) ...@@ -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, ssize_t il4965_ucode_rx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct il_priv *priv = file->private_data; struct il_priv *il = file->private_data;
int pos = 0; int pos = 0;
char *buf; char *buf;
int bufsz = sizeof(struct statistics_rx_phy) * 40 + 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, ...@@ -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_non_phy *delta_general, *max_general;
struct statistics_rx_ht_phy *ht, *accum_ht, *delta_ht, *max_ht; struct statistics_rx_ht_phy *ht, *accum_ht, *delta_ht, *max_ht;
if (!il_is_alive(priv)) if (!il_is_alive(il))
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n"); IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -84,24 +84,24 @@ ssize_t il4965_ucode_rx_stats_read(struct file *file, char __user *user_buf, ...@@ -84,24 +84,24 @@ ssize_t il4965_ucode_rx_stats_read(struct file *file, char __user *user_buf,
* the last statistics notification from uCode * the last statistics notification from uCode
* might not reflect the current uCode activity * might not reflect the current uCode activity
*/ */
ofdm = &priv->_4965.statistics.rx.ofdm; ofdm = &il->_4965.statistics.rx.ofdm;
cck = &priv->_4965.statistics.rx.cck; cck = &il->_4965.statistics.rx.cck;
general = &priv->_4965.statistics.rx.general; general = &il->_4965.statistics.rx.general;
ht = &priv->_4965.statistics.rx.ofdm_ht; ht = &il->_4965.statistics.rx.ofdm_ht;
accum_ofdm = &priv->_4965.accum_statistics.rx.ofdm; accum_ofdm = &il->_4965.accum_statistics.rx.ofdm;
accum_cck = &priv->_4965.accum_statistics.rx.cck; accum_cck = &il->_4965.accum_statistics.rx.cck;
accum_general = &priv->_4965.accum_statistics.rx.general; accum_general = &il->_4965.accum_statistics.rx.general;
accum_ht = &priv->_4965.accum_statistics.rx.ofdm_ht; accum_ht = &il->_4965.accum_statistics.rx.ofdm_ht;
delta_ofdm = &priv->_4965.delta_statistics.rx.ofdm; delta_ofdm = &il->_4965.delta_statistics.rx.ofdm;
delta_cck = &priv->_4965.delta_statistics.rx.cck; delta_cck = &il->_4965.delta_statistics.rx.cck;
delta_general = &priv->_4965.delta_statistics.rx.general; delta_general = &il->_4965.delta_statistics.rx.general;
delta_ht = &priv->_4965.delta_statistics.rx.ofdm_ht; delta_ht = &il->_4965.delta_statistics.rx.ofdm_ht;
max_ofdm = &priv->_4965.max_delta.rx.ofdm; max_ofdm = &il->_4965.max_delta.rx.ofdm;
max_cck = &priv->_4965.max_delta.rx.cck; max_cck = &il->_4965.max_delta.rx.cck;
max_general = &priv->_4965.max_delta.rx.general; max_general = &il->_4965.max_delta.rx.general;
max_ht = &priv->_4965.max_delta.rx.ofdm_ht; 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, pos += scnprintf(buf + pos, bufsz - pos,
fmt_header, "Statistics_Rx - OFDM:"); fmt_header, "Statistics_Rx - OFDM:");
pos += scnprintf(buf + pos, bufsz - pos, pos += scnprintf(buf + pos, bufsz - pos,
...@@ -489,19 +489,19 @@ ssize_t il4965_ucode_tx_stats_read(struct file *file, ...@@ -489,19 +489,19 @@ ssize_t il4965_ucode_tx_stats_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct il_priv *priv = file->private_data; struct il_priv *il = file->private_data;
int pos = 0; int pos = 0;
char *buf; char *buf;
int bufsz = (sizeof(struct statistics_tx) * 48) + 250; int bufsz = (sizeof(struct statistics_tx) * 48) + 250;
ssize_t ret; ssize_t ret;
struct statistics_tx *tx, *accum_tx, *delta_tx, *max_tx; struct statistics_tx *tx, *accum_tx, *delta_tx, *max_tx;
if (!il_is_alive(priv)) if (!il_is_alive(il))
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n"); IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -509,12 +509,12 @@ ssize_t il4965_ucode_tx_stats_read(struct file *file, ...@@ -509,12 +509,12 @@ ssize_t il4965_ucode_tx_stats_read(struct file *file,
* the last statistics notification from uCode * the last statistics notification from uCode
* might not reflect the current uCode activity * might not reflect the current uCode activity
*/ */
tx = &priv->_4965.statistics.tx; tx = &il->_4965.statistics.tx;
accum_tx = &priv->_4965.accum_statistics.tx; accum_tx = &il->_4965.accum_statistics.tx;
delta_tx = &priv->_4965.delta_statistics.tx; delta_tx = &il->_4965.delta_statistics.tx;
max_tx = &priv->_4965.max_delta.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, pos += scnprintf(buf + pos, bufsz - pos,
fmt_header, "Statistics_Tx:"); fmt_header, "Statistics_Tx:");
pos += scnprintf(buf + pos, bufsz - pos, pos += scnprintf(buf + pos, bufsz - pos,
...@@ -664,7 +664,7 @@ ssize_t ...@@ -664,7 +664,7 @@ ssize_t
il4965_ucode_general_stats_read(struct file *file, char __user *user_buf, il4965_ucode_general_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct il_priv *priv = file->private_data; struct il_priv *il = file->private_data;
int pos = 0; int pos = 0;
char *buf; char *buf;
int bufsz = sizeof(struct statistics_general) * 10 + 300; int bufsz = sizeof(struct statistics_general) * 10 + 300;
...@@ -674,12 +674,12 @@ il4965_ucode_general_stats_read(struct file *file, char __user *user_buf, ...@@ -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_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg;
struct statistics_div *div, *accum_div, *delta_div, *max_div; struct statistics_div *div, *accum_div, *delta_div, *max_div;
if (!il_is_alive(priv)) if (!il_is_alive(il))
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf) {
IL_ERR(priv, "Can not allocate Buffer\n"); IL_ERR(il, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -687,20 +687,20 @@ il4965_ucode_general_stats_read(struct file *file, char __user *user_buf, ...@@ -687,20 +687,20 @@ il4965_ucode_general_stats_read(struct file *file, char __user *user_buf,
* the last statistics notification from uCode * the last statistics notification from uCode
* might not reflect the current uCode activity * might not reflect the current uCode activity
*/ */
general = &priv->_4965.statistics.general.common; general = &il->_4965.statistics.general.common;
dbg = &priv->_4965.statistics.general.common.dbg; dbg = &il->_4965.statistics.general.common.dbg;
div = &priv->_4965.statistics.general.common.div; div = &il->_4965.statistics.general.common.div;
accum_general = &priv->_4965.accum_statistics.general.common; accum_general = &il->_4965.accum_statistics.general.common;
accum_dbg = &priv->_4965.accum_statistics.general.common.dbg; accum_dbg = &il->_4965.accum_statistics.general.common.dbg;
accum_div = &priv->_4965.accum_statistics.general.common.div; accum_div = &il->_4965.accum_statistics.general.common.div;
delta_general = &priv->_4965.delta_statistics.general.common; delta_general = &il->_4965.delta_statistics.general.common;
max_general = &priv->_4965.max_delta.general.common; max_general = &il->_4965.max_delta.general.common;
delta_dbg = &priv->_4965.delta_statistics.general.common.dbg; delta_dbg = &il->_4965.delta_statistics.general.common.dbg;
max_dbg = &priv->_4965.max_delta.general.common.dbg; max_dbg = &il->_4965.max_delta.general.common.dbg;
delta_div = &priv->_4965.delta_statistics.general.common.div; delta_div = &il->_4965.delta_statistics.general.common.div;
max_div = &priv->_4965.max_delta.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, pos += scnprintf(buf + pos, bufsz - pos,
fmt_header, "Statistics_General:"); fmt_header, "Statistics_General:");
pos += scnprintf(buf + pos, bufsz - pos, pos += scnprintf(buf + pos, bufsz - pos,
......
...@@ -87,23 +87,23 @@ ...@@ -87,23 +87,23 @@
* EEPROM chip, not a single event, so even reads could conflict if they * EEPROM chip, not a single event, so even reads could conflict if they
* weren't arbitrated by the semaphore. * 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; u16 count;
int ret; int ret;
for (count = 0; count < EEPROM_SEM_RETRY_LIMIT; count++) { for (count = 0; count < EEPROM_SEM_RETRY_LIMIT; count++) {
/* Request semaphore */ /* 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); CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM);
/* See if we got it */ /* 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,
CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM, CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
EEPROM_SEM_TIMEOUT); EEPROM_SEM_TIMEOUT);
if (ret >= 0) { if (ret >= 0) {
IL_DEBUG_IO(priv, IL_DEBUG_IO(il,
"Acquired semaphore after %d tries.\n", "Acquired semaphore after %d tries.\n",
count+1); count+1);
return ret; return ret;
...@@ -113,42 +113,42 @@ int il4965_eeprom_acquire_semaphore(struct il_priv *priv) ...@@ -113,42 +113,42 @@ int il4965_eeprom_acquire_semaphore(struct il_priv *priv)
return ret; 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); 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 eeprom_ver;
u16 calib_ver; u16 calib_ver;
eeprom_ver = il_eeprom_query16(priv, EEPROM_VERSION); eeprom_ver = il_eeprom_query16(il, EEPROM_VERSION);
calib_ver = il_eeprom_query16(priv, calib_ver = il_eeprom_query16(il,
EEPROM_4965_CALIB_VERSION_OFFSET); EEPROM_4965_CALIB_VERSION_OFFSET);
if (eeprom_ver < priv->cfg->eeprom_ver || if (eeprom_ver < il->cfg->eeprom_ver ||
calib_ver < priv->cfg->eeprom_calib_ver) calib_ver < il->cfg->eeprom_calib_ver)
goto err; 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); eeprom_ver, calib_ver);
return 0; return 0;
err: 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", "CALIB=0x%x < 0x%x\n",
eeprom_ver, priv->cfg->eeprom_ver, eeprom_ver, il->cfg->eeprom_ver,
calib_ver, priv->cfg->eeprom_calib_ver); calib_ver, il->cfg->eeprom_calib_ver);
return -EINVAL; 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); EEPROM_MAC_ADDRESS);
memcpy(mac, addr, ETH_ALEN); memcpy(mac, addr, ETH_ALEN);
} }
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
/* Send led command */ /* Send led command */
static int 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 = { struct il_host_cmd cmd = {
.id = REPLY_LEDS_CMD, .id = REPLY_LEDS_CMD,
...@@ -55,17 +55,17 @@ il4965_send_led_cmd(struct il_priv *priv, struct il_led_cmd *led_cmd) ...@@ -55,17 +55,17 @@ il4965_send_led_cmd(struct il_priv *priv, struct il_led_cmd *led_cmd)
}; };
u32 reg; u32 reg;
reg = il_read32(priv, CSR_LED_REG); reg = il_read32(il, CSR_LED_REG);
if (reg != (reg & CSR_LED_BSM_CTRL_MSK)) 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 */ /* 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 = { const struct il_led_ops il4965_led_ops = {
......
...@@ -28,6 +28,6 @@ ...@@ -28,6 +28,6 @@
#define __il_4965_led_h__ #define __il_4965_led_h__
extern const struct il_led_ops il4965_led_ops; 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__ */ #endif /* __il_4965_led_h__ */
This diff is collapsed.
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "iwl-4965-hw.h" #include "iwl-4965-hw.h"
#include "iwl-4965.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) struct il_rx_mem_buffer *rxb)
{ {
...@@ -50,22 +50,22 @@ void il4965_rx_missed_beacon_notif(struct il_priv *priv, ...@@ -50,22 +50,22 @@ void il4965_rx_missed_beacon_notif(struct il_priv *priv,
missed_beacon = &pkt->u.missed_beacon; missed_beacon = &pkt->u.missed_beacon;
if (le32_to_cpu(missed_beacon->consecutive_missed_beacons) > if (le32_to_cpu(missed_beacon->consecutive_missed_beacons) >
priv->missed_beacon_threshold) { il->missed_beacon_threshold) {
IL_DEBUG_CALIB(priv, IL_DEBUG_CALIB(il,
"missed bcn cnsq %d totl %d rcd %d expctd %d\n", "missed bcn cnsq %d totl %d rcd %d expctd %d\n",
le32_to_cpu(missed_beacon->consecutive_missed_beacons), le32_to_cpu(missed_beacon->consecutive_missed_beacons),
le32_to_cpu(missed_beacon->total_missed_becons), le32_to_cpu(missed_beacon->total_missed_becons),
le32_to_cpu(missed_beacon->num_recvd_beacons), le32_to_cpu(missed_beacon->num_recvd_beacons),
le32_to_cpu(missed_beacon->num_expected_beacons)); le32_to_cpu(missed_beacon->num_expected_beacons));
if (!test_bit(STATUS_SCANNING, &priv->status)) if (!test_bit(STATUS_SCANNING, &il->status))
il4965_init_sensitivity(priv); il4965_init_sensitivity(il);
} }
} }
/* Calculate noise level, based on measurements during network silence just /* Calculate noise level, based on measurements during network silence just
* before arriving beacon. This measurement can be done only if we know * before arriving beacon. This measurement can be done only if we know
* exactly when to expect beacons, therefore only when we're associated. */ * 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; struct statistics_rx_non_phy *rx_info;
int num_active_rx = 0; int num_active_rx = 0;
...@@ -73,7 +73,7 @@ static void il4965_rx_calc_noise(struct il_priv *priv) ...@@ -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 bcn_silence_a, bcn_silence_b, bcn_silence_c;
int last_rx_noise; int last_rx_noise;
rx_info = &(priv->_4965.statistics.rx.general); rx_info = &(il->_4965.statistics.rx.general);
bcn_silence_a = bcn_silence_a =
le32_to_cpu(rx_info->beacon_silence_rssi_a) & IN_BAND_FILTER; le32_to_cpu(rx_info->beacon_silence_rssi_a) & IN_BAND_FILTER;
bcn_silence_b = bcn_silence_b =
...@@ -100,7 +100,7 @@ static void il4965_rx_calc_noise(struct il_priv *priv) ...@@ -100,7 +100,7 @@ static void il4965_rx_calc_noise(struct il_priv *priv)
else else
last_rx_noise = IL_NOISE_MEAS_NOT_AVAILABLE; 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, bcn_silence_a, bcn_silence_b, bcn_silence_c,
last_rx_noise); last_rx_noise);
} }
...@@ -111,7 +111,7 @@ static void il4965_rx_calc_noise(struct il_priv *priv) ...@@ -111,7 +111,7 @@ static void il4965_rx_calc_noise(struct il_priv *priv)
* FIXME: This function is for debugging, do not deal with * FIXME: This function is for debugging, do not deal with
* the case of counters roll-over. * 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) __le32 *stats)
{ {
int i, size; int i, size;
...@@ -121,15 +121,15 @@ static void il4965_accumulative_statistics(struct il_priv *priv, ...@@ -121,15 +121,15 @@ static void il4965_accumulative_statistics(struct il_priv *priv,
struct statistics_general_common *general, *accum_general; struct statistics_general_common *general, *accum_general;
struct statistics_tx *tx, *accum_tx; struct statistics_tx *tx, *accum_tx;
prev_stats = (__le32 *)&priv->_4965.statistics; prev_stats = (__le32 *)&il->_4965.statistics;
accum_stats = (u32 *)&priv->_4965.accum_statistics; accum_stats = (u32 *)&il->_4965.accum_statistics;
size = sizeof(struct il_notif_statistics); size = sizeof(struct il_notif_statistics);
general = &priv->_4965.statistics.general.common; general = &il->_4965.statistics.general.common;
accum_general = &priv->_4965.accum_statistics.general.common; accum_general = &il->_4965.accum_statistics.general.common;
tx = &priv->_4965.statistics.tx; tx = &il->_4965.statistics.tx;
accum_tx = &priv->_4965.accum_statistics.tx; accum_tx = &il->_4965.accum_statistics.tx;
delta = (u32 *)&priv->_4965.delta_statistics; delta = (u32 *)&il->_4965.delta_statistics;
max_delta = (u32 *)&priv->_4965.max_delta; max_delta = (u32 *)&il->_4965.max_delta;
for (i = sizeof(__le32); i < size; for (i = sizeof(__le32); i < size;
i += sizeof(__le32), stats++, prev_stats++, delta++, i += sizeof(__le32), stats++, prev_stats++, delta++,
...@@ -151,65 +151,65 @@ static void il4965_accumulative_statistics(struct il_priv *priv, ...@@ -151,65 +151,65 @@ static void il4965_accumulative_statistics(struct il_priv *priv,
#define REG_RECALIB_PERIOD (60) #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) struct il_rx_mem_buffer *rxb)
{ {
int change; int change;
struct il_rx_packet *pkt = rxb_addr(rxb); struct il_rx_packet *pkt = rxb_addr(rxb);
IL_DEBUG_RX(priv, IL_DEBUG_RX(il,
"Statistics notification received (%d vs %d).\n", "Statistics notification received (%d vs %d).\n",
(int)sizeof(struct il_notif_statistics), (int)sizeof(struct il_notif_statistics),
le32_to_cpu(pkt->len_n_flags) & le32_to_cpu(pkt->len_n_flags) &
FH_RSCSR_FRAME_SIZE_MSK); 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) || pkt->u.stats.general.common.temperature) ||
((priv->_4965.statistics.flag & ((il->_4965.statistics.flag &
STATISTICS_REPLY_FLG_HT40_MODE_MSK) != STATISTICS_REPLY_FLG_HT40_MODE_MSK) !=
(pkt->u.stats.flag & (pkt->u.stats.flag &
STATISTICS_REPLY_FLG_HT40_MODE_MSK))); STATISTICS_REPLY_FLG_HT40_MODE_MSK)));
#ifdef CONFIG_IWLWIFI_LEGACY_DEBUGFS #ifdef CONFIG_IWLWIFI_LEGACY_DEBUGFS
il4965_accumulative_statistics(priv, (__le32 *)&pkt->u.stats); il4965_accumulative_statistics(il, (__le32 *)&pkt->u.stats);
#endif #endif
/* TODO: reading some of statistics is unneeded */ /* TODO: reading some of statistics is unneeded */
memcpy(&priv->_4965.statistics, &pkt->u.stats, memcpy(&il->_4965.statistics, &pkt->u.stats,
sizeof(priv->_4965.statistics)); sizeof(il->_4965.statistics));
set_bit(STATUS_STATISTICS, &priv->status); set_bit(STATUS_STATISTICS, &il->status);
/* Reschedule the statistics timer to occur in /* Reschedule the statistics timer to occur in
* REG_RECALIB_PERIOD seconds to ensure we get a * REG_RECALIB_PERIOD seconds to ensure we get a
* thermal update even if the uCode doesn't give * thermal update even if the uCode doesn't give
* us one */ * us one */
mod_timer(&priv->statistics_periodic, jiffies + mod_timer(&il->statistics_periodic, jiffies +
msecs_to_jiffies(REG_RECALIB_PERIOD * 1000)); 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)) { (pkt->hdr.cmd == STATISTICS_NOTIFICATION)) {
il4965_rx_calc_noise(priv); il4965_rx_calc_noise(il);
queue_work(priv->workqueue, &priv->run_time_calib_work); queue_work(il->workqueue, &il->run_time_calib_work);
} }
if (priv->cfg->ops->lib->temp_ops.temperature && change) if (il->cfg->ops->lib->temp_ops.temperature && change)
priv->cfg->ops->lib->temp_ops.temperature(priv); 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_mem_buffer *rxb)
{ {
struct il_rx_packet *pkt = rxb_addr(rxb); struct il_rx_packet *pkt = rxb_addr(rxb);
if (le32_to_cpu(pkt->u.stats.flag) & UCODE_STATISTICS_CLEAR_MSK) { if (le32_to_cpu(pkt->u.stats.flag) & UCODE_STATISTICS_CLEAR_MSK) {
#ifdef CONFIG_IWLWIFI_LEGACY_DEBUGFS #ifdef CONFIG_IWLWIFI_LEGACY_DEBUGFS
memset(&priv->_4965.accum_statistics, 0, memset(&il->_4965.accum_statistics, 0,
sizeof(struct il_notif_statistics)); sizeof(struct il_notif_statistics));
memset(&priv->_4965.delta_statistics, 0, memset(&il->_4965.delta_statistics, 0,
sizeof(struct il_notif_statistics)); sizeof(struct il_notif_statistics));
memset(&priv->_4965.max_delta, 0, memset(&il->_4965.max_delta, 0,
sizeof(struct il_notif_statistics)); sizeof(struct il_notif_statistics));
#endif #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);
} }
This diff is collapsed.
...@@ -48,22 +48,22 @@ ...@@ -48,22 +48,22 @@
* it's a pretty good bet that everything between them is good, too. * it's a pretty good bet that everything between them is good, too.
*/ */
static int 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; u32 val;
int ret = 0; int ret = 0;
u32 errcnt = 0; u32 errcnt = 0;
u32 i; 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)) { for (i = 0; i < len; i += 100, image += 100/sizeof(u32)) {
/* read data comes through single port, auto-incr addr */ /* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log /* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */ * 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); 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)) { if (val != le32_to_cpu(*image)) {
ret = -EIO; ret = -EIO;
errcnt++; errcnt++;
...@@ -79,7 +79,7 @@ il4965_verify_inst_sparse(struct il_priv *priv, __le32 *image, u32 len) ...@@ -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, * il4965_verify_inst_full - verify runtime uCode image in card vs. host,
* looking at all data. * 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 len)
{ {
u32 val; u32 val;
...@@ -87,9 +87,9 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image, ...@@ -87,9 +87,9 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
int ret = 0; int ret = 0;
u32 errcnt; 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); IWL4965_RTC_INST_LOWER_BOUND);
errcnt = 0; errcnt = 0;
...@@ -97,9 +97,9 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image, ...@@ -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 */ /* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log /* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */ * 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)) { 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", "offset 0x%x, is 0x%x, s/b 0x%x\n",
save_len - len, val, le32_to_cpu(*image)); save_len - len, val, le32_to_cpu(*image));
ret = -EIO; ret = -EIO;
...@@ -110,7 +110,7 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image, ...@@ -110,7 +110,7 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
} }
if (!errcnt) if (!errcnt)
IL_DEBUG_INFO(priv, IL_DEBUG_INFO(il,
"ucode image in INSTRUCTION memory is good\n"); "ucode image in INSTRUCTION memory is good\n");
return ret; return ret;
...@@ -120,47 +120,47 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image, ...@@ -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, * il4965_verify_ucode - determine which instruction image is in SRAM,
* and verify its contents * and verify its contents
*/ */
int il4965_verify_ucode(struct il_priv *priv) int il4965_verify_ucode(struct il_priv *il)
{ {
__le32 *image; __le32 *image;
u32 len; u32 len;
int ret; int ret;
/* Try bootstrap */ /* Try bootstrap */
image = (__le32 *)priv->ucode_boot.v_addr; image = (__le32 *)il->ucode_boot.v_addr;
len = priv->ucode_boot.len; len = il->ucode_boot.len;
ret = il4965_verify_inst_sparse(priv, image, len); ret = il4965_verify_inst_sparse(il, image, len);
if (!ret) { 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; return 0;
} }
/* Try initialize */ /* Try initialize */
image = (__le32 *)priv->ucode_init.v_addr; image = (__le32 *)il->ucode_init.v_addr;
len = priv->ucode_init.len; len = il->ucode_init.len;
ret = il4965_verify_inst_sparse(priv, image, len); ret = il4965_verify_inst_sparse(il, image, len);
if (!ret) { 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; return 0;
} }
/* Try runtime/protocol */ /* Try runtime/protocol */
image = (__le32 *)priv->ucode_code.v_addr; image = (__le32 *)il->ucode_code.v_addr;
len = priv->ucode_code.len; len = il->ucode_code.len;
ret = il4965_verify_inst_sparse(priv, image, len); ret = il4965_verify_inst_sparse(il, image, len);
if (!ret) { 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; 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 /* Since nothing seems to match, show first several data entries in
* instruction SRAM, so maybe visual inspection will give a clue. * instruction SRAM, so maybe visual inspection will give a clue.
* Selection of bootstrap image (vs. other images) is arbitrary. */ * Selection of bootstrap image (vs. other images) is arbitrary. */
image = (__le32 *)priv->ucode_boot.v_addr; image = (__le32 *)il->ucode_boot.v_addr;
len = priv->ucode_boot.len; len = il->ucode_boot.len;
ret = il4965_verify_inst_full(priv, image, len); ret = il4965_verify_inst_full(il, image, len);
return ret; return ret;
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -37,7 +37,7 @@ extern u32 iwlegacy_debug_level; ...@@ -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_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_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 { \ do { \
print_hex_dump(KERN_ERR, "iwl data: ", \ print_hex_dump(KERN_ERR, "iwl data: ", \
DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
...@@ -60,9 +60,9 @@ do { \ ...@@ -60,9 +60,9 @@ do { \
__func__ , ## args); \ __func__ , ## args); \
} while (0) } while (0)
#define il_print_hex_dump(priv, level, p, len) \ #define il_print_hex_dump(il, level, p, len) \
do { \ do { \
if (il_get_debug_level(priv) & level) \ if (il_get_debug_level(il) & level) \
print_hex_dump(KERN_DEBUG, "iwl data: ", \ print_hex_dump(KERN_DEBUG, "iwl data: ", \
DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
} while (0) } while (0)
...@@ -70,21 +70,21 @@ do { \ ...@@ -70,21 +70,21 @@ do { \
#else #else
#define IL_DEBUG(__priv, level, fmt, args...) #define IL_DEBUG(__priv, level, fmt, args...)
#define IL_DEBUG_LIMIT(__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) const void *p, u32 len)
{} {}
#endif /* CONFIG_IWLWIFI_LEGACY_DEBUG */ #endif /* CONFIG_IWLWIFI_LEGACY_DEBUG */
#ifdef CONFIG_IWLWIFI_LEGACY_DEBUGFS #ifdef CONFIG_IWLWIFI_LEGACY_DEBUGFS
int il_dbgfs_register(struct il_priv *priv, const char *name); int il_dbgfs_register(struct il_priv *il, const char *name);
void il_dbgfs_unregister(struct il_priv *priv); void il_dbgfs_unregister(struct il_priv *il);
#else #else
static inline int 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; 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 */ #endif /* CONFIG_IWLWIFI_LEGACY_DEBUGFS */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -325,20 +325,20 @@ struct il_eeprom_calib_info { ...@@ -325,20 +325,20 @@ struct il_eeprom_calib_info {
struct il_eeprom_ops { struct il_eeprom_ops {
const u32 regulatory_bands[7]; const u32 regulatory_bands[7];
int (*acquire_semaphore) (struct il_priv *priv); int (*acquire_semaphore) (struct il_priv *il);
void (*release_semaphore) (struct il_priv *priv); void (*release_semaphore) (struct il_priv *il);
}; };
int il_eeprom_init(struct il_priv *priv); int il_eeprom_init(struct il_priv *il);
void il_eeprom_free(struct il_priv *priv); void il_eeprom_free(struct il_priv *il);
const u8 *il_eeprom_query_addr(const struct il_priv *priv, const u8 *il_eeprom_query_addr(const struct il_priv *il,
size_t offset); size_t offset);
u16 il_eeprom_query16(const struct il_priv *priv, size_t offset); u16 il_eeprom_query16(const struct il_priv *il, size_t offset);
int il_init_channel_map(struct il_priv *priv); int il_init_channel_map(struct il_priv *il);
void il_free_channel_map(struct il_priv *priv); void il_free_channel_map(struct il_priv *il);
const struct il_channel_info *il_get_channel_info( 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); enum ieee80211_band band, u16 channel);
#endif /* __il_eeprom_h__ */ #endif /* __il_eeprom_h__ */
This diff is collapsed.
...@@ -108,28 +108,28 @@ il_set_swq_id(struct il_tx_queue *txq, u8 ac, u8 hwq) ...@@ -108,28 +108,28 @@ il_set_swq_id(struct il_tx_queue *txq, u8 ac, u8 hwq)
txq->swq_id = (hwq << 2) | ac; 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) struct il_tx_queue *txq)
{ {
u8 queue = txq->swq_id; u8 queue = txq->swq_id;
u8 ac = queue & 3; u8 ac = queue & 3;
u8 hwq = (queue >> 2) & 0x1f; u8 hwq = (queue >> 2) & 0x1f;
if (test_and_clear_bit(hwq, priv->queue_stopped)) if (test_and_clear_bit(hwq, il->queue_stopped))
if (atomic_dec_return(&priv->queue_stop_count[ac]) <= 0) if (atomic_dec_return(&il->queue_stop_count[ac]) <= 0)
ieee80211_wake_queue(priv->hw, ac); 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) struct il_tx_queue *txq)
{ {
u8 queue = txq->swq_id; u8 queue = txq->swq_id;
u8 ac = queue & 3; u8 ac = queue & 3;
u8 hwq = (queue >> 2) & 0x1f; u8 hwq = (queue >> 2) & 0x1f;
if (!test_and_set_bit(hwq, priv->queue_stopped)) if (!test_and_set_bit(hwq, il->queue_stopped))
if (atomic_inc_return(&priv->queue_stop_count[ac]) > 0) if (atomic_inc_return(&il->queue_stop_count[ac]) > 0)
ieee80211_stop_queue(priv->hw, ac); ieee80211_stop_queue(il->hw, ac);
} }
#ifdef ieee80211_stop_queue #ifdef ieee80211_stop_queue
...@@ -144,39 +144,39 @@ static inline void il_stop_queue(struct il_priv *priv, ...@@ -144,39 +144,39 @@ static inline void il_stop_queue(struct il_priv *priv,
#define ieee80211_wake_queue DO_NOT_USE_ieee80211_wake_queue #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 */ /* 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 /* acknowledge/clear/reset any interrupts still pending
* from uCode or flow handler (Rx/Tx DMA) */ * from uCode or flow handler (Rx/Tx DMA) */
il_write32(priv, CSR_INT, 0xffffffff); il_write32(il, CSR_INT, 0xffffffff);
il_write32(priv, CSR_FH_INT_STATUS, 0xffffffff); il_write32(il, CSR_FH_INT_STATUS, 0xffffffff);
IL_DEBUG_ISR(priv, "Disabled interrupts\n"); 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_DEBUG_ISR(il, "Enabling rfkill interrupt\n");
il_write32(priv, CSR_INT_MASK, CSR_INT_BIT_RF_KILL); 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"); IL_DEBUG_ISR(il, "Enabling interrupts\n");
set_bit(STATUS_INT_ENABLED, &priv->status); set_bit(STATUS_INT_ENABLED, &il->status);
il_write32(priv, CSR_INT_MASK, priv->inta_mask); il_write32(il, CSR_INT_MASK, il->inta_mask);
} }
/** /**
* il_beacon_time_mask_low - mask of lower 32 bit of beacon time * 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) * @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) u16 tsf_bits)
{ {
return (1 << tsf_bits) - 1; return (1 << tsf_bits) - 1;
...@@ -184,10 +184,10 @@ static inline u32 il_beacon_time_mask_low(struct il_priv *priv, ...@@ -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 * 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) * @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) u16 tsf_bits)
{ {
return ((1 << (32 - tsf_bits)) - 1) << tsf_bits; return ((1 << (32 - tsf_bits)) - 1) << tsf_bits;
......
This diff is collapsed.
This diff is collapsed.
...@@ -50,7 +50,7 @@ enum il_led_mode { ...@@ -50,7 +50,7 @@ enum il_led_mode {
IL_LED_BLINK, IL_LED_BLINK,
}; };
void il_leds_init(struct il_priv *priv); void il_leds_init(struct il_priv *il);
void il_leds_exit(struct il_priv *priv); void il_leds_exit(struct il_priv *il);
#endif /* __il_leds_h__ */ #endif /* __il_leds_h__ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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