diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-04-21 13:01:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-01 17:38:39 -0400 |
commit | 61c2b682b8391f13b67e2d95990a0aba34697d9c (patch) | |
tree | c64692ce1a5ea6eb5ac362fc7391b2a081479e18 /drivers/net/wireless/rt2x00/rt2x00leds.c | |
parent | 44a9809b97ec5acd1c549c3120bdd35613897d7c (diff) |
rt2x00: Fix quality/activity led handling
There was an obvious typo in LED structure
initialization which caused the radio and quality/activity
leds to be incorrectly initialized which resulted in
the leds not being enabled.
Additionally add the rt2x00led_led_activity() handler
that will enable TX/RX activity leds when the radio
is being enabled.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00leds.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00leds.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00leds.c b/drivers/net/wireless/rt2x00/rt2x00leds.c index 40c1f5c1b805..b362a1cf3f8d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00leds.c +++ b/drivers/net/wireless/rt2x00/rt2x00leds.c | |||
@@ -72,6 +72,21 @@ void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi) | |||
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev, bool enabled) | ||
76 | { | ||
77 | struct rt2x00_led *led = &rt2x00dev->led_qual; | ||
78 | unsigned int brightness; | ||
79 | |||
80 | if ((led->type != LED_TYPE_ACTIVITY) || !(led->flags & LED_REGISTERED)) | ||
81 | return; | ||
82 | |||
83 | brightness = enabled ? LED_FULL : LED_OFF; | ||
84 | if (brightness != led->led_dev.brightness) { | ||
85 | led->led_dev.brightness_set(&led->led_dev, brightness); | ||
86 | led->led_dev.brightness = brightness; | ||
87 | } | ||
88 | } | ||
89 | |||
75 | void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled) | 90 | void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled) |
76 | { | 91 | { |
77 | struct rt2x00_led *led = &rt2x00dev->led_assoc; | 92 | struct rt2x00_led *led = &rt2x00dev->led_assoc; |