Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278155
b: refs/heads/master
c: 7c2cde2
h: refs/heads/master
i:
  278153: 37c5ff5
  278151: f99810b
v: v3
  • Loading branch information
Stanislaw Gruszka committed Nov 15, 2011
1 parent 5d77172 commit 4558d57
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 140 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dcae1c641a4d7b7a00b1a566355ffaa517588aa6
refs/heads/master: 7c2cde2ef278cb833581fe599c6654fc28b11a7e
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ void il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_i
int i;

D_INFO("enter\n");
if (sta_id == il->contexts[IL_RXON_CTX_BSS].bcast_sta_id)
if (sta_id == il->ctx.bcast_sta_id)
goto out;

psta = (struct il3945_sta_priv *) sta->drv_priv;
Expand Down Expand Up @@ -936,7 +936,7 @@ void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)

rcu_read_lock();

sta = ieee80211_find_sta(il->contexts[IL_RXON_CTX_BSS].vif,
sta = ieee80211_find_sta(il->ctx.vif,
il->stations[sta_id].sta.sta.addr);
if (!sta) {
D_RATE("Unable to find station to initialize rate scaling.\n");
Expand All @@ -953,7 +953,7 @@ void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
switch (il->band) {
case IEEE80211_BAND_2GHZ:
/* TODO: this always does G, not a regression */
if (il->contexts[IL_RXON_CTX_BSS].active.flags &
if (il->ctx.active.flags &
RXON_FLG_TGG_PROTECT_MSK) {
rs_sta->tgg = 1;
rs_sta->expected_tpt = il3945_expected_tpt_g_prot;
Expand Down
30 changes: 15 additions & 15 deletions trunk/drivers/net/wireless/iwlegacy/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ int il3945_rs_next_rate(struct il_priv *il, int rate)
break;
case IEEE80211_BAND_2GHZ:
if (!(il->_3945.sta_supp_rates & IL_OFDM_RATES_MASK) &&
il_is_associated(il, IL_RXON_CTX_BSS)) {
il_is_associated(il)) {
if (rate == IL_RATE_11M_INDEX)
next_rate = IL_RATE_5M_INDEX;
}
Expand Down Expand Up @@ -1374,15 +1374,15 @@ static int il3945_send_tx_power(struct il_priv *il)
int rate_idx, i;
const struct il_channel_info *ch_info = NULL;
struct il3945_txpowertable_cmd txpower = {
.channel = il->contexts[IL_RXON_CTX_BSS].active.channel,
.channel = il->ctx.active.channel,
};
u16 chan;

if (WARN_ONCE(test_bit(STATUS_SCAN_HW, &il->status),
"TX Power requested while scanning!\n"))
return -EAGAIN;

chan = le16_to_cpu(il->contexts[IL_RXON_CTX_BSS].active.channel);
chan = le16_to_cpu(il->ctx.active.channel);

txpower.band = (il->band == IEEE80211_BAND_5GHZ) ? 0 : 1;
ch_info = il_get_channel_info(il, il->band, chan);
Expand Down Expand Up @@ -1734,9 +1734,9 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
* il3945_rxon_assoc_cmd which is used to reconfigure filter
* and other flags for the current radio configuration. */
if (!il_full_rxon_required(il,
&il->contexts[IL_RXON_CTX_BSS])) {
&il->ctx)) {
rc = il_send_rxon_assoc(il,
&il->contexts[IL_RXON_CTX_BSS]);
&il->ctx);
if (rc) {
IL_ERR("Error setting RXON_ASSOC "
"configuration (%d).\n", rc);
Expand All @@ -1756,7 +1756,7 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
* an RXON_ASSOC and the new config wants the associated mask enabled,
* we must clear the associated from the active configuration
* before we apply the new config */
if (il_is_associated(il, IL_RXON_CTX_BSS) && new_assoc) {
if (il_is_associated(il) && new_assoc) {
D_INFO("Toggling associated bit on current RXON\n");
active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;

Expand All @@ -1768,7 +1768,7 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
active_rxon->reserved5 = 0;
rc = il_send_cmd_pdu(il, REPLY_RXON,
sizeof(struct il3945_rxon_cmd),
&il->contexts[IL_RXON_CTX_BSS].active);
&il->ctx.active);

/* If the mask clearing failed then we set
* active_rxon back to what it was previously */
Expand All @@ -1779,9 +1779,9 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
return rc;
}
il_clear_ucode_stations(il,
&il->contexts[IL_RXON_CTX_BSS]);
&il->ctx);
il_restore_stations(il,
&il->contexts[IL_RXON_CTX_BSS]);
&il->ctx);
}

D_INFO("Sending RXON\n"
Expand Down Expand Up @@ -1814,9 +1814,9 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)

if (!new_assoc) {
il_clear_ucode_stations(il,
&il->contexts[IL_RXON_CTX_BSS]);
&il->ctx);
il_restore_stations(il,
&il->contexts[IL_RXON_CTX_BSS]);
&il->ctx);
}

