Skip to content

Commit

Permalink
iwlagn: default to MAX_UCODE_BEACON_INTERVAL in iwl_adjust_beacon_int…
Browse files Browse the repository at this point in the history
…erval

Default to MAX_UCODE_BEACON_INTERVAL if the output of
iwl_adjust_beacon_interval would otherwise be zero.  This prevents a
division by zero on my iwl5300-equipped Lenovo T400 with kernels that
include "mac80211: use cfg80211s BSS infrastructure".

This patch is a bit of a hack -- I'm not sure why iwl_setup_rxon_timing
is giving iwl_adjust_beacon_interval a zero input (which is the only way
it would output zero).  I would be happy to have a better fix.  But for
now, this makes my box boot...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
linvjw committed Feb 27, 2009
1 parent c493b01 commit 41d2f29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,9 @@ static u16 iwl_adjust_beacon_interval(u16 beacon_val)
/ MAX_UCODE_BEACON_INTERVAL;
new_val = beacon_val / beacon_factor;

if (!new_val)
new_val = MAX_UCODE_BEACON_INTERVAL;

return new_val;
}

Expand Down

0 comments on commit 41d2f29

Please sign in to comment.