From owner-svn-src-head@freebsd.org Wed Sep 2 12:46:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEA1E9C7242; Wed, 2 Sep 2015 12:46:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B580717A1; Wed, 2 Sep 2015 12:46:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82CkhWF099534; Wed, 2 Sep 2015 12:46:43 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82Ckhkn099532; Wed, 2 Sep 2015 12:46:43 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201509021246.t82Ckhkn099532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 2 Sep 2015 12:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287394 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2015 12:46:44 -0000 Author: glebius Date: Wed Sep 2 12:46:42 2015 New Revision: 287394 URL: https://svnweb.freebsd.org/changeset/base/287394 Log: 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: In collaboration with: "Oleg V. Nauman" Modified: head/etc/devd.conf head/etc/pccard_ether Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Wed Sep 2 05:55:57 2015 (r287393) +++ head/etc/devd.conf Wed Sep 2 12:46:42 2015 (r287394) @@ -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"; Modified: head/etc/pccard_ether ============================================================================== --- head/etc/pccard_ether Wed Sep 2 05:55:57 2015 (r287393) +++ head/etc/pccard_ether Wed Sep 2 12:46:42 2015 (r287394) @@ -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