aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2012-05-10 08:53:14 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-06 07:03:25 -0400
commite19ebcab01cc130fa832764d453b263460ec3b91 (patch)
treeb5c4e061cd55d7e291a7b349e075fbf0a9bc4755
parentfdbfff73408f99799724f583cbc2a0ce3263c6a7 (diff)
iwlwifi: Check BSS ctx active before call mac80211
It is possible that the BSS context is not active (for example when the current mode is set to GO), or that the vif->type is different than station. In such a case we cannot call mac80211 to report the average rssi for the interface (the function assumes that the vif is valid and that the type is station). Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index e55ec6c8a920..c31072d42791 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -617,6 +617,11 @@ static bool iwlagn_fill_txpower_mode(struct iwl_priv *priv,
617 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; 617 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
618 int ave_rssi; 618 int ave_rssi;
619 619
620 if (!ctx->vif || (ctx->vif->type != NL80211_IFTYPE_STATION)) {
621 IWL_DEBUG_INFO(priv, "BSS ctx not active or not in sta mode\n");
622 return false;
623 }
624
620 ave_rssi = ieee80211_ave_rssi(ctx->vif); 625 ave_rssi = ieee80211_ave_rssi(ctx->vif);
621 if (!ave_rssi) { 626 if (!ave_rssi) {
622 /* no rssi data, no changes to reduce tx power */ 627 /* no rssi data, no changes to reduce tx power */