hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/******************************************************************************
 *
 * Copyright(c) 2019 - 2020 Realtek Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 *****************************************************************************/
#ifndef __PHL_BTC_DEF_H__
#define __PHL_BTC_DEF_H__
 
#define RTW_PHL_BTC_CTRL_BUF 40
#define RTW_PHL_BTC_FWINFO_BUF 1800
 
 
/*****************************************
 * Please contact the member of BTC submodule if you
 * need to revise this section
 *****************************************/
#define RTW_BTINFO_MAXLEN 10
#define RTW_SCBD_MAXLEN 10
 
#define BTC_C2H_CAT 2 /* C2H Category for OutSrc */
#define BTC_CLASS_MIN 0x10
#define BTC_CLASS_FEV 0x12
#define BTC_CLASS_MAX 0x17
 
enum {
   BTC_FEV_REPORT = 0,
   BTC_FEV_BT_INFO = 1,
   BTC_FEV_BT_SCBD = 2,
   BTC_FEV_BT_REG = 3
};
/*****************************************/
 
enum {
   BTC_HMSG_TMR_EN = 0x0,
   BTC_HMSG_BT_REG_READBACK = 0x1,
   BTC_HMSG_SET_BT_REQ_SLOT = 0x2,
   BTC_HMSG_FW_EV = 0x3,
   BTC_HMSG_BT_LINK_CHG = 0x4,
   BTC_HMSG_SET_BT_REQ_STBC = 0x5,
   BTC_HMSG_MAX
};
 
enum {
   BTC_CTRL_TYPE_MANUAL,
   BTC_CTRL_TYPE_EN_REPORT,
   BTC_CTRL_TYPE_SET_SLOTS,
   BTC_CTRL_TYPE_SET_MREGS,
   BTC_CTRL_TYPE_SET_TDMA,
   BTC_CTRL_TYPE_SET_1SLOT,
   BTC_CTRL_TYPE_SET_POLICY,
   BTC_CTRL_TYPE_SET_GPIO_DBG,
   BTC_CTRL_TYPE_SEND_HUB_MSG,
   BTC_CTRL_TYPE_TEST,
   BTC_CTRL_TYPE_MAX
};
 
enum {
   BTC_TIMER_PERIODIC,
   BTC_TIMER_WL_SPECPKT,
   BTC_TIMER_WL_RFKTO,
   BTC_TIMER_BT_A2DPPLAY,
   BTC_TIMER_WL_LPS_EXIT,
   BTC_TIMER_EVENT_1,
   BTC_TIMER_EVENT_2,
   BTC_TIMER_EVENT_3,
   BTC_TIMER_MAX
};
 
enum RTW_PHL_BTC_CTRL_TYPE {
   PHL_BTC_CTRL_MANUAL,
   PHL_BTC_CTRL_MAX
};
 
enum {
   PHL_BTC_CNTFY_BTINFO,
   PHL_BTC_PKTOFLD_NTFY,
   PHL_BTC_CNTFY_MAX
};
 
enum PHL_BTC_NTFY_REASON {
   PHL_BTC_NTFY_RSN_PERIOTIC
};
 
enum RTW_PHL_BTC_NOTIFY {
   PHL_BTC_NTFY_SCAN_START,
   PHL_BTC_NTFY_SCAN_STOP,
   PHL_BTC_NTFY_COEX_INFO,
   PHL_BTC_NTFY_ROLE_INFO,
   PHL_BTC_NTFY_CTRL,
   PHL_BTC_NTFY_FWINFO,
   PHL_BTC_NTFY_RADIO_STATE,
   PHL_BTC_NTFY_WLSTA,
   PHL_BTC_NTFY_PACKET_EVT,
   PHL_BTC_NTFY_TIMER,
   PHL_BTC_NTFY_MAX
};
 
enum {
   BTC_MODE_NORMAL,
   BTC_MODE_WL,
   BTC_MODE_BT,
   BTC_MODE_WLOFF,
   BTC_MODE_COTX,
   BTC_MODE_MECHANISM_INIT,
   BTC_MODE_MAX
};
 
enum {
   BTC_RFCTRL_WL_OFF,
   BTC_RFCTRL_WL_ON,
   BTC_RFCTRL_LPS_WL_ON,
   BTC_RFCTRL_FW_CTRL,
   BTC_RFCTRL_RESUME_DL_FW,
   BTC_RFCTRL_MAX
};
 
struct rtw_phl_btc_ops {
   void (*print)(const char *msg);
};
 
struct rtw_phl_btc_coex_info_param {
   u8 query_type;
};
 
struct rtw_phl_btc_role_info_param {
   u8 role_id;
   enum role_state rstate;
};
 
struct rtw_phl_btc_wl_sta_param {
   u8 role_id;
   u16 mac_id;
   u8 reason;
};
 
struct rtw_phl_btc_pkt_param {
   u8 role_id;
   u8 pkt_evt_type;
};
 
struct rtw_phl_btc_ctrl_param {
   u8 type;
   u16 len;
   u8 buf[RTW_PHL_BTC_CTRL_BUF];
};
 
struct rtw_phl_btc_fwinfo_param {
   u8 c2h_class;
   u8 c2h_func;
};
 
struct rtw_phl_btc_radio_state_param {
   u8 rf_on;
};
 
struct rtw_phl_btc_tmr_param {
   void *timer;
};
 
struct rtw_phl_btc_ntfy {
   enum RTW_PHL_BTC_NOTIFY notify;
   struct rtw_phl_btc_ops *ops;
 
   /* real parameter for different notifications */
   union {
       struct rtw_phl_btc_coex_info_param cinfo;
       struct rtw_phl_btc_role_info_param rinfo;
       struct rtw_phl_btc_ctrl_param ctrl;
       struct rtw_phl_btc_radio_state_param rfst;
       struct rtw_phl_btc_fwinfo_param finfo;
       struct rtw_phl_btc_wl_sta_param wsta;
       struct rtw_phl_btc_pkt_param pkt;
       struct rtw_phl_btc_tmr_param tmr;
   } u;
 
   void *priv;
   int (*ntfy_cb)(void *priv, enum RTW_PHL_BTC_NOTIFY ntfy,
       struct rtw_phl_btc_ntfy *info);
};
 
#endif /* __PHL_BTC_DEF_H__ */