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_BTC_DEF_H__ 16 #define __PHL_BTC_DEF_H__ 17 18 #define RTW_PHL_BTC_CTRL_BUF 40 19 #define RTW_PHL_BTC_FWINFO_BUF 1280 20 21 22 /***************************************** 23 * Please contact the member of BTC submodule if you 24 * need to revise this section 25 *****************************************/ 26 #define RTW_BTINFO_MAXLEN 10 27 #define RTW_SCBD_MAXLEN 10 28 29 #define BTC_C2H_CAT 2 /* C2H Category for OutSrc */ 30 #define BTC_CLASS_MIN 0x10 31 #define BTC_CLASS_FEV 0x12 32 #define BTC_CLASS_MAX 0x17 33 34 enum { 35 BTC_FEV_REPORT = 0, 36 BTC_FEV_BT_INFO = 1, 37 BTC_FEV_BT_SCBD = 2, 38 BTC_FEV_BT_REG = 3 39 }; 40 /*****************************************/ 41 42 enum { 43 BTC_HMSG_TMR_EN = 0x0, 44 BTC_HMSG_BT_REG_READBACK = 0x1, 45 BTC_HMSG_SET_BT_REQ_SLOT = 0x2, 46 BTC_HMSG_FW_EV = 0x3, 47 BTC_HMSG_BT_LINK_CHG = 0x4, 48 BTC_HMSG_SET_BT_REQ_STBC = 0x5, 49 BTC_HMSG_MAX 50 }; 51 52 enum { 53 BTC_CTRL_TYPE_MANUAL, 54 BTC_CTRL_TYPE_EN_REPORT, 55 BTC_CTRL_TYPE_SET_SLOTS, 56 BTC_CTRL_TYPE_SET_MREGS, 57 BTC_CTRL_TYPE_SET_TDMA, 58 BTC_CTRL_TYPE_SET_1SLOT, 59 BTC_CTRL_TYPE_SET_POLICY, 60 BTC_CTRL_TYPE_SET_GPIO_DBG, 61 BTC_CTRL_TYPE_SEND_HUB_MSG, 62 BTC_CTRL_TYPE_TEST, 63 BTC_CTRL_TYPE_MAX 64 }; 65 66 enum { 67 BTC_TIMER_PERIODIC, 68 BTC_TIMER_WL_SPECPKT, 69 BTC_TIMER_WL_RFKTO, 70 BTC_TIMER_BT_A2DPPLAY, 71 BTC_TIMER_MAX 72 }; 73 74 enum RTW_PHL_BTC_CTRL_TYPE { 75 PHL_BTC_CTRL_MANUAL, 76 PHL_BTC_CTRL_MAX 77 }; 78 79 enum { 80 PHL_BTC_CNTFY_BTINFO, 81 PHL_BTC_CNTFY_MAX 82 }; 83 84 enum PHL_BTC_NTFY_REASON { 85 PHL_BTC_NTFY_RSN_PERIOTIC 86 }; 87 88 enum RTW_PHL_BTC_NOTIFY { 89 PHL_BTC_NTFY_SCAN_START, 90 PHL_BTC_NTFY_SCAN_STOP, 91 PHL_BTC_NTFY_COEX_INFO, 92 PHL_BTC_NTFY_ROLE_INFO, 93 PHL_BTC_NTFY_CTRL, 94 PHL_BTC_NTFY_FWINFO, 95 PHL_BTC_NTFY_RADIO_STATE, 96 PHL_BTC_NTFY_WLSTA, 97 PHL_BTC_NTFY_PACKET_EVT, 98 PHL_BTC_NTFY_TIMER, 99 PHL_BTC_NTFY_MAX 100 }; 101 102 enum { 103 BTC_MODE_NORMAL, 104 BTC_MODE_WL, 105 BTC_MODE_BT, 106 BTC_MODE_WLOFF, 107 BTC_MODE_MAX 108 }; 109 110 enum { 111 BTC_RFCTRL_WL_OFF, 112 BTC_RFCTRL_WL_ON, 113 BTC_RFCTRL_LPS_WL_ON, 114 BTC_RFCTRL_FW_CTRL, 115 BTC_RFCTRL_MAX 116 }; 117 118 struct rtw_phl_btc_ops { 119 void (*print)(const char *msg); 120 }; 121 122 struct rtw_phl_btc_coex_info_param { 123 u8 query_type; 124 }; 125 126 struct rtw_phl_btc_role_info_param { 127 u8 role_id; 128 enum role_state rstate; 129 }; 130 131 struct rtw_phl_btc_wl_sta_param { 132 u8 role_id; 133 u16 mac_id; 134 u8 reason; 135 }; 136 137 struct rtw_phl_btc_pkt_param { 138 u8 role_id; 139 u8 pkt_evt_type; 140 }; 141 142 struct rtw_phl_btc_ctrl_param { 143 u8 type; 144 u16 len; 145 u8 buf[RTW_PHL_BTC_CTRL_BUF]; 146 }; 147 148 struct rtw_phl_btc_fwinfo_param { 149 u8 c2h_class; 150 u8 c2h_func; 151 }; 152 153 struct rtw_phl_btc_radio_state_param { 154 u8 rf_on; 155 }; 156 157 struct rtw_phl_btc_tmr_param { 158 void *timer; 159 }; 160 161 struct rtw_phl_btc_ntfy { 162 enum RTW_PHL_BTC_NOTIFY notify; 163 struct rtw_phl_btc_ops *ops; 164 165 /* real parameter for different notifications */ 166 union { 167 struct rtw_phl_btc_coex_info_param cinfo; 168 struct rtw_phl_btc_role_info_param rinfo; 169 struct rtw_phl_btc_ctrl_param ctrl; 170 struct rtw_phl_btc_radio_state_param rfst; 171 struct rtw_phl_btc_fwinfo_param finfo; 172 struct rtw_phl_btc_wl_sta_param wsta; 173 struct rtw_phl_btc_pkt_param pkt; 174 struct rtw_phl_btc_tmr_param tmr; 175 } u; 176 177 void *priv; 178 int (*ntfy_cb)(void *priv, enum RTW_PHL_BTC_NOTIFY ntfy, 179 struct rtw_phl_btc_ntfy *info); 180 }; 181 182 #endif /* __PHL_BTC_DEF_H__ */ 183