mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
staging: r8188eu: remove bLedLinkBlinkInProgress
Remove the bLedLinkBlinkInProgress component from struct led_priv. Its only use is to block requests for "link blinking" when this blinking pattern is already active. The "link blinking" pattern is a continuous blinking pattern (as opposed to other patterns where we blink N times), it's no problem to restart this pattern when it's already running. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Link: https://lore.kernel.org/r/20221001170618.444444-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fd22186003
commit
febdb8eea9
@@ -26,7 +26,6 @@ static void ResetLedStatus(struct led_priv *pLed)
|
||||
|
||||
pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
}
|
||||
|
||||
@@ -99,7 +98,6 @@ static void blink_work(struct work_struct *work)
|
||||
pLed->BlinkTimes--;
|
||||
if (pLed->BlinkTimes == 0) {
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
pLed->bLedLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
} else {
|
||||
@@ -115,7 +113,6 @@ static void blink_work(struct work_struct *work)
|
||||
pLed->BlinkTimes--;
|
||||
if (pLed->BlinkTimes == 0) {
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
pLed->bLedLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
} else {
|
||||
@@ -132,7 +129,6 @@ static void blink_work(struct work_struct *work)
|
||||
break;
|
||||
case LED_BLINK_WPS_STOP: /* WPS success */
|
||||
if (!pLed->bLedOn) {
|
||||
pLed->bLedLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
|
||||
@@ -189,23 +185,18 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
||||
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
|
||||
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
|
||||
break;
|
||||
case LED_CTL_LINK:
|
||||
if (!pLed->bLedLinkBlinkInProgress)
|
||||
return;
|
||||
|
||||
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
pLed->bLedLinkBlinkInProgress = true;
|
||||
|
||||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
@@ -222,7 +213,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
||||
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = true;
|
||||
|
||||
@@ -240,7 +230,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
||||
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = true;
|
||||
|
||||
pLed->CurrLedState = LED_BLINK_TXRX;
|
||||
@@ -253,7 +242,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
||||
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
pLed->bLedWPSBlinkInProgress = true;
|
||||
@@ -263,7 +251,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
||||
case LED_CTL_STOP_WPS:
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
pLed->bLedWPSBlinkInProgress = true;
|
||||
@@ -283,7 +270,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
||||
break;
|
||||
case LED_CTL_POWER_OFF:
|
||||
pLed->CurrLedState = RTW_LED_OFF;
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
pLed->bLedWPSBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
|
||||
@@ -47,7 +47,6 @@ struct led_priv {
|
||||
|
||||
u32 BlinkTimes; /* Number of times to toggle led state for blinking. */
|
||||
|
||||
bool bLedLinkBlinkInProgress;
|
||||
bool bLedScanBlinkInProgress;
|
||||
struct delayed_work blink_work;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user