Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265890
b: refs/heads/master
c: debcf73
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Aug 29, 2011
1 parent bc00099 commit 4059823
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ad71bef4a9d8173cbcfbb2f796b08d33d4ca01b
refs/heads/master: debcf734287a4e15710e6da7add0febca349d5b4
5 changes: 5 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
if (!ctx->is_active)
return 0;

/* override BSSID if necessary due to preauth */
if (ctx->preauth_bssid)
memcpy(ctx->staging.bssid_addr, ctx->bssid, ETH_ALEN);

/* always get timestamp with Rx frame */
ctx->staging.flags |= RXON_FLG_TSF2HOST_MSK;

Expand Down Expand Up @@ -897,6 +901,7 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
if (!priv->disable_chain_noise_cal)
iwlagn_chain_noise_reset(priv);
priv->start_calib = 1;
WARN_ON(ctx->preauth_bssid);
}

if (changes & BSS_CHANGED_IBSS) {
Expand Down
68 changes: 68 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2956,6 +2956,72 @@ static int iwl_mac_cancel_remain_on_channel(struct ieee80211_hw *hw)
return 0;
}

static int iwl_mac_tx_sync(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
const u8 *bssid, enum ieee80211_tx_sync_type type)
{
struct iwl_priv *priv = hw->priv;
struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv;
struct iwl_rxon_context *ctx = vif_priv->ctx;
int ret;
u8 sta_id;

mutex_lock(&priv->shrd->mutex);

if (iwl_is_associated_ctx(ctx)) {
ret = 0;
goto out;
}

if (ctx->preauth_bssid || test_bit(STATUS_SCAN_HW, &priv->shrd->status)) {
ret = -EBUSY;
goto out;
}

ret = iwl_add_station_common(priv, ctx, bssid, true, NULL, &sta_id);
if (ret)
goto out;

if (WARN_ON(sta_id != ctx->ap_sta_id)) {
ret = -EIO;
goto out_remove_sta;
}

memcpy(ctx->bssid, bssid, ETH_ALEN);
ctx->preauth_bssid = true;

ret = iwlagn_commit_rxon(priv, ctx);

if (ret == 0)
goto out;

out_remove_sta:
iwl_remove_station(priv, sta_id, bssid);
out:
mutex_unlock(&priv->shrd->mutex);
return ret;
}

static void iwl_mac_finish_tx_sync(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
const u8 *bssid,
enum ieee80211_tx_sync_type type)
{
struct iwl_priv *priv = hw->priv;
struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv;
struct iwl_rxon_context *ctx = vif_priv->ctx;

mutex_lock(&priv->shrd->mutex);

if (iwl_is_associated_ctx(ctx))
goto out;

iwl_remove_station(priv, ctx->ap_sta_id, bssid);
ctx->preauth_bssid = false;
/* no need to commit */
out:
mutex_unlock(&priv->shrd->mutex);
}

/*****************************************************************************
*
* driver setup and teardown
Expand Down Expand Up @@ -3164,6 +3230,8 @@ struct ieee80211_ops iwlagn_hw_ops = {
.rssi_callback = iwl_mac_rssi_callback,
CFG80211_TESTMODE_CMD(iwl_testmode_cmd)
CFG80211_TESTMODE_DUMP(iwl_testmode_dump)
.tx_sync = iwl_mac_tx_sync,
.finish_tx_sync = iwl_mac_finish_tx_sync,
};

static u32 iwl_hw_detect(struct iwl_priv *priv)
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,9 @@ struct iwl_rxon_context {
u8 extension_chan_offset;
} ht;

u8 bssid[ETH_ALEN];
bool preauth_bssid;

bool last_tx_rejected;
};

Expand Down

0 comments on commit 4059823

Please sign in to comment.