aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-09-05 18:36:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-09-05 18:36:23 +0000
commitd9442b10a2e14c1c55f21743fa7a653e9b241e05 (patch)
treec2636bec23985b92b33023a5ca2e324f89604bfa /etc
parent4ca9a88ad0c8fd1dc753c2fa5b4f4e9f7e09f46c (diff)
parent1f8577e633d3c2759d29326457deb34935adfd6f (diff)
downloadsrc-d9442b10a2e14c1c55f21743fa7a653e9b241e05.tar.gz
src-d9442b10a2e14c1c55f21743fa7a653e9b241e05.zip
Merge ^/head r286858 through r287489.
Notes
Notes: svn path=/projects/clang-trunk/; revision=287490
Diffstat (limited to 'etc')
-rw-r--r--etc/devd.conf20
-rw-r--r--etc/mtree/BSD.tests.dist2
-rw-r--r--etc/mtree/BSD.usr.dist4
-rw-r--r--etc/network.subr86
-rwxr-xr-xetc/pccard_ether17
-rwxr-xr-xetc/rc.d/jail2
-rwxr-xr-xetc/rc.d/netif12
7 files changed, 133 insertions, 10 deletions
diff --git a/etc/devd.conf b/etc/devd.conf
index 04a090bdc805..fb8841991433 100644
--- a/etc/devd.conf
+++ b/etc/devd.conf
@@ -22,6 +22,9 @@ options {
"(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\
esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\
[0-9]+";
+ set wifi-driver-regex
+ "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rum|run|uath|\
+ upgt|ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+";
};
# Note that the attach/detach with the highest value wins, so that one can
@@ -57,17 +60,16 @@ notify 0 {
};
#
-# Like Ethernet devices, but separate because
-# they have a different media type. We may want
-# to exploit this later.
+# Like Ethernet devices, but separate because 802.11 require spawning
+# wlan(4) interface.
#
-detach 0 {
- media-type "802.11";
- action "/etc/pccard_ether $device-name stop";
-};
attach 0 {
- media-type "802.11";
- action "/etc/pccard_ether $device-name start";
+ device-name "$wifi-driver-regex";
+ action "/etc/pccard_ether $device-name startchildren";
+};
+detach 0 {
+ device-name "$wifi-driver-regex";
+ action "/etc/pccard_ether $device-name stopchildren";
};
notify 0 {
match "system" "IFNET";
diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index d16bb4759f1f..3d2ff5156642 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -574,6 +574,8 @@
usr.sbin
etcupdate
..
+ fstyp
+ ..
newsyslog
..
nmtree
diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index c0a6926fb908..f786438956ba 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -38,6 +38,10 @@
..
i18n
..
+ libxo
+ encoder
+ ..
+ ..
..
lib32
dtrace
diff --git a/etc/network.subr b/etc/network.subr
index 73ed57536317..0e5911b3fd44 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -1249,6 +1249,89 @@ ifscript_down()
fi
}
+# wlan_up
+# Create IEEE802.11 interfaces.
+#
+wlan_up()
+{
+ local _list _iflist parent child_wlans child create_args debug_flags
+ _list=
+ _iflist=$*
+
+ # Parse wlans_$parent="$child ..."
+ for parent in `set | sed -nE 's/wlans_([a-z]+[0-9]+)=.*/\1/p'`; do
+ child_wlans=`get_if_var $parent wlans_IF`
+ for child in ${child_wlans}; do
+ create_args="wlandev $parent `get_if_var $child create_args_IF`"
+ debug_flags="`get_if_var $child wlandebug_IF`"
+ case $_iflist in
+ ""|$child|$child\ *|*\ $child\ *|*\ $child) ;;
+ *) continue ;;
+ esac
+ # Skip if ${child} already exists.
+ if ${IFCONFIG_CMD} $child > /dev/null 2>&1; then
+ continue
+ fi
+ if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then
+ ${IFCONFIG_CMD} $child create ${create_args} && cfg=0
+ if [ $? -eq 0 ]; then
+ _list="$_list $child"
+ fi
+ if [ -n "${debug_flags}" ]; then
+ wlandebug -i $child ${debug_flags}
+ fi
+ else
+ i=`${IFCONFIG_CMD} wlan create ${create_args}`
+ # XXXGL: wlandebug should accept any name
+ if [ -n "${debug_flags}" ]; then
+ wlandebug -i $i ${debug_flags}
+ fi
+ ${IFCONFIG_CMD} $i name $child && cfg=0
+ if [ $? -eq 0 ]; then
+ _list="$_list $child"
+ fi
+ fi
+ done
+ done
+ if [ -n "${_list# }" ]; then
+ echo "Created wlan(4) interfaces: ${_list# }."
+ fi
+ debug "Created wlan(4)s: ${_list# }"
+}
+
+# wlan_down
+# Destroy IEEE802.11 interfaces.
+#
+wlan_down()
+{
+ local _list _iflist parent child_wlans child
+ _list=
+ _iflist=$*
+
+ # Parse wlans_$parent="$child ..."
+ for parent in `set | sed -nE 's/wlans_([a-z]+[0-9]+)=.*/\1/p'`; do
+ child_wlans=`get_if_var $parent wlans_IF`
+ for child in ${child_wlans}; do
+ case $_iflist in
+ ""|$child|$child\ *|*\ $child\ *|*\ $child) ;;
+ *) continue ;;
+ esac
+ # Skip if ${child} doesn't exists.
+ if ! ${IFCONFIG_CMD} $child > /dev/null 2>&1; then
+ continue
+ fi
+ ${IFCONFIG_CMD} -n ${child} destroy
+ if [ $? -eq 0 ]; then
+ _list="$_list $child"
+ fi
+ done
+ done
+ if [ -n "${_list# }" ]; then
+ echo "Destroyed wlan(4) interfaces: ${_list# }."
+ fi
+ debug "Destroyed wlan(4)s: ${_list# }"
+}
+
# clone_up
# Create cloneable interfaces.
#
@@ -1398,6 +1481,9 @@ clone_down()
# Create and configure child interfaces. Return 0 if child
# interfaces are created.
#
+# XXXGL: the wlan code in this functions is superseded by wlan_up(),
+# and will go away soon.
+#
childif_create()
{
local cfg child child_vlans child_wlans create_args debug_flags ifn i
diff --git a/etc/pccard_ether b/etc/pccard_ether
index 5bd9c3326fe4..7d324a11b89b 100755
--- a/etc/pccard_ether
+++ b/etc/pccard_ether
@@ -17,6 +17,9 @@ stop_precmd="checkauto"
stop_cmd="pccard_ether_stop"
restart_precmd="checkauto"
restart_cmd="pccard_ether_restart"
+startchildren_cmd="pccard_ether_startchildren"
+stopchildren_cmd="pccard_ether_stopchildren"
+extra_commands="startchildren stopchildren"
setup_routes()
{
@@ -114,6 +117,20 @@ pccard_ether_restart()
pccard_ether_start
}
+pccard_ether_startchildren()
+{
+ for child in `get_if_var $ifn wlans_IF`; do
+ /etc/rc.d/netif quietstart $child
+ done
+}
+
+pccard_ether_stopchildren()
+{
+ for child in `get_if_var $ifn wlans_IF`; do
+ /etc/rc.d/netif quietstop $child
+ done
+}
+
ifn=$1
shift
if [ -z "$*" ]; then
diff --git a/etc/rc.d/jail b/etc/rc.d/jail
index ea62f4839db4..d4861185a0a5 100755
--- a/etc/rc.d/jail
+++ b/etc/rc.d/jail
@@ -238,7 +238,7 @@ parse_options()
eval : \${jail_${_j}_mount_enable:=${jail_mount_enable:-NO}}
if checkyesno jail_${_j}_mount_enable; then
- echo " allow.mount;" >> $_conf
+ echo " allow.mount;"
fi
extract_var $_j set_hostname_allow allow.set_hostname YN NO
diff --git a/etc/rc.d/netif b/etc/rc.d/netif
index 0915b28e29ed..00e05b21fbb5 100755
--- a/etc/rc.d/netif
+++ b/etc/rc.d/netif
@@ -37,6 +37,8 @@ name="netif"
rcvar="${name}_enable"
start_cmd="netif_start"
stop_cmd="netif_stop"
+wlanup_cmd="wlan_up"
+wlandown_cmd="wlan_down"
cloneup_cmd="clone_up"
clonedown_cmd="clone_down"
clear_cmd="doclear"
@@ -65,6 +67,9 @@ netif_start()
trap : 2
fi
+ # Create IEEE802.11 interface
+ wlan_up $cmdifn
+
# Create cloned interfaces
clone_up $cmdifn
@@ -91,12 +96,14 @@ netif_start()
netif_stop()
{
_clone_down=1
+ _wlan_down=1
netif_stop0 $*
}
doclear()
{
_clone_down=
+ _wlan_down=
netif_stop0 $*
}
@@ -111,6 +118,11 @@ netif_stop0()
# Deconfigure the interface(s)
netif_common ifn_stop $cmdifn
+ # Destroy wlan interfaces
+ if [ -n "$_wlan_down" ]; then
+ wlan_down $cmdifn
+ fi
+
# Destroy cloned interfaces
if [ -n "$_clone_down" ]; then
clone_down $cmdifn