Commit 83007196 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville

iwlegacy: get rid of ctx structure

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 20c47eba
...@@ -341,7 +341,7 @@ il3945_send_beacon_cmd(struct il_priv *il) ...@@ -341,7 +341,7 @@ il3945_send_beacon_cmd(struct il_priv *il)
return -ENOMEM; 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); frame_size = il3945_hw_get_beacon_cmd(il, frame, rate);
...@@ -512,7 +512,7 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb) ...@@ -512,7 +512,7 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
hdr_len = ieee80211_hdrlen(fc); hdr_len = ieee80211_hdrlen(fc);
/* Find idx into station table for destination station */ /* 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) { if (sta_id == IL_INVALID_STATION) {
D_DROP("Dropping - INVALID STATION: %pM\n", hdr->addr1); D_DROP("Dropping - INVALID STATION: %pM\n", hdr->addr1);
goto drop; goto drop;
...@@ -541,7 +541,6 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb) ...@@ -541,7 +541,6 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
/* Set up driver data for this TFD */ /* Set up driver data for this TFD */
memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct il_tx_info)); memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct il_tx_info));
txq->txb[q->write_ptr].skb = skb; 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 */ /* Init first empty entry in queue's array of Tx/cmd buffers */
out_cmd = txq->cmd[idx]; out_cmd = txq->cmd[idx];
...@@ -2208,7 +2207,7 @@ il3945_alive_start(struct il_priv *il) ...@@ -2208,7 +2207,7 @@ il3945_alive_start(struct il_priv *il)
active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK; active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
} else { } else {
/* Initialize our rx_config data */ /* Initialize our rx_config data */
il_connection_init_rx_config(il, &il->ctx); il_connection_init_rx_config(il);
} }
/* Configure Bluetooth device coexistence support */ /* Configure Bluetooth device coexistence support */
...@@ -2217,7 +2216,7 @@ il3945_alive_start(struct il_priv *il) ...@@ -2217,7 +2216,7 @@ il3945_alive_start(struct il_priv *il)
set_bit(S_READY, &il->status); set_bit(S_READY, &il->status);
/* Configure the adapter for unassociated operation */ /* Configure the adapter for unassociated operation */
il3945_commit_rxon(il, &il->ctx); il3945_commit_rxon(il);
il3945_reg_txpower_periodic(il); il3945_reg_txpower_periodic(il);
...@@ -2249,7 +2248,7 @@ __il3945_down(struct il_priv *il) ...@@ -2249,7 +2248,7 @@ __il3945_down(struct il_priv *il)
del_timer_sync(&il->watchdog); del_timer_sync(&il->watchdog);
/* Station information will now be cleared in device */ /* 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_dealloc_bcast_stations(il);
il_clear_driver_stations(il); il_clear_driver_stations(il);
...@@ -2335,12 +2334,11 @@ il3945_down(struct il_priv *il) ...@@ -2335,12 +2334,11 @@ il3945_down(struct il_priv *il)
static int static int
il3945_alloc_bcast_station(struct il_priv *il) il3945_alloc_bcast_station(struct il_priv *il)
{ {
struct il_rxon_context *ctx = &il->ctx;
unsigned long flags; unsigned long flags;
u8 sta_id; u8 sta_id;
spin_lock_irqsave(&il->sta_lock, flags); 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) { if (sta_id == IL_INVALID_STATION) {
IL_ERR("Unable to prepare broadcast station\n"); IL_ERR("Unable to prepare broadcast station\n");
spin_unlock_irqrestore(&il->sta_lock, flags); spin_unlock_irqrestore(&il->sta_lock, flags);
...@@ -2660,14 +2658,12 @@ il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif) ...@@ -2660,14 +2658,12 @@ il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
void void
il3945_post_scan(struct il_priv *il) il3945_post_scan(struct il_priv *il)
{ {
struct il_rxon_context *ctx = &il->ctx;
/* /*
* Since setting the RXON may have been deferred while * Since setting the RXON may have been deferred while
* performing the scan, fire one off if needed * performing the scan, fire one off if needed
*/ */
if (memcmp(&il->staging, &il->active, sizeof(il->staging))) if (memcmp(&il->staging, &il->active, sizeof(il->staging)))
il3945_commit_rxon(il, ctx); il3945_commit_rxon(il);
} }
static void static void
...@@ -2680,7 +2676,8 @@ il3945_bg_restart(struct work_struct *data) ...@@ -2680,7 +2676,8 @@ il3945_bg_restart(struct work_struct *data)
if (test_and_clear_bit(S_FW_ERROR, &il->status)) { if (test_and_clear_bit(S_FW_ERROR, &il->status)) {
mutex_lock(&il->mutex); mutex_lock(&il->mutex);
il->ctx.vif = NULL; /* FIXME: vif can be dereferenced */
il->vif = NULL;
il->is_open = 0; il->is_open = 0;
mutex_unlock(&il->mutex); mutex_unlock(&il->mutex);
il3945_down(il); il3945_down(il);
...@@ -2718,12 +2715,11 @@ il3945_post_associate(struct il_priv *il) ...@@ -2718,12 +2715,11 @@ il3945_post_associate(struct il_priv *il)
{ {
int rc = 0; int rc = 0;
struct ieee80211_conf *conf = NULL; 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; 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); il->active.bssid_addr);
if (test_bit(S_EXIT_PENDING, &il->status)) if (test_bit(S_EXIT_PENDING, &il->status))
...@@ -2734,34 +2730,34 @@ il3945_post_associate(struct il_priv *il) ...@@ -2734,34 +2730,34 @@ il3945_post_associate(struct il_priv *il)
conf = &il->hw->conf; conf = &il->hw->conf;
il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 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) if (rc)
IL_WARN("C_RXON_TIMING failed - " "Attempting to continue.\n"); IL_WARN("C_RXON_TIMING failed - " "Attempting to continue.\n");
il->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; 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, D_ASSOC("assoc id %d beacon interval %d\n", il->vif->bss_conf.aid,
ctx->vif->bss_conf.beacon_int); 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; il->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
else else
il->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK; il->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
if (il->staging.flags & RXON_FLG_BAND_24G_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; il->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
else else
il->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 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: case NL80211_IFTYPE_STATION:
il3945_rate_scale_init(il->hw, IL_AP_ID); il3945_rate_scale_init(il->hw, IL_AP_ID);
break; break;
...@@ -2770,7 +2766,7 @@ il3945_post_associate(struct il_priv *il) ...@@ -2770,7 +2766,7 @@ il3945_post_associate(struct il_priv *il)
break; break;
default: default:
IL_ERR("%s Should not be called in %d mode\n", __func__, IL_ERR("%s Should not be called in %d mode\n", __func__,
ctx->vif->type); il->vif->type);
break; break;
} }
} }
...@@ -2887,8 +2883,7 @@ il3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -2887,8 +2883,7 @@ il3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
void void
il3945_config_ap(struct il_priv *il) il3945_config_ap(struct il_priv *il)
{ {
struct il_rxon_context *ctx = &il->ctx; struct ieee80211_vif *vif = il->vif;
struct ieee80211_vif *vif = ctx->vif;
int rc = 0; int rc = 0;
if (test_bit(S_EXIT_PENDING, &il->status)) if (test_bit(S_EXIT_PENDING, &il->status))
...@@ -2899,10 +2894,10 @@ il3945_config_ap(struct il_priv *il) ...@@ -2899,10 +2894,10 @@ il3945_config_ap(struct il_priv *il)
/* RXON - unassoc (to set timing command) */ /* RXON - unassoc (to set timing command) */
il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
il3945_commit_rxon(il, ctx); il3945_commit_rxon(il);
/* RXON Timing */ /* RXON Timing */
rc = il_send_rxon_timing(il, ctx); rc = il_send_rxon_timing(il);
if (rc) if (rc)
IL_WARN("C_RXON_TIMING failed - " IL_WARN("C_RXON_TIMING failed - "
"Attempting to continue.\n"); "Attempting to continue.\n");
...@@ -2922,7 +2917,7 @@ il3945_config_ap(struct il_priv *il) ...@@ -2922,7 +2917,7 @@ il3945_config_ap(struct il_priv *il)
} }
/* restore RXON assoc */ /* restore RXON assoc */
il->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; il->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
il3945_commit_rxon(il, ctx); il3945_commit_rxon(il);
} }
il3945_send_beacon_cmd(il); il3945_send_beacon_cmd(il);
} }
...@@ -2955,7 +2950,7 @@ il3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -2955,7 +2950,7 @@ il3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
static_key = !il_is_associated(il); static_key = !il_is_associated(il);
if (!static_key) { 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) if (sta_id == IL_INVALID_STATION)
return -EINVAL; return -EINVAL;
} }
...@@ -3003,8 +2998,7 @@ il3945_mac_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -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); D_INFO("proceeding to add station %pM\n", sta->addr);
sta_priv->common.sta_id = IL_INVALID_STATION; sta_priv->common.sta_id = IL_INVALID_STATION;
ret = ret = il_add_station_common(il, sta->addr, is_ap, sta, &sta_id);
il_add_station_common(il, &il->ctx, sta->addr, is_ap, sta, &sta_id);
if (ret) { if (ret) {
IL_ERR("Unable to add station %pM (%d)\n", sta->addr, ret); IL_ERR("Unable to add station %pM (%d)\n", sta->addr, ret);
/* Should we return success if return code is EEXIST ? */ /* Should we return success if return code is EEXIST ? */
...@@ -3184,7 +3178,7 @@ il3945_store_flags(struct device *d, struct device_attribute *attr, ...@@ -3184,7 +3178,7 @@ il3945_store_flags(struct device *d, struct device_attribute *attr,
else { else {
D_INFO("Committing rxon.flags = 0x%04X\n", flags); D_INFO("Committing rxon.flags = 0x%04X\n", flags);
il->staging.flags = cpu_to_le32(flags); il->staging.flags = cpu_to_le32(flags);
il3945_commit_rxon(il, &il->ctx); il3945_commit_rxon(il);
} }
} }
mutex_unlock(&il->mutex); mutex_unlock(&il->mutex);
...@@ -3220,7 +3214,7 @@ il3945_store_filter_flags(struct device *d, struct device_attribute *attr, ...@@ -3220,7 +3214,7 @@ il3945_store_filter_flags(struct device *d, struct device_attribute *attr,
D_INFO("Committing rxon.filter_flags = " "0x%04X\n", D_INFO("Committing rxon.filter_flags = " "0x%04X\n",
filter_flags); filter_flags);
il->staging.filter_flags = cpu_to_le32(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); mutex_unlock(&il->mutex);
...@@ -3750,8 +3744,7 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3750,8 +3744,7 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_release_irq; goto out_release_irq;
} }
il_set_rxon_channel(il, &il->bands[IEEE80211_BAND_2GHZ].channels[5], il_set_rxon_channel(il, &il->bands[IEEE80211_BAND_2GHZ].channels[5]);
&il->ctx);
il3945_setup_deferred_work(il); il3945_setup_deferred_work(il);
il3945_setup_handlers(il); il3945_setup_handlers(il);
il_power_initialize(il); il_power_initialize(il);
......
...@@ -927,8 +927,7 @@ il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) ...@@ -927,8 +927,7 @@ il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
rcu_read_lock(); rcu_read_lock();
sta = sta = ieee80211_find_sta(il->vif, il->stations[sta_id].sta.sta.addr);
ieee80211_find_sta(il->ctx.vif, il->stations[sta_id].sta.sta.addr);
if (!sta) { if (!sta) {
D_RATE("Unable to find station to initialize rate scaling.\n"); D_RATE("Unable to find station to initialize rate scaling.\n");
rcu_read_unlock(); rcu_read_unlock();
......
...@@ -1662,7 +1662,7 @@ il3945_hw_reg_set_txpower(struct il_priv *il, s8 power) ...@@ -1662,7 +1662,7 @@ il3945_hw_reg_set_txpower(struct il_priv *il, s8 power)
} }
static int 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; int rc = 0;
struct il_rx_pkt *pkt; struct il_rx_pkt *pkt;
...@@ -1714,7 +1714,7 @@ il3945_send_rxon_assoc(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -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. * a HW tune is required based on the RXON structure changes.
*/ */
int 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 */ /* cast away the const for active_rxon in this function */
struct il3945_rxon_cmd *active_rxon = (void *)&il->active; struct il3945_rxon_cmd *active_rxon = (void *)&il->active;
...@@ -1735,7 +1735,7 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -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 &= ~(RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_SEL_MSK);
staging_rxon->flags |= il3945_get_antenna_flags(il); staging_rxon->flags |= il3945_get_antenna_flags(il);
rc = il_check_rxon_cmd(il, ctx); rc = il_check_rxon_cmd(il);
if (rc) { if (rc) {
IL_ERR("Invalid RXON configuration. Not committing.\n"); IL_ERR("Invalid RXON configuration. Not committing.\n");
return -EINVAL; return -EINVAL;
...@@ -1744,8 +1744,8 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -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 /* If we don't need to send a full RXON, we can use
* il3945_rxon_assoc_cmd which is used to reconfigure filter * il3945_rxon_assoc_cmd which is used to reconfigure filter
* and other flags for the current radio configuration. */ * and other flags for the current radio configuration. */
if (!il_full_rxon_required(il, &il->ctx)) { if (!il_full_rxon_required(il)) {
rc = il_send_rxon_assoc(il, &il->ctx); rc = il_send_rxon_assoc(il);
if (rc) { if (rc) {
IL_ERR("Error setting RXON_ASSOC " IL_ERR("Error setting RXON_ASSOC "
"configuration (%d).\n", rc); "configuration (%d).\n", rc);
...@@ -1786,8 +1786,8 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1786,8 +1786,8 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
"configuration (%d).\n", rc); "configuration (%d).\n", rc);
return rc; return rc;
} }
il_clear_ucode_stations(il, &il->ctx); il_clear_ucode_stations(il);
il_restore_stations(il, &il->ctx); il_restore_stations(il);
} }
D_INFO("Sending RXON\n" "* with%s RXON_FILTER_ASSOC_MSK\n" D_INFO("Sending RXON\n" "* with%s RXON_FILTER_ASSOC_MSK\n"
...@@ -1801,7 +1801,7 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1801,7 +1801,7 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
staging_rxon->reserved4 = 0; staging_rxon->reserved4 = 0;
staging_rxon->reserved5 = 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 */ /* Apply the new configuration */
rc = il_send_cmd_pdu(il, C_RXON, sizeof(struct il3945_rxon_cmd), rc = il_send_cmd_pdu(il, C_RXON, sizeof(struct il3945_rxon_cmd),
...@@ -1814,8 +1814,8 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1814,8 +1814,8 @@ il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
memcpy(active_rxon, staging_rxon, sizeof(*active_rxon)); memcpy(active_rxon, staging_rxon, sizeof(*active_rxon));
if (!new_assoc) { if (!new_assoc) {
il_clear_ucode_stations(il, &il->ctx); il_clear_ucode_stations(il);
il_restore_stations(il, &il->ctx); il_restore_stations(il);
} }
/* If we issue a new RXON command which required a tune then we must /* If we issue a new RXON command which required a tune then we must
...@@ -2258,7 +2258,6 @@ il3945_build_addsta_hcmd(const struct il_addsta_cmd *cmd, u8 * data) ...@@ -2258,7 +2258,6 @@ il3945_build_addsta_hcmd(const struct il_addsta_cmd *cmd, u8 * data)
static int static int
il3945_add_bssid_station(struct il_priv *il, const u8 * addr, u8 * sta_id_r) il3945_add_bssid_station(struct il_priv *il, const u8 * addr, u8 * sta_id_r)
{ {
struct il_rxon_context *ctx = &il->ctx;
int ret; int ret;
u8 sta_id; u8 sta_id;
unsigned long flags; unsigned long flags;
...@@ -2266,7 +2265,7 @@ il3945_add_bssid_station(struct il_priv *il, const u8 * addr, u8 * sta_id_r) ...@@ -2266,7 +2265,7 @@ il3945_add_bssid_station(struct il_priv *il, const u8 * addr, u8 * sta_id_r)
if (sta_id_r) if (sta_id_r)
*sta_id_r = IL_INVALID_STATION; *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) { if (ret) {
IL_ERR("Unable to add station %pM\n", addr); IL_ERR("Unable to add station %pM\n", addr);
return ret; return ret;
......
...@@ -249,7 +249,7 @@ extern int il4965_get_temperature(const struct il_priv *il); ...@@ -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_post_associate(struct il_priv *il);
extern void il3945_config_ap(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 * il3945_hw_find_station - Find station id for a given BSSID
......
This diff is collapsed.
...@@ -820,8 +820,6 @@ il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband, ...@@ -820,8 +820,6 @@ il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband,
u32 tx_rate; u32 tx_rate;
struct il_scale_tbl_info tbl_type; struct il_scale_tbl_info tbl_type;
struct il_scale_tbl_info *curr_tbl, *other_tbl, *tmp_tbl; struct il_scale_tbl_info *curr_tbl, *other_tbl, *tmp_tbl;
struct il_station_priv *sta_priv = (void *)sta->drv_priv;
struct il_rxon_context *ctx = sta_priv->common.ctx;
D_RATE("get frame ack response, update rate scale win\n"); D_RATE("get frame ack response, update rate scale win\n");
...@@ -889,7 +887,7 @@ il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband, ...@@ -889,7 +887,7 @@ il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband,
lq_sta->missed_rate_counter++; lq_sta->missed_rate_counter++;
if (lq_sta->missed_rate_counter > IL_MISSED_RATE_MAX) { if (lq_sta->missed_rate_counter > IL_MISSED_RATE_MAX) {
lq_sta->missed_rate_counter = 0; lq_sta->missed_rate_counter = 0;
il_send_lq_cmd(il, ctx, &lq_sta->lq, CMD_ASYNC, false); il_send_lq_cmd(il, &lq_sta->lq, CMD_ASYNC, false);
} }
/* Regardless, ignore this status info for outdated rate */ /* Regardless, ignore this status info for outdated rate */
return; return;
...@@ -1181,8 +1179,6 @@ il4965_rs_switch_to_mimo2(struct il_priv *il, struct il_lq_sta *lq_sta, ...@@ -1181,8 +1179,6 @@ il4965_rs_switch_to_mimo2(struct il_priv *il, struct il_lq_sta *lq_sta,
u16 rate_mask; u16 rate_mask;
s32 rate; s32 rate;
s8 is_green = lq_sta->is_green; s8 is_green = lq_sta->is_green;
struct il_station_priv *sta_priv = (void *)sta->drv_priv;
struct il_rxon_context *ctx = sta_priv->common.ctx;
if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
return -1; return -1;
...@@ -1203,7 +1199,7 @@ il4965_rs_switch_to_mimo2(struct il_priv *il, struct il_lq_sta *lq_sta, ...@@ -1203,7 +1199,7 @@ il4965_rs_switch_to_mimo2(struct il_priv *il, struct il_lq_sta *lq_sta,
tbl->max_search = IL_MAX_SEARCH; tbl->max_search = IL_MAX_SEARCH;
rate_mask = lq_sta->active_mimo2_rate; rate_mask = lq_sta->active_mimo2_rate;
if (il_is_ht40_tx_allowed(il, ctx, &sta->ht_cap)) if (il_is_ht40_tx_allowed(il, &sta->ht_cap))
tbl->is_ht40 = 1; tbl->is_ht40 = 1;
else else
tbl->is_ht40 = 0; tbl->is_ht40 = 0;
...@@ -1237,8 +1233,6 @@ il4965_rs_switch_to_siso(struct il_priv *il, struct il_lq_sta *lq_sta, ...@@ -1237,8 +1233,6 @@ il4965_rs_switch_to_siso(struct il_priv *il, struct il_lq_sta *lq_sta,
u16 rate_mask; u16 rate_mask;
u8 is_green = lq_sta->is_green; u8 is_green = lq_sta->is_green;
s32 rate; s32 rate;
struct il_station_priv *sta_priv = (void *)sta->drv_priv;
struct il_rxon_context *ctx = sta_priv->common.ctx;
if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
return -1; return -1;
...@@ -1251,7 +1245,7 @@ il4965_rs_switch_to_siso(struct il_priv *il, struct il_lq_sta *lq_sta, ...@@ -1251,7 +1245,7 @@ il4965_rs_switch_to_siso(struct il_priv *il, struct il_lq_sta *lq_sta,
tbl->max_search = IL_MAX_SEARCH; tbl->max_search = IL_MAX_SEARCH;
rate_mask = lq_sta->active_siso_rate; rate_mask = lq_sta->active_siso_rate;
if (il_is_ht40_tx_allowed(il, ctx, &sta->ht_cap)) if (il_is_ht40_tx_allowed(il, &sta->ht_cap))
tbl->is_ht40 = 1; tbl->is_ht40 = 1;
else else
tbl->is_ht40 = 0; tbl->is_ht40 = 0;
...@@ -1730,8 +1724,7 @@ il4965_rs_stay_in_table(struct il_lq_sta *lq_sta, bool force_search) ...@@ -1730,8 +1724,7 @@ il4965_rs_stay_in_table(struct il_lq_sta *lq_sta, bool force_search)
* setup rate table in uCode * setup rate table in uCode
*/ */
static void static void
il4965_rs_update_rate_tbl(struct il_priv *il, struct il_rxon_context *ctx, il4965_rs_update_rate_tbl(struct il_priv *il, struct il_lq_sta *lq_sta,
struct il_lq_sta *lq_sta,
struct il_scale_tbl_info *tbl, int idx, u8 is_green) struct il_scale_tbl_info *tbl, int idx, u8 is_green)
{ {
u32 rate; u32 rate;
...@@ -1739,7 +1732,7 @@ il4965_rs_update_rate_tbl(struct il_priv *il, struct il_rxon_context *ctx, ...@@ -1739,7 +1732,7 @@ il4965_rs_update_rate_tbl(struct il_priv *il, struct il_rxon_context *ctx,
/* Update uCode's rate table. */ /* Update uCode's rate table. */
rate = il4965_rate_n_flags_from_tbl(il, tbl, idx, is_green); rate = il4965_rate_n_flags_from_tbl(il, tbl, idx, is_green);
il4965_rs_fill_link_cmd(il, lq_sta, rate); il4965_rs_fill_link_cmd(il, lq_sta, rate);
il_send_lq_cmd(il, ctx, &lq_sta->lq, CMD_ASYNC, false); il_send_lq_cmd(il, &lq_sta->lq, CMD_ASYNC, false);
} }
/* /*
...@@ -1775,8 +1768,6 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb, ...@@ -1775,8 +1768,6 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb,
s32 sr; s32 sr;
u8 tid = MAX_TID_COUNT; u8 tid = MAX_TID_COUNT;
struct il_tid_data *tid_data; struct il_tid_data *tid_data;
struct il_station_priv *sta_priv = (void *)sta->drv_priv;
struct il_rxon_context *ctx = sta_priv->common.ctx;
D_RATE("rate scale calculate new rate for skb\n"); D_RATE("rate scale calculate new rate for skb\n");
...@@ -1851,7 +1842,7 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb, ...@@ -1851,7 +1842,7 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb,
tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
/* get "active" rate info */ /* get "active" rate info */
idx = il4965_hwrate_to_plcp_idx(tbl->current_rate); idx = il4965_hwrate_to_plcp_idx(tbl->current_rate);
il4965_rs_update_rate_tbl(il, ctx, lq_sta, tbl, idx, il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx,
is_green); is_green);
} }
return; return;
...@@ -2054,8 +2045,7 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb, ...@@ -2054,8 +2045,7 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb,
lq_update: lq_update:
/* Replace uCode's rate table for the destination station. */ /* Replace uCode's rate table for the destination station. */
if (update_lq) if (update_lq)
il4965_rs_update_rate_tbl(il, ctx, lq_sta, tbl, idx, il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx, is_green);
is_green);
/* Should we stay with this modulation mode, /* Should we stay with this modulation mode,
* or search for a new one? */ * or search for a new one? */
...@@ -2095,7 +2085,7 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb, ...@@ -2095,7 +2085,7 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb,
D_RATE("Switch current mcs: %X idx: %d\n", D_RATE("Switch current mcs: %X idx: %d\n",
tbl->current_rate, idx); tbl->current_rate, idx);
il4965_rs_fill_link_cmd(il, lq_sta, tbl->current_rate); il4965_rs_fill_link_cmd(il, lq_sta, tbl->current_rate);
il_send_lq_cmd(il, ctx, &lq_sta->lq, CMD_ASYNC, false); il_send_lq_cmd(il, &lq_sta->lq, CMD_ASYNC, false);
} else } else
done_search = 1; done_search = 1;
} }
...@@ -2167,13 +2157,11 @@ il4965_rs_initialize_lq(struct il_priv *il, struct ieee80211_conf *conf, ...@@ -2167,13 +2157,11 @@ il4965_rs_initialize_lq(struct il_priv *il, struct ieee80211_conf *conf,
u8 active_tbl = 0; u8 active_tbl = 0;
u8 valid_tx_ant; u8 valid_tx_ant;
struct il_station_priv *sta_priv; struct il_station_priv *sta_priv;
struct il_rxon_context *ctx;
if (!sta || !lq_sta) if (!sta || !lq_sta)
return; return;
sta_priv = (void *)sta->drv_priv; sta_priv = (void *)sta->drv_priv;
ctx = sta_priv->common.ctx;
i = lq_sta->last_txrate_idx; i = lq_sta->last_txrate_idx;
...@@ -2205,7 +2193,7 @@ il4965_rs_initialize_lq(struct il_priv *il, struct ieee80211_conf *conf, ...@@ -2205,7 +2193,7 @@ il4965_rs_initialize_lq(struct il_priv *il, struct ieee80211_conf *conf,
il4965_rs_set_expected_tpt_table(lq_sta, tbl); il4965_rs_set_expected_tpt_table(lq_sta, tbl);
il4965_rs_fill_link_cmd(NULL, lq_sta, rate); il4965_rs_fill_link_cmd(NULL, lq_sta, rate);
il->stations[lq_sta->lq.sta_id].lq = &lq_sta->lq; il->stations[lq_sta->lq.sta_id].lq = &lq_sta->lq;
il_send_lq_cmd(il, ctx, &lq_sta->lq, CMD_SYNC, true); il_send_lq_cmd(il, &lq_sta->lq, CMD_SYNC, true);
} }
static void static void
...@@ -2576,9 +2564,6 @@ il4965_rs_sta_dbgfs_scale_table_write(struct file *file, ...@@ -2576,9 +2564,6 @@ il4965_rs_sta_dbgfs_scale_table_write(struct file *file,
char buf[64]; char buf[64];
size_t buf_size; size_t buf_size;
u32 parsed_rate; u32 parsed_rate;
struct il_station_priv *sta_priv =
container_of(lq_sta, struct il_station_priv, lq_sta);
struct il_rxon_context *ctx = sta_priv->common.ctx;
il = lq_sta->drv; il = lq_sta->drv;
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
...@@ -2600,7 +2585,7 @@ il4965_rs_sta_dbgfs_scale_table_write(struct file *file, ...@@ -2600,7 +2585,7 @@ il4965_rs_sta_dbgfs_scale_table_write(struct file *file,
if (lq_sta->dbg_fixed_rate) { if (lq_sta->dbg_fixed_rate) {
il4965_rs_fill_link_cmd(NULL, lq_sta, lq_sta->dbg_fixed_rate); il4965_rs_fill_link_cmd(NULL, lq_sta, lq_sta->dbg_fixed_rate);
il_send_lq_cmd(lq_sta->drv, ctx, &lq_sta->lq, CMD_ASYNC, false); il_send_lq_cmd(lq_sta->drv, &lq_sta->lq, CMD_ASYNC, false);
} }
return count; return count;
......
...@@ -1370,7 +1370,7 @@ il4965_send_tx_power(struct il_priv *il) ...@@ -1370,7 +1370,7 @@ il4965_send_tx_power(struct il_priv *il)
} }
static int static int
il4965_send_rxon_assoc(struct il_priv *il, struct il_rxon_context *ctx) il4965_send_rxon_assoc(struct il_priv *il)
{ {
int ret = 0; int ret = 0;
struct il4965_rxon_assoc_cmd rxon_assoc; struct il4965_rxon_assoc_cmd rxon_assoc;
...@@ -1409,7 +1409,7 @@ il4965_send_rxon_assoc(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1409,7 +1409,7 @@ il4965_send_rxon_assoc(struct il_priv *il, struct il_rxon_context *ctx)
} }
static int static int
il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) il4965_commit_rxon(struct il_priv *il)
{ {
/* cast away the const for active_rxon in this function */ /* cast away the const for active_rxon in this function */
struct il_rxon_cmd *active_rxon = (void *)&il->active; struct il_rxon_cmd *active_rxon = (void *)&il->active;
...@@ -1422,7 +1422,7 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1422,7 +1422,7 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
/* always get timestamp with Rx frame */ /* always get timestamp with Rx frame */
il->staging.flags |= RXON_FLG_TSF2HOST_MSK; il->staging.flags |= RXON_FLG_TSF2HOST_MSK;
ret = il_check_rxon_cmd(il, ctx); ret = il_check_rxon_cmd(il);
if (ret) { if (ret) {
IL_ERR("Invalid RXON configuration. Not committing.\n"); IL_ERR("Invalid RXON configuration. Not committing.\n");
return -EINVAL; return -EINVAL;
...@@ -1442,15 +1442,15 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1442,15 +1442,15 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
/* If we don't need to send a full RXON, we can use /* If we don't need to send a full RXON, we can use
* il_rxon_assoc_cmd which is used to reconfigure filter * il_rxon_assoc_cmd which is used to reconfigure filter
* and other flags for the current radio configuration. */ * and other flags for the current radio configuration. */
if (!il_full_rxon_required(il, ctx)) { if (!il_full_rxon_required(il)) {
ret = il_send_rxon_assoc(il, ctx); ret = il_send_rxon_assoc(il);
if (ret) { if (ret) {
IL_ERR("Error setting RXON_ASSOC (%d)\n", ret); IL_ERR("Error setting RXON_ASSOC (%d)\n", ret);
return ret; return ret;
} }
memcpy(active_rxon, &il->staging, sizeof(*active_rxon)); memcpy(active_rxon, &il->staging, sizeof(*active_rxon));
il_print_rx_config_cmd(il, ctx); il_print_rx_config_cmd(il);
/* /*
* We do not commit tx power settings while channel changing, * We do not commit tx power settings while channel changing,
* do it now if tx power changed. * do it now if tx power changed.
...@@ -1478,9 +1478,9 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1478,9 +1478,9 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
IL_ERR("Error clearing ASSOC_MSK (%d)\n", ret); IL_ERR("Error clearing ASSOC_MSK (%d)\n", ret);
return ret; return ret;
} }
il_clear_ucode_stations(il, ctx); il_clear_ucode_stations(il);
il_restore_stations(il, ctx); il_restore_stations(il);
ret = il4965_restore_default_wep_keys(il, ctx); ret = il4965_restore_default_wep_keys(il);
if (ret) { if (ret) {
IL_ERR("Failed to restore WEP keys (%d)\n", ret); IL_ERR("Failed to restore WEP keys (%d)\n", ret);
return ret; return ret;
...@@ -1491,7 +1491,7 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1491,7 +1491,7 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
"* channel = %d\n" "* bssid = %pM\n", (new_assoc ? "" : "out"), "* channel = %d\n" "* bssid = %pM\n", (new_assoc ? "" : "out"),
le16_to_cpu(il->staging.channel), il->staging.bssid_addr); le16_to_cpu(il->staging.channel), il->staging.bssid_addr);
il_set_rxon_hwcrypto(il, ctx, !il->cfg->mod_params->sw_crypto); il_set_rxon_hwcrypto(il, !il->cfg->mod_params->sw_crypto);
/* Apply the new configuration /* Apply the new configuration
* RXON unassoc clears the station table in uCode so restoration of * RXON unassoc clears the station table in uCode so restoration of
...@@ -1507,9 +1507,9 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1507,9 +1507,9 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
} }
D_INFO("Return from !new_assoc RXON.\n"); D_INFO("Return from !new_assoc RXON.\n");
memcpy(active_rxon, &il->staging, sizeof(*active_rxon)); memcpy(active_rxon, &il->staging, sizeof(*active_rxon));
il_clear_ucode_stations(il, ctx); il_clear_ucode_stations(il);
il_restore_stations(il, ctx); il_restore_stations(il);
ret = il4965_restore_default_wep_keys(il, ctx); ret = il4965_restore_default_wep_keys(il);
if (ret) { if (ret) {
IL_ERR("Failed to restore WEP keys (%d)\n", ret); IL_ERR("Failed to restore WEP keys (%d)\n", ret);
return ret; return ret;
...@@ -1529,7 +1529,7 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1529,7 +1529,7 @@ il4965_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
} }
memcpy(active_rxon, &il->staging, sizeof(*active_rxon)); memcpy(active_rxon, &il->staging, sizeof(*active_rxon));
} }
il_print_rx_config_cmd(il, ctx); il_print_rx_config_cmd(il);
il4965_init_sensitivity(il); il4965_init_sensitivity(il);
...@@ -1548,7 +1548,6 @@ static int ...@@ -1548,7 +1548,6 @@ static int
il4965_hw_channel_switch(struct il_priv *il, il4965_hw_channel_switch(struct il_priv *il,
struct ieee80211_channel_switch *ch_switch) struct ieee80211_channel_switch *ch_switch)
{ {
struct il_rxon_context *ctx = &il->ctx;
int rc; int rc;
u8 band = 0; u8 band = 0;
bool is_ht40 = false; bool is_ht40 = false;
...@@ -1560,8 +1559,11 @@ il4965_hw_channel_switch(struct il_priv *il, ...@@ -1560,8 +1559,11 @@ il4965_hw_channel_switch(struct il_priv *il,
u32 tsf_low; u32 tsf_low;
u8 switch_count; u8 switch_count;
u16 beacon_interval = le16_to_cpu(il->timing.beacon_interval); u16 beacon_interval = le16_to_cpu(il->timing.beacon_interval);
struct ieee80211_vif *vif = ctx->vif; struct ieee80211_vif *vif = il->vif;
band = il->band == IEEE80211_BAND_2GHZ; band = (il->band == IEEE80211_BAND_2GHZ);
if (WARN_ON_ONCE(vif == NULL))
return -EIO;
is_ht40 = iw4965_is_ht40_channel(il->staging.flags); is_ht40 = iw4965_is_ht40_channel(il->staging.flags);
...@@ -2128,21 +2130,18 @@ static struct il_hcmd_ops il4965_hcmd = { ...@@ -2128,21 +2130,18 @@ static struct il_hcmd_ops il4965_hcmd = {
static void static void
il4965_post_scan(struct il_priv *il) il4965_post_scan(struct il_priv *il)
{ {
struct il_rxon_context *ctx = &il->ctx;
/* /*
* Since setting the RXON may have been deferred while * Since setting the RXON may have been deferred while
* performing the scan, fire one off if needed * performing the scan, fire one off if needed
*/ */
if (memcmp(&il->staging, &il->active, sizeof(il->staging))) if (memcmp(&il->staging, &il->active, sizeof(il->staging)))
il_commit_rxon(il, ctx); il_commit_rxon(il);
} }
static void static void
il4965_post_associate(struct il_priv *il) il4965_post_associate(struct il_priv *il)
{ {
struct il_rxon_context *ctx = &il->ctx; struct ieee80211_vif *vif = il->vif;
struct ieee80211_vif *vif = ctx->vif;
struct ieee80211_conf *conf = NULL; struct ieee80211_conf *conf = NULL;
int ret = 0; int ret = 0;
...@@ -2157,9 +2156,9 @@ il4965_post_associate(struct il_priv *il) ...@@ -2157,9 +2156,9 @@ il4965_post_associate(struct il_priv *il)
conf = &il->hw->conf; conf = &il->hw->conf;
il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
il_commit_rxon(il, ctx); il_commit_rxon(il);
ret = il_send_rxon_timing(il, ctx); ret = il_send_rxon_timing(il);
if (ret) if (ret)
IL_WARN("RXON timing - " "Attempting to continue.\n"); IL_WARN("RXON timing - " "Attempting to continue.\n");
...@@ -2168,7 +2167,7 @@ il4965_post_associate(struct il_priv *il) ...@@ -2168,7 +2167,7 @@ il4965_post_associate(struct il_priv *il)
il_set_rxon_ht(il, &il->current_ht_config); il_set_rxon_ht(il, &il->current_ht_config);
if (il->cfg->ops->hcmd->set_rxon_chain) if (il->cfg->ops->hcmd->set_rxon_chain)
il->cfg->ops->hcmd->set_rxon_chain(il, ctx); il->cfg->ops->hcmd->set_rxon_chain(il);
il->staging.assoc_id = cpu_to_le16(vif->bss_conf.aid); il->staging.assoc_id = cpu_to_le16(vif->bss_conf.aid);
...@@ -2187,7 +2186,7 @@ il4965_post_associate(struct il_priv *il) ...@@ -2187,7 +2186,7 @@ il4965_post_associate(struct il_priv *il)
il->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK; il->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
} }
il_commit_rxon(il, ctx); il_commit_rxon(il);
D_ASSOC("Associated as %d to: %pM\n", vif->bss_conf.aid, D_ASSOC("Associated as %d to: %pM\n", vif->bss_conf.aid,
il->active.bssid_addr); il->active.bssid_addr);
...@@ -2218,8 +2217,7 @@ il4965_post_associate(struct il_priv *il) ...@@ -2218,8 +2217,7 @@ il4965_post_associate(struct il_priv *il)
static void static void
il4965_config_ap(struct il_priv *il) il4965_config_ap(struct il_priv *il)
{ {
struct il_rxon_context *ctx = &il->ctx; struct ieee80211_vif *vif = il->vif;
struct ieee80211_vif *vif = ctx->vif;
int ret = 0; int ret = 0;
lockdep_assert_held(&il->mutex); lockdep_assert_held(&il->mutex);
...@@ -2232,10 +2230,10 @@ il4965_config_ap(struct il_priv *il) ...@@ -2232,10 +2230,10 @@ il4965_config_ap(struct il_priv *il)
/* RXON - unassoc (to set timing command) */ /* RXON - unassoc (to set timing command) */
il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
il_commit_rxon(il, ctx); il_commit_rxon(il);
/* RXON Timing */ /* RXON Timing */
ret = il_send_rxon_timing(il, ctx); ret = il_send_rxon_timing(il);
if (ret) if (ret)
IL_WARN("RXON timing failed - " IL_WARN("RXON timing failed - "
"Attempting to continue.\n"); "Attempting to continue.\n");
...@@ -2244,7 +2242,7 @@ il4965_config_ap(struct il_priv *il) ...@@ -2244,7 +2242,7 @@ il4965_config_ap(struct il_priv *il)
il->chain_noise_data.active_chains = il->hw_params.valid_rx_ant; il->chain_noise_data.active_chains = il->hw_params.valid_rx_ant;
il_set_rxon_ht(il, &il->current_ht_config); il_set_rxon_ht(il, &il->current_ht_config);
if (il->cfg->ops->hcmd->set_rxon_chain) if (il->cfg->ops->hcmd->set_rxon_chain)
il->cfg->ops->hcmd->set_rxon_chain(il, ctx); il->cfg->ops->hcmd->set_rxon_chain(il);
il->staging.assoc_id = 0; il->staging.assoc_id = 0;
...@@ -2263,7 +2261,7 @@ il4965_config_ap(struct il_priv *il) ...@@ -2263,7 +2261,7 @@ il4965_config_ap(struct il_priv *il)
il4965_send_beacon_cmd(il); il4965_send_beacon_cmd(il);
/* restore RXON assoc */ /* restore RXON assoc */
il->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; il->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
il_commit_rxon(il, ctx); il_commit_rxon(il);
} }
il4965_send_beacon_cmd(il); il4965_send_beacon_cmd(il);
} }
......
...@@ -48,7 +48,7 @@ void il4965_free_tfds_in_queue(struct il_priv *il, int sta_id, int tid, ...@@ -48,7 +48,7 @@ void il4965_free_tfds_in_queue(struct il_priv *il, int sta_id, int tid,
int freed); int freed);
/* RXON */ /* RXON */
void il4965_set_rxon_chain(struct il_priv *il, struct il_rxon_context *ctx); void il4965_set_rxon_chain(struct il_priv *il);
/* uCode */ /* uCode */
int il4965_verify_ucode(struct il_priv *il); int il4965_verify_ucode(struct il_priv *il);
...@@ -134,21 +134,18 @@ il4965_get_tx_fail_reason(u32 status) ...@@ -134,21 +134,18 @@ il4965_get_tx_fail_reason(u32 status)
#endif #endif
/* station management */ /* station management */
int il4965_alloc_bcast_station(struct il_priv *il, struct il_rxon_context *ctx); int il4965_alloc_bcast_station(struct il_priv *il);
int il4965_add_bssid_station(struct il_priv *il, struct il_rxon_context *ctx, int il4965_add_bssid_station(struct il_priv *il, const u8 *addr, u8 *sta_id_r);
const u8 *addr, u8 *sta_id_r);
int il4965_remove_default_wep_key(struct il_priv *il, int il4965_remove_default_wep_key(struct il_priv *il,
struct il_rxon_context *ctx,
struct ieee80211_key_conf *key); struct ieee80211_key_conf *key);
int il4965_set_default_wep_key(struct il_priv *il, struct il_rxon_context *ctx, int il4965_set_default_wep_key(struct il_priv *il,
struct ieee80211_key_conf *key); struct ieee80211_key_conf *key);
int il4965_restore_default_wep_keys(struct il_priv *il, int il4965_restore_default_wep_keys(struct il_priv *il);
struct il_rxon_context *ctx); int il4965_set_dynamic_key(struct il_priv *il,
int il4965_set_dynamic_key(struct il_priv *il, struct il_rxon_context *ctx,
struct ieee80211_key_conf *key, u8 sta_id); struct ieee80211_key_conf *key, u8 sta_id);
int il4965_remove_dynamic_key(struct il_priv *il, struct il_rxon_context *ctx, int il4965_remove_dynamic_key(struct il_priv *il,
struct ieee80211_key_conf *key, u8 sta_id); struct ieee80211_key_conf *key, u8 sta_id);
void il4965_update_tkip_key(struct il_priv *il, struct il_rxon_context *ctx, void il4965_update_tkip_key(struct il_priv *il,
struct ieee80211_key_conf *keyconf, struct ieee80211_key_conf *keyconf,
struct ieee80211_sta *sta, u32 iv32, struct ieee80211_sta *sta, u32 iv32,
u16 *phase1key); u16 *phase1key);
......
This diff is collapsed.
...@@ -146,7 +146,6 @@ struct il_queue { ...@@ -146,7 +146,6 @@ struct il_queue {
/* One for each TFD */ /* One for each TFD */
struct il_tx_info { struct il_tx_info {
struct sk_buff *skb; struct sk_buff *skb;
struct il_rxon_context *ctx;
}; };
/** /**
...@@ -741,7 +740,6 @@ struct il_station_entry { ...@@ -741,7 +740,6 @@ struct il_station_entry {
}; };
struct il_station_priv_common { struct il_station_priv_common {
struct il_rxon_context *ctx;
u8 sta_id; u8 sta_id;
}; };
...@@ -752,7 +750,6 @@ struct il_station_priv_common { ...@@ -752,7 +750,6 @@ struct il_station_priv_common {
* space for us to put data into. * space for us to put data into.
*/ */
struct il_vif_priv { struct il_vif_priv {
struct il_rxon_context *ctx;
u8 ibss_bssid_sta_id; u8 ibss_bssid_sta_id;
}; };
...@@ -1257,7 +1254,7 @@ struct il_priv { ...@@ -1257,7 +1254,7 @@ struct il_priv {
u8 ucode_write_complete; /* the image write is complete */ u8 ucode_write_complete; /* the image write is complete */
char firmware_name[25]; char firmware_name[25];
struct il_rxon_context ctx; struct ieee80211_vif *vif;
struct il_qos_info qos_data; struct il_qos_info qos_data;
...@@ -1426,7 +1423,7 @@ struct il_priv { ...@@ -1426,7 +1423,7 @@ struct il_priv {
struct work_struct rx_replenish; struct work_struct rx_replenish;
struct work_struct abort_scan; struct work_struct abort_scan;
struct il_rxon_context *beacon_ctx; bool beacon_enabled;
struct sk_buff *beacon_skb; struct sk_buff *beacon_skb;
struct work_struct tx_flush; struct work_struct tx_flush;
...@@ -1493,17 +1490,6 @@ il_tx_queue_get_hdr(struct il_priv *il, int txq_id, int idx) ...@@ -1493,17 +1490,6 @@ il_tx_queue_get_hdr(struct il_priv *il, int txq_id, int idx)
return NULL; return NULL;
} }
static inline struct il_rxon_context *
il_rxon_ctx_from_vif(struct ieee80211_vif *vif)
{
struct il_vif_priv *vif_priv = (void *)vif->drv_priv;
return vif_priv->ctx;
}
#define for_each_context(il, _ctx) \
for (_ctx = &il->ctx; _ctx == &il->ctx; _ctx++)
static inline int static inline int
il_is_associated(struct il_priv *il) il_is_associated(struct il_priv *il)
{ {
...@@ -1585,10 +1571,9 @@ il_free_pages(struct il_priv *il, unsigned long page) ...@@ -1585,10 +1571,9 @@ il_free_pages(struct il_priv *il, unsigned long page)
#define IL_RX_BUF_SIZE_8K (8 * 1024) #define IL_RX_BUF_SIZE_8K (8 * 1024)
struct il_hcmd_ops { struct il_hcmd_ops {
int (*rxon_assoc) (struct il_priv *il, struct il_rxon_context *ctx); int (*rxon_assoc) (struct il_priv *il);
int (*commit_rxon) (struct il_priv *il, struct il_rxon_context *ctx); int (*commit_rxon) (struct il_priv *il);
void (*set_rxon_chain) (struct il_priv *il, void (*set_rxon_chain) (struct il_priv *il);
struct il_rxon_context *ctx);
}; };
struct il_hcmd_utils_ops { struct il_hcmd_utils_ops {
...@@ -1811,20 +1796,17 @@ int il_mac_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -1811,20 +1796,17 @@ int il_mac_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u16 queue, const struct ieee80211_tx_queue_params *params); u16 queue, const struct ieee80211_tx_queue_params *params);
int il_mac_tx_last_beacon(struct ieee80211_hw *hw); int il_mac_tx_last_beacon(struct ieee80211_hw *hw);
void il_set_rxon_hwcrypto(struct il_priv *il, struct il_rxon_context *ctx, void il_set_rxon_hwcrypto(struct il_priv *il, int hw_decrypt);
int hw_decrypt); int il_check_rxon_cmd(struct il_priv *il);
int il_check_rxon_cmd(struct il_priv *il, struct il_rxon_context *ctx); int il_full_rxon_required(struct il_priv *il);
int il_full_rxon_required(struct il_priv *il, struct il_rxon_context *ctx); int il_set_rxon_channel(struct il_priv *il, struct ieee80211_channel *ch);
int il_set_rxon_channel(struct il_priv *il, struct ieee80211_channel *ch, void il_set_flags_for_band(struct il_priv *il, enum ieee80211_band band,
struct il_rxon_context *ctx); struct ieee80211_vif *vif);
void il_set_flags_for_band(struct il_priv *il, struct il_rxon_context *ctx,
enum ieee80211_band band, struct ieee80211_vif *vif);
u8 il_get_single_channel_number(struct il_priv *il, enum ieee80211_band band); u8 il_get_single_channel_number(struct il_priv *il, enum ieee80211_band band);
void il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf); void il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf);
bool il_is_ht40_tx_allowed(struct il_priv *il, struct il_rxon_context *ctx, bool il_is_ht40_tx_allowed(struct il_priv *il,
struct ieee80211_sta_ht_cap *ht_cap); struct ieee80211_sta_ht_cap *ht_cap);
void il_connection_init_rx_config(struct il_priv *il, void il_connection_init_rx_config(struct il_priv *il);
struct il_rxon_context *ctx);
void il_set_rate(struct il_priv *il); void il_set_rate(struct il_priv *il);
int il_set_decrypted_flag(struct il_priv *il, struct ieee80211_hdr *hdr, int il_set_decrypted_flag(struct il_priv *il, struct ieee80211_hdr *hdr,
u32 decrypt_res, struct ieee80211_rx_status *stats); u32 decrypt_res, struct ieee80211_rx_status *stats);
...@@ -1927,7 +1909,7 @@ int il_set_tx_power(struct il_priv *il, s8 tx_power, bool force); ...@@ -1927,7 +1909,7 @@ int il_set_tx_power(struct il_priv *il, s8 tx_power, bool force);
* Rate * Rate
******************************************************************************/ ******************************************************************************/
u8 il_get_lowest_plcp(struct il_priv *il, struct il_rxon_context *ctx); u8 il_get_lowest_plcp(struct il_priv *il);
/******************************************************************************* /*******************************************************************************
* Scanning * Scanning
...@@ -2014,10 +1996,10 @@ extern const struct dev_pm_ops il_pm_ops; ...@@ -2014,10 +1996,10 @@ extern const struct dev_pm_ops il_pm_ops;
******************************************************/ ******************************************************/
void il4965_dump_nic_error_log(struct il_priv *il); void il4965_dump_nic_error_log(struct il_priv *il);
#ifdef CONFIG_IWLEGACY_DEBUG #ifdef CONFIG_IWLEGACY_DEBUG
void il_print_rx_config_cmd(struct il_priv *il, struct il_rxon_context *ctx); void il_print_rx_config_cmd(struct il_priv *il);
#else #else
static inline void static inline void
il_print_rx_config_cmd(struct il_priv *il, struct il_rxon_context *ctx) il_print_rx_config_cmd(struct il_priv *il)
{ {
} }
#endif #endif
...@@ -2106,17 +2088,18 @@ extern int il_send_stats_request(struct il_priv *il, u8 flags, bool clear); ...@@ -2106,17 +2088,18 @@ extern int il_send_stats_request(struct il_priv *il, u8 flags, bool clear);
void il_apm_stop(struct il_priv *il); void il_apm_stop(struct il_priv *il);
int il_apm_init(struct il_priv *il); int il_apm_init(struct il_priv *il);
int il_send_rxon_timing(struct il_priv *il, struct il_rxon_context *ctx); int il_send_rxon_timing(struct il_priv *il);
static inline int static inline int
il_send_rxon_assoc(struct il_priv *il, struct il_rxon_context *ctx) il_send_rxon_assoc(struct il_priv *il)
{ {
return il->cfg->ops->hcmd->rxon_assoc(il, ctx); return il->cfg->ops->hcmd->rxon_assoc(il);
} }
static inline int static inline int
il_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) il_commit_rxon(struct il_priv *il)
{ {
return il->cfg->ops->hcmd->commit_rxon(il, ctx); return il->cfg->ops->hcmd->commit_rxon(il);
} }
static inline const struct ieee80211_supported_band * static inline const struct ieee80211_supported_band *
...@@ -2274,23 +2257,22 @@ il_clear_bits_prph(struct il_priv *il, u32 reg, u32 mask) ...@@ -2274,23 +2257,22 @@ il_clear_bits_prph(struct il_priv *il, u32 reg, u32 mask)
(this is for the IBSS BSSID stations) */ (this is for the IBSS BSSID stations) */
#define IL_STA_BCAST BIT(4) /* this station is the special bcast station */ #define IL_STA_BCAST BIT(4) /* this station is the special bcast station */
void il_restore_stations(struct il_priv *il, struct il_rxon_context *ctx); void il_restore_stations(struct il_priv *il);
void il_clear_ucode_stations(struct il_priv *il, struct il_rxon_context *ctx); void il_clear_ucode_stations(struct il_priv *il);
void il_dealloc_bcast_stations(struct il_priv *il); void il_dealloc_bcast_stations(struct il_priv *il);
int il_get_free_ucode_key_idx(struct il_priv *il); int il_get_free_ucode_key_idx(struct il_priv *il);
int il_send_add_sta(struct il_priv *il, struct il_addsta_cmd *sta, u8 flags); int il_send_add_sta(struct il_priv *il, struct il_addsta_cmd *sta, u8 flags);
int il_add_station_common(struct il_priv *il, struct il_rxon_context *ctx, int il_add_station_common(struct il_priv *il, const u8 *addr, bool is_ap,
const u8 *addr, bool is_ap,
struct ieee80211_sta *sta, u8 *sta_id_r); struct ieee80211_sta *sta, u8 *sta_id_r);
int il_remove_station(struct il_priv *il, const u8 sta_id, const u8 * addr); int il_remove_station(struct il_priv *il, const u8 sta_id, const u8 * addr);
int il_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int il_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_sta *sta); struct ieee80211_sta *sta);
u8 il_prep_station(struct il_priv *il, struct il_rxon_context *ctx, u8 il_prep_station(struct il_priv *il, const u8 *addr, bool is_ap,
const u8 *addr, bool is_ap, struct ieee80211_sta *sta); struct ieee80211_sta *sta);
int il_send_lq_cmd(struct il_priv *il, struct il_rxon_context *ctx, int il_send_lq_cmd(struct il_priv *il, struct il_link_quality_cmd *lq,
struct il_link_quality_cmd *lq, u8 flags, bool init); u8 flags, bool init);
/** /**
* il_clear_driver_stations - clear knowledge of all stations from driver * il_clear_driver_stations - clear knowledge of all stations from driver
...@@ -2334,8 +2316,7 @@ il_sta_id(struct ieee80211_sta *sta) ...@@ -2334,8 +2316,7 @@ il_sta_id(struct ieee80211_sta *sta)
* inline wraps that pattern. * inline wraps that pattern.
*/ */
static inline int static inline int
il_sta_id_or_broadcast(struct il_priv *il, struct il_rxon_context *context, il_sta_id_or_broadcast(struct il_priv *il, struct ieee80211_sta *sta)
struct ieee80211_sta *sta)
{ {
int sta_id; int sta_id;
......
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