# How to get rid of iwlagn LED blinking (new Intel wifi LED)

## h017ah

When upgrading from iwl4965 to iwlagn on my Dell XPS M1330, my Wifi LED indicator suddenly started working again due to the added support for /sys/class/leds-devices in the new iwlagn-driver in the recent kernels, which is very neat. One unnecessary bonus feature was that the LED are blinking when there's activity on the wifi, and when you are used to the LED only working as an on/off indicator (in Windows), or not working at all, that can get annoying after a while. So I set out to find out how you disable this blinking.

```
m1330 ~ # ls /sys/devices/pci0000\:00/0000:00\:1c.1/0000\:0c\:00.0/leds

iwl-phy0:assoc  iwl-phy0:radio  iwl-phy0:RX  iwl-phy0:TX

m1330 ~ # cat /sys/devices/pci0000\:00/0000:00\:1c.1/0000\:0c\:00.0/leds/*/trigger

none AC-online BAT0-charging-or-full BAT0-charging BAT0-full mmc0 phy0rx phy0tx [phy0assoc] phy0radio rfkill0 

none AC-online BAT0-charging-or-full BAT0-charging BAT0-full mmc0 phy0rx phy0tx phy0assoc [phy0radio] rfkill0 

none AC-online BAT0-charging-or-full BAT0-charging BAT0-full mmc0 [phy0rx] phy0tx phy0assoc phy0radio rfkill0 

none AC-online BAT0-charging-or-full BAT0-charging BAT0-full mmc0 phy0rx [phy0tx] phy0assoc phy0radio rfkill0 

m1330 ~ #
```

I tried setting each one of these triggers to none one at a time, but my goal of just disable that darn blinking seemed to just pop up at random sometimes during my testing. After much fiddling around, I found out that if I just reset the iwl-phy0:assoc/trigger to phy0assoc, the blinking during activity stops! Success! By reset I mean just echo'ing phy0assoc into iwl-phy0:assoc/trigger, so it sets the same value as it already has. Why this works, I have no idea.

My /etc/conf.d/net has a preup() section which loads the iwlagn kernel module if net.wlan0 is called. For me, echoing the value in preup does not work, since the hardware needs some time to settle and for the led devices to show up. So I decided to make a little led.sh-script which gets called from /etc/conf.d/local, but I guess I could just test to put it in postup() or something. YMMV.

If the iwlagn-modules gets unloaded and then loaded again, the LED device path changes (from *phy0* to *phy1*), so the script looks up what number it should use before echoing.

led.sh:

```
#!/bin/bash

# Disable led-blinking

tall=$( ls /sys/devices/pci0000\:00/0000:00\:1c.1/0000\:0c\:00.0/leds/ | head -1 | cut -c 8 )

echo phy"$tall"assoc > /sys/devices/pci0000\:00/0000:00\:1c.1/0000\:0c\:00.0/leds/iwl-phy"$tall"\:assoc/trigger
```

Remember to check that the pci-path is correct on your own system, of course.

Hope this info is useful for someone :)

----------

## jamapii

Thanks h017ah, that's useful to me!

I had to search for the leds directory, maybe it's because I'm on 2.6.28-rc.

My script

```
#!/bin/sh

#

# 2008-12-17 from http://forums.gentoo.org/viewtopic-t-718460.html

#

tall=$(ls -d /sys/class/leds/iwl-phy*:assoc/)

# FIXME lol brute force

n=$(echo $tall | perl -ne '/(\d)/ and print $1')

echo phy${n}assoc > $tall/trigger

```

I'm using it in postassociate now.

Btw, seems there's no simple way to extract the number with just bash.

----------

## eruvaer_ohta

Thanks a lot h017ah, that's also helpful to me!   :Smile: 

I just had to correct the command a bit for my system with the help of lspci. I did implement it into my /etc/conf.d/net usign the postup() function as you suggested:

```
postup() {

   # If wlan0 is up, deactivate the blinking of the WLAN-LED

   if [ ${IFVAR} == "wlan0" ]; then

      tall=$( ls /sys/devices/pci0000\:00/0000\:00\:1c.1/0000\:0b\:00.0/leds* | head -1 | cut -c 63 )

      echo phy"$tall"assoc > /sys/devices/pci0000\:00/0000\:00\:1c.1/0000\:0b\:00.0/leds\:iwl-phy"$tall"\:assoc/trigger

   fi

   

   return 0

}

```

