aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-09-03 09:32:21 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-09-11 11:51:39 -0400
commit763cc3bf5c2ae189a929fce54759c5bd94b8ba16 (patch)
tree99d8574d1b8172b4f527d6674908081b6e279355 /drivers/net/wireless/iwlwifi/iwl-agn.c
parentc6abdc0dc3440b9b6ae00a59c3560ab2160c7c7d (diff)
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)
110 if (!iwl_is_alive(priv)) 110 if (!iwl_is_alive(priv))
111 return -EBUSY; 111 return -EBUSY;
112 112
113 if (!ctx->is_active)
114 return 0;
115
113 /* always get timestamp with Rx frame */ 116 /* always get timestamp with Rx frame */
114 ctx->staging.flags |= RXON_FLG_TSF2HOST_MSK; 117 ctx->staging.flags |= RXON_FLG_TSF2HOST_MSK;
115 118
@@ -4301,6 +4304,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
4301 for (i = 0; i < NUM_IWL_RXON_CTX; i++) 4304 for (i = 0; i < NUM_IWL_RXON_CTX; i++)
4302 priv->contexts[i].ctxid = i; 4305 priv->contexts[i].ctxid = i;
4303 4306
4307 priv->contexts[IWL_RXON_CTX_BSS].always_active = true;
4308 priv->contexts[IWL_RXON_CTX_BSS].is_active = true;
4304 priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON; 4309 priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON;
4305 priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING; 4310 priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
4306 priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC; 4311 priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;