On Sunday 13 March 2011 23:01:33 Steve Brown wrote:
> It seems possible to slip in a set coverage class before
> ath5k_hw_init_core_clock has been called. The openwrt
> script /lib/wifi/mac80211.sh does it reliably. Sometimes I get "rmmod
> ath5k;insmod ath5k;iw phyx set distance 11000" to oops, but not always.

Hi,

the attached patch should prevent the OOPS, but I will have to investigate 
this more deeply, because the real bug might be somewhere else - it didn't 
happen before the conversion to ath_common in 2.6.37.

Lukas Turek

--- a/drivers/net/wireless/ath/ath5k/pcu.c
+++ b/drivers/net/wireless/ath/ath5k/pcu.c
@@ -750,14 +750,18 @@
  */
 void ath5k_hw_set_coverage_class(struct ath5k_hw *ah, u8 coverage_class)
 {
+       struct ath_common *common = ath5k_hw_common(ah);
+
        /* As defined by IEEE 802.11-2007 17.3.8.6 */
        int slot_time = ath5k_hw_get_default_slottime(ah) + 3 * coverage_class;
        int ack_timeout = ath5k_hw_get_default_sifs(ah) + slot_time;
        int cts_timeout = ack_timeout;
 
-       ath5k_hw_set_slot_time(ah, slot_time);
-       ath5k_hw_set_ack_timeout(ah, ack_timeout);
-       ath5k_hw_set_cts_timeout(ah, cts_timeout);
+       if (common->clockrate) {
+               ath5k_hw_set_slot_time(ah, slot_time);
+               ath5k_hw_set_ack_timeout(ah, ack_timeout);
+               ath5k_hw_set_cts_timeout(ah, cts_timeout);
+       }
 
        ah->ah_coverage_class = coverage_class;
 }
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to