Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290392
b: refs/heads/master
c: 8300719
h: refs/heads/master
v: v3
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Feb 6, 2012
1 parent f11f6bd commit bab8b0c
Show file tree
Hide file tree
Showing 11 changed files with 262 additions and 379 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: 20c47eba7001680e62878c5b20e487a8b0b873ad
refs/heads/master: 83007196037cc2d0bffd9f7afbe56d675779a6cb
67 changes: 30 additions & 37 deletions trunk/drivers/net/wireless/iwlegacy/3945-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ il3945_send_beacon_cmd(struct il_priv *il)
return -ENOMEM;
}

rate = il_get_lowest_plcp(il, &il->ctx);
rate = il_get_lowest_plcp(il);

frame_size = il3945_hw_get_beacon_cmd(il, frame, rate);

Expand Down Expand Up @@ -512,7 +512,7 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
hdr_len = ieee80211_hdrlen(fc);

/* Find idx into station table for destination station */
sta_id = il_sta_id_or_broadcast(il, &il->ctx, info->control.sta);
sta_id = il_sta_id_or_broadcast(il, info->control.sta);
if (sta_id == IL_INVALID_STATION) {
D_DROP("Dropping - INVALID STATION: %pM\n", hdr->addr1);
goto drop;
Expand Down Expand Up @@ -541,7 +541,6 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
/* Set up driver data for this TFD */
memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct il_tx_info));
txq->txb[q->write_ptr].skb = skb;
txq->txb[q->write_ptr].ctx = &il->ctx;

/* Init first empty entry in queue's array of Tx/cmd buffers */
out_cmd = txq->cmd[idx];
Expand Down Expand Up @@ -2208,7 +2207,7 @@ il3945_alive_start(struct il_priv *il)
active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
} else {
/* Initialize our rx_config data */
il_connection_init_rx_config(il, &il->ctx);
il_connection_init_rx_config(il);
}

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

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

il3945_reg_txpower_periodic(il);

Expand Down Expand Up @@ -2249,7 +2248,7 @@ __il3945_down(struct il_priv *il)
del_timer_sync(&il->watchdog);

/* Station information will now be cleared in device */
il_clear_ucode_stations(il, NULL);
il_clear_ucode_stations(il);
il_dealloc_bcast_stations(il);
il_clear_driver_stations(il);

