Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290372
b: refs/heads/master
c: c8b0395
h: refs/heads/master
v: v3
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Feb 6, 2012
1 parent 539e897 commit e6142a5
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 229 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: caf60a6c957e7a35837a41f845e57b4433e20276
refs/heads/master: c8b03958d4b23dc48932ec095a391f3d6447e0e9
82 changes: 36 additions & 46 deletions trunk/drivers/net/wireless/iwlegacy/3945-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,13 @@ il3945_get_measurement(struct il_priv *il,
int rc;
int spectrum_resp_status;
int duration = le16_to_cpu(params->duration);
struct il_rxon_context *ctx = &il->ctx;

if (il_is_associated(il))
add_time =
il_usecs_to_beacons(il,
le64_to_cpu(params->start_time) -
il->_3945.last_tsf,
le16_to_cpu(ctx->timing.
beacon_interval));
le16_to_cpu(il->timing.beacon_interval));

memset(&spectrum, 0, sizeof(spectrum));

Expand All @@ -694,15 +692,14 @@ il3945_get_measurement(struct il_priv *il,
if (il_is_associated(il))
spectrum.start_time =
il_add_beacon_time(il, il->_3945.last_beacon_time, add_time,
le16_to_cpu(ctx->timing.
beacon_interval));
le16_to_cpu(il->timing.beacon_interval));
else
spectrum.start_time = 0;

spectrum.channels[0].duration = cpu_to_le32(duration * TIME_UNIT);
spectrum.channels[0].channel = params->channel;
spectrum.channels[0].type = type;
if (ctx->active.flags & RXON_FLG_BAND_24G_MSK)
if (il->active.flags & RXON_FLG_BAND_24G_MSK)
spectrum.flags |=
RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK |
RXON_FLG_TGG_PROTECT_MSK;
Expand Down Expand Up @@ -2150,7 +2147,6 @@ il3945_alive_start(struct il_priv *il)
{
int thermal_spin = 0;
u32 rfkill;
struct il_rxon_context *ctx = &il->ctx;

D_INFO("Runtime Alive received.\n");

Expand Down Expand Up @@ -2206,13 +2202,13 @@ il3945_alive_start(struct il_priv *il)

if (il_is_associated(il)) {
struct il3945_rxon_cmd *active_rxon =
(struct il3945_rxon_cmd *)(&ctx->active);
(struct il3945_rxon_cmd *)(&il->active);

ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
il->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
} else {
/* Initialize our rx_config data */
il_connection_init_rx_config(il, ctx);
il_connection_init_rx_config(il, &il->ctx);
}

/* Configure Bluetooth device coexistence support */
Expand All @@ -2221,7 +2217,7 @@ il3945_alive_start(struct il_priv *il)
set_bit(S_READY, &il->status);

/* Configure the adapter for unassociated operation */
il3945_commit_rxon(il, ctx);
il3945_commit_rxon(il, &il->ctx);

il3945_reg_txpower_periodic(il);

Expand Down Expand Up @@ -2670,7 +2666,7 @@ il3945_post_scan(struct il_priv *il)
* Since setting the RXON may have been deferred while
* performing the scan, fire one off if needed
*/
if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
if (memcmp(&il->staging, &il->active, sizeof(il->staging)))
il3945_commit_rxon(il, ctx);
}

Expand Down Expand Up @@ -2728,7 +2724,7 @@ il3945_post_associate(struct il_priv *il)
return;

D_ASSOC("Associated as %d to: %pM\n", ctx->vif->bss_conf.aid,
ctx->active.bssid_addr);
il->active.bssid_addr);

if (test_bit(S_EXIT_PENDING, &il->status))
return;
Expand All @@ -2737,30 +2733,30 @@ il3945_post_associate(struct il_priv *il)

conf = &il->hw->conf;

ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
il3945_commit_rxon(il, ctx);

rc = il_send_rxon_timing(il, ctx);
if (rc)
IL_WARN("C_RXON_TIMING failed - " "Attempting to continue.\n");

ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
il->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;

ctx->staging.assoc_id = cpu_to_le16(ctx->vif->bss_conf.aid);
il->staging.assoc_id = cpu_to_le16(ctx->vif->bss_conf.aid);

D_ASSOC("assoc id %d beacon interval %d\n", ctx->vif->bss_conf.aid,
ctx->vif->bss_conf.beacon_int);

if (ctx->vif->bss_conf.use_short_preamble)
ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
il->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
else
ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
il->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;

