Skip to contentSkip to conversation

p54: more SoftLED updates

PATCH In review Christian Lamparter 3 participants 4 messages Mar 25, 2009 – Apr 14, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 p54: more SoftLED updates

This patch hopefully finishes the SoftLED code:
- It adds two more LEDs (rx and radio).
(the FW claims it can support up to 16 LEDs,
but I doubt that any vendor put more than 4 on a board)
- update the LEDs in a _delayed_ workqueue.
No one reported any more crashes.
(see: "PATCH] p54: fix race condition in memory management") So we can stop burning the mm code.

---

drivers/net/wireless/p54/p54.h +3 -2
index 04d95a1..0954044 100644
@@ -125,6 +125,7 @@ struct p54_led_dev {
 	struct led_classdev led_dev;
 	char name[P54_LED_MAX_NAME_LEN + 1];
 
+	unsigned int toggled;
 	unsigned int index;
 	unsigned int registered;
 };
@@ -187,8 +188,8 @@ struct p54_common {
 
 	/* LED management */
 #ifdef CONFIG_P54_LEDS
-	struct p54_led_dev assoc_led;
-	struct p54_led_dev tx_led;
+	struct p54_led_dev leds[4];
+	struct delayed_work led_work;
 #endif /* CONFIG_P54_LEDS */
 	u16 softled_state;		/* bit field of glowing LEDs */
 
drivers/net/wireless/p54/p54common.c +65 -19

135 lines not on this page · raw message

Acked-by on v1 2/3
#1 lore raw
Quoted 11 lines · Christian Lamparter

This patch hopefully finishes the SoftLED code:
- It adds two more LEDs (rx and radio).
(the FW claims it can support up to 16 LEDs,
but I doubt that any vendor put more than 4 on a board)
- update the LEDs in a _delayed_ workqueue.
No one reported any more crashes.
(see: "PATCH] p54: fix race condition in memory management") So we can stop burning the mm code.

---

My device has 2 LED's - one for power and one blinks on TX(?). No messages in logs.

#2 lore raw
In reply to Christian Lamparter
Quoted 8 lines · Christian Lamparter

This patch hopefully finishes the SoftLED code:
- It adds two more LEDs (rx and radio).
(the FW claims it can support up to 16 LEDs,
but I doubt that any vendor put more than 4 on a board)
- update the LEDs in a _delayed_ workqueue.
No one reported any more crashes.
(see: "PATCH] p54: fix race condition in memory management") So we can stop burning the mm code.

My device has 2 LEDs and I can see 4 registrations (assoc, tx, rx and radio). Does it make sense to register LEDs which are not available?

Fabio

#3 lore raw
Quoted 11 lines · On Tuesday 14 April 2009 17:12:33 Fabio Rossi wrote:
Quoted 8 lines · Christian Lamparter

This patch hopefully finishes the SoftLED code:
- It adds two more LEDs (rx and radio).
(the FW claims it can support up to 16 LEDs,
but I doubt that any vendor put more than 4 on a board)
- update the LEDs in a _delayed_ workqueue.
No one reported any more crashes.
(see: "PATCH] p54: fix race condition in memory management") So we can stop burning the mm code.

Quoted 2 lines

My device has 2 LEDs and I can see 4 registrations (assoc, tx, rx and radio). Does it make sense to register LEDs which are not available?

Well, trouble is that you can look (with your eyes) at your device and see the number of LEDs... This is something we cannot do with the driver. (Unless we find a EEPROM field which stores the # of LEDs and maybe even what they are used for?)

4 is just a "save" guess which should cover most - if not all - customer devices.

Regards,
Chr