With the new wlan stack, we need to check a sysctl to determine if it
is an ndis(4) interface because it is now wlanX that gets passed to
the script.
Depending on this, wpa_supplicant(8) will be started with either
"-D bsd" or "-D ndis".
Reported-by: Max Herrgard <herrgard@gmail.com>
Taken-from: FreeBSD
#!/bin/sh
#
# $FreeBSD: src/etc/rc.d/wpa_supplicant,v 1.2 2005/10/19 22:26:47 jkim Exp $
-# $DragonFly: src/etc/rc.d/wpa_supplicant,v 1.2 2008/07/07 00:00:56 thomas Exp $
#
# PROVIDE: wpa_supplicant
return 1
fi
-case ${ifn} in
-ndis*)
+is_ndis_interface()
+{
+ case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in
+ ndis*) true ;;
+ *) false ;;
+ esac
+}
+
+if is_ndis_interface ${ifn}; then
driver="ndis"
- ;;
-*)
+else
driver="bsd"
- ;;
-esac
+fi
load_rc_config $name