1 /****************************************************************************** 2 * 3 * Copyright(c) 2019 - 2020 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_CMD_FSM_H__ 16 #define __PHL_CMD_FSM_H__ 17 18 #include "phl_cmd_job.h" 19 20 /* Header file for application to invoke command service */ 21 22 struct phl_cmd_job; 23 struct job_hdl_ent; 24 struct fsm_root; 25 struct fsm_main; 26 struct _cmd_obj; 27 28 struct _cmd_obj { 29 struct fsm_main *fsm; 30 struct phl_info_t *phl_info; 31 struct fsm_obj *fsm_obj; 32 struct job_hdl_ent *job_tbl; 33 34 u8 wdog_pwr_level; 35 u32 wdog_pause_num; 36 bool has_power; 37 38 struct list_head wd_q; 39 _os_mutex wd_q_lock; 40 }; 41 42 /* function form command service management */ 43 struct fsm_main *phl_cmd_new_fsm(struct fsm_root *fsm_m, 44 struct phl_info_t *phl_info); 45 void phl_cmd_destory_fsm(struct fsm_main *fsm); 46 struct _cmd_obj *phl_cmd_new_obj(struct fsm_main *fsm, 47 struct phl_info_t *phl_info); 48 void phl_cmd_destory_obj(struct _cmd_obj *pcmd); 49 void phl_fsm_cmd_stop(struct phl_info_t *phl_info); 50 51 /* function form command service */ 52 enum rtw_phl_status phl_cmd_start(struct _cmd_obj *pcmd); 53 enum rtw_phl_status phl_cmd_cancel(struct _cmd_obj *pcmd); 54 55 #endif /* __PHL_CMD_FSM_H__ */ 56 57