Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #706 (new enhancement)

Opened 16 years ago

Last modified 16 years ago

Disable Radio by Software

Reported by: andy (dot) boehler (at) gmx (dot) at Assigned to:
Priority: minor Milestone: version 1.0.0 - first stable release
Component: madwifi: driver Version: trunk
Keywords: RF-Kill, Disable Radio, rfkill Cc:
Patch is attached: 0 Pending:

Description

Hello,

I use madwifi-ng on a Router (Netgear WGT634U) that has a Mini-PCI Atheros based card. However, I don't want my radio to be on all the time, so it would be good if there is sort of a radio kill switch in software (I know this works under Windows or under Linux on ipw2200).

Does the HAL provide support for this? Or needs the HAL to be updated to accomplish this task?

Thanks, andy

Change History

06/21/06 05:36:11 changed by mrenzmann

  • priority changed from major to minor.
  • version set to trunk.
  • type changed from defect to enhancement.
  • milestone set to version 1.0.0 - first stable release.

06/22/06 00:39:55 changed by espy@pepper.com

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.