if (ctx->staging.flags & RXON_FLG_BAND_24G_MSK) {
if (il->staging.flags & RXON_FLG_BAND_24G_MSK) {
if (ctx->vif->bss_conf.use_short_slot)
ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
il->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
else
ctx->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
il->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
}

il3945_commit_rxon(il, ctx);
Expand Down Expand Up @@ -2902,7 +2898,7 @@ il3945_config_ap(struct il_priv *il)
if (!(il_is_associated(il))) {

/* RXON - unassoc (to set timing command) */
ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
il3945_commit_rxon(il, ctx);

/* RXON Timing */
Expand All @@ -2911,21 +2907,21 @@ il3945_config_ap(struct il_priv *il)
IL_WARN("C_RXON_TIMING failed - "
"Attempting to continue.\n");

ctx->staging.assoc_id = 0;
il->staging.assoc_id = 0;

if (vif->bss_conf.use_short_preamble)
ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
il->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
else
ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
il->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;

if (ctx->staging.flags & RXON_FLG_BAND_24G_MSK) {
if (il->staging.flags & RXON_FLG_BAND_24G_MSK) {
if (vif->bss_conf.use_short_slot)
ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
il->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
else
ctx->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
il->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
}
/* restore RXON assoc */
ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
il->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
il3945_commit_rxon(il, ctx);
}
il3945_send_beacon_cmd(il);
Expand Down Expand Up @@ -3032,7 +3028,6 @@ il3945_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
{
struct il_priv *il = hw->priv;
__le32 filter_or = 0, filter_nand = 0;
struct il_rxon_context *ctx = &il->ctx;

#define CHK(test, flag) do { \
if (*total_flags & (test)) \
Expand All @@ -3052,8 +3047,8 @@ il3945_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,

mutex_lock(&il->mutex);

ctx->staging.filter_flags &= ~filter_nand;
ctx->staging.filter_flags |= filter_or;
il->staging.filter_flags &= ~filter_nand;
il->staging.filter_flags |= filter_or;

/*
* Not committing directly because hardware can perform a scan,
Expand Down Expand Up @@ -3170,9 +3165,8 @@ static ssize_t
il3945_show_flags(struct device *d, struct device_attribute *attr, char *buf)
{
struct il_priv *il = dev_get_drvdata(d);
struct il_rxon_context *ctx = &il->ctx;

return sprintf(buf, "0x%04X\n", ctx->active.flags);
return sprintf(buf, "0x%04X\n", il->active.flags);
}

static ssize_t
Expand All @@ -3181,17 +3175,16 @@ il3945_store_flags(struct device *d, struct device_attribute *attr,
{
struct il_priv *il = dev_get_drvdata(d);
u32 flags = simple_strtoul(buf, NULL, 0);
struct il_rxon_context *ctx = &il->ctx;

mutex_lock(&il->mutex);
if (le32_to_cpu(ctx->staging.flags) != flags) {
if (le32_to_cpu(il->staging.flags) != flags) {
/* Cancel any currently running scans... */
if (il_scan_cancel_timeout(il, 100))
IL_WARN("Could not cancel scan.\n");
else {
D_INFO("Committing rxon.flags = 0x%04X\n", flags);
ctx->staging.flags = cpu_to_le32(flags);
il3945_commit_rxon(il, ctx);
il->staging.flags = cpu_to_le32(flags);
il3945_commit_rxon(il, &il->ctx);
}
}
mutex_unlock(&il->mutex);
Expand All @@ -3207,29 +3200,27 @@ il3945_show_filter_flags(struct device *d, struct device_attribute *attr,
char *buf)
{
struct il_priv *il = dev_get_drvdata(d);
struct il_rxon_context *ctx = &il->ctx;

return sprintf(buf, "0x%04X\n", le32_to_cpu(ctx->active.filter_flags));
return sprintf(buf, "0x%04X\n", le32_to_cpu(il->active.filter_flags));
}

static ssize_t
il3945_store_filter_flags(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{
struct il_priv *il = dev_get_drvdata(d);
struct il_rxon_context *ctx = &il->ctx;
u32 filter_flags = simple_strtoul(buf, NULL, 0);

mutex_lock(&il->mutex);
if (le32_to_cpu(ctx->staging.filter_flags) != filter_flags) {
if (le32_to_cpu(il->staging.filter_flags) != filter_flags) {
/* Cancel any currently running scans... */
if (il_scan_cancel_timeout(il, 100))
IL_WARN("Could not cancel scan.\n");
else {
D_INFO("Committing rxon.filter_flags = " "0x%04X\n",
filter_flags);
ctx->staging.filter_flags = cpu_to_le32(filter_flags);
il3945_commit_rxon(il, ctx);
il->staging.filter_flags = cpu_to_le32(filter_flags);
il3945_commit_rxon(il, &il->ctx);
}
}
mutex_unlock(&il->mutex);
Expand Down Expand Up @@ -3278,9 +3269,8 @@ il3945_store_measurement(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{
struct il_priv *il = dev_get_drvdata(d);
struct il_rxon_context *ctx = &il->ctx;
struct ieee80211_measurement_params params = {
.channel = le16_to_cpu(ctx->active.channel),
.channel = le16_to_cpu(il->active.channel),
.start_time = cpu_to_le64(il->_3945.last_tsf),
.duration = cpu_to_le16(1),
};
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/iwlegacy/3945-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ 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->ctx.active.flags & RXON_FLG_TGG_PROTECT_MSK) {
if (il->active.flags & RXON_FLG_TGG_PROTECT_MSK) {
rs_sta->tgg = 1;
rs_sta->expected_tpt = il3945_expected_tpt_g_prot;
} else
Expand Down
22 changes: 11 additions & 11 deletions trunk/drivers/net/wireless/iwlegacy/3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ 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->ctx.active.channel,
.channel = il->active.channel,
};
u16 chan;

Expand All @@ -1397,7 +1397,7 @@ il3945_send_tx_power(struct il_priv *il)
"TX Power requested while scanning!\n"))
return -EAGAIN;

chan = le16_to_cpu(il->ctx.active.channel);
chan = le16_to_cpu(il->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 @@ -1673,8 +1673,8 @@ il3945_send_rxon_assoc(struct il_priv *il, struct il_rxon_context *ctx)
.flags = CMD_WANT_SKB,
.data = &rxon_assoc,
};
const struct il_rxon_cmd *rxon1 = &ctx->staging;
const struct il_rxon_cmd *rxon2 = &ctx->active;
const struct il_rxon_cmd *rxon1 = &il->staging;
const struct il_rxon_cmd *rxon2 = &il->active;

if (rxon1->flags == rxon2->flags &&
rxon1->filter_flags == rxon2->filter_flags &&
Expand All @@ -1684,10 +1684,10 @@ il3945_send_rxon_assoc(struct il_priv *il, struct il_rxon_context *ctx)
return 0;
}

rxon_assoc.flags = ctx->staging.flags;
rxon_assoc.filter_flags = ctx->staging.filter_flags;
rxon_assoc.ofdm_basic_rates = ctx->staging.ofdm_basic_rates;
rxon_assoc.cck_basic_rates = ctx->staging.cck_basic_rates;
rxon_assoc.flags = il->staging.flags;
rxon_assoc.filter_flags = il->staging.filter_flags;
rxon_assoc.ofdm_basic_rates = il->staging.ofdm_basic_rates;
rxon_assoc.cck_basic_rates = il->staging.cck_basic_rates;
rxon_assoc.reserved = 0;

rc = il_send_cmd_sync(il, &cmd);
Expand Down Expand Up @@ -1717,8 +1717,8 @@ int
il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
{
/* cast away the const for active_rxon in this function */
struct il3945_rxon_cmd *active_rxon = (void *)&ctx->active;
struct il3945_rxon_cmd *staging_rxon = (void *)&ctx->staging;
struct il3945_rxon_cmd *active_rxon = (void *)&il->active;
struct il3945_rxon_cmd *staging_rxon = (void *)&il->staging;
int rc = 0;
bool new_assoc = !!(staging_rxon->filter_flags & RXON_FILTER_ASSOC_MSK);

Expand Down Expand Up @@ -1776,7 +1776,7 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
active_rxon->reserved4 = 0;
active_rxon->reserved5 = 0;
rc = il_send_cmd_pdu(il, C_RXON, sizeof(struct il3945_rxon_cmd),
&il->ctx.active);
&il->active);

/* If the mask clearing failed then we set
* active_rxon back to what it was previously */
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/net/wireless/iwlegacy/4965-calib.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,6 @@ il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp)
unsigned long flags;
struct stats_rx_non_phy *rx_info;

struct il_rxon_context *ctx = &il->ctx;

if (il->disable_chain_noise_cal)
return;

Expand All @@ -833,8 +831,8 @@ il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp)
return;
}

rxon_band24 = !!(ctx->staging.flags & RXON_FLG_BAND_24G_MSK);
rxon_chnum = le16_to_cpu(ctx->staging.channel);
rxon_band24 = !!(il->staging.flags & RXON_FLG_BAND_24G_MSK);
rxon_chnum = le16_to_cpu(il->staging.channel);

stat_band24 =
!!(((struct il_notif_stats *)stat_resp)->
Expand Down
Loading

0 comments on commit e6142a5

Please sign in to comment.