Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224246
b: refs/heads/master
c: bd50a8a
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Nov 15, 2010
1 parent b67e1ea commit 756fd0f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 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: 2295c66b68ae160dde2e6e2dc4f3061105153bfc
refs/heads/master: bd50a8ab9f48787109f6ff761c8f0e185e3d0690
47 changes: 36 additions & 11 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,
return ret;
}

static int iwlagn_update_beacon(struct iwl_priv *priv,
struct ieee80211_vif *vif)
{
lockdep_assert_held(&priv->mutex);

dev_kfree_skb(priv->beacon_skb);
priv->beacon_skb = ieee80211_beacon_get(priv->hw, vif);
if (!priv->beacon_skb)
return -ENOMEM;
return iwlagn_send_beacon_cmd(priv);
}

/**
* iwlagn_commit_rxon - commit staging_rxon to hardware
*
Expand Down Expand Up @@ -201,17 +213,19 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
}

if (new_assoc) {
if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_AP ||
ctx->vif->type == NL80211_IFTYPE_ADHOC)) {
/*
* We'll run into this code path when beaconing is
* enabled, but then we also need to send the beacon
* to the device.
*/
dev_kfree_skb(priv->beacon_skb);
priv->beacon_skb = ieee80211_beacon_get(priv->hw,
ctx->vif);
iwlagn_send_beacon_cmd(priv);
/*
* We'll run into this code path when beaconing is
* enabled, but then we also need to send the beacon
* to the device.
*/
if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_AP)) {
ret = iwlagn_update_beacon(priv, ctx->vif);
if (ret) {
IWL_ERR(priv,
"Error sending required beacon (%d)!\n",
ret);
return ret;
}
}

priv->start_calib = 0;
Expand All @@ -228,6 +242,11 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
return ret;
}
memcpy(active, &ctx->staging, sizeof(*active));

/* IBSS beacon needs to be sent after setting assoc */
if (ctx->vif && (ctx->vif->type == NL80211_IFTYPE_ADHOC))
if (iwlagn_update_beacon(priv, ctx->vif))
IWL_ERR(priv, "Error sending IBSS beacon\n");
}

iwl_print_rx_config_cmd(priv, ctx);
Expand Down Expand Up @@ -558,5 +577,11 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
bss_conf->bssid);
}

if (changes & BSS_CHANGED_BEACON && vif->type == NL80211_IFTYPE_ADHOC &&
priv->beacon_ctx) {
if (iwlagn_update_beacon(priv, vif))
IWL_ERR(priv, "Error sending IBSS beacon\n");
}

mutex_unlock(&priv->mutex);
}

0 comments on commit 756fd0f

Please sign in to comment.