aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2015-09-02 12:46:42 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2015-09-02 12:46:42 +0000
commite56079102882a46c189559d116506b5a2df5401c (patch)
tree35794ba94b3606028f567a6196803ceedcd6e431
parent9c10871d751ca50a13be87ba63d60c987c50e607 (diff)
downloadsrc-e56079102882a46c189559d116506b5a2df5401c.tar.gz
src-e56079102882a46c189559d116506b5a2df5401c.zip
Fix dynamic attach/detach of 802.11 devices after r287197:
o In pccard_ether add code to start children of a 802.11 device, that are configured in rc.conf. o In devd.conf provide a regex matching all 802.11 devices, and on match run pccard_ether to spawn children. PR: 202784 Submitted by: <vidwer gmail.com> In collaboration with: "Oleg V. Nauman" <oleg opentransfer.com>
Notes
Notes: svn path=/head/; revision=287394
-rw-r--r--etc/devd.conf20
-rwxr-xr-xetc/pccard_ether17
2 files changed, 28 insertions, 9 deletions
diff --git a/etc/devd.conf b/etc/devd.conf
index 04a090bdc805..120eabd629d0 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|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/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