The broadcom driver keeps track of 4 seperate LEDs. These 4 LEDs have 3 important properties:
- An id
- A behaviour
- A boolean describing whether the LED is active high or not
The LED id is the bit offset in MMIO register 0x49C used to toggle the LED's state. A value of 2 for instance, corresponds to bit (1 << 2) in MMIO register 0x49C. The LED's status is controlled by a function which turns on and off LEDs by masking and unmasking bits in PHY MMIO register 0x49C. There is also a copy the LED regsiter kept in the driver, most likely for MMIO access speed reasons. Some LEDs are active when the bit is set high, others active when their bit is set low. This is controlled by the active hight LED property (#3).
There are 12 different behaviours which are listed in wlioctl.h (as provided by broadcom and distributed under the GPL). These behaviours are described below:
LED Behaviour value |
LED Behaviour |
Behaviour Result |
0 |
WL_LED_OFF |
Always Off |
1 |
WL_LED_ON |
Always On |
2 |
WL_LED_ACTIVITY |
Activity |
3 |
WL_LED_RADIO |
Radio Enabled |
4 |
WL_LED_ARADIO |
5GHz A Radio Enabled |
5 |
WL_LED_BRADIO |
2.4GHz B Radio Enabled |
6 |
WL_LED_BGMODE |
On if G Mode off if B Mode |
7 |
WL_LED_WI1 |
blink at medium speed while transferring packets |
8 |
WL_LED_WI2 |
AP mode: blink fast while transferring packets; STA mode: blink slowly if not associated, blink fast while transferring packets |
9 |
WL_LED_WI3 |
weird stuff |
10 |
WL_LED_ASSOC |
Associated State Indicator |
11 |
WL_LED_INACTIVE |
Null, Clears Default Behaviour |
When setting up the LED properties, the driver checks the SPROM wl0gpio%d variable, where %d is a led index number. This variable contains the following information:
Bits |
7 |
6-0 |
Meaning |
polarity |
behaviour value |
The polarity bit is 0 if the LED is activehigh, meaning that it is on when the bit in 0x49C is turned on, otherwise the LED is on if the bit is turned off (activelow).
The LEDs are fully controlled by the driver, the behaviour stored in the SPROM is purely informational (probably because what the resellers of the chip print on the board beside the LEDs differs).
If the relevant SPROM entries are not set, all LEDs default to activehigh and the following behaviours:
LED |
Default Behaviour |
0 |
WL_LED_ACTIVITY, unless the board vendor is 0xe11 in which case it is WL_LED_RADIO |
1 |
WL_LED_BRADIO |
2 |
WL_LED_ARADIO |
3 |
WL_LED_OFF |