af10705d5b5cc4343dcf7705aa4db4fc616183e1
[GitHub/LineageOS/G12/android_hardware_amlogic_kernel-modules_dhd-driver.git] / bcmdhd.1.579.77.41.1.cn / dhd_config.h
1
2 #ifndef _dhd_config_
3 #define _dhd_config_
4
5 #include <bcmdevs.h>
6 #include <dngl_stats.h>
7 #include <dhd.h>
8 #include <wlioctl.h>
9 #include <802.11.h>
10
11 #define FW_PATH_AUTO_SELECT 1
12 //#define CONFIG_PATH_AUTO_SELECT
13 extern char firmware_path[MOD_PARAM_PATHLEN];
14 extern uint dhd_rxbound;
15 extern uint dhd_txbound;
16 #ifdef BCMSDIO
17 #define TXGLOM_RECV_OFFSET 8
18 extern uint dhd_doflow;
19 extern uint dhd_slpauto;
20
21 #define BCM43362A0_CHIP_REV 0
22 #define BCM43362A2_CHIP_REV 1
23 #define BCM43430A0_CHIP_REV 0
24 #define BCM43430A1_CHIP_REV 1
25 #define BCM43430A2_CHIP_REV 2
26 #define BCM43012B0_CHIP_REV 1
27 #define BCM4330B2_CHIP_REV 4
28 #define BCM4334B1_CHIP_REV 3
29 #define BCM43341B0_CHIP_REV 2
30 #define BCM43241B4_CHIP_REV 5
31 #define BCM4335A0_CHIP_REV 2
32 #define BCM4339A0_CHIP_REV 1
33 #define BCM43455C0_CHIP_REV 6
34 #define BCM43455C5_CHIP_REV 9
35 #define BCM4354A1_CHIP_REV 1
36 #define BCM4359B1_CHIP_REV 5
37 #define BCM4359C0_CHIP_REV 9
38 #endif
39 #define BCM4356A2_CHIP_REV 2
40 #define BCM4358A3_CHIP_REV 3
41
42 typedef struct wl_mac_range {
43 uint32 oui;
44 uint32 nic_start;
45 uint32 nic_end;
46 } wl_mac_range_t;
47
48 typedef struct wl_mac_list {
49 int count;
50 wl_mac_range_t *mac;
51 char name[MOD_PARAM_PATHLEN];
52 } wl_mac_list_t;
53
54 typedef struct wl_mac_list_ctrl {
55 int count;
56 struct wl_mac_list *m_mac_list_head;
57 } wl_mac_list_ctrl_t;
58
59 typedef struct wl_chip_nv_path {
60 uint chip;
61 uint chiprev;
62 char name[MOD_PARAM_PATHLEN];
63 } wl_chip_nv_path_t;
64
65 typedef struct wl_chip_nv_path_list_ctrl {
66 int count;
67 struct wl_chip_nv_path *m_chip_nv_path_head;
68 } wl_chip_nv_path_list_ctrl_t;
69
70 typedef struct wl_channel_list {
71 uint32 count;
72 uint32 channel[WL_NUMCHANNELS];
73 } wl_channel_list_t;
74
75 typedef struct wmes_param {
76 int aifsn[AC_COUNT];
77 int ecwmin[AC_COUNT];
78 int ecwmax[AC_COUNT];
79 int txop[AC_COUNT];
80 } wme_param_t;
81
82 #ifdef PKT_FILTER_SUPPORT
83 #define DHD_CONF_FILTER_MAX 8
84 #define PKT_FILTER_LEN 300
85 typedef struct conf_pkt_filter_add {
86 uint32 count;
87 char filter[DHD_CONF_FILTER_MAX][PKT_FILTER_LEN];
88 } conf_pkt_filter_add_t;
89
90 typedef struct conf_pkt_filter_del {
91 uint32 count;
92 uint32 id[DHD_CONF_FILTER_MAX];
93 } conf_pkt_filter_del_t;
94 #endif
95
96 #define CONFIG_COUNTRY_LIST_SIZE 100
97 typedef struct conf_country_list {
98 uint32 count;
99 wl_country_t cspec[CONFIG_COUNTRY_LIST_SIZE];
100 } conf_country_list_t;
101
102 typedef struct dhd_conf {
103 uint chip;
104 uint chiprev;
105 wl_mac_list_ctrl_t fw_by_mac;
106 wl_mac_list_ctrl_t nv_by_mac;
107 wl_chip_nv_path_list_ctrl_t nv_by_chip;
108 conf_country_list_t country_list;
109 int band;
110 int mimo_bw_cap;
111 int bw_cap_2g;
112 int bw_cap_5g;
113 wl_country_t cspec;
114 wl_channel_list_t channels;
115 uint roam_off;
116 uint roam_off_suspend;
117 int roam_trigger[2];
118 int roam_scan_period[2];
119 int roam_delta[2];
120 int fullroamperiod;
121 uint keep_alive_period;
122 int force_wme_ac;
123 wme_param_t wme_sta;
124 wme_param_t wme_ap;
125 int stbc;
126 int phy_oclscdenable;
127 #ifdef PKT_FILTER_SUPPORT
128 conf_pkt_filter_add_t pkt_filter_add;
129 conf_pkt_filter_del_t pkt_filter_del;
130 conf_pkt_filter_add_t magic_pkt_filter_add;
131 #endif
132 int srl;
133 int lrl;
134 uint bcn_timeout;
135 int spect;
136 int txbf;
137 int lpc;
138 int disable_proptx;
139 #ifdef BCMSDIO
140 int bus_txglom;
141 int use_rxchain;
142 bool bus_rxglom;
143 bool txglom_ext; /* Only for 43362/4330/43340/43341/43241 */
144 /* terence 20161011:
145 1) conf->tx_max_offset = 1 to fix credict issue in adaptivity testing
146 2) conf->tx_max_offset = 1 will cause to UDP Tx not work in rxglom supported,
147 but not happened in sw txglom
148 */
149 int tx_max_offset;
150 uint txglomsize;
151 int dhd_poll;
152 bool txctl_tmo_fix;
153 bool tx_in_rx;
154 bool txglom_mode;
155 uint deferred_tx_len;
156 /*txglom_bucket_size:
157 * 43362/4330: 1680
158 * 43340/43341/43241: 1684
159 */
160 int txglom_bucket_size;
161 int txinrx_thres;
162 int dhd_txminmax; // -1=DATABUFCNT(bus)
163 uint sd_f2_blocksize;
164 bool oob_enabled_later;
165 #endif
166 int ampdu_ba_wsize;
167 int ampdu_hostreorder;
168 int dpc_cpucore;
169 int rxf_cpucore;
170 int frameburst;
171 bool deepsleep;
172 int pm;
173 int pm_in_suspend;
174 int pm2_sleep_ret;
175 #ifdef DHDTCPACK_SUPPRESS
176 uint8 tcpack_sup_mode;
177 #endif
178 int pktprio8021x;
179 int rsdb_mode;
180 int vhtmode;
181 int num_different_channels;
182 int xmit_in_suspend;
183 int ap_in_suspend;
184 #ifdef SUSPEND_EVENT
185 bool suspend_eventmask_enable;
186 char suspend_eventmask[WL_EVENTING_MASK_LEN];
187 char resume_eventmask[WL_EVENTING_MASK_LEN];
188 #endif
189 #ifdef IDHCP
190 int dhcpc_enable;
191 int dhcpd_enable;
192 struct ipv4_addr dhcpd_ip_addr;
193 struct ipv4_addr dhcpd_ip_mask;
194 struct ipv4_addr dhcpd_ip_start;
195 struct ipv4_addr dhcpd_ip_end;
196 #endif
197 #ifdef IAPSTA_PREINIT
198 char iapsta_init[50];
199 char iapsta_config[300];
200 char iapsta_enable[50];
201 #endif
202 int autocountry;
203 int tsq;
204 } dhd_conf_t;
205
206 #ifdef BCMSDIO
207 int dhd_conf_get_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, uint8 *mac);
208 void dhd_conf_set_fw_name_by_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, char *fw_path);
209 void dhd_conf_set_nv_name_by_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, char *nv_path);
210 #if defined(HW_OOB) || defined(FORCE_WOWLAN)
211 void dhd_conf_set_hw_oob_intr(bcmsdh_info_t *sdh, uint chip);
212 #endif
213 void dhd_conf_set_txglom_params(dhd_pub_t *dhd, bool enable);
214 #endif
215 void dhd_conf_set_fw_name_by_chip(dhd_pub_t *dhd, char *fw_path);
216 void dhd_conf_set_clm_name_by_chip(dhd_pub_t *dhd, char *clm_path);
217 void dhd_conf_set_nv_name_by_chip(dhd_pub_t *dhd, char *nv_path);
218 void dhd_conf_set_path(dhd_pub_t *dhd, char *dst_name, char *dst_path, char *src_path);
219 #ifdef CONFIG_PATH_AUTO_SELECT
220 void dhd_conf_set_conf_name_by_chip(dhd_pub_t *dhd, char *conf_path);
221 #endif
222 int dhd_conf_set_intiovar(dhd_pub_t *dhd, uint cmd, char *name, int val, int def, bool down);
223 int dhd_conf_get_iovar(dhd_pub_t *dhd, int cmd, char *name, char *buf, int len, int ifidx);
224 int dhd_conf_set_bufiovar(dhd_pub_t *dhd, uint cmd, char *name, char *buf, int len, bool down);
225 uint dhd_conf_get_band(dhd_pub_t *dhd);
226 int dhd_conf_set_country(dhd_pub_t *dhd);
227 int dhd_conf_get_country(dhd_pub_t *dhd, wl_country_t *cspec);
228 int dhd_conf_get_country_from_config(dhd_pub_t *dhd, wl_country_t *cspec);
229 int dhd_conf_fix_country(dhd_pub_t *dhd);
230 bool dhd_conf_match_channel(dhd_pub_t *dhd, uint32 channel);
231 int dhd_conf_set_roam(dhd_pub_t *dhd);
232 void dhd_conf_set_bw_cap(dhd_pub_t *dhd);
233 void dhd_conf_set_wme(dhd_pub_t *dhd, int mode);
234 void dhd_conf_add_pkt_filter(dhd_pub_t *dhd);
235 bool dhd_conf_del_pkt_filter(dhd_pub_t *dhd, uint32 id);
236 void dhd_conf_discard_pkt_filter(dhd_pub_t *dhd);
237 int dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path);
238 int dhd_conf_set_chiprev(dhd_pub_t *dhd, uint chip, uint chiprev);
239 uint dhd_conf_get_chip(void *context);
240 uint dhd_conf_get_chiprev(void *context);
241 int dhd_conf_get_pm(dhd_pub_t *dhd);
242 #ifdef PROP_TXSTATUS
243 int dhd_conf_get_disable_proptx(dhd_pub_t *dhd);
244 #endif
245 int dhd_conf_get_ap_mode_in_suspend(dhd_pub_t *dhd);
246 int dhd_conf_set_ap_in_suspend(dhd_pub_t *dhd, int suspend);
247 int dhd_conf_set_blksize(bcmsdh_info_t *sdh);
248 int dhd_conf_preinit(dhd_pub_t *dhd);
249 int dhd_conf_reset(dhd_pub_t *dhd);
250 int dhd_conf_attach(dhd_pub_t *dhd);
251 void dhd_conf_detach(dhd_pub_t *dhd);
252 void *dhd_get_pub(struct net_device *dev);
253 void *dhd_get_conf(struct net_device *dev);
254 #endif /* _dhd_config_ */