From 498d84fc4e00ad75514c3a9dde09338552b89a8c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 2 Dec 2013 16:41:03 +0000 Subject: netifd: add wireless configuration support and port mac80211 to the new framework Signed-off-by: Felix Fietkau SVN-Revision: 38988 --- package/base-files/files/sbin/wifi | 39 +++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'package/base-files') diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index ef20787..7663432 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -2,15 +2,25 @@ # Copyright (C) 2006 OpenWrt.org . /lib/functions.sh +. /usr/share/libubox/jshn.sh usage() { cat </dev/null >/dev/null; then eval "scan_$iftype '$device'" eval "${1}_$iftype '$device'" || echo "$device($iftype): ${1} failed" - else + elif [ ! -f /lib/netifd/wireless/$iftype.sh ]; then echo "$device($iftype): Interface type not supported" fi ); done } +wifi_updown() { + cmd=down + [ enable = "$1" ] && { + _wifi_updown disable "$2" + scan_wifi + cmd=up + } + ubus_wifi_cmd "$cmd" "$2" + _wifi_updown "$@" +} + +wifi_reload() { + _wifi_updown "disable" "$1" + scan_wifi + _wifi_updown "enable" "$1" +} + wifi_detect() { for driver in ${2:-$DRIVERS}; do ( if eval "type detect_$driver" 2>/dev/null >/dev/null; then @@ -199,6 +222,8 @@ scan_wifi case "$1" in down) wifi_updown "disable" "$2";; detect) wifi_detect "$2";; + status) ubus_wifi_cmd "status" "$2";; + reload) wifi_reload "$2";; --help|help) usage;; *) wifi_updown "enable" "$2";; esac -- cgit v1.1