Hardware switch starts wpasupplicant

Dan Williams dcbw
Thu Oct 18 23:32:10 PDT 2007


On Thu, 2007-10-18 at 20:45 +0200, Angel Martin Alganza wrote:
> I have successfully set up wpasupplicant to connect to my work
> networks (2) and it works like a charm.  I have to start
> wpa_supplicant by hand, though, and once connected to one of the
> networks do a dhclient request on the wireless interface.
> 
> What I would like is the wpasupplicant and dhclient to be run
> automatically upon pressing the wireless switch, so that I only have
> to do so to get connected to the first (preferred) wireless network on
> /etc/wpa_supplicant.conf.
> 
> I haven't been able to find a way to do it after reading the
> wpasupplican man page and the information on the web site.
> 
> Is it possible to make such a set up?  Could someone point me to some
> documentation which explains how to do it?

There isn't a good way.  For the moment, the method which the rfkill
switch reports is highly driver dependent.  Some switches are actual
hardware switches which cut the the radio and tell the wireless card by
toggling a GPIO pin.  Others are actual hardware switches that cut the
radio and don't tell the card, but push the event up to userspace and
rely on something there to tell the driver that the power has been cut.
Others are pure input buttons and show up as input events like keyboard
keys.  Others show up as ACPI events because they are handled by BIOS.
It will depend on your specific laptop model.

2.6.24 will have a generic rfkill layer that will standardize the
behavior of hardware switches, but likely won't handle the pure
input-layer buttons.

HAL has support for Dell and Intel-based rfkill switches if the laptop
provides those switches.  However, you have to poll the switch to figure
out when it's off right now, since most switches aren't integrated into
Linux enough to provide status change notifications.

Dan






More information about the Hostap mailing list