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 #1018 (new enhancement)

Opened 13 years ago

Last modified 11 years ago

[patch] softled: turn on LED when device is up and turn off when down; allow LED allways-on (without blinking)

Reported by: deller@gmx.de Assigned to:
Priority: minor Milestone: version 0.9.x - progressive release candidate phase
Component: madwifi: driver Version: trunk
Keywords: softled Cc:
Patch is attached: 1 Pending:

Description

"My last patch enabled the LED-blinking in my HP nc6000 laptop (http://madwifi.org/ticket/990).
Now, since the LED blinks, I think it was a bad idea, because after some hours people may get crazy seeing the LED blinking the whole time :-)
I verified with Windows XP, and there it stays constantly on, which I think might be a better default option.

The following patch cleans up madwifi's LED handling, which I think was at a few places wrong. The LED e.g. didn't went off when I unloaded the module or did a "ifdown ath0".

With the following patch the LED now behaves as expected and you may configure it's behaviour at command line:

sysctl -w dev.wifi0.softled=0softled and LED is always off
sysctl -w dev.wifi0.softled=1This is the default. LED keeps staying ON (no blinking at all!) when device athX is in status "up", and LED is off when device athX is "down".
sysctl -w dev.wifi0.softled=2LED blinks when device athX is "up" and transmitting or receiving data. LED is off when device athX is "down" or madwifi module is unloaded.


It would be great if you could test this patch and apply it.

Best regards,
Helge

Signed-off-by: Helge Deller <deller@gmx.de>


Some notes on the patch:

  • if the LEDs doesn't work as described for you, try to initialize the "sc_ledon" variable (in if_ath_pci.c) to 0" instead of "1". I tested only on my HP/AR5212 and feedback is very much welcome.
  • this patch nukes the sc_ledstate variable. I couldn't find any real user of it.
  • current behaviour was, that the LED got lit as soon as the driver was loaded. I tink this is wrong. Now it lits up, when the device goes up ("on air"), and turns off when it goes down.
  • in the timer table I changed the type of "rate" from u_int to u_int16_t. On 32bit/64bit platforms this saves a few static bytes.

Attachments

led.patch (5.8 kB) - added by deller@gmx.de on 11/19/06 13:19:09.
patch to fix LED behaviour (ifup/ifdown/always on)

Change History

11/19/06 13:19:09 changed by deller@gmx.de

  • attachment led.patch added.

patch to fix LED behaviour (ifup/ifdown/always on)

12/14/06 09:25:48 changed by Marc Tommasi

This patch works on HP nc4010 as well.

I've set softled to 0, and the led switches off. When I press the HP button, bluetooth is activated and the led switches on. I think that the state of the bluetooh/wifi adaptor is stored at the BIOS level and restored as identical when the machine is turned off and on. I get a problem when the laptop starts with the wifi/bt on. So I would say : 'switch off the wifi/bt btn when your turn off your laptop, to prevent disfunct at the next boot.'

12/14/06 09:30:59 changed by mrenzmann

  • milestone set to version 0.9.x - progressive release candidate phase.

09/27/07 04:35:32 changed by dan@libby.com

Hi, it doesn't look like this patch has been applied to the trunk. Is that right?

As a proud new owner of a Thinkpad T61 I can confirm that the blinking is annoying. Especially as the LED is right below the screen. I may end up disabling the leds entirely for now.

So please, please consider applying this patch. thanks!

12/03/08 01:01:26 changed by y5005

Yaay ! It works. It doesn't suit current version exactly but it works. I finally got this LED working the way I wanted... Thanks a lot!