Expand Down Expand Up @@ -2335,12 +2334,11 @@ il3945_down(struct il_priv *il)
static int
il3945_alloc_bcast_station(struct il_priv *il)
{
struct il_rxon_context *ctx = &il->ctx;
unsigned long flags;
u8 sta_id;

spin_lock_irqsave(&il->sta_lock, flags);
sta_id = il_prep_station(il, ctx, il_bcast_addr, false, NULL);
sta_id = il_prep_station(il, il_bcast_addr, false, NULL);
if (sta_id == IL_INVALID_STATION) {
IL_ERR("Unable to prepare broadcast station\n");
spin_unlock_irqrestore(&il->sta_lock, flags);
Expand Down Expand Up @@ -2660,14 +2658,12 @@ il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
void
il3945_post_scan(struct il_priv *il)
{
struct il_rxon_context *ctx = &il->ctx;

/*
* Since setting the RXON may have been deferred while
* performing the scan, fire one off if needed
*/
if (memcmp(&il->staging, &il->active, sizeof(il->staging)))
il3945_commit_rxon(il, ctx);
il3945_commit_rxon(il);
}

static void
Expand All @@ -2680,7 +2676,8 @@ il3945_bg_restart(struct work_struct *data)

if (test_and_clear_bit(S_FW_ERROR, &il->status)) {
mutex_lock(&il->mutex);
il->ctx.vif = NULL;
/* FIXME: vif can be dereferenced */
il->vif = NULL;
il->is_open = 0;
mutex_unlock(&il->mutex);
il3945_down(il);
Expand Down Expand Up @@ -2718,12 +2715,11 @@ il3945_post_associate(struct il_priv *il)
{
int rc = 0;
struct ieee80211_conf *conf = NULL;
struct il_rxon_context *ctx = &il->ctx;

if (!ctx->vif || !il->is_open)
if (!il->vif || !il->is_open)
return;

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

if (test_bit(S_EXIT_PENDING, &il->status))
Expand All @@ -2734,34 +2730,34 @@ il3945_post_associate(struct il_priv *il)
conf = &il->hw->conf;

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

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

il->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;

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

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

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

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

il3945_commit_rxon(il, ctx);
il3945_commit_rxon(il);

switch (ctx->vif->type) {
switch (il->vif->type) {
case NL80211_IFTYPE_STATION:
il3945_rate_scale_init(il->hw, IL_AP_ID);
break;
Expand All @@ -2770,7 +2766,7 @@ il3945_post_associate(struct il_priv *il)
break;
default:
IL_ERR("%s Should not be called in %d mode\n", __func__,
ctx->vif->type);
il->vif->type);
break;
}
}
Expand Down Expand Up @@ -2887,8 +2883,7 @@ il3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
void
il3945_config_ap(struct il_priv *il)
{
struct il_rxon_context *ctx = &il->ctx;
struct ieee80211_vif *vif = ctx->vif;
struct ieee80211_vif *vif = il->vif;
int rc = 0;

if (test_bit(S_EXIT_PENDING, &il->status))
Expand All @@ -2899,10 +2894,10 @@ il3945_config_ap(struct il_priv *il)

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

/* RXON Timing */
rc = il_send_rxon_timing(il, ctx);
rc = il_send_rxon_timing(il);
if (rc)
IL_WARN("C_RXON_TIMING failed - "
"Attempting to continue.\n");
Expand All @@ -2922,7 +2917,7 @@ il3945_config_ap(struct il_priv *il)
}
/* restore RXON assoc */
il->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
il3945_commit_rxon(il, ctx);
il3945_commit_rxon(il);
}
il3945_send_beacon_cmd(il);
}
Expand Down Expand Up @@ -2955,7 +2950,7 @@ il3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
static_key = !il_is_associated(il);

if (!static_key) {
sta_id = il_sta_id_or_broadcast(il, &il->ctx, sta);
sta_id = il_sta_id_or_broadcast(il, sta);
if (sta_id == IL_INVALID_STATION)
return -EINVAL;
}
Expand Down Expand Up @@ -3003,8 +2998,7 @@ il3945_mac_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
D_INFO("proceeding to add station %pM\n", sta->addr);
sta_priv->common.sta_id = IL_INVALID_STATION;

ret =
il_add_station_common(il, &il->ctx, sta->addr, is_ap, sta, &sta_id);
ret = il_add_station_common(il, sta->addr, is_ap, sta, &sta_id);
if (ret) {
IL_ERR("Unable to add station %pM (%d)\n", sta->addr, ret);
/* Should we return success if return code is EEXIST ? */
Expand Down Expand Up @@ -3184,7 +3178,7 @@ il3945_store_flags(struct device *d, struct device_attribute *attr,
else {
D_INFO("Committing rxon.flags = 0x%04X\n", flags);
il->staging.flags = cpu_to_le32(flags);
il3945_commit_rxon(il, &il->ctx);
il3945_commit_rxon(il);
}
}
mutex_unlock(&il->mutex);
Expand Down Expand Up @@ -3220,7 +3214,7 @@ il3945_store_filter_flags(struct device *d, struct device_attribute *attr,
D_INFO("Committing rxon.filter_flags = " "0x%04X\n",
filter_flags);
il->staging.filter_flags = cpu_to_le32(filter_flags);
il3945_commit_rxon(il, &il->ctx);
il3945_commit_rxon(il);
}
}
mutex_unlock(&il->mutex);
Expand Down Expand Up @@ -3750,8 +3744,7 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_release_irq;
}

il_set_rxon_channel(il, &il->bands[IEEE80211_BAND_2GHZ].channels[5],
&il->ctx);
il_set_rxon_channel(il, &il->bands[IEEE80211_BAND_2GHZ].channels[5]);
il3945_setup_deferred_work(il);
il3945_setup_handlers(il);
il_power_initialize(il);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/iwlegacy/3945-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,7 @@ il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)

