1 /****************************************************************************** 2 * 3 * Copyright(c) 2019 Realtek Corporation. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of version 2 of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * 9 * This program is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 * more details. 13 * 14 *****************************************************************************/ 15 #ifndef _PHL_LED_DEF_H_ 16 #define _PHL_LED_DEF_H_ 17 18 #define PHL_RADIO_ON_OFF_NOT_READY 19 20 enum rtw_led_ctrl_mode { 21 RTW_LED_CTRL_NOT_SUPPORT, 22 RTW_LED_CTRL_HW_TRX_MODE, 23 RTW_LED_CTRL_HW_TX_MODE, 24 RTW_LED_CTRL_HW_RX_MODE, 25 RTW_LED_CTRL_SW_PP_MODE, 26 RTW_LED_CTRL_SW_OD_MODE, 27 }; 28 29 enum rtw_led_id { RTW_LED_ID_0, RTW_LED_ID_1, RTW_LED_ID_LENGTH }; 30 31 #define RTW_LED_TIMER_LENGTH (RTW_LED_ID_LENGTH + 1) 32 33 /* 34 * led_event here is not integrated with msg_evt_id due to the following reason: 35 * 36 * (a) led_event is used for mapping LED events with LED actions, and 37 * the mapping can be configured in core layer according to the 38 * customized LED table. 39 * 40 * (b) LED module inside uses led_event as the index of led action 41 * arrays, and hence it would be inappropriate to directly replace 42 * led_event with msg_evt_id which is not continuous and does not 43 * start from zero. 44 */ 45 enum rtw_led_event { 46 RTW_LED_EVENT_PHL_START, 47 RTW_LED_EVENT_PHL_STOP, 48 RTW_LED_EVENT_SW_RF_ON, 49 RTW_LED_EVENT_SW_RF_OFF, 50 RTW_LED_EVENT_SCAN_START, 51 RTW_LED_EVENT_LINK_START, 52 RTW_LED_EVENT_LINKED, 53 RTW_LED_EVENT_NO_LINK, 54 RTW_LED_EVENT_LINKED_CIPHER, 55 RTW_LED_EVENT_LINKED_NOCIPHER, 56 RTW_LED_EVENT_LINKED_24G, 57 RTW_LED_EVENT_LINKED_5G, 58 RTW_LED_EVENT_LENGTH 59 }; 60 61 enum rtw_led_state { 62 RTW_LED_STATE_IGNORE = BIT0, 63 RTW_LED_STATE_SW_RF_ON = BIT1, 64 }; 65 66 enum rtw_led_action { 67 RTW_LED_ACTION_LOW, 68 RTW_LED_ACTION_HIGH, 69 RTW_LED_ACTION_HW_TRX, 70 RTW_LED_ACTION_TOGGLE, 71 }; 72 73 enum rtw_led_opt { 74 RTW_LED_OPT_LOW = 0, 75 RTW_LED_OPT_HIGH = 1, 76 RTW_LED_OPT_UNKNOWN = 2 77 }; 78 79 struct rtw_led_toggle_args_t { 80 enum rtw_led_opt start_opt; 81 u32 start_delay; 82 u32 loop; 83 u8 intervals_idx; 84 }; 85 86 struct rtw_led_action_args_t { 87 enum rtw_led_id led_id; 88 enum rtw_led_action led_action; 89 struct rtw_led_toggle_args_t toggle_args; 90 }; 91 92 struct rtw_led_intervals_t { 93 u32 *interval_arr; 94 u8 len; 95 }; 96 97 #endif /*_PHL_LED_DEF_H_*/ 98