aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2010-09-21 15:49:14 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-09-21 15:49:14 -0400
commitb618f6f885579a6237e5bf4582fa6167972ddef4 (patch)
treeb11508178570b98ce9cb2d76ecebd046a6f0e77c /drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
parent462fb2af9788a82a534f8184abfde31574e1cfa0 (diff)
parent6e5c2b4e8addfaab8ef54dedaf7b607e1585c35b (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts: arch/arm/mach-omap2/board-omap3pandora.c drivers/net/wireless/ath/ath5k/base.c
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
index 6fb52abafc8d..d86902b83630 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
@@ -287,6 +287,15 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)
287 ctx_bss = &priv->contexts[IWL_RXON_CTX_BSS]; 287 ctx_bss = &priv->contexts[IWL_RXON_CTX_BSS];
288 ctx_pan = &priv->contexts[IWL_RXON_CTX_PAN]; 288 ctx_pan = &priv->contexts[IWL_RXON_CTX_PAN];
289 289
290 /*
291 * If the PAN context is inactive, then we don't need
292 * to update the PAN parameters, the last thing we'll
293 * have done before it goes inactive is making the PAN
294 * parameters be WLAN-only.
295 */
296 if (!ctx_pan->is_active)
297 return 0;
298
290 memset(&cmd, 0, sizeof(cmd)); 299 memset(&cmd, 0, sizeof(cmd));
291 300
292 /* only 2 slots are currently allowed */ 301 /* only 2 slots are currently allowed */
@@ -312,7 +321,7 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)
312 bcnint = max_t(int, bcnint, 321 bcnint = max_t(int, bcnint,
313 ctx_bss->vif->bss_conf.beacon_int); 322 ctx_bss->vif->bss_conf.beacon_int);
314 if (!bcnint) 323 if (!bcnint)
315 bcnint = 100; 324 bcnint = DEFAULT_BEACON_INTERVAL;
316 slot0 = bcnint / 2; 325 slot0 = bcnint / 2;
317 slot1 = bcnint - slot0; 326 slot1 = bcnint - slot0;
318 327
@@ -330,7 +339,12 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)
330 slot0 = 0; 339 slot0 = 0;
331 slot1 = max_t(int, 1, ctx_pan->vif->bss_conf.dtim_period) * 340 slot1 = max_t(int, 1, ctx_pan->vif->bss_conf.dtim_period) *
332 ctx_pan->vif->bss_conf.beacon_int; 341 ctx_pan->vif->bss_conf.beacon_int;
333 slot1 = max_t(int, 100, slot1); 342 slot1 = max_t(int, DEFAULT_BEACON_INTERVAL, slot1);
343
344 if (test_bit(STATUS_SCAN_HW, &priv->status)) {
345 slot0 = slot1 * 3 - 20;
346 slot1 = 20;
347 }
334 } 348 }
335 349
336 cmd.slots[0].width = cpu_to_le16(slot0); 350 cmd.slots[0].width = cpu_to_le16(slot0);