diff --git a/Makefile b/Makefile index 08e64a5..181f9b0 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,15 @@ EXTRA_CFLAGS += -Wno-unused-variable #EXTRA_CFLAGS += -Wno-vla EXTRA_CFLAGS += -Wno-misleading-indentation EXTRA_CFLAGS += -Wno-implicit-fallthrough + +# Activates Concurrent Mode if uncommented #EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE +# LED Control +EXTRA_CFLAGS += -DCONFIG_LED_CONTROL +EXTRA_CFLAGS += -DCONFIG_SW_LED -DCONFIG_RTW_SW_LED +EXTRA_CFLAGS += -DCONFIG_LED_ENABLE + # gcc-12 EXTRA_CFLAGS += -Wno-address EXTRA_CFLAGS += -Wframe-larger-than=1648 diff --git a/hal/led/hal_usb_led.c b/hal/led/hal_usb_led.c index 1599536..032de9b 100644 --- a/hal/led/hal_usb_led.c +++ b/hal/led/hal_usb_led.c @@ -1745,6 +1745,22 @@ void BlinkHandler(PLED_USB pLed) return; } + #ifdef CONFIG_SW_LED + // 1 is normal blinking + if (padapter->registrypriv.led_ctrl != 1) { + if (padapter->registrypriv.led_ctrl == 0) + { + // Set LED to off + pLed->BlinkingLedState = RTW_LED_OFF; + } else { + // Set LED to solid for 2 or greater + pLed->BlinkingLedState = RTW_LED_ON; + } + // Skip various switch cases where SwLedBlink*() is called below + pLed->CurrLedState = LED_UNKNOWN; + } + #endif + switch (ledpriv->LedStrategy) { #if CONFIG_RTW_SW_LED_TRX_DA_CLASSIFY case SW_LED_MODE_UC_TRX_ONLY: @@ -4287,4 +4303,4 @@ DeInitLed( _cancel_timer_ex(&(pLed->BlinkTimer)); ResetLedStatus(pLed); } -#endif \ No newline at end of file +#endif diff --git a/include/autoconf.h b/include/autoconf.h index fcb1b0a..7925f59 100644 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -167,7 +167,7 @@ #define CONFIG_RTW_LED #ifdef CONFIG_RTW_LED - #define CONFIG_RTW_SW_LED +// #define CONFIG_RTW_SW_LED #ifdef CONFIG_RTW_SW_LED /* #define CONFIG_RTW_LED_HANDLED_BY_CMD_THREAD */ #endif diff --git a/include/drv_types.h b/include/drv_types.h index eb4e7d8..9a8e3e4 100755 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -242,6 +242,9 @@ struct registry_priv { #ifdef CONFIG_TX_EARLY_MODE u8 early_mode; #endif +#ifdef CONFIG_SW_LED + u8 led_ctrl; +#endif #ifdef CONFIG_NARROWBAND_SUPPORTING u8 rtw_nb_config; #endif diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 65a5c91..8c5d72f 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -142,6 +142,10 @@ int rtw_check_fw_ps = 1; int rtw_early_mode = 1; #endif +#ifdef CONFIG_SW_LED +int rtw_led_ctrl = 1; // default to normal blinking +#endif + int rtw_usb_rxagg_mode = 2;/* RX_AGG_DMA=1, RX_AGG_USB=2 */ module_param(rtw_usb_rxagg_mode, int, 0644); @@ -612,6 +616,12 @@ module_param(rtw_pci_aspm_enable, int, 0644); #ifdef CONFIG_TX_EARLY_MODE module_param(rtw_early_mode, int, 0644); #endif + +#ifdef CONFIG_SW_LED +module_param(rtw_led_ctrl, int, 0644); +MODULE_PARM_DESC(rtw_led_ctrl,"Led Control: 0=Always off, 1=Normal blink, 2=Always on"); +#endif + #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE char *rtw_adaptor_info_caching_file_path = "/data/misc/wifi/rtw_cache"; module_param(rtw_adaptor_info_caching_file_path, charp, 0644); @@ -1307,6 +1317,9 @@ uint loadparam(_adapter *padapter) #ifdef CONFIG_TX_EARLY_MODE registry_par->early_mode = (u8)rtw_early_mode; +#endif +#ifdef CONFIG_SW_LED + registry_par->led_ctrl = (u8)rtw_led_ctrl; #endif registry_par->trx_path_bmp = (u8)rtw_trx_path_bmp; registry_par->tx_path_lmt = (u8)rtw_tx_path_lmt;