Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2013 11:14:07 +0100
From:      CeDeROM <cederom@tlen.pl>
To:        freebsd-questions@freebsd.org
Subject:   devd wlan wpa
Message-ID:  <CAFYkXjkbBpeY%2B%2BTkq=ShPSU3-QgFaOcErtBVTHiUOepq4T6Nmw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello :-)

I want to setup wpa_supplicant to start after wlan0 interface gets up.
The rc.conf ifconfig_wlan0="WPA DHCP" does the job only at boot. When
I get the interface down I need to start everything by hand, which is
a bit annoying when I test a lot and need to switch between Ethernet
and WiFi interfaces very often. I have tried to write devd rule:

notify 0 {
        match "system"          "IFNET";
        match "subsystem"       "wlan[0-9]+";
        match "type"            "LINK_UP";
        media-type              "802.11";
        match "device-name"     "wlan[0-9]+";
        action "/usr/sbin/wpa_supplicant -i $device-name -c
/etc/wpa_supplicant.conf -B";
};

But there goes the chicken-egg problem - I want to run wpa_supplicant
on LINK_UP event that occurs when Media Status is "connected", but to
get that "connected" status I need to run  wpa_supplicant first, so
capabilities of devd are not enough in this case, or I miss something?
Is there any distinction between LINK_UP and IF_UP?

Any hints appreciated :-)
Tomek

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXjkbBpeY%2B%2BTkq=ShPSU3-QgFaOcErtBVTHiUOepq4T6Nmw>