My computer has extra LEDs for wireless information, how can I make them work?
If the LED is connected to the chipsets GPIO pins, then the following commands should make it blink slowly on power up, and then switch to a 3 second blink period on association (similar to the LED behaviour on PC Cards).
sysctl -w dev.wifi0.ledpin=1 sysctl -w dev.wifi0.softled=1
For AR5007EG the value of dev.wifi0.ledpin must be 3
For MadWifi-Old use:sysctl -w dev.ath0.ledpin=1 sysctl -w dev.ath0.softled=1
Note that sysctl parameters are not saved in non-volatile memory, so you’ll want to put these commands in a local boot script or just add the following lines to /etc/sysctl.conf:
For MadWifi-Old use:dev.ath0.ledpin=1 dev.ath0.softled=1
For the owners of Gigabyte GN-WIAG02 minipci card: I found out that the led is on pin 2, so in this case dev.wifi0.ledpin=2 is the proper choice. Note that I am using it with Dell D610 laptop, this could also be important.
For the owners of IBM Thinkpads (at least R51 and R51e series): the following settings will light up your led:
sysctl -w dev.wifi0.ledpin=0 sysctl -w dev.wifi0.softled=1
For the Thinkpad R60e and X40 set both values to 1.
Can I turn on my wireless card LEDs automatically?
If you were able to turn on your LEDs as described above, then most likely yes.
udev "works entirely in userspace, using hotplug events the kernel sends whenever a device is added or removed from the kernel." udev can also "run a particular program when a device is connected or disconnected."
To make udev enable the LEDs, create a short script that calls the correct sysctl commands and then add a udev rule: KERNEL=="ath0", RUN+="/path/to/led/script"
To see if udev manages your wireless card, try $ udevinfo -a -p /sys/class/net/ath0 and if you see descriptions about your card fill the screen, then udev manages your wireless card.
The PCMCIA wireless card SMC WCBT-G? has two LEDs: one for Link (which lights when the card is up) and the other for Activity (which blinks with traffic). Both LEDs can be turned on using the following script:
#!/bin/bash # Set the Link LED to behave like link. sysctl -w dev.wifi0.ledpin=1 sysctl -w dev.wifi0.softled=1 sysctl -w dev.wifi0.softled=0 # Set the Activity LED to behave like activity. sysctl -w dev.wifi0.ledpin=0 sysctl -w dev.wifi0.softled=1
- Save this script as "leds"
- Make it executable with $ chmod +x leds
- Place it in your system path with something like # mv leds /usr/local/bin
- Add a udev rule to /etc/udev/udev.d/10-local.rules KERNEL=="ath0", RUN+="/usr/local/bin/leds"
- Reload udev's rules with # udevcontrol reload_rules
- Test your new rule with $ udevtest /class/net/ath0
$ udevtest /sys/class/net/ath0 This program is for debugging only, it does not create any node, or run any program specified by a RUN key. It may show incorrect results, if rules match against subsystem specfic kernel event variables. main: looking at device '/class/net/ath0' from subsystem 'net' wait_for_sysfs: file '/sys/class/net/ath0/address' appeared after 0 loops udev_rules_get_name: rule applied, 'ath0' becomes 'ath0' main: run: 'ifplugd.agent' main: run: '/usr/local/bin/leds' main: run: 'socket:/org/kernel/udev/monitor' main: run: 'net.agent' main: run: 'socket:/org/freedesktop/hal/udev_event'
The next time udev dectects the wireless card being connected to the system, it will call /usr/local/bin/leds and the LEDs will turn on. Anytime you want to turn on the LEDs, you can also issue # leds.
Working example for a Philips SNN6500 PCMCIA card on Gentoo
- ath_led.sh (3.4 kB) - added by anonymous on 12/11/08 02:35:45.