This source file includes following definitions.
- sw_led_on
- sw_led_off
- rtw_hal_sw_led_init
- rtw_hal_sw_led_deinit
1
2
3
4
5
6
7
8 #include <osdep_service.h>
9 #include <drv_types.h>
10 #include <rtl8188e_hal.h>
11 #include <usb_ops_linux.h>
12
13 void sw_led_on(struct adapter *padapter, struct LED_871x *pLed)
14 {
15 u8 led_cfg;
16
17 if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
18 return;
19 led_cfg = usb_read8(padapter, REG_LEDCFG2);
20 usb_write8(padapter, REG_LEDCFG2, (led_cfg & 0xf0) | BIT(5) | BIT(6));
21 pLed->bLedOn = true;
22 }
23
24 void sw_led_off(struct adapter *padapter, struct LED_871x *pLed)
25 {
26 u8 led_cfg;
27
28 if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
29 goto exit;
30
31 led_cfg = usb_read8(padapter, REG_LEDCFG2);
32
33
34 led_cfg &= 0x90;
35 usb_write8(padapter, REG_LEDCFG2, (led_cfg | BIT(3)));
36 led_cfg = usb_read8(padapter, REG_MAC_PINMUX_CFG);
37 led_cfg &= 0xFE;
38 usb_write8(padapter, REG_MAC_PINMUX_CFG, led_cfg);
39 exit:
40 pLed->bLedOn = false;
41 }
42
43 void rtw_hal_sw_led_init(struct adapter *padapter)
44 {
45 struct led_priv *pledpriv = &padapter->ledpriv;
46
47 InitLed871x(padapter, &pledpriv->sw_led);
48 }
49
50 void rtw_hal_sw_led_deinit(struct adapter *padapter)
51 {
52 struct led_priv *ledpriv = &padapter->ledpriv;
53
54 DeInitLed871x(&ledpriv->sw_led);
55 }