- this configuration option seems to be undocumented. Unfortunately,
  it tries to disable powersaving by default for all mac80211 based
  wifi interfaces that use 'sta' mode. Some drivers (e.g. ath5k) don't
  support setting/enabling powersaving mode. The result is an error
  message when bringing wifi up. This change makes the setting
  optional.

Signed-off-by: Jan Čapek <[email protected]>
---
 package/mac80211/files/lib/wifi/mac80211.sh |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/package/mac80211/files/lib/wifi/mac80211.sh 
b/package/mac80211/files/lib/wifi/mac80211.sh
index d395db1..113491b 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -324,9 +324,15 @@ enable_mac80211() {
                                [ "$wds" -gt 0 ] && wdsflag="4addr on"
                                iw phy "$phy" interface add "$ifname" type 
managed $wdsflag
                                config_get_bool powersave "$vif" powersave 0
-                               [ "$powersave" -gt 0 ] && powersave="on" || 
powersave="off"
-                               iwconfig "$ifname" power "$powersave"
-                       ;;
+                                [ -n "$powersave" ] && {
+                                    [ "$powersave" -gt 0 ] && powersave="on" 
|| powersave="off"
+                                   # TODO: using iw needs to be tested. E.g. 
on ath5k which
+                                   # doesn't seem to support this, calling iw 
immediately
+                                   # after interface addition seems to pass..
+                                    #iw dev "$ifname" set power_save 
"$powersave"
+                                   iwconfig "$ifname" power "$powersave"
+                                }
+                       ;;
                esac
 
                # All interfaces must have unique mac addresses
-- 
1.6.3.1

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to