/* If we issue a new RXON command which required a tune then we must
Expand Down Expand Up @@ -2252,7 +2252,7 @@ static u16 il3945_build_addsta_hcmd(const struct il_addsta_cmd *cmd,
static int il3945_add_bssid_station(struct il_priv *il,
const u8 *addr, u8 *sta_id_r)
{
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;
int ret;
u8 sta_id;
unsigned long flags;
Expand Down Expand Up @@ -2346,7 +2346,7 @@ int il3945_init_hw_rate_table(struct il_priv *il)
* 1M CCK rates */

if (!(il->_3945.sta_supp_rates & IL_OFDM_RATES_MASK) &&
il_is_associated(il, IL_RXON_CTX_BSS)) {
il_is_associated(il)) {

index = IL_FIRST_CCK_RATE;
for (i = IL_RATE_6M_INDEX_TABLE;
Expand Down Expand Up @@ -2401,7 +2401,7 @@ int il3945_hw_set_hw_params(struct il_priv *il)
il->hw_params.max_rxq_size = RX_QUEUE_SIZE;
il->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
il->hw_params.max_stations = IL3945_STATION_COUNT;
il->contexts[IL_RXON_CTX_BSS].bcast_sta_id = IL3945_BROADCAST_ID;
il->ctx.bcast_sta_id = IL3945_BROADCAST_ID;

il->sta_key_max_num = STA_KEY_MAX_NUM;

Expand All @@ -2422,7 +2422,7 @@ unsigned int il3945_hw_get_beacon_cmd(struct il_priv *il,
memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd));

tx_beacon_cmd->tx.sta_id =
il->contexts[IL_RXON_CTX_BSS].bcast_sta_id;
il->ctx.bcast_sta_id;
tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;

frame_size = il3945_fill_beacon_frame(il,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/iwlegacy/iwl-4965-calib.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ void il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp)
unsigned long flags;
struct statistics_rx_non_phy *rx_info;

struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;

if (il->disable_chain_noise_cal)
return;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/iwlegacy/iwl-4965-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ int il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
.flags = CMD_SIZE_HUGE,
};
struct il_scan_cmd *scan;
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;
u32 rate_flags = 0;
u16 cmd_len;
u16 rx_chain = 0;
Expand Down Expand Up @@ -866,7 +866,7 @@ int il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
case IEEE80211_BAND_2GHZ:
scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;
chan_mod = le32_to_cpu(
il->contexts[IL_RXON_CTX_BSS].active.flags &
il->ctx.active.flags &
RXON_FLG_CHANNEL_MODE_MSK)
>> RXON_FLG_CHANNEL_MODE_POS;
if (chan_mod == CHANNEL_MODE_PURE_40) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ int il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
struct il_device_cmd *out_cmd;
struct il_cmd_meta *out_meta;
struct il_tx_cmd *tx_cmd;
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;
int txq_id;
dma_addr_t phys_addr;
dma_addr_t txcmd_phys;
Expand Down Expand Up @@ -1041,7 +1041,7 @@ int il4965_txq_check_empty(struct il_priv *il,
struct il_tid_data *tid_data = &il->stations[sta_id].tid[tid];
struct il_rxon_context *ctx;

ctx = &il->contexts[il->stations[sta_id].ctxid];
ctx = &il->ctx;

lockdep_assert_held(&il->sta_lock);

Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/net/wireless/iwlegacy/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ static int il4965_hw_set_hw_params(struct il_priv *il)
sizeof(struct il4965_scd_bc_tbl);
il->hw_params.tfd_size = sizeof(struct il_tfd);
il->hw_params.max_stations = IL4965_STATION_COUNT;
il->contexts[IL_RXON_CTX_BSS].bcast_sta_id = IL4965_BROADCAST_ID;
il->ctx.bcast_sta_id = IL4965_BROADCAST_ID;
il->hw_params.max_data_size = IL49_RTC_DATA_SIZE;
il->hw_params.max_inst_size = IL49_RTC_INST_SIZE;
il->hw_params.max_bsm_size = BSM_SRAM_SIZE;
Expand Down Expand Up @@ -1121,7 +1121,7 @@ static int il4965_send_tx_power(struct il_priv *il)
u8 band = 0;
bool is_ht40 = false;
u8 ctrl_chan_high = 0;
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;

if (WARN_ONCE(test_bit(STATUS_SCAN_HW, &il->status),
"TX Power requested while scanning!\n"))
Expand Down Expand Up @@ -1333,7 +1333,7 @@ static int il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
static int il4965_hw_channel_switch(struct il_priv *il,
struct ieee80211_channel_switch *ch_switch)
{
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;
int rc;
u8 band = 0;
bool is_ht40 = false;
Expand Down Expand Up @@ -1726,7 +1726,7 @@ static u8 il4965_find_station(struct il_priv *il, const u8 *addr)
start = IL_STA_ID;

if (is_broadcast_ether_addr(addr))
return il->contexts[IL_RXON_CTX_BSS].bcast_sta_id;
return il->ctx.bcast_sta_id;

spin_lock_irqsave(&il->sta_lock, flags);
for (i = start; i < il->hw_params.max_stations; i++)
Expand Down Expand Up @@ -1911,7 +1911,7 @@ static struct il_hcmd_ops il4965_hcmd = {

static void il4965_post_scan(struct il_priv *il)
{
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;

/*
* Since setting the RXON may have been deferred while
Expand All @@ -1923,7 +1923,7 @@ static void il4965_post_scan(struct il_priv *il)

static void il4965_post_associate(struct il_priv *il)
{
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;
struct ieee80211_vif *vif = ctx->vif;
struct ieee80211_conf *conf = NULL;
int ret = 0;
Expand Down Expand Up @@ -2000,7 +2000,7 @@ static void il4965_post_associate(struct il_priv *il)

static void il4965_config_ap(struct il_priv *il)
{
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;
struct ieee80211_vif *vif = ctx->vif;
int ret = 0;

Expand Down
17 changes: 8 additions & 9 deletions trunk/drivers/net/wireless/iwlegacy/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ EXPORT_SYMBOL(il_set_rate);

void il_chswitch_done(struct il_priv *il, bool is_success)
{
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;

if (test_bit(STATUS_EXIT_PENDING, &il->status))
return;
Expand All @@ -868,7 +868,7 @@ void il_rx_csa(struct il_priv *il, struct il_rx_mem_buffer *rxb)
struct il_rx_pkt *pkt = rxb_addr(rxb);
struct il_csa_notification *csa = &(pkt->u.csa_notif);

struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;
struct il_rxon_cmd *rxon = (void *)&ctx->active;

if (!test_bit(STATUS_CHANNEL_SWITCH_PENDING, &il->status))
Expand Down Expand Up @@ -933,7 +933,7 @@ void il_irq_handle_error(struct il_priv *il)
#ifdef CONFIG_IWLEGACY_DEBUG
if (il_get_debug_level(il) & IL_DL_FW_ERRORS)
il_print_rx_config_cmd(il,
&il->contexts[IL_RXON_CTX_BSS]);
&il->ctx);
#endif

wake_up(&il->wait_command_queue);
Expand Down Expand Up @@ -1110,7 +1110,7 @@ int il_set_tx_power(struct il_priv *il, s8 tx_power, bool force)
int ret;
s8 prev_tx_power;
bool defer;
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;

lockdep_assert_held(&il->mutex);

Expand Down Expand Up @@ -2069,7 +2069,7 @@ int il_mac_config(struct ieee80211_hw *hw, u32 changed)
int ret = 0;
u16 ch;
int scan_active = 0;
bool ht_changed[NUM_IL_RXON_CTX] = {};
bool ht_changed = false;

if (WARN_ON(!il->cfg->ops->legacy))
return -EOPNOTSUPP;
Expand Down Expand Up @@ -2129,7 +2129,7 @@ int il_mac_config(struct ieee80211_hw *hw, u32 changed)
/* Configure HT40 channels */
if (ctx->ht.enabled != conf_is_ht(conf)) {
ctx->ht.enabled = conf_is_ht(conf);
ht_changed[ctx->ctxid] = true;
ht_changed = true;
}
if (ctx->ht.enabled) {
if (conf_is_ht40_minus(conf)) {
Expand Down Expand Up @@ -2209,7 +2209,7 @@ int il_mac_config(struct ieee80211_hw *hw, u32 changed)
else
D_INFO(
"Not re-sending same RXON configuration.\n");
if (ht_changed[ctx->ctxid])
if (ht_changed)
il_update_qos(il, ctx);
}

Expand All @@ -2225,8 +2225,7 @@ void il_mac_reset_tsf(struct ieee80211_hw *hw,
{
struct il_priv *il = hw->priv;
unsigned long flags;
/* IBSS can only be the IL_RXON_CTX_BSS context */
struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
struct il_rxon_context *ctx = &il->ctx;

if (WARN_ON(!il->cfg->ops->legacy))
return;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/iwlegacy/iwl-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ il_dbgfs_qos_read(struct file *file, char __user *user_buf,
struct il_priv *il = file->private_data;
struct il_rxon_context *ctx;
int pos = 0, i;
char buf[256 * NUM_IL_RXON_CTX];
char buf[256];
const size_t bufsz = sizeof(buf);

for_each_context(il, ctx) {
Expand Down Expand Up @@ -1064,7 +1064,7 @@ static ssize_t il_dbgfs_rxon_flags_read(struct file *file,
char buf[20];

len = sprintf(buf, "0x%04X\n",
le32_to_cpu(il->contexts[IL_RXON_CTX_BSS].active.flags));
le32_to_cpu(il->ctx.active.flags));
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}

Expand All @@ -1077,7 +1077,7 @@ static ssize_t il_dbgfs_rxon_filter_flags_read(struct file *file,
char buf[20];

len = sprintf(buf, "0x%04X\n",
le32_to_cpu(il->contexts[IL_RXON_CTX_BSS].active.filter_flags));
le32_to_cpu(il->ctx.active.filter_flags));
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}

Expand Down
Loading

0 comments on commit 4558d57

Please sign in to comment.