xref: /wlan-driver/fw-api/fw/txmon_tlvs.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2022,2024 Qualcomm Innovation Center, Inc. All rights reserved.
3*5113495bSYour Name  *
4*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
5*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
6*5113495bSYour Name  * above copyright notice and this permission notice appear in all
7*5113495bSYour Name  * copies.
8*5113495bSYour Name  *
9*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
17*5113495bSYour Name  */
18*5113495bSYour Name 
19*5113495bSYour Name #ifndef _TXMON_TLVS_H_
20*5113495bSYour Name #define _TXMON_TLVS_H_
21*5113495bSYour Name 
22*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_M   0x0000ffff
23*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_S   0
24*5113495bSYour Name 
25*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_M   0xffff0000
26*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_S   16
27*5113495bSYour Name 
28*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_M            0x000000ff
29*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_S            0
30*5113495bSYour Name 
31*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_MHZ_M                 0x00ffff00
32*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_MHZ_S                 8
33*5113495bSYour Name 
34*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_M         0xffffffff
35*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_S         0
36*5113495bSYour Name 
37*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_M           0x000fffff
38*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_S           0
39*5113495bSYour Name 
40*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_SEQ_NUM_M   0x000007ff
41*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_SEQ_NUM_S   0
42*5113495bSYour Name 
43*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_HW_LINK_ID_M 0x00003800
44*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_HW_LINK_ID_S 11
45*5113495bSYour Name 
46*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_PACKET_ID_M 0x0007c000
47*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_PACKET_ID_S 14
48*5113495bSYour Name 
49*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_VALID_M     0x00080000
50*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_VALID_S     19
51*5113495bSYour Name 
52*5113495bSYour Name 
53*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_GET(_var) \
54*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_M) >> \
55*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_S)
56*5113495bSYour Name 
57*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_SET(_var, _val) \
58*5113495bSYour Name     do { \
59*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1, _val); \
60*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_S)); \
61*5113495bSYour Name     } while (0)
62*5113495bSYour Name 
63*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_GET(_var) \
64*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_M) >> \
65*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_S)
66*5113495bSYour Name 
67*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_SET(_var, _val) \
68*5113495bSYour Name     do { \
69*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2, _val); \
70*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_S)); \
71*5113495bSYour Name     } while (0)
72*5113495bSYour Name 
73*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_GET(_var) \
74*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_M) >> \
75*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_S)
76*5113495bSYour Name 
77*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_SET(_var, _val) \
78*5113495bSYour Name     do { \
79*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_PHY_MODE, _val); \
80*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_S)); \
81*5113495bSYour Name     } while (0)
82*5113495bSYour Name 
83*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_MHZ_GET(_var) \
84*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_MHZ_M) >> \
85*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_MHZ_S)
86*5113495bSYour Name 
87*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_MHZ_SET(_var, _val) \
88*5113495bSYour Name     do { \
89*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_MHZ, _val); \
90*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_MHZ_S)); \
91*5113495bSYour Name     } while (0)
92*5113495bSYour Name 
93*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_GET(_var) \
94*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_M) >> \
95*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_S)
96*5113495bSYour Name 
97*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_SET(_var, _val) \
98*5113495bSYour Name     do { \
99*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID, _val); \
100*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_S)); \
101*5113495bSYour Name     } while (0)
102*5113495bSYour Name 
103*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_GET(_var) \
104*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_M) >> \
105*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_S)
106*5113495bSYour Name 
107*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_SET(_var, _val) \
108*5113495bSYour Name     do { \
109*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE, _val); \
110*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_S)); \
111*5113495bSYour Name     } while (0)
112*5113495bSYour Name 
113*5113495bSYour Name 
114*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_SEQ_NUM_GET(_var) \
115*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_SEQ_NUM_M) >> \
116*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_SEQ_NUM_S)
117*5113495bSYour Name 
118*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_SEQ_NUM_SET(_var, _val) \
119*5113495bSYour Name     do { \
120*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_SEQ_NUM, _val); \
121*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_SEQ_NUM_S)); \
122*5113495bSYour Name     } while (0)
123*5113495bSYour Name 
124*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_HW_LINK_ID_GET(_var) \
125*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_HW_LINK_ID_M) >> \
126*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_HW_LINK_ID_S)
127*5113495bSYour Name 
128*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_HW_LINK_ID_SET(_var, _val) \
129*5113495bSYour Name     do { \
130*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_FW_COOKIEHW_LINK_ID, _val); \
131*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_HW_LINK_ID_S)); \
132*5113495bSYour Name     } while (0)
133*5113495bSYour Name 
134*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_PACKET_ID_GET(_var) \
135*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_PACKET_ID_M) >> \
136*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_PACKET_ID_S)
137*5113495bSYour Name 
138*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_PACKET_ID_SET(_var, _val) \
139*5113495bSYour Name     do { \
140*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_PACKET_ID, _val); \
141*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_PACKET_ID_S)); \
142*5113495bSYour Name     } while (0)
143*5113495bSYour Name 
144*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_VALID_GET(_var) \
145*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_VALID_M) >> \
146*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_VALID_S)
147*5113495bSYour Name 
148*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_VALID_SET(_var, _val) \
149*5113495bSYour Name     do { \
150*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_VALID, _val); \
151*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_FW_COOKIE_VALID_S)); \
152*5113495bSYour Name     } while (0)
153*5113495bSYour Name 
154*5113495bSYour Name 
155*5113495bSYour Name enum txmon_fw2sw_user_id {
156*5113495bSYour Name     TXMON_FW2SW_TYPE_FES_SETUP      = 0, /* Placed after  FES_SETUP */
157*5113495bSYour Name     TXMON_FW2SW_TYPE_FES_SETUP_USER = 1, /* Placed before FES_SETUP_COMPLETE */
158*5113495bSYour Name     TXMON_FW2SW_TYPE_FES_SETUP_EXT  = 2, /* Placed after  FES_SETUP_COMPLETE */
159*5113495bSYour Name     TXMON_FW2SW_TYPE_MAX            = 4
160*5113495bSYour Name };
161*5113495bSYour Name 
162*5113495bSYour Name typedef struct txmon_fw2sw_fes_setup {
163*5113495bSYour Name     A_UINT32 band_center_freq1  : 16,
164*5113495bSYour Name              band_center_freq2  : 16;
165*5113495bSYour Name     A_UINT32 phy_mode : 8,              /* this field is filled with WLAN_PHY_MODE enum value */
166*5113495bSYour Name              mhz      : 16,
167*5113495bSYour Name              reserved : 8;
168*5113495bSYour Name     A_UINT32 schedule_id;
169*5113495bSYour Name     A_UINT32 fw_cookie : 20,
170*5113495bSYour Name              rsvd      : 12;
171*5113495bSYour Name } txmon_fw2sw_fes_setup_t;
172*5113495bSYour Name 
173*5113495bSYour Name typedef struct txmon_fw2sw_fes_setup_ext {
174*5113495bSYour Name     A_UINT32 reserved;
175*5113495bSYour Name } txmon_fw2sw_fes_setup_ext_t;
176*5113495bSYour Name 
177*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_M        0x0000003f
178*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_S        0
179*5113495bSYour Name 
180*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_GET(_var) \
181*5113495bSYour Name     (((_var) & TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_M) >> \
182*5113495bSYour Name      TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_S)
183*5113495bSYour Name 
184*5113495bSYour Name #define TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_SET(_var, _val) \
185*5113495bSYour Name     do { \
186*5113495bSYour Name         HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID, _val); \
187*5113495bSYour Name         ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_S)); \
188*5113495bSYour Name     } while (0)
189*5113495bSYour Name 
190*5113495bSYour Name 
191*5113495bSYour Name typedef struct txmon_fw2sw_fes_setup_user {
192*5113495bSYour Name     A_UINT32 user_id  : 6,
193*5113495bSYour Name              reserved : 24;
194*5113495bSYour Name } txmon_fw2sw_fes_setup_user_t;
195*5113495bSYour Name 
196*5113495bSYour Name struct txmon_fw2sw_mon_fes_setup_tlv {
197*5113495bSYour Name     struct tlv_usr_32_hdr tag; /* tlv_usrid => TXMON_FW2SW_TYPE_FES_SETUP */
198*5113495bSYour Name     struct txmon_fw2sw_fes_setup setup;
199*5113495bSYour Name };
200*5113495bSYour Name 
201*5113495bSYour Name struct txmon_fw2sw_mon_fes_setup_ext_tlv {
202*5113495bSYour Name     struct tlv_usr_32_hdr tag; /* tlv_usrid => TXMON_FW2SW_TYPE_FES_SETUP_EXT*/
203*5113495bSYour Name     struct txmon_fw2sw_fes_setup_ext setup_ext;
204*5113495bSYour Name };
205*5113495bSYour Name 
206*5113495bSYour Name struct txmon_fw2sw_mon_fes_setup_user_tlv {
207*5113495bSYour Name     struct tlv_usr_32_hdr tag; /* tlv_usrid => TXMON_FW2SW_TYPE_FES_SETUP_USER */
208*5113495bSYour Name     struct txmon_fw2sw_fes_setup_user user_setup;
209*5113495bSYour Name };
210*5113495bSYour Name 
211*5113495bSYour Name #endif /* _TXMON_TLVS_H_ */
212