26 #include <linux/kernel.h>
27 #include <linux/module.h>
68 brightness = ((
LED_FULL / 6) * rssi) + 1;
69 if (brightness != led->
led_dev.brightness) {
89 rt2x00led_led_simple(&rt2x00dev->led_qual, enabled);
95 rt2x00led_led_simple(&rt2x00dev->led_assoc, enabled);
101 rt2x00led_led_simple(&rt2x00dev->led_radio, enabled);
116 ERROR(rt2x00dev,
"Failed to register led handler.\n");
129 unsigned long on_period;
130 unsigned long off_period;
131 const char *phy_name = wiphy_name(rt2x00dev->
hw->wiphy);
134 snprintf(name,
sizeof(name),
"%s-%s::radio",
135 rt2x00dev->
ops->name, phy_name);
137 retval = rt2x00leds_register_led(rt2x00dev,
138 &rt2x00dev->led_radio,
145 snprintf(name,
sizeof(name),
"%s-%s::assoc",
146 rt2x00dev->
ops->name, phy_name);
148 retval = rt2x00leds_register_led(rt2x00dev,
149 &rt2x00dev->led_assoc,
156 snprintf(name,
sizeof(name),
"%s-%s::quality",
157 rt2x00dev->
ops->name, phy_name);
159 retval = rt2x00leds_register_led(rt2x00dev,
160 &rt2x00dev->led_qual,
171 if (rt2x00dev->led_radio.led_dev.blink_set) {
174 rt2x00dev->led_radio.led_dev.blink_set(
175 &rt2x00dev->led_radio.led_dev, &on_period, &off_period);
184 static void rt2x00leds_unregister_led(
struct rt2x00_led *led)
203 rt2x00leds_unregister_led(&rt2x00dev->led_qual);
205 rt2x00leds_unregister_led(&rt2x00dev->led_assoc);
207 rt2x00leds_unregister_led(&rt2x00dev->led_radio);
210 static inline void rt2x00leds_suspend_led(
struct rt2x00_led *led)
222 rt2x00leds_suspend_led(&rt2x00dev->led_qual);
224 rt2x00leds_suspend_led(&rt2x00dev->led_assoc);
226 rt2x00leds_suspend_led(&rt2x00dev->led_radio);
229 static inline void rt2x00leds_resume_led(
struct rt2x00_led *led)
241 rt2x00leds_resume_led(&rt2x00dev->led_radio);
243 rt2x00leds_resume_led(&rt2x00dev->led_assoc);
245 rt2x00leds_resume_led(&rt2x00dev->led_qual);