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_WATCHDOG_H_ 16 #define _PHL_WATCHDOG_H_ 17 18 #define WDOG_PERIOD 2000 19 20 enum watchdog_state{ 21 WD_STATE_INIT, 22 WD_STATE_STARTED, 23 WD_STATE_STOP, 24 }; 25 26 struct phl_watchdog { 27 _os_timer wdog_timer; 28 enum watchdog_state state; 29 30 /* Only sw statistics or sw behavior or trigger FG cmd */ 31 void (*core_sw_wdog)(void *drv_priv); 32 33 /* I/O, tx behavior, request power, ... */ 34 void (*core_hw_wdog)(void *drv_priv); 35 u16 period; 36 }; 37 void 38 phl_watchdog_cmd_complete_hdl(struct phl_info_t *phl_info); 39 enum rtw_phl_status 40 phl_watchdog_hw_cmd_hdl(struct phl_info_t *phl_info, enum rtw_phl_status psts); 41 enum rtw_phl_status 42 phl_watchdog_sw_cmd_hdl(struct phl_info_t *phl_info, enum rtw_phl_status psts); 43 void rtw_phl_watchdog_stop(void *phl); 44 45 46 #ifdef CONFIG_FSM 47 void rtw_phl_watchdog_callback(void *phl); 48 #endif 49 50 #endif /*_PHL_WATCHDOG_H_*/ 51 52