summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-09-03 17:32:21 +0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-09-11 19:51:39 +0400
commit763cc3bf5c2ae189a929fce54759c5bd94b8ba16 (patch)
tree99d8574d1b8172b4f527d6674908081b6e279355 /drivers/net/wireless/iwlwifi/iwl-agn.c
parentc6abdc0dc3440b9b6ae00a59c3560ab2160c7c7d (diff)
downloadlinux-763cc3bf5c2ae189a929fce54759c5bd94b8ba16.tar.xz
iwlwifi: avoid sending too many commands
When the PAN context is unused, there's no need to continually update it in the device. So track which contexts are active (with the special case that the WLAN context is always active ...) and only send their commands to the device when needed. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index df2edccdf9bd..a19671d99248 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -110,6 +110,9 @@ int iwl_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
if (!iwl_is_alive(priv))
return -EBUSY;
+ if (!ctx->is_active)
+ return 0;
+
/* always get timestamp with Rx frame */
ctx->staging.flags |= RXON_FLG_TSF2HOST_MSK;
@@ -4301,6 +4304,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
for (i = 0; i < NUM_IWL_RXON_CTX; i++)
priv->contexts[i].ctxid = i;
+ priv->contexts[IWL_RXON_CTX_BSS].always_active = true;
+ priv->contexts[IWL_RXON_CTX_BSS].is_active = true;
priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON;
priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;