diff options
Diffstat (limited to 'drivers/staging/rtl8712/rtl8712_led.c')
-rw-r--r-- | drivers/staging/rtl8712/rtl8712_led.c | 473 |
1 files changed, 248 insertions, 225 deletions
diff --git a/drivers/staging/rtl8712/rtl8712_led.c b/drivers/staging/rtl8712/rtl8712_led.c index 56e8add..f1d47a0 100644 --- a/drivers/staging/rtl8712/rtl8712_led.c +++ b/drivers/staging/rtl8712/rtl8712_led.c @@ -97,7 +97,8 @@ static void InitLed871x(struct _adapter *padapter, struct LED_871x *pLed, pLed->bLedBlinkInProgress = false; pLed->BlinkTimes = 0; pLed->BlinkingLedState = LED_UNKNOWN; - _init_timer(&(pLed->BlinkTimer), nic, BlinkTimerCallback, pLed); + setup_timer(&pLed->BlinkTimer, BlinkTimerCallback, + (unsigned long)pLed); INIT_WORK(&pLed->BlinkWorkItem, BlinkWorkItemCallback); } @@ -107,7 +108,7 @@ static void InitLed871x(struct _adapter *padapter, struct LED_871x *pLed, */ static void DeInitLed871x(struct LED_871x *pLed) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); /* We should reset bLedBlinkInProgress if we cancel * the LedControlTimer, */ pLed->bLedBlinkInProgress = false; @@ -258,21 +259,21 @@ static void SwLedBlink(struct LED_871x *pLed) /* Schedule a timer to toggle LED state. */ switch (pLed->CurrLedState) { case LED_BLINK_NORMAL: - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NORMAL_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NORMAL_INTERVAL)); break; case LED_BLINK_SLOWLY: case LED_BLINK_StartToBlink: - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SLOWLY_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SLOWLY_INTERVAL)); break; case LED_BLINK_WPS: - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_LONG_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_LONG_INTERVAL)); break; default: - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SLOWLY_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SLOWLY_INTERVAL)); break; } } @@ -315,16 +316,16 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); break; case LED_BLINK_NORMAL: if (pLed->bLedOn) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_LINK_INTERVAL_ALPHA)); break; case LED_SCAN_BLINK: pLed->BlinkTimes--; @@ -338,8 +339,8 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_LINK_INTERVAL_ALPHA)); } else if (!check_fwstate(pmlmepriv, _FW_LINKED)) { pLed->bLedNoLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_SLOWLY; @@ -347,8 +348,8 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); } pLed->bLedScanBlinkInProgress = false; } else { @@ -356,8 +357,8 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_TXRX_BLINK: @@ -372,8 +373,8 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_LINK_INTERVAL_ALPHA)); } else if (!check_fwstate(pmlmepriv, _FW_LINKED)) { pLed->bLedNoLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_SLOWLY; @@ -381,8 +382,8 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); } pLed->BlinkTimes = 0; pLed->bLedBlinkInProgress = false; @@ -391,8 +392,8 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; case LED_BLINK_WPS: @@ -400,14 +401,14 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); break; case LED_BLINK_WPS_STOP: /* WPS success */ if (pLed->BlinkingLedState == LED_ON) { pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA)); bStopBlinking = false; } else bStopBlinking = true; @@ -418,8 +419,8 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_LINK_INTERVAL_ALPHA)); } pLed->bLedWPSBlinkInProgress = false; break; @@ -460,8 +461,8 @@ static void SwLedBlink2(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_TXRX_BLINK: @@ -484,8 +485,8 @@ static void SwLedBlink2(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; default: @@ -528,8 +529,8 @@ static void SwLedBlink3(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_TXRX_BLINK: @@ -554,8 +555,8 @@ static void SwLedBlink3(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; case LED_BLINK_WPS: @@ -563,14 +564,14 @@ static void SwLedBlink3(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); break; case LED_BLINK_WPS_STOP: /*WPS success*/ if (pLed->BlinkingLedState == LED_ON) { pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA)); bStopBlinking = false; } else bStopBlinking = true; @@ -610,18 +611,18 @@ static void SwLedBlink4(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); break; case LED_BLINK_StartToBlink: if (pLed->bLedOn) { pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SLOWLY_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SLOWLY_INTERVAL)); } else { pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NORMAL_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NORMAL_INTERVAL)); } break; case LED_SCAN_BLINK: @@ -635,16 +636,16 @@ static void SwLedBlink4(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); pLed->bLedScanBlinkInProgress = false; } else { if (pLed->bLedOn) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_TXRX_BLINK: @@ -658,27 +659,27 @@ static void SwLedBlink4(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); pLed->bLedBlinkInProgress = false; } else { if (pLed->bLedOn) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; case LED_BLINK_WPS: if (pLed->bLedOn) { pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SLOWLY_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SLOWLY_INTERVAL)); } else { pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NORMAL_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NORMAL_INTERVAL)); } break; case LED_BLINK_WPS_STOP: /*WPS authentication fail*/ @@ -686,7 +687,8 @@ static void SwLedBlink4(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NORMAL_INTERVAL)); break; case LED_BLINK_WPS_STOP_OVERLAP: /*WPS session overlap */ pLed->BlinkTimes--; @@ -699,15 +701,15 @@ static void SwLedBlink4(struct LED_871x *pLed) if (bStopBlinking) { pLed->BlinkTimes = 10; pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_LINK_INTERVAL_ALPHA)); } else { if (pLed->bLedOn) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NORMAL_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NORMAL_INTERVAL)); } break; default: @@ -734,16 +736,16 @@ static void SwLedBlink5(struct LED_871x *pLed) pLed->CurrLedState = LED_ON; pLed->BlinkingLedState = LED_ON; if (!pLed->bLedOn) - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); pLed->bLedScanBlinkInProgress = false; } else { if (pLed->bLedOn) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_TXRX_BLINK: @@ -754,16 +756,16 @@ static void SwLedBlink5(struct LED_871x *pLed) pLed->CurrLedState = LED_ON; pLed->BlinkingLedState = LED_ON; if (!pLed->bLedOn) - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); pLed->bLedBlinkInProgress = false; } else { if (pLed->bLedOn) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; default: @@ -797,8 +799,8 @@ static void SwLedBlink6(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; case LED_BLINK_WPS: @@ -806,7 +808,8 @@ static void SwLedBlink6(struct LED_871x *pLed) pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); break; default: @@ -895,11 +898,11 @@ static void SwLedControlMode1(struct _adapter *padapter, IS_LED_WPS_BLINKING(pLed)) return; if (pLed->bLedLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedLinkBlinkInProgress = false; } if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } pLed->bLedNoLinkBlinkInProgress = true; @@ -908,8 +911,8 @@ static void SwLedControlMode1(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); } break; case LED_CTL_LINK: @@ -918,11 +921,11 @@ static void SwLedControlMode1(struct _adapter *padapter, IS_LED_WPS_BLINKING(pLed)) return; if (pLed->bLedNoLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } pLed->bLedLinkBlinkInProgress = true; @@ -931,8 +934,8 @@ static void SwLedControlMode1(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_LINK_INTERVAL_ALPHA)); } break; case LED_CTL_SITE_SURVEY: @@ -943,15 +946,15 @@ static void SwLedControlMode1(struct _adapter *padapter, if (IS_LED_WPS_BLINKING(pLed)) return; if (pLed->bLedNoLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } if (pLed->bLedLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedLinkBlinkInProgress = false; } if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } pLed->bLedScanBlinkInProgress = true; @@ -961,8 +964,8 @@ static void SwLedControlMode1(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_CTL_TX: @@ -972,11 +975,11 @@ static void SwLedControlMode1(struct _adapter *padapter, IS_LED_WPS_BLINKING(pLed)) return; if (pLed->bLedNoLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } if (pLed->bLedLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedLinkBlinkInProgress = false; } pLed->bLedBlinkInProgress = true; @@ -986,8 +989,8 @@ static void SwLedControlMode1(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; @@ -995,19 +998,19 @@ static void SwLedControlMode1(struct _adapter *padapter, case LED_CTL_START_WPS_BOTTON: if (pLed->bLedWPSBlinkInProgress == false) { if (pLed->bLedNoLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } if (pLed->bLedLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedLinkBlinkInProgress = false; } if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } pLed->bLedWPSBlinkInProgress = true; @@ -1016,44 +1019,45 @@ static void SwLedControlMode1(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_CTL_STOP_WPS: if (pLed->bLedNoLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } if (pLed->bLedLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedLinkBlinkInProgress = false; } if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } if (pLed->bLedWPSBlinkInProgress) - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); else pLed->bLedWPSBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_WPS_STOP; if (pLed->bLedOn) { pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA)); } else { pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); } break; case LED_CTL_STOP_WPS_FAIL: if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } pLed->bLedNoLinkBlinkInProgress = true; @@ -1062,33 +1066,34 @@ static void SwLedControlMode1(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); break; case LED_CTL_POWER_OFF: pLed->CurrLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF; if (pLed->bLedNoLinkBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } if (pLed->bLedLinkBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedLinkBlinkInProgress = false; } if (pLed->bLedBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); break; default: break; @@ -1111,7 +1116,7 @@ static void SwLedControlMode2(struct _adapter *padapter, return; if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } pLed->bLedScanBlinkInProgress = true; @@ -1121,8 +1126,8 @@ static void SwLedControlMode2(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; @@ -1140,8 +1145,8 @@ static void SwLedControlMode2(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; @@ -1149,32 +1154,34 @@ static void SwLedControlMode2(struct _adapter *padapter, pLed->CurrLedState = LED_ON; pLed->BlinkingLedState = LED_ON; if (pLed->bLedBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); break; case LED_CTL_START_WPS: /*wait until xinpin finish*/ case LED_CTL_START_WPS_BOTTON: if (pLed->bLedWPSBlinkInProgress == false) { if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } pLed->bLedWPSBlinkInProgress = true; pLed->CurrLedState = LED_ON; pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); } break; @@ -1182,14 +1189,16 @@ static void SwLedControlMode2(struct _adapter *padapter, pLed->bLedWPSBlinkInProgress = false; pLed->CurrLedState = LED_ON; pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); break; case LED_CTL_STOP_WPS_FAIL: pLed->bLedWPSBlinkInProgress = false; pLed->CurrLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); break; case LED_CTL_START_TO_LINK: @@ -1197,25 +1206,27 @@ static void SwLedControlMode2(struct _adapter *padapter, if (!IS_LED_BLINKING(pLed)) { pLed->CurrLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); } break; case LED_CTL_POWER_OFF: pLed->CurrLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF; if (pLed->bLedBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); break; default: break; @@ -1237,7 +1248,7 @@ static void SwLedControlMode3(struct _adapter *padapter, if (IS_LED_WPS_BLINKING(pLed)) return; if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } pLed->bLedScanBlinkInProgress = true; @@ -1247,8 +1258,8 @@ static void SwLedControlMode3(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_CTL_TX: @@ -1265,8 +1276,8 @@ static void SwLedControlMode3(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; case LED_CTL_LINK: @@ -1275,24 +1286,25 @@ static void SwLedControlMode3(struct _adapter *padapter, pLed->CurrLedState = LED_ON; pLed->BlinkingLedState = LED_ON; if (pLed->bLedBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); break; case LED_CTL_START_WPS: /* wait until xinpin finish */ case LED_CTL_START_WPS_BOTTON: if (pLed->bLedWPSBlinkInProgress == false) { if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } pLed->bLedWPSBlinkInProgress = true; @@ -1301,59 +1313,63 @@ static void SwLedControlMode3(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_CTL_STOP_WPS: if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&(pLed->BlinkTimer)); pLed->bLedWPSBlinkInProgress = false; } else pLed->bLedWPSBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_WPS_STOP; if (pLed->bLedOn) { pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA)); } else { pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); } break; case LED_CTL_STOP_WPS_FAIL: if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } pLed->CurrLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); break; case LED_CTL_START_TO_LINK: case LED_CTL_NO_LINK: if (!IS_LED_BLINKING(pLed)) { pLed->CurrLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); } break; case LED_CTL_POWER_OFF: pLed->CurrLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF; if (pLed->bLedBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); break; default: break; @@ -1372,34 +1388,35 @@ static void SwLedControlMode4(struct _adapter *padapter, case LED_CTL_START_TO_LINK: if (pLed1->bLedWPSBlinkInProgress) { pLed1->bLedWPSBlinkInProgress = false; - _cancel_timer_ex(&(pLed1->BlinkTimer)); + del_timer_sync(&pLed1->BlinkTimer); pLed1->BlinkingLedState = LED_OFF; pLed1->CurrLedState = LED_OFF; if (pLed1->bLedOn) - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); } if (pLed->bLedStartToLinkBlinkInProgress == false) { if (pLed->CurrLedState == LED_SCAN_BLINK || IS_LED_WPS_BLINKING(pLed)) return; if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedNoLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } pLed->bLedStartToLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_StartToBlink; if (pLed->bLedOn) { pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SLOWLY_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SLOWLY_INTERVAL)); } else { pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NORMAL_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NORMAL_INTERVAL)); } } break; @@ -1409,11 +1426,12 @@ static void SwLedControlMode4(struct _adapter *padapter, if (LedAction == LED_CTL_LINK) { if (pLed1->bLedWPSBlinkInProgress) { pLed1->bLedWPSBlinkInProgress = false; - _cancel_timer_ex(&(pLed1->BlinkTimer)); + del_timer_sync(&pLed1->BlinkTimer); pLed1->BlinkingLedState = LED_OFF; pLed1->CurrLedState = LED_OFF; if (pLed1->bLedOn) - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); } } if (pLed->bLedNoLinkBlinkInProgress == false) { @@ -1421,7 +1439,7 @@ static void SwLedControlMode4(struct _adapter *padapter, IS_LED_WPS_BLINKING(pLed)) return; if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } pLed->bLedNoLinkBlinkInProgress = true; @@ -1430,8 +1448,8 @@ static void SwLedControlMode4(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); } break; case LED_CTL_SITE_SURVEY: @@ -1442,11 +1460,11 @@ static void SwLedControlMode4(struct _adapter *padapter, if (IS_LED_WPS_BLINKING(pLed)) return; if (pLed->bLedNoLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } pLed->bLedScanBlinkInProgress = true; @@ -1456,8 +1474,8 @@ static void SwLedControlMode4(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_CTL_TX: @@ -1467,7 +1485,7 @@ static void SwLedControlMode4(struct _adapter *padapter, IS_LED_WPS_BLINKING(pLed)) return; if (pLed->bLedNoLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } pLed->bLedBlinkInProgress = true; @@ -1477,49 +1495,50 @@ static void SwLedControlMode4(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; case LED_CTL_START_WPS: /*wait until xinpin finish*/ case LED_CTL_START_WPS_BOTTON: if (pLed1->bLedWPSBlinkInProgress) { pLed1->bLedWPSBlinkInProgress = false; - _cancel_timer_ex(&(pLed1->BlinkTimer)); + del_timer_sync(&(pLed1->BlinkTimer)); pLed1->BlinkingLedState = LED_OFF; pLed1->CurrLedState = LED_OFF; if (pLed1->bLedOn) - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); } if (pLed->bLedWPSBlinkInProgress == false) { if (pLed->bLedNoLinkBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } pLed->bLedWPSBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_WPS; if (pLed->bLedOn) { pLed->BlinkingLedState = LED_OFF; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SLOWLY_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SLOWLY_INTERVAL)); } else { pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NORMAL_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NORMAL_INTERVAL)); } } break; case LED_CTL_STOP_WPS: /*WPS connect success*/ if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } pLed->bLedNoLinkBlinkInProgress = true; @@ -1528,12 +1547,12 @@ static void SwLedControlMode4(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); break; case LED_CTL_STOP_WPS_FAIL: /*WPS authentication fail*/ if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } pLed->bLedNoLinkBlinkInProgress = true; @@ -1542,11 +1561,11 @@ static void SwLedControlMode4(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); /*LED1 settings*/ if (pLed1->bLedWPSBlinkInProgress) - _cancel_timer_ex(&(pLed1->BlinkTimer)); + del_timer_sync(&pLed1->BlinkTimer); else pLed1->bLedWPSBlinkInProgress = true; pLed1->CurrLedState = LED_BLINK_WPS_STOP; @@ -1554,11 +1573,12 @@ static void SwLedControlMode4(struct _adapter *padapter, pLed1->BlinkingLedState = LED_OFF; else pLed1->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NORMAL_INTERVAL)); break; case LED_CTL_STOP_WPS_FAIL_OVERLAP: /*WPS session overlap*/ if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } pLed->bLedNoLinkBlinkInProgress = true; @@ -1567,11 +1587,11 @@ static void SwLedControlMode4(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_NO_LINK_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); /*LED1 settings*/ if (pLed1->bLedWPSBlinkInProgress) - _cancel_timer_ex(&(pLed1->BlinkTimer)); + del_timer_sync(&pLed1->BlinkTimer); else pLed1->bLedWPSBlinkInProgress = true; pLed1->CurrLedState = LED_BLINK_WPS_STOP_OVERLAP; @@ -1580,37 +1600,38 @@ static void SwLedControlMode4(struct _adapter *padapter, pLed1->BlinkingLedState = LED_OFF; else pLed1->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_NORMAL_INTERVAL)); break; case LED_CTL_POWER_OFF: pLed->CurrLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF; if (pLed->bLedNoLinkBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; } if (pLed->bLedLinkBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedLinkBlinkInProgress = false; } if (pLed->bLedBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } if (pLed->bLedScanBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedScanBlinkInProgress = false; } if (pLed->bLedStartToLinkBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedStartToLinkBlinkInProgress = false; } if (pLed1->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed1->BlinkTimer)); + del_timer_sync(&pLed1->BlinkTimer); pLed1->bLedWPSBlinkInProgress = false; } pLed1->BlinkingLedState = LED_UNKNOWN; @@ -1641,7 +1662,8 @@ static void SwLedControlMode5(struct _adapter *padapter, pLed->CurrLedState = LED_ON; pLed->BlinkingLedState = LED_ON; pLed->bLedBlinkInProgress = false; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); break; case LED_CTL_SITE_SURVEY: if ((pmlmepriv->sitesurveyctrl.traffic_busy) && @@ -1649,7 +1671,7 @@ static void SwLedControlMode5(struct _adapter *padapter, ; /* dummy branch */ else if (pLed->bLedScanBlinkInProgress == false) { if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } pLed->bLedScanBlinkInProgress = true; @@ -1659,8 +1681,8 @@ static void SwLedControlMode5(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_CTL_TX: @@ -1675,15 +1697,15 @@ static void SwLedControlMode5(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; case LED_CTL_POWER_OFF: pLed->CurrLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF; if (pLed->bLedBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } SwLedOff(padapter, pLed); @@ -1711,7 +1733,7 @@ static void SwLedControlMode6(struct _adapter *padapter, pLed->CurrLedState = LED_ON; pLed->BlinkingLedState = LED_ON; pLed->bLedBlinkInProgress = false; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&(pLed->BlinkTimer), jiffies + msecs_to_jiffies(0)); break; case LED_CTL_TX: case LED_CTL_RX: @@ -1726,15 +1748,15 @@ static void SwLedControlMode6(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_FASTER_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); } break; case LED_CTL_START_WPS: /*wait until xinpin finish*/ case LED_CTL_START_WPS_BOTTON: if (pLed->bLedWPSBlinkInProgress == false) { if (pLed->bLedBlinkInProgress == true) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } pLed->bLedWPSBlinkInProgress = true; @@ -1743,29 +1765,30 @@ static void SwLedControlMode6(struct _adapter *padapter, pLed->BlinkingLedState = LED_OFF; else pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), - LED_BLINK_SCAN_INTERVAL_ALPHA); + mod_timer(&pLed->BlinkTimer, jiffies + + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); } break; case LED_CTL_STOP_WPS_FAIL: case LED_CTL_STOP_WPS: if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } pLed->CurrLedState = LED_ON; pLed->BlinkingLedState = LED_ON; - _set_timer(&(pLed->BlinkTimer), 0); + mod_timer(&pLed->BlinkTimer, + jiffies + msecs_to_jiffies(0)); break; case LED_CTL_POWER_OFF: pLed->CurrLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF; if (pLed->bLedBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedBlinkInProgress = false; } if (pLed->bLedWPSBlinkInProgress) { - _cancel_timer_ex(&(pLed->BlinkTimer)); + del_timer_sync(&pLed->BlinkTimer); pLed->bLedWPSBlinkInProgress = false; } SwLedOff(padapter, pLed); |