Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/include/cmn_info/rtw_sta_info.h
1307 views
1
/******************************************************************************
2
*
3
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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
* You should have received a copy of the GNU General Public License along with
15
* this program; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17
*
18
*
19
******************************************************************************/
20
21
/*This header file is for all driver teams to use the same station info.
22
If you want to change this file please make sure notify all driver teams maintainers.*/
23
24
/*Created by YuChen 20170301*/
25
26
#ifndef __INC_RTW_STA_INFO_H
27
#define __INC_RTW_STA_INFO_H
28
29
/*--------------------Define ---------------------------------------*/
30
31
#define STA_DM_CTRL_ACTIVE BIT(0)
32
#define STA_DM_CTRL_CFO_TRACKING BIT(1)
33
34
#ifdef CONFIG_BEAMFORMING
35
#define BEAMFORMING_HT_BEAMFORMER_ENABLE BIT(0) /*Declare sta support beamformer*/
36
#define BEAMFORMING_HT_BEAMFORMEE_ENABLE BIT(1) /*Declare sta support beamformee*/
37
#define BEAMFORMING_HT_BEAMFORMER_TEST BIT(2) /*Transmiting Beamforming no matter the target supports it or not*/
38
#define BEAMFORMING_HT_BEAMFORMER_STEER_NUM (BIT(4)|BIT(5)) /*Sta Bfer's capability*/
39
#define BEAMFORMING_HT_BEAMFORMEE_CHNL_EST_CAP (BIT(6)|BIT(7)) /*Sta BFee's capability*/
40
41
#define BEAMFORMING_VHT_BEAMFORMER_ENABLE BIT(0) /*Declare sta support beamformer*/
42
#define BEAMFORMING_VHT_BEAMFORMEE_ENABLE BIT(1) /*Declare sta support beamformee*/
43
#define BEAMFORMING_VHT_MU_MIMO_AP_ENABLE BIT(2) /*Declare sta support MU beamformer*/
44
#define BEAMFORMING_VHT_MU_MIMO_STA_ENABLE BIT(3) /*Declare sta support MU beamformer*/
45
#define BEAMFORMING_VHT_BEAMFORMER_TEST BIT(4) /*Transmiting Beamforming no matter the target supports it or not*/
46
#define BEAMFORMING_VHT_BEAMFORMER_STS_CAP (BIT(8)|BIT(9)|BIT(10)) /*Sta BFee's capability*/
47
#define BEAMFORMING_VHT_BEAMFORMEE_SOUND_DIM (BIT(12)|BIT(13)|BIT(14)) /*Sta Bfer's capability*/
48
#endif
49
50
#define HT_STBC_EN BIT(0)
51
#define VHT_STBC_EN BIT(1)
52
53
#define HT_LDPC_EN BIT(0)
54
#define VHT_LDPC_EN BIT(1)
55
56
#define SM_PS_STATIC 0
57
#define SM_PS_DYNAMIC 1
58
#define SM_PS_INVALID 2
59
#define SM_PS_DISABLE 3
60
61
62
/*cmn_sta_info.ra_sta_info.txrx_state*/
63
#define TX_STATE 0
64
#define RX_STATE 1
65
#define BI_DIRECTION_STATE 2
66
67
/*--------------------Define Enum-----------------------------------*/
68
enum channel_width {
69
CHANNEL_WIDTH_20 = 0,
70
CHANNEL_WIDTH_40 = 1,
71
CHANNEL_WIDTH_80 = 2,
72
CHANNEL_WIDTH_160 = 3,
73
CHANNEL_WIDTH_80_80 = 4,
74
CHANNEL_WIDTH_5 = 5,
75
CHANNEL_WIDTH_10 = 6,
76
CHANNEL_WIDTH_MAX = 7,
77
};
78
79
enum rf_type {
80
RF_1T1R = 0,
81
RF_1T2R = 1,
82
RF_2T2R = 2,
83
RF_2T3R = 3,
84
RF_2T4R = 4,
85
RF_3T3R = 5,
86
RF_3T4R = 6,
87
RF_4T4R = 7,
88
RF_TYPE_MAX,
89
};
90
91
enum bb_path {
92
BB_PATH_NON = 0,
93
BB_PATH_A = 0x00000001,
94
BB_PATH_B = 0x00000002,
95
BB_PATH_C = 0x00000004,
96
BB_PATH_D = 0x00000008,
97
98
BB_PATH_AB = (BB_PATH_A | BB_PATH_B),
99
BB_PATH_AC = (BB_PATH_A | BB_PATH_C),
100
BB_PATH_AD = (BB_PATH_A | BB_PATH_D),
101
BB_PATH_BC = (BB_PATH_B | BB_PATH_C),
102
BB_PATH_BD = (BB_PATH_B | BB_PATH_D),
103
BB_PATH_CD = (BB_PATH_C | BB_PATH_D),
104
105
BB_PATH_ABC = (BB_PATH_A | BB_PATH_B | BB_PATH_C),
106
BB_PATH_ABD = (BB_PATH_A | BB_PATH_B | BB_PATH_D),
107
BB_PATH_ACD = (BB_PATH_A | BB_PATH_C | BB_PATH_D),
108
BB_PATH_BCD = (BB_PATH_B | BB_PATH_C | BB_PATH_D),
109
110
BB_PATH_ABCD = (BB_PATH_A | BB_PATH_B | BB_PATH_C | BB_PATH_D),
111
BB_PATH_AUTO = 0xff /*for path diversity*/
112
};
113
114
enum rf_path {
115
RF_PATH_A = 0,
116
RF_PATH_B = 1,
117
RF_PATH_C = 2,
118
RF_PATH_D = 3,
119
RF_PATH_AB,
120
RF_PATH_AC,
121
RF_PATH_AD,
122
RF_PATH_BC,
123
RF_PATH_BD,
124
RF_PATH_CD,
125
RF_PATH_ABC,
126
RF_PATH_ABD,
127
RF_PATH_ACD,
128
RF_PATH_BCD,
129
RF_PATH_ABCD,
130
};
131
132
enum rf_syn {
133
RF_SYN0 = 0,
134
RF_SYN1 = 1,
135
};
136
137
enum rfc_mode {
138
rfc_4x4 = 0,
139
rfc_2x2 = 1,
140
};
141
142
enum wireless_set {
143
WIRELESS_CCK = 0x00000001,
144
WIRELESS_OFDM = 0x00000002,
145
WIRELESS_HT = 0x00000004,
146
WIRELESS_VHT = 0x00000008,
147
};
148
149
/*--------------------Define MACRO---------------------------------*/
150
151
/*--------------------Define Struct-----------------------------------*/
152
153
#ifdef CONFIG_BEAMFORMING
154
struct bf_cmn_info {
155
u8 ht_beamform_cap; /*Sta capablity*/
156
u16 vht_beamform_cap; /*Sta capablity*/
157
u16 p_aid;
158
u8 g_id;
159
};
160
#endif
161
struct rssi_info {
162
s8 rssi;
163
s8 rssi_cck;
164
s8 rssi_ofdm;
165
u8 packet_map;
166
u8 ofdm_pkt_cnt;
167
u8 cck_pkt_cnt;
168
u16 cck_sum_power;
169
u8 is_send_rssi;
170
u8 valid_bit;
171
s16 rssi_acc; /*accumulate RSSI for per packet MA sum*/
172
};
173
174
struct ra_sta_info {
175
u8 rate_id; /*[PHYDM] ratr_idx*/
176
u8 rssi_level; /*[PHYDM]*/
177
u8 is_first_connect:1; /*[PHYDM] CE: ra_rpt_linked, AP: H2C_rssi_rpt*/
178
u8 is_support_sgi:1; /*[driver]*/
179
u8 is_vht_enable:2; /*[driver]*/
180
u8 disable_ra:1; /*[driver]*/
181
u8 disable_pt:1; /*[driver] remove is_disable_power_training*/
182
u8 txrx_state:2; /*[PHYDM] 0: Tx, 1:Rx, 2:bi-direction*/
183
u8 is_noisy:1; /*[PHYDM]*/
184
u8 curr_tx_rate; /*[PHYDM] FW->Driver*/
185
enum channel_width ra_bw_mode; /*[Driver] max bandwidth, for RA only*/
186
enum channel_width curr_tx_bw; /*[PHYDM] FW->Driver*/
187
u8 curr_retry_ratio; /*[PHYDM] FW->Driver*/
188
u64 ramask;
189
};
190
191
struct dtp_info {
192
u8 dyn_tx_power; /*Dynamic Tx power offset*/
193
u8 last_tx_power;
194
u8 sta_tx_high_power_lvl:4;
195
u8 sta_last_dtp_lvl:4;
196
};
197
198
struct cmn_sta_info {
199
u16 dm_ctrl; /*[Driver]*/
200
enum channel_width bw_mode; /*[Driver] max support BW*/
201
u8 mac_id; /*[Driver]*/
202
u8 mac_addr[6]; /*[Driver]*/
203
u16 aid; /*[Driver]*/
204
enum rf_type mimo_type; /*[Driver] sta XTXR*/
205
struct rssi_info rssi_stat; /*[PHYDM]*/
206
struct ra_sta_info ra_info; /*[Driver&PHYDM]*/
207
u16 tx_moving_average_tp; /*[Driver] tx average MBps*/
208
u16 rx_moving_average_tp; /*[Driver] rx average MBps*/
209
u8 stbc_en:2; /*[Driver] really transmitt STBC*/
210
u8 ldpc_en:2; /*[Driver] really transmitt LDPC*/
211
enum wireless_set support_wireless_set;/*[Driver]*/
212
#ifdef CONFIG_BEAMFORMING
213
struct bf_cmn_info bf_info; /*[Driver]*/
214
#endif
215
u8 sm_ps:2; /*[Driver]*/
216
struct dtp_info dtp_stat; /*[PHYDM] Dynamic Tx power offset*/
217
/*u8 pw2cca_over_TH_cnt;*/
218
/*u8 total_pw2cca_cnt;*/
219
};
220
221
struct phydm_phyinfo_fw_struct {
222
u8 rx_rssi[4]; /* RSSI in 0~100 index */
223
};
224
225
struct phydm_phyinfo_struct {
226
boolean physts_rpt_valid; /* @if physts_rpt_valid is false, please ignore the parsing result in this structure*/
227
u8 rx_pwdb_all;
228
u8 signal_quality; /* OFDM: signal_quality=rx_mimo_signal_quality[0], CCK: signal qualityin 0-100 index. */
229
u8 rx_mimo_signal_strength[4]; /* RSSI in 0~100 index */
230
s8 rx_mimo_signal_quality[4]; /* OFDM: per-path's EVM translate to 0~100% , no used for CCK*/
231
u8 rx_mimo_evm_dbm[4]; /* per-path's original EVM (dbm) */
232
s16 cfo_short[4]; /* per-path's cfo_short */
233
s16 cfo_tail[4]; /* per-path's cfo_tail */
234
s8 rx_power; /* in dBm Translate from PWdB */
235
s8 recv_signal_power; /* Real power in dBm for this packet, no beautification and aggregation. Keep this raw info to be used for the other procedures. */
236
u8 bt_rx_rssi_percentage;
237
u8 signal_strength; /* in 0-100 index. */
238
s8 rx_pwr[4]; /* per-path's pwdb */
239
s8 rx_snr[4]; /* per-path's SNR */
240
u8 ant_idx[4]; /*per-path's antenna index*/
241
/*ODM_PHY_STATUS_NEW_TYPE_SUPPORT*/
242
u8 rx_count:2; /* RX path counter---*/
243
u8 band_width:3;
244
u8 rxsc:4; /* sub-channel---*/
245
u8 channel; /* channel number---*/
246
u8 is_mu_packet:1; /* is MU packet or not---boolean*/
247
u8 is_beamformed:1; /* BF packet---boolean*/
248
u8 cnt_pw2cca;
249
u8 cnt_cca2agc_rdy;
250
/*ODM_PHY_STATUS_NEW_TYPE_SUPPORT*/
251
};
252
253
struct phydm_perpkt_info_struct {
254
u8 data_rate;
255
u8 station_id;
256
u8 is_cck_rate: 1;
257
u8 rate_ss:3; /*spatial stream of data rate*/
258
u8 is_packet_match_bssid:1; /*boolean*/
259
u8 is_packet_to_self:1; /*boolean*/
260
u8 is_packet_beacon:1; /*boolean*/
261
u8 is_to_self:1; /*boolean*/
262
u8 ppdu_cnt;
263
};
264
265
/*--------------------Export global variable----------------------------*/
266
267
/*--------------------Function declaration-----------------------------*/
268
269
#endif
270
271