rtl8188eu: Add rtw_led_enable module parameter

Make it possible to disable the LED, as it can be pretty annoying
depending on where it's located.
This commit is contained in:
Bastien Nocera 2020-01-06 21:15:07 +01:00
parent 4930848feb
commit 627a577e5c
3 changed files with 12 additions and 0 deletions

View file

@ -1652,6 +1652,7 @@ void BlinkHandler(struct LED_871x *pLed)
void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction) void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction)
{ {
struct led_priv *ledpriv = &(padapter->ledpriv); struct led_priv *ledpriv = &(padapter->ledpriv);
struct registry_priv *registry_par;
if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped) || if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped) ||
(!padapter->hw_init_completed)) (!padapter->hw_init_completed))
@ -1660,6 +1661,10 @@ void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction)
if (!ledpriv->bRegUseLed) if (!ledpriv->bRegUseLed)
return; return;
registry_par = &padapter->registrypriv;
if (!registry_par->led_enable)
return;
if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on && if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on &&
padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS) && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS) &&
(LedAction == LED_CTL_TX || LedAction == LED_CTL_RX || (LedAction == LED_CTL_TX || LedAction == LED_CTL_RX ||

View file

@ -114,6 +114,8 @@ struct registry_priv {
u8 uapsd_acvi_en; u8 uapsd_acvi_en;
u8 uapsd_acvo_en; u8 uapsd_acvo_en;
u8 led_enable;
struct wlan_bssid_ex dev_network; struct wlan_bssid_ex dev_network;
u8 ht_enable; u8 ht_enable;

View file

@ -86,6 +86,8 @@ static int rtw_uapsd_acbe_en;
static int rtw_uapsd_acvi_en; static int rtw_uapsd_acvi_en;
static int rtw_uapsd_acvo_en; static int rtw_uapsd_acvo_en;
static int rtw_led_enable = 1;
int rtw_ht_enable = 1; int rtw_ht_enable = 1;
int rtw_cbw40_enable = 3; /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */ int rtw_cbw40_enable = 3; /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */
int rtw_ampdu_enable = 1;/* for enable tx_ampdu */ int rtw_ampdu_enable = 1;/* for enable tx_ampdu */
@ -137,6 +139,7 @@ module_param(rtw_wmm_enable, int, 0644);
module_param(rtw_vrtl_carrier_sense, int, 0644); module_param(rtw_vrtl_carrier_sense, int, 0644);
module_param(rtw_vcs_type, int, 0644); module_param(rtw_vcs_type, int, 0644);
module_param(rtw_busy_thresh, int, 0644); module_param(rtw_busy_thresh, int, 0644);
module_param(rtw_led_enable, int, 0644);
module_param(rtw_ht_enable, int, 0644); module_param(rtw_ht_enable, int, 0644);
module_param(rtw_cbw40_enable, int, 0644); module_param(rtw_cbw40_enable, int, 0644);
module_param(rtw_ampdu_enable, int, 0644); module_param(rtw_ampdu_enable, int, 0644);
@ -562,6 +565,8 @@ static uint loadparam(struct adapter *padapter, struct net_device *pnetdev)
registry_par->uapsd_acvi_en = (u8)rtw_uapsd_acvi_en; registry_par->uapsd_acvi_en = (u8)rtw_uapsd_acvi_en;
registry_par->uapsd_acvo_en = (u8)rtw_uapsd_acvo_en; registry_par->uapsd_acvo_en = (u8)rtw_uapsd_acvo_en;
registry_par->led_enable = (u8)rtw_led_enable;
registry_par->ht_enable = (u8)rtw_ht_enable; registry_par->ht_enable = (u8)rtw_ht_enable;
registry_par->cbw40_enable = (u8)rtw_cbw40_enable; registry_par->cbw40_enable = (u8)rtw_cbw40_enable;
registry_par->ampdu_enable = (u8)rtw_ampdu_enable; registry_par->ampdu_enable = (u8)rtw_ampdu_enable;