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_MCC_DEF_H_ 16 #define _PHL_MCC_DEF_H_ 17 /* MCC definition for public usage in phl layer */ 18 #ifdef CONFIG_MCC_SUPPORT 19 20 struct phl_com_mcc_info { 21 struct rtw_phl_mcc_ops ops; 22 }; 23 24 struct phl_mcc_dur_lim_req_info { 25 enum rtw_phl_mcc_dur_lim_tag tag; 26 bool enable; 27 u32 start_t_h; /*start time of Prohibit slot*/ 28 u32 start_t_l; 29 u32 dur; /*Prohibit time slot, unit: us*/ 30 u32 intvl; /*Prohibit internval, unit us*/ 31 }; 32 33 struct phl_tdmra_dur_change_info { 34 bool bt_role; 35 u8 hw_band; 36 struct rtw_wifi_role_t *role; 37 u16 dur; 38 }; 39 40 void rtw_phl_mcc_watchdog(struct phl_info_t *phl, u8 band_idx); 41 42 void rtw_phl_mcc_sta_entry_change(struct phl_info_t *phl, 43 struct rtw_wifi_role_t *wrole); 44 45 void phl_mcc_client_link_notify_for_ap(struct phl_info_t *phl, 46 struct rtw_wifi_role_t *wrole, enum role_state state); 47 48 enum rtw_phl_status rtw_phl_mcc_dur_lim_change(struct phl_info_t *phl, 49 struct rtw_wifi_role_t *wrole, 50 struct phl_mcc_dur_lim_req_info *lim_req); 51 52 bool rtw_phl_mcc_inprogress(struct phl_info_t *phl, u8 band_idx); 53 54 enum rtw_phl_status rtw_phl_mcc_reset(struct phl_info_t *phl, 55 u8 band_idx); 56 57 enum rtw_phl_status rtw_phl_mcc_recovery(struct phl_info_t *phl, 58 u8 band_idx); 59 60 enum rtw_phl_status rtw_phl_mcc_enable(struct phl_info_t *phl, 61 struct rtw_wifi_role_t *cur_role); 62 63 enum rtw_phl_status rtw_phl_mcc_disable(struct phl_info_t *phl, 64 struct rtw_wifi_role_t *spec_role); 65 66 enum rtw_phl_status rtw_phl_tdmra_duration_change(struct phl_info_t *phl, 67 struct phl_tdmra_dur_change_info *info); 68 69 enum rtw_phl_status rtw_phl_tdmra_enable(struct phl_info_t *phl, 70 struct rtw_wifi_role_t *cur_role); 71 72 enum rtw_phl_status rtw_phl_tdmra_disable(struct phl_info_t *phl, 73 struct rtw_wifi_role_t *spec_role); 74 75 enum rtw_phl_status rtw_phl_mcc_init_ops(struct phl_info_t *phl, struct rtw_phl_mcc_ops *ops); 76 77 enum rtw_phl_status rtw_phl_mcc_init(struct phl_info_t *phl); 78 79 void rtw_phl_mcc_deinit(struct phl_info_t *phl); 80 81 bool rtw_phl_mcc_get_dbg_info(struct phl_info_t *phl, u8 band_idx, 82 enum rtw_phl_mcc_dbg_type type, void *info); 83 84 #else /* CONFIG_MCC_SUPPORT ==0 */ 85 #define rtw_phl_mcc_watchdog(_phl, _band_idx) 86 #define phl_mcc_client_link_notify_for_ap(_phl, _wrole, _state) 87 #define rtw_phl_mcc_enable(_phl,_cur_role) RTW_PHL_STATUS_FAILURE 88 #define rtw_phl_mcc_disable(_phl,_spec_role) RTW_PHL_STATUS_FAILURE 89 #define rtw_phl_mcc_init_ops(_phl, _ops) RTW_PHL_STATUS_FAILURE 90 #define rtw_phl_mcc_init(_phl) RTW_PHL_STATUS_FAILURE 91 #define rtw_phl_mcc_deinit(_phl) 92 #define rtw_phl_mcc_inprogress(_phl, _band_idx) false 93 #define rtw_phl_mcc_reset(_phl, _band_idx) RTW_PHL_STATUS_SUCCESS 94 #define rtw_phl_mcc_recovery(_phl, _band_idx) RTW_PHL_STATUS_SUCCESS 95 #define rtw_phl_tdmra_duration_change(_phl, _info) RTW_PHL_STATUS_FAILURE 96 #define rtw_phl_tdmra_enable(_phl, _cur_role) RTW_PHL_STATUS_FAILURE 97 #define rtw_phl_tdmra_disable(_phl, _spec_role) RTW_PHL_STATUS_FAILURE 98 #define rtw_phl_mcc_sta_entry_change(_phl, _wrole); 99 100 #endif /* CONFIG_MCC_SUPPORT */ 101 #endif /*_PHL_MCC_DEF_H_*/ 102