From 7e67577c7937c15c854c97cddc1b8b133c124368 Mon Sep 17 00:00:00 2001 From: Nick Bartos Date: Sun, 13 Nov 2016 13:37:20 -0800 Subject: [PATCH] Re-add module parameter for status LED. This feature was lost when "merge new version v4.3.14" was applied. Original PR: #136 Original commit: ea61cdf0fa85d5341a6bc1d3ae531c0190726827 --- hal/led/hal_usb_led.c | 16 ++++++++++++++++ include/drv_types.h | 4 ++++ include/hal_com_led.h | 6 +----- os_dep/linux/os_intfs.c | 10 ++++++++++ 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/hal/led/hal_usb_led.c b/hal/led/hal_usb_led.c index 1ab61b1..9cb626a 100644 --- a/hal/led/hal_usb_led.c +++ b/hal/led/hal_usb_led.c @@ -21,6 +21,22 @@ #include #include +void +rtw_led_control( + _adapter *adapter, + LED_CTL_MODE LedAction + ) +{ + if (adapter->registrypriv.led_enable) + { + do + { + (adapter)->ledpriv.LedControlHandler((adapter), (LedAction)); + } + while(0); + } +} + // // Description: // Implementation of LED blinking behavior. diff --git a/include/drv_types.h b/include/drv_types.h index 625c8cd..c8c8cec 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -333,6 +333,10 @@ struct registry_priv { u8 adaptivity_dml; u8 boffefusemask; BOOLEAN bFileMaskEfuse; + +#ifdef CONFIG_SW_LED + u8 led_enable; +#endif }; diff --git a/include/hal_com_led.h b/include/hal_com_led.h index 08b7022..5580ceb 100644 --- a/include/hal_com_led.h +++ b/include/hal_com_led.h @@ -353,11 +353,7 @@ struct led_priv { }; #ifdef CONFIG_SW_LED -#define rtw_led_control(adapter, LedAction) \ - do { \ - if((adapter)->ledpriv.LedControlHandler) \ - (adapter)->ledpriv.LedControlHandler((adapter), (LedAction)); \ - } while(0) +void rtw_led_control(_adapter *adapter, LED_CTL_MODE LedAction); #else //CONFIG_SW_LED #define rtw_led_control(adapter, LedAction) #endif //CONFIG_SW_LED diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 482400b..48cb0c3 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -328,6 +328,12 @@ uint rtw_notch_filter = RTW_NOTCH_FILTER; module_param(rtw_notch_filter, uint, 0644); MODULE_PARM_DESC(rtw_notch_filter, "0:Disable, 1:Enable, 2:Enable only for P2P"); +#ifdef CONFIG_SW_LED +int rtw_led_enable = 1; +module_param(rtw_led_enable, int, 0644); +MODULE_PARM_DESC(rtw_led_enable,"Enable status LED"); +#endif //CONFIG_SW_LED + uint rtw_hiq_filter = CONFIG_RTW_HIQ_FILTER; module_param(rtw_hiq_filter, uint, 0644); MODULE_PARM_DESC(rtw_hiq_filter, "0:allow all, 1:allow special, 2:deny all"); @@ -578,6 +584,10 @@ uint loadparam( _adapter *padapter, _nic_hdl pnetdev) registry_par->ext_iface_num = (u8)rtw_ext_iface_num; #endif //CONFIG_MULTI_VIR_IFACES +#ifdef CONFIG_SW_LED + registry_par->led_enable = (u8)rtw_led_enable; +#endif //CONFIG_SW_LED + registry_par->RegEnableTxPowerLimit = (u8)rtw_tx_pwr_lmt_enable; registry_par->RegEnableTxPowerByRate = (u8)rtw_tx_pwr_by_rate;