Skip to content

Commit

Permalink
Added LED control
Browse files Browse the repository at this point in the history
  • Loading branch information
kimocoder committed Aug 16, 2019
1 parent 61ad137 commit 313311c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hal/led/hal_usb_led.c
Original file line number Diff line number Diff line change
Expand Up @@ -1745,6 +1745,22 @@ void BlinkHandler(PLED_USB pLed)
return;
}

#ifdef CONFIG_SW_LED
// led_enable 1 is normal blinking so don't cause always on/off
if (padapter->registrypriv.led_ctrl != 1) {
if (padapter->registrypriv.led_ctrl == 0)
{
// Cause LED to be always off
pLed->BlinkingLedState = RTW_LED_OFF;
} else {
// Cause LED to be always on for led_ctrl 2 or greater
pLed->BlinkingLedState = RTW_LED_ON;
}
// Skip various switch cases where SwLedBlink*() 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:
Expand Down
3 changes: 3 additions & 0 deletions include/drv_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ struct registry_priv {
u8 software_decrypt;
#ifdef CONFIG_TX_EARLY_MODE
u8 early_mode;
#endif
#ifdef CONFIG_SW_LED
u8 led_ctrl;
#endif
u8 acm_method;
/* WMM */
Expand Down
13 changes: 13 additions & 0 deletions os_dep/linux/os_intfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,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 blink
#endif

int rtw_usb_rxagg_mode = 2;/* RX_AGG_DMA=1, RX_AGG_USB=2 */
module_param(rtw_usb_rxagg_mode, int, 0644);

Expand Down Expand Up @@ -471,6 +475,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);
Expand Down Expand Up @@ -1015,6 +1025,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->lowrate_two_xmit = (u8)rtw_lowrate_two_xmit;
registry_par->rf_config = (u8)rtw_rf_config;
Expand Down

0 comments on commit 313311c

Please sign in to comment.