Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jan 2011 21:34:32 +0100
From:      Bernhard Schmidt <bschmidt@freebsd.org>
To:        freebsd-net@freebsd.org
Subject:   Re: devd and 802.11
Message-ID:  <201101172134.32367.bschmidt@freebsd.org>
In-Reply-To: <201101052151.46883.bschmidt@freebsd.org>
References:  <201101052151.46883.bschmidt@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

no objections so far. If non arise till this weekend, I going to commit it.

On Wednesday 05 January 2011 21:51:46 you wrote:
> Hi,
> 
> While working on the 'netif restart' issue (kern/153594) I noticed that
>  there are to entries in devd.conf with shady usefulness.
> 
> 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";
> };
> 
> I assume that the general use-case for devd is to automatically configure
> wireless devices as soon as those are plugged in (PCMCIA, ..). Those are
> already handled by
> 
> notify 0 {
>         match "system"          "IFNET";
>         match "type"            "ATTACH";
>         action "/etc/pccard_ether $subsystem start";
> };
> 
> this will invoke netif which then will create and configure the wlan0
>  device. While wlan0 is created, devd is poked again and this time the
>  other rule kicks in and starts netif again. This effectively results in 2
>  'netif start wlan0' calls. Due to the racy nature of this all tries to
>  ensure wpa_supplicant has exclusive access to the wlan device fail,
>  wpa_supplicant gets started twice and each instance is fighting for
>  ownership.
> 
> That devd entries a quite old (pre-VAP), the media-type might have changed
>  and this was just overlooked, so, I did some tests to figure out if those
>  are really necessary. After removing the 2 entries, I tried 3 things:
> - plug in PCMCIA card while system is up
> - remove PCMCIA device while system is up
> - kldunload if_drv; kldload if_drv
> in both cases, the wireless device was configure according to the settings
>  in rc.conf. Also, cleaning up after kldunload or removal of the device
>  worked as expected.
> 
> If I'm not missing an use-case here (pointers?) and there are no complains,
> the attached diff is worth being committed.
> 
> --
> Bernhard
> 

-- 
Bernhard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101172134.32367.bschmidt>