Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to get rid of iwlagn LED blinking (new Intel wifi LED)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
h017ah
n00b
n00b


Joined: 18 Apr 2007
Posts: 42

PostPosted: Mon Dec 15, 2008 11:04 pm    Post subject: How to get rid of iwlagn LED blinking (new Intel wifi LED) Reply with quote

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.
Code:
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:
Code:
#!/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 :)
Back to top
View user's profile Send private message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 527

PostPosted: Wed Dec 17, 2008 9:32 pm    Post subject: Reply with quote

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
Code:
#!/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.
Back to top
View user's profile Send private message
eruvaer_ohta
n00b
n00b


Joined: 18 Jul 2007
Posts: 22

PostPosted: Thu Jan 01, 2009 11:26 pm    Post subject: Reply with quote

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

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:
Code:
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 ;)

Greetings, Eruvaer
Back to top
View user's profile Send private message
h017ah
n00b
n00b


Joined: 18 Apr 2007
Posts: 42

PostPosted: Thu Jan 08, 2009 8:04 pm    Post subject: Reply with quote

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:
Code:
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 :)
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Thu Jan 08, 2009 8:59 pm    Post subject: Reply with quote

And if you disable this option inside the kernel ?

Code:

 [ ]   Enable LEDS features in iwlagn driver (NEW) 

_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
eruvaer_ohta
n00b
n00b


Joined: 18 Jul 2007
Posts: 22

PostPosted: Thu Jan 08, 2009 9:46 pm    Post subject: Reply with quote

d2_racing wrote:
And if you disable this option inside the kernel ?

Code:

 [ ]   Enable LEDS features in iwlagn driver (NEW) 


Then I don't have the WLAN LED at all ;-). (tested)
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Fri Jan 09, 2009 1:44 am    Post subject: Reply with quote

So you don't have to tweak it, you disable the feature inside the kernel, then you can kill any feature that you want :P
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
h017ah
n00b
n00b


Joined: 18 Apr 2007
Posts: 42

PostPosted: Fri Jan 16, 2009 8:15 am    Post subject: Reply with quote

But I want the LED, I just don't want it to blink.
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Fri Jan 16, 2009 11:58 am    Post subject: Reply with quote

The best for you is to go to the Intel Wireless bugzilla and post your demand there.
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
h017ah
n00b
n00b


Joined: 18 Apr 2007
Posts: 42

PostPosted: Sat Jan 17, 2009 12:10 pm    Post subject: Reply with quote

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...?
Back to top
View user's profile Send private message
eruvaer_ohta
n00b
n00b


Joined: 18 Jul 2007
Posts: 22

PostPosted: Sat Jan 17, 2009 7:01 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Sun Jan 18, 2009 4:25 am    Post subject: Reply with quote

Yep, in fact :P
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2859
Location: Omnipresent

PostPosted: Thu Dec 17, 2009 2:01 pm    Post subject: Reply with quote

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:

Code:
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.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Thu Dec 17, 2009 6:27 pm    Post subject: Reply with quote

Thanks, nice to know that trick.
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
nafre
Guru
Guru


Joined: 27 Dec 2003
Posts: 388

PostPosted: Fri Dec 18, 2009 8:13 pm    Post subject: Reply with quote

thanks
_________________
Nome- Felipe
Nick- Nafre
Idade- 25
Salvador - Bahia - Brasil
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2614
Location: Hamburg/Germany

PostPosted: Fri Mar 19, 2010 9:22 am    Post subject: Reply with quote

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:

Code:
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.
seems to be rejected in v2.6.34-rc1-1429-g3971047 :-(
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2859
Location: Omnipresent

PostPosted: Fri Mar 19, 2010 9:44 am    Post subject: Reply with quote

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 ...)
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2614
Location: Hamburg/Germany

PostPosted: Fri Mar 19, 2010 9:57 am    Post subject: Reply with quote

Rejected is the wrong work I think - I mean even if I have this
Code:
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 :
Code:
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
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2859
Location: Omnipresent

PostPosted: Fri Mar 19, 2010 10:04 am    Post subject: Reply with quote

Yes, but is the functionality in the sources you're using? What does "modinfo iwlcore" say?
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
xiaweitang
Apprentice
Apprentice


Joined: 26 Feb 2010
Posts: 152

PostPosted: Mon Apr 12, 2010 7:02 pm    Post subject: Re: How to get rid of iwlagn LED blinking (new Intel wifi LE Reply with quote

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.
Code:
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:
Code:
#!/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 :)


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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum