#706: Disable Radio by Software
-------------------------------------------------------+--------------------
Reporter: andy (dot) boehler (at) gmx (dot) at | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone: version
1.0.0 - first stable release
Component: madwifi: driver | Version: trunk
Resolution: | Keywords: RF-Kill,
Disable Radio, rfkill
Patch_attached: 0 |
-------------------------------------------------------+--------------------
Comment (by [EMAIL PROTECTED]):
I needed the same feature. The Pepper Pad allows the user to ''disable''
WiFi for improved battery life and also for situations where the radio
needs to be turned off ( ie. airplanes ).
The Pepper Pad 2 used a Prism-based PCMCIA Wi-Fi card and to disable the
radio, I just ejected the card via the ''cardctl'' PCMCIA command-line
tool.
The Pepper Pad 3 uses a mini-PCI card. I've found that there's no
''standard'' way to disable and/or suspend an individual PCI device from
userspace, nor from what I could find is this is supported by the kernel
(2.6.12).
So...what I did was hi-jack the PCI suspend mechanism and cause it to be
invoked via the private '''SETPARAM''' ioctl called using the '''sleep'''
parameter.
When a value of ''1'' is received for the ''sleep'' parameter, I lookup
the PCI device for our WiFi card using {{{pci_get_device()}}} with the
device and vendor ids, and then I call {{{pdev->driver->suspend(pdev,
PCI_D3hot);}}} which is the same thing the low-level {{{pci_suspend()}}}
function does.
Also for safety sake, I remove all of the MADWiFi modules after putting
the card to sleep. Not doing this lead to lockups and/or system ooops.
To re-enable the radio, I just re-insert the MADWiFi modules, no need to
issue the '''SETPARAM''' ioctl with ''sleep'' set to 0 ( although the code
is there ).
I haven't confirmed that this suspend actually saves power and/or turns
off the radio, but it's a first step.
'''Note''' - there is a '''HAL_PM_FULL_SLEEP''' constant defined in
{{{/hal/ah.h}}}. There's a chunk of code in {{{ath_stop()}}} that calls
{{{ath_hal_setpower(...,HAL_PM_FULL_SLEEP)}}}, but it's surrounded by an
{{{#if 0}}} block. There's also a comment about it being tricky to use
due to timing issues.
--
Ticket URL: <http://madwifi.org/ticket/706>
MadWifi <http://madwifi.org/>
Multiband Atheros Driver for Wireless FidelityAll the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Madwifi-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/madwifi-tickets