// SPDX-License-Identifier: GPL-2.0 /****************************************************************************** * rtl8712_led.c * * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. * Linux device driver for RTL8192SU * * Modifications for inclusion into the Linux staging tree are * Copyright(c) 2010 Larry Finger. All rights reserved. * * Contact information: * WLAN FAE <[email protected]> * Larry Finger <[email protected]> * ******************************************************************************/ #include "drv_types.h" /*=========================================================================== * Constant. *=========================================================================== * * Default LED behavior. */ #define LED_BLINK_NORMAL_INTERVAL … #define LED_BLINK_SLOWLY_INTERVAL … #define LED_BLINK_LONG_INTERVAL … #define LED_BLINK_NO_LINK_INTERVAL_ALPHA … #define LED_BLINK_LINK_INTERVAL_ALPHA … #define LED_BLINK_SCAN_INTERVAL_ALPHA … #define LED_BLINK_FASTER_INTERVAL_ALPHA … #define LED_BLINK_WPS_SUCCESS_INTERVAL_ALPHA … /*=========================================================================== * LED object. *=========================================================================== */ enum _LED_STATE_871x { … }; /*=========================================================================== * Prototype of protected function. *=========================================================================== */ static void BlinkTimerCallback(struct timer_list *t); static void BlinkWorkItemCallback(struct work_struct *work); /*=========================================================================== * LED_819xUsb routines. *=========================================================================== * * * * Description: * Initialize an LED_871x object. */ static void InitLed871x(struct _adapter *padapter, struct LED_871x *pLed, enum LED_PIN_871x LedPin) { … } /* * Description: * DeInitialize an LED_871x object. */ static void DeInitLed871x(struct LED_871x *pLed) { … } /* * Description: * Turn on LED according to LedPin specified. */ static void SwLedOn(struct _adapter *padapter, struct LED_871x *pLed) { … } /* * Description: * Turn off LED according to LedPin specified. */ static void SwLedOff(struct _adapter *padapter, struct LED_871x *pLed) { … } /*=========================================================================== * Interface to manipulate LED objects. *=========================================================================== * * Description: * Initialize all LED_871x objects. */ void r8712_InitSwLeds(struct _adapter *padapter) { … } /* Description: * DeInitialize all LED_819xUsb objects. */ void r8712_DeInitSwLeds(struct _adapter *padapter) { … } /* Description: * Implementation of LED blinking behavior. * It toggle off LED and schedule corresponding timer if necessary. */ static void SwLedBlink(struct LED_871x *pLed) { … } static void SwLedBlink1(struct LED_871x *pLed) { … } static void SwLedBlink2(struct LED_871x *pLed) { … } static void SwLedBlink3(struct LED_871x *pLed) { … } static void SwLedBlink4(struct LED_871x *pLed) { … } static void SwLedBlink5(struct LED_871x *pLed) { … } static void SwLedBlink6(struct LED_871x *pLed) { … } /* Description: * Callback function of LED BlinkTimer, * it just schedules to corresponding BlinkWorkItem. */ static void BlinkTimerCallback(struct timer_list *t) { … } /* Description: * Callback function of LED BlinkWorkItem. * We dispatch actual LED blink action according to LedStrategy. */ static void BlinkWorkItemCallback(struct work_struct *work) { … } /*============================================================================ * Default LED behavior. *============================================================================ * * Description: * Implement each led action for SW_LED_MODE0. * This is default strategy. */ static void SwLedControlMode1(struct _adapter *padapter, enum LED_CTL_MODE LedAction) { … } static void SwLedControlMode2(struct _adapter *padapter, enum LED_CTL_MODE LedAction) { … } static void SwLedControlMode3(struct _adapter *padapter, enum LED_CTL_MODE LedAction) { … } static void SwLedControlMode4(struct _adapter *padapter, enum LED_CTL_MODE LedAction) { … } static void SwLedControlMode5(struct _adapter *padapter, enum LED_CTL_MODE LedAction) { … } static void SwLedControlMode6(struct _adapter *padapter, enum LED_CTL_MODE LedAction) { … } /* Description: * Dispatch LED action according to pHalData->LedStrategy. */ void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction) { … } void r8712_flush_led_works(struct _adapter *padapter) { … }