diff --git a/hal/led/hal_usb_led.c b/hal/led/hal_usb_led.c index 0e3af08..84c3376 100644 --- a/hal/led/hal_usb_led.c +++ b/hal/led/hal_usb_led.c @@ -4704,3 +4704,18 @@ DeInitLed( } +void +rtw_led_control( + _adapter *adapter, + LED_CTL_MODE LedAction + ) +{ + if (adapter->registrypriv.led_enable) + { + do + { + (adapter)->ledpriv.LedControlHandler((adapter), (LedAction)); + } + while(0); + } +} diff --git a/include/drv_types.h b/include/drv_types.h index c8852b0..e38bc83 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -309,6 +309,10 @@ struct registry_priv #ifdef CONFIG_MULTI_VIR_IFACES u8 ext_iface_num;//primary/secondary iface is excluded #endif + +#ifdef CONFIG_SW_LED + u8 led_enable; +#endif }; diff --git a/include/hal_com_led.h b/include/hal_com_led.h index 2c2eb7e..e26ef4b 100644 --- a/include/hal_com_led.h +++ b/include/hal_com_led.h @@ -337,11 +337,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 4f79e14..a964d67 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -301,6 +301,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 + static uint loadparam(PADAPTER padapter, _nic_hdl pnetdev); int _netdev_open(struct net_device *pnetdev); int netdev_open (struct net_device *pnetdev); @@ -926,6 +932,10 @@ _func_enter_; 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 + _func_exit_; return status;