summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-02-28 17:06:53 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-02-28 17:06:53 +0000
commit1c8fbfbaa6cc060f47483a5ab9c858bd75ca52a7 (patch)
treea9c18d28218b02abad47cab198d44097b1551477 /package
parenteeb982177dbc423786a83680a10006cfd221151d (diff)
downloadmtk-20170518-1c8fbfbaa6cc060f47483a5ab9c858bd75ca52a7.zip
mtk-20170518-1c8fbfbaa6cc060f47483a5ab9c858bd75ca52a7.tar.gz
mtk-20170518-1c8fbfbaa6cc060f47483a5ab9c858bd75ca52a7.tar.bz2
mac80211: fix interface startup order for AP+STA (patch by yann lopez)
SVN-Revision: 19912
Diffstat (limited to 'package')
-rw-r--r--package/mac80211/files/lib/wifi/mac80211.sh53
1 files changed, 30 insertions, 23 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
index 257277a..f127b28 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -318,29 +318,6 @@ enable_mac80211() {
if [ -n "$rts" ]; then
iw phy "$phy" set rts "${rts%%.*}"
fi
-
- ifconfig "$ifname" up
-
- if [ ! "$mode" = "ap" ]; then
- mac80211_start_vif "$vif" "$ifname"
-
- case "$mode" in
- adhoc)
- config_get bssid "$vif" bssid
- iw dev "$ifname" ibss join "$ssid" $freq ${fixed:+fixed-freq} $bssid
- ;;
- sta)
- if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then
- wpa_supplicant_setup_vif "$vif" wext || {
- echo "enable_mac80211($device): Failed to set up wpa_supplicant for interface $ifname" >&2
- # make sure this wifi interface won't accidentally stay open without encryption
- ifconfig "$ifname" down
- continue
- }
- fi
- ;;
- esac
- fi
done
local start_hostapd=
@@ -366,6 +343,36 @@ enable_mac80211() {
[ "$mode" = "ap" ] || continue
mac80211_start_vif "$vif" "$ifname"
done
+
+ for vif in $vifs; do
+ config_get mode "$vif" mode
+ config_get ifname "$vif" ifname
+ [ ! "$mode" = "ap" ] || continue
+ ifconfig "$ifname" up
+
+ if [ ! "$mode" = "ap" ]; then
+ mac80211_start_vif "$vif" "$ifname"
+
+ case "$mode" in
+ adhoc)
+ config_get bssid "$vif" bssid
+ config_get bssid "$vif" ssid
+ iw dev "$ifname" ibss join "$ssid" $freq ${fixed:+fixed-freq} $bssid
+ ;;
+ sta)
+ if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then
+ wpa_supplicant_setup_vif "$vif" wext || {
+ echo "enable_mac80211($device): Failed to set up wpa_supplicant for interface $ifname" >&2
+ # make sure this wifi interface won't accidentally stay open without encryption
+ ifconfig "$ifname" down
+ continue
+ }
+ fi
+ ;;
+ esac
+ fi
+ done
+
}