Search Linux Wireless

[PATCH] iwlagn: default to MAX_UCODE_BEACON_INTERVAL in iwl_adjust_beacon_interval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: John W. Linville <linville@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxx>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 50f8c7f..ad31005 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -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;
 }
 
-- 
1.6.0.6

-- 
John W. Linville		Someday the world will need a hero, and you
linville@xxxxxxxxxxxxx			might be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux