rtl8188eu icon indicating copy to clipboard operation
rtl8188eu copied to clipboard

TL-WN725N activity LED indicator doesn't work

Open rostyslav80 opened this issue 3 years ago • 3 comments

The activity LED indicator doesn't work at all on the v5.2.2.4 branch. When I'm switching to the master branch, compile and install the driver, the indicator starts flashing.

rostyslav80 avatar Sep 15 '20 07:09 rostyslav80

You probably need to uncomment lline 151 in file include/autoconf.h

/* #define CONFIG_LED / <<<<<<====== #ifdef CONFIG_LED #define CONFIG_SW_LED #ifdef CONFIG_SW_LED / #define CONFIG_LED_HANDLED_BY_CMD_THREAD / #endif #endif / CONFIG_LED */

MrEngman

MrEngman avatar Sep 15 '20 10:09 MrEngman

@MrEngman No, after uncommenting of the lline 151 in file include/autoconf.h the status LED just lights all time and doesn't blinking.

@lwfinger could you explain why the LED is disabled by default on this branch and how can I enable it?

rostyslav80 avatar Sep 18 '20 18:09 rostyslav80

It is disabled in this branch because it doesn't work.

You would need to debug what is happening in the LED routines. My 8188eu does not have any LEDS, thus I cannot tell if it works or not.

lwfinger avatar Sep 18 '20 18:09 lwfinger

A simple alternative to the disabled LED code is hardware-controlled blinking. You just need to set bits 1 and 5 of REG_LEDCFG2. Then the chip will make the LED blink as needed. This works with my TP-Link TL-WN725N.

dubhater avatar Dec 19 '22 16:12 dubhater

@dubhater Could you please explain exactly where and how to make these changes?

rostyslav80 avatar Dec 20 '22 20:12 rostyslav80

Like this, for example:

diff --git a/usb_halinit.c b/usb_halinit.c
index 3e037e5..1fab065 100644
--- a/usb_halinit.c
+++ b/usb_halinit.c
@@ -1339,6 +1339,12 @@ static u32 rtl8188eu_hal_init(PADAPTER Adapter)
 	_InitHWLed(Adapter);
 #endif /* CONFIG_LED */
 
+	if (Adapter->registrypriv.led_enable) {
+		value8 = rtw_read8(Adapter, REG_LEDCFG2);
+		value8 |= BIT(5) | BIT(1);
+		rtw_write8(Adapter, REG_LEDCFG2, value8);
+	}
+
 	/*  */
 	/* Joseph Note: Keep RfRegChnlVal for later use. */
 	/*  */

The proper way would be to put those lines into _InitHWLed() where the "to do ...." comment is, but then you also have to make sure CONFIG_LED is defined and LedStrategy is HW_LED.

dubhater avatar Dec 20 '22 21:12 dubhater

@dubhater Thanks, it works.

rostyslav80 avatar Dec 20 '22 22:12 rostyslav80

I have added this change to the source. Anyone that does not like the change will need to load the module with the option led_enable=0.

lwfinger avatar Dec 20 '22 23:12 lwfinger