xref: /OK3568_Linux_fs/external/rkwifibt/drivers/bcmdhd/include/wl_bigdata.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Bigdata logging and report. None EWP and Hang event.
3  *
4  * Copyright (C) 2020, Broadcom.
5  *
6  *      Unless you and Broadcom execute a separate written software license
7  * agreement governing use of this software, this software is licensed to you
8  * under the terms of the GNU General Public License version 2 (the "GPL"),
9  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10  * following added to such license:
11  *
12  *      As a special exception, the copyright holders of this software give you
13  * permission to link this software with independent modules, and to copy and
14  * distribute the resulting executable under terms of your choice, provided that
15  * you also meet, for each linked independent module, the terms and conditions of
16  * the license of that module.  An independent module is a module which is not
17  * derived from this software.  The special exception does not apply to any
18  * modifications of the software.
19  *
20  *
21  * <<Broadcom-WL-IPTag/Dual:>>
22  */
23 #ifndef __WL_BIGDATA_H_
24 #define __WL_BIGDATA_H_
25 
26 #include <802.11.h>
27 #include <bcmevent.h>
28 #include <bcmwifi_channels.h>
29 
30 #define MAX_STA_INFO_AP_CNT	20
31 
32 #define DOT11_11B_MAX_RATE 11
33 #define DOT11_2GHZ_MAX_CH_NUM 14
34 #define DOT11_HT_MCS_RATE_MASK 0xFF
35 
36 enum {
37 	BIGDATA_DOT11_11B_MODE = 0,
38 	BIGDATA_DOT11_11G_MODE = 1,
39 	BIGDATA_DOT11_11N_MODE = 2,
40 	BIGDATA_DOT11_11A_MODE = 3,
41 	BIGDATA_DOT11_11AC_MODE = 4,
42 	BIGDATA_DOT11_11AX_MODE = 5,
43 	BIGDATA_DOT11_MODE_MAX
44 };
45 
46 typedef struct wl_ap_sta_data
47 {
48 	struct ether_addr mac;
49 	uint32 mode_80211;
50 	uint32 nss;
51 	chanspec_t chanspec;
52 	int16 rssi;
53 	uint32 rate;
54 	uint8 channel;
55 	uint32 mimo;
56 	uint32 disconnected;
57 	uint32 is_empty;
58 	uint32 reason_code;
59 } wl_ap_sta_data_t;
60 
61 typedef struct ap_sta_wq_data
62 {
63 	wl_event_msg_t e;
64 	void *dhdp;
65 	void *bcm_cfg;
66 	void *ndev;
67 } ap_sta_wq_data_t;
68 
69 typedef struct wl_ap_sta_info
70 {
71 	wl_ap_sta_data_t *ap_sta_data;
72 	uint32 sta_list_cnt;
73 	struct mutex wq_data_sync;
74 } wl_ap_sta_info_t;
75 
76 int wl_attach_ap_stainfo(void *bcm_cfg);
77 int wl_detach_ap_stainfo(void *bcm_cfg);
78 int wl_ap_stainfo_init(void *bcm_cfg);
79 void wl_gather_ap_stadata(void *handle, void *event_info, u8 event);
80 int wl_get_ap_stadata(void *bcm_cfg, struct ether_addr *sta_mac, void **data);
81 #endif /* __WL_BIGDATA_H_ */
82