Works like a charm  :Wink: 

Greetings, Eruvaer

----------

## h017ah

jamapii reminded me that none of these scripts will work if the device number surpasses 9, so I did a minor, hackish adjustment inspired by jamapii's adjustments. Just replace the tall= line with this:

```
tall=$( ls -d /sys/class/leds/iwl-phy*:assoc | sed -e 's/[[:alpha:]]//g' -e 's/[[:punct:]]//g' )
```

I'm confident that this must be some of the most inelegant solutions avaliable for this problem :)

----------

## d2_racing

And if you disable this option inside the kernel ?

```

 [ ]   Enable LEDS features in iwlagn driver (NEW)  

```

----------

## eruvaer_ohta

 *d2_racing wrote:*   

> And if you disable this option inside the kernel ?
> 
> ```
> 
>  [ ]   Enable LEDS features in iwlagn driver (NEW)  
> ...

 

Then I don't have the WLAN LED at all  :Wink: . (tested)

----------

## d2_racing

So you don't have to tweak it, you disable the feature inside the kernel, then you can kill any feature that you want  :Razz: 

----------

## h017ah

But I want the LED, I just don't want it to blink.

----------

## d2_racing

The best for you is to go to the Intel Wireless bugzilla and post your demand there.

----------

## h017ah

 *d2_racing wrote:*   

> The best for you is to go to the Intel Wireless bugzilla and post your demand there.

 What? I just posted the solution to the problem... I'm not sure that the behaviour qualifies as a bug...?

----------

## eruvaer_ohta

There already is a bug marked as enhancement concerning the LED behavior:

http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1771

The last post is about two months old, but perhaps you can post your demand there, h017ah. I am also going to do this when I have the time, since an easy solution would be nice.

----------

## d2_racing

Yep, in fact  :Razz: 

----------

## Hypnos

Sorry, I'm way behind the curve on this issue -- until now I just disabled the iwlwifi LED support.

If you go to the bug link above, the patch against kernel 2.6.31 (posted in September 2009) works quite well.  It lets you set the LED behavior by module parameter:

```
parm:           led_mode:led mode: 0=blinking, 1=On(RF On)/Off(RF Off), (default 0)
```

The patch applies cleanly to tuxonice-sources-2.6.32.

----------

## d2_racing

Thanks, nice to know that trick.

----------

## nafre

thanks

----------

## toralf

 *Hypnos wrote:*   

> Sorry, I'm way behind the curve on this issue -- until now I just disabled the iwlwifi LED support.
> 
> If you go to the bug link above, the patch against kernel 2.6.31 (posted in September 2009) works quite well.  It lets you set the LED behavior by module parameter:
> 
> ```
> ...

 seems to be rejected in v2.6.34-rc1-1429-g3971047  :Sad: 

----------

## Hypnos

By "rejected" you mean the patch does not apply cleanly, or that the functionality was already in your sources and then pulled out before this ref?  (Perhaps I misunderstood you in your other thread ...)

----------

## toralf

Rejected is the wrong work I think  - I mean even if I have this 

```
n22 /usr/portage/app-emulation/vmware-player # cat /etc/modules.d/iwlcore

led_mode:1

```

the led is blinking ...

Update:

Damn, syntax error, this is ok : 

```
tfoerste@n22 ~ $ cat /etc/modprobe.d/iwlcore

options iwlcore led_mode=1

```

Last edited by toralf on Fri Apr 16, 2010 2:18 pm; edited 1 time in total

----------

## Hypnos

Yes, but is the functionality in the sources you're using?  What does "modinfo iwlcore" say?

----------

## xiaweitang

 *h017ah wrote:*   

> When upgrading from iwl4965 to iwlagn on my Dell XPS M1330, my Wifi LED indicator suddenly started working again due to the added support for /sys/class/leds-devices in the new iwlagn-driver in the recent kernels, which is very neat. One unnecessary bonus feature was that the LED are blinking when there's activity on the wifi, and when you are used to the LED only working as an on/off indicator (in Windows), or not working at all, that can get annoying after a while. So I set out to find out how you disable this blinking.
> 
> ```
> m1330 ~ # ls /sys/devices/pci0000\:00/0000:00\:1c.1/0000\:0c\:00.0/leds
> 
> ...

 

This works for me. Do you know how to disable the hard disk LED blinking. It's not as often as the wireless LED, but still annoying.

----------

