Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214626
b: refs/heads/master
c: ea196fd
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and Wey-Yi Guy committed Sep 11, 2010
1 parent 501d7c3 commit 2029882
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 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: f1f270b25c6ece9ff65f7ad970850338a198d52f
refs/heads/master: ea196fdbb982150c19854f90773cb8b9bf331049
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)
bcnint = max_t(int, bcnint,
ctx_bss->vif->bss_conf.beacon_int);
if (!bcnint)
bcnint = 100;
bcnint = DEFAULT_BEACON_INTERVAL;
slot0 = bcnint / 2;
slot1 = bcnint - slot0;

Expand All @@ -339,7 +339,7 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)
slot0 = 0;
slot1 = max_t(int, 1, ctx_pan->vif->bss_conf.dtim_period) *
ctx_pan->vif->bss_conf.beacon_int;
slot1 = max_t(int, 100, slot1);
slot1 = max_t(int, DEFAULT_BEACON_INTERVAL, slot1);

if (test_bit(STATUS_SCAN_HW, &priv->status)) {
slot0 = slot1 * 3 - 20;
Expand Down
25 changes: 23 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,29 @@ EXPORT_SYMBOL(iwl_is_ht40_tx_allowed);

static u16 iwl_adjust_beacon_interval(u16 beacon_val, u16 max_beacon_val)
{
u16 new_val = 0;
u16 beacon_factor = 0;
u16 new_val;
u16 beacon_factor;

/*
* If mac80211 hasn't given us a beacon interval, program
* the default into the device (not checking this here
* would cause the adjustment below to return the maximum
* value, which may break PAN.)
*/
if (!beacon_val)
return DEFAULT_BEACON_INTERVAL;

/*
* If the beacon interval we obtained from the peer
* is too large, we'll have to wake up more often
* (and in IBSS case, we'll beacon too much)
*
* For example, if max_beacon_val is 4096, and the
* requested beacon interval is 7000, we'll have to
* use 3500 to be able to wake up on the beacons.
*
* This could badly influence beacon detection stats.
*/

beacon_factor = (beacon_val + max_beacon_val) / max_beacon_val;
new_val = beacon_val / beacon_factor;
Expand Down

0 comments on commit 2029882

Please sign in to comment.