99-ath9k_disable_ani 984 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. #
  3. # "ANI-thing is better than no WiFi"-Workaround
  4. #
  5. # In order to avoid further WiFi-Blackouts that *might* be caused by a buggy
  6. # ANI feature in the ath9k kernel module, we disable ANI until it got fixed in
  7. # OpenWRT completely.
  8. # Don't need to do anything, unless the script gets triggered by an "ifup"
  9. # event.
  10. [[ "$ACTION" != "ifup" ]] && exit 0;
  11. [[ "$INTERFACE" != "mesh_radio0" && "$INTERFACE" != "ibss_radio0" && "$INTERFACE" != "mesh_radio1" && "$INTERFACE" != "ibss_radio1" && "$INTERFACE" != "client" ]] && exit 0;
  12. # Test whether disabling ANI is applicable or not
  13. if [ -e "/sys/kernel/debug/ieee80211/phy0/ath9k/ani" ] ; then
  14. logger -s -t ath9k-disable-ani -p local0.info "phy0 disabling ANI"
  15. /bin/echo 0 > /sys/kernel/debug/ieee80211/phy0/ath9k/ani
  16. fi
  17. if [ -e "/sys/kernel/debug/ieee80211/phy1/ath9k/ani" ] ; then
  18. logger -s -t ath9k-disable-ani -p local0.info "phy1 disabling ANI"
  19. /bin/echo 0 > /sys/kernel/debug/ieee80211/phy1/ath9k/ani
  20. fi