Em Quarta-feira 15 Abril 2009, às 17:33:40, Larry Finger escreveu: > The following patch implements some control over the LED on RTL8187B and > RTL8187L devices. Triggers are registered for TX and RX. Whenever the > trigger event occurs, the LED is turned off for 1/20 second, then turned > back on. > > Note: For those RTL8187X devices that are built into the computer and have > a LED that is expected to be controlled with a radio switch, this patch > will not operate that LED. That will take a separate patch to be prepared > later. > > Please test and comment. It didn't work for me, I need to fix this typo in V3 patch: ./drivers/net/wireless/rtl818x/rtl8187_leds.c --- ./drivers/net/wireless/rtl818x/rtl8187_leds.c.orig 2009-04-15 18:47:24.000000000 -0300 +++ ./drivers/net/wireless/rtl818x/rtl8187_leds.c 2009-04-16 11:32:11.000000000 -0300 @@ -64,7 +64,7 @@ static void led_turn_off(struct work_str */ u8 reg; struct rtl8187_priv *priv = container_of(work, struct rtl8187_priv, - led_on.work); + led_off.work); struct rtl8187_led *led = &priv->led_tx; /* Don't change the LED, when the device is down. */ Also, it doens't turn on led on interface up, probably because we don't have a 'radio' led and now removed led on from init_regs, may be we could do this: @@ -186,8 +187,10 @@ void rtl8187_leds_init(struct ieee80211_ "rtl8187-%s::rx", wiphy_name(dev->wiphy)); err = rtl8187_register_led(dev, &priv->led_rx, name, ieee80211_get_rx_led_name(dev), ledpin); - if (!err) + if (!err) { + queue_delayed_work(priv->dev->workqueue, &priv->led_on, 0); return; + } /* registration of RX LED failed - unregister TX */ rtl8187_unregister_led(&priv->led_tx); error: For the led off/stop code you added on rtl8187_stop, may be we would want to protect: rtl818x_iowrite8(priv, &priv->map->GPIO, 0x01); rtl818x_iowrite8(priv, &priv->map->GP_ENABLE, 0x01); inside an ifdef CONFIG_RTL8187_LEDS, but it will not work also for other led hardware (the ones which don't use GPIO/GP_ENABLE to set leds. we could do this instead on rtl8187_leds_exit: @@ -200,6 +203,7 @@ void rtl8187_leds_exit(struct ieee80211_ { struct rtl8187_priv *priv = dev->priv; + queue_delayed_work(priv->dev->workqueue, &priv->led_off, 0); cancel_delayed_work_sync(&priv->led_off); cancel_delayed_work_sync(&priv->led_on); rtl8187_unregister_led(&priv->led_tx); but then it will not turn off led on interface stop, just on module removal... > > The behavior described above is found for my Level One RTL8187B. Prior to > this patch, the LED was on continuously. On a Netgear WG111V2 RTL8187L, the > LED blinks erratically. Before the patch, the LED was off. > > If you test, please report the status of the LED before and after applying > the patch. In addition, find the line that looks like "rtl8187: Customer ID > 0x00" in the dmesg output and report it. I also need to know if you have a > B or L model. > > Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx> > --- > > V2 fixed a locking problem that caused the RTL8187L to fail. > > V3 removes the code that turned the LED on at device startup, and turns > it off when the driver is unloaded. > > <snip> -- []'s Herton -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html