rcu_read_lock();

sta =
ieee80211_find_sta(il->ctx.vif, il->stations[sta_id].sta.sta.addr);
sta = ieee80211_find_sta(il->vif, il->stations[sta_id].sta.sta.addr);
if (!sta) {
D_RATE("Unable to find station to initialize rate scaling.\n");
rcu_read_unlock();
Expand Down
23 changes: 11 additions & 12 deletions trunk/drivers/net/wireless/iwlegacy/3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ il3945_hw_reg_set_txpower(struct il_priv *il, s8 power)
}

static int
il3945_send_rxon_assoc(struct il_priv *il, struct il_rxon_context *ctx)
il3945_send_rxon_assoc(struct il_priv *il)
{
int rc = 0;
struct il_rx_pkt *pkt;
Expand Down Expand Up @@ -1714,7 +1714,7 @@ il3945_send_rxon_assoc(struct il_priv *il, struct il_rxon_context *ctx)
* a HW tune is required based on the RXON structure changes.
*/
int
il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
il3945_commit_rxon(struct il_priv *il)
{
/* cast away the const for active_rxon in this function */
struct il3945_rxon_cmd *active_rxon = (void *)&il->active;
Expand All @@ -1735,7 +1735,7 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
staging_rxon->flags &= ~(RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_SEL_MSK);
staging_rxon->flags |= il3945_get_antenna_flags(il);

rc = il_check_rxon_cmd(il, ctx);
rc = il_check_rxon_cmd(il);
if (rc) {
IL_ERR("Invalid RXON configuration. Not committing.\n");
return -EINVAL;
Expand All @@ -1744,8 +1744,8 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
/* If we don't need to send a full RXON, we can use
* 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->ctx)) {
rc = il_send_rxon_assoc(il, &il->ctx);
if (!il_full_rxon_required(il)) {
rc = il_send_rxon_assoc(il);
if (rc) {
IL_ERR("Error setting RXON_ASSOC "
"configuration (%d).\n", rc);
Expand Down Expand Up @@ -1786,8 +1786,8 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
"configuration (%d).\n", rc);
return rc;
}
il_clear_ucode_stations(il, &il->ctx);
il_restore_stations(il, &il->ctx);
il_clear_ucode_stations(il);
il_restore_stations(il);
}

D_INFO("Sending RXON\n" "* with%s RXON_FILTER_ASSOC_MSK\n"
Expand All @@ -1801,7 +1801,7 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
staging_rxon->reserved4 = 0;
staging_rxon->reserved5 = 0;

il_set_rxon_hwcrypto(il, ctx, !il3945_mod_params.sw_crypto);
il_set_rxon_hwcrypto(il, !il3945_mod_params.sw_crypto);

/* Apply the new configuration */
rc = il_send_cmd_pdu(il, C_RXON, sizeof(struct il3945_rxon_cmd),
Expand All @@ -1814,8 +1814,8 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
memcpy(active_rxon, staging_rxon, sizeof(*active_rxon));

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

/* If we issue a new RXON command which required a tune then we must
Expand Down Expand Up @@ -2258,15 +2258,14 @@ il3945_build_addsta_hcmd(const struct il_addsta_cmd *cmd, u8 * data)
static int
il3945_add_bssid_station(struct il_priv *il, const u8 * addr, u8 * sta_id_r)
{
struct il_rxon_context *ctx = &il->ctx;
int ret;
u8 sta_id;
unsigned long flags;

if (sta_id_r)
*sta_id_r = IL_INVALID_STATION;

ret = il_add_station_common(il, ctx, addr, 0, NULL, &sta_id);
ret = il_add_station_common(il, addr, 0, NULL, &sta_id);
if (ret) {
IL_ERR("Unable to add station %pM\n", addr);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/iwlegacy/3945.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ 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 *il, struct il_rxon_context *ctx);
extern int il3945_commit_rxon(struct il_priv *il);

/**
* il3945_hw_find_station - Find station id for a given BSSID
Expand Down
Loading

0 comments on commit bab8b0c

Please sign in to comment.