• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_TYPE_STA     0
12 #define FW_TYPE_APSTA   1
13 #define FW_TYPE_P2P     2
14 #define FW_TYPE_MESH    3
15 #define FW_TYPE_ES      4
16 #define FW_TYPE_MFG     5
17 #define FW_TYPE_G       0
18 #define FW_TYPE_AG      1
19 
20 #define FW_PATH_AUTO_SELECT 1
21 
22 extern char firmware_path[MOD_PARAM_PATHLEN];
23 #if defined(BCMSDIO) || defined(BCMPCIE)
24 extern uint dhd_rxbound;
25 extern uint dhd_txbound;
26 #endif
27 #ifdef BCMSDIO
28 #define TXGLOM_RECV_OFFSET 8
29 extern uint dhd_doflow;
30 extern uint dhd_slpauto;
31 #endif
32 
33 typedef struct wl_mac_range {
34     uint32 oui;
35     uint32 nic_start;
36     uint32 nic_end;
37 } wl_mac_range_t;
38 
39 typedef struct wl_mac_list {
40     int count;
41     wl_mac_range_t *mac;
42     char name[MOD_PARAM_PATHLEN];
43 } wl_mac_list_t;
44 
45 typedef struct wl_mac_list_ctrl {
46     int count;
47     struct wl_mac_list *m_mac_list_head;
48 } wl_mac_list_ctrl_t;
49 
50 typedef struct wl_chip_nv_path {
51     uint chip;
52     uint chiprev;
53     char name[MOD_PARAM_PATHLEN];
54 } wl_chip_nv_path_t;
55 
56 typedef struct wl_chip_nv_path_list_ctrl {
57     int count;
58     struct wl_chip_nv_path *m_chip_nv_path_head;
59 } wl_chip_nv_path_list_ctrl_t;
60 
61 typedef struct wl_channel_list {
62     uint32 count;
63     uint32 channel[WL_NUMCHANNELS];
64 } wl_channel_list_t;
65 
66 typedef struct wmes_param {
67     int aifsn[AC_COUNT];
68     int ecwmin[AC_COUNT];
69     int ecwmax[AC_COUNT];
70     int txop[AC_COUNT];
71 } wme_param_t;
72 
73 #ifdef PKT_FILTER_SUPPORT
74 #define DHD_CONF_FILTER_MAX    8
75 #define PKT_FILTER_LEN 300
76 #define MAGIC_PKT_FILTER_LEN 450
77 typedef struct conf_pkt_filter_add {
78     uint32 count;
79     char filter[DHD_CONF_FILTER_MAX][PKT_FILTER_LEN];
80 } conf_pkt_filter_add_t;
81 
82 typedef struct conf_pkt_filter_del {
83     uint32 count;
84     uint32 id[DHD_CONF_FILTER_MAX];
85 } conf_pkt_filter_del_t;
86 #endif
87 
88 #define CONFIG_COUNTRY_LIST_SIZE 100
89 typedef struct conf_country_list {
90     uint32 count;
91     wl_country_t *cspec[CONFIG_COUNTRY_LIST_SIZE];
92 } conf_country_list_t;
93 
94 /* mchan_params */
95 #define MCHAN_MAX_NUM 4
96 #define MIRACAST_SOURCE    1
97 #define MIRACAST_SINK    2
98 typedef struct mchan_params {
99     int bw;
100     int p2p_mode;
101     int miracast_mode;
102 } mchan_params_t;
103 
104 enum in4way_flags {
105     NO_SCAN_IN4WAY    = (1 << (0)),
106     NO_BTC_IN4WAY    = (1 << (1)),
107     DONT_DELETE_GC_AFTER_WPS    = (1 << (2)),
108     WAIT_DISCONNECTED    = (1 << (3)),
109 };
110 
111 enum in_suspend_flags {
112     NO_EVENT_IN_SUSPEND    = (1 << (0)),
113     NO_TXDATA_IN_SUSPEND    = (1 << (1)),
114     AP_DOWN_IN_SUSPEND    = (1 << (2)),
115     ROAM_OFFLOAD_IN_SUSPEND    = (1 << (3)),
116 };
117 
118 enum eapol_status {
119     EAPOL_STATUS_NONE = 0,
120     EAPOL_STATUS_WPS_REQID,
121     EAPOL_STATUS_WPS_RSPID,
122     EAPOL_STATUS_WPS_WSC_START,
123     EAPOL_STATUS_WPS_M1,
124     EAPOL_STATUS_WPS_M2,
125     EAPOL_STATUS_WPS_M3,
126     EAPOL_STATUS_WPS_M4,
127     EAPOL_STATUS_WPS_M5,
128     EAPOL_STATUS_WPS_M6,
129     EAPOL_STATUS_WPS_M7,
130     EAPOL_STATUS_WPS_M8,
131     EAPOL_STATUS_WPS_DONE,
132     EAPOL_STATUS_WPA_START,
133     EAPOL_STATUS_WPA_M1,
134     EAPOL_STATUS_WPA_M2,
135     EAPOL_STATUS_WPA_M3,
136     EAPOL_STATUS_WPA_M4,
137     EAPOL_STATUS_WPA_END
138 };
139 
140 typedef struct dhd_conf {
141     uint chip;
142     uint chiprev;
143     int fw_type;
144     wl_mac_list_ctrl_t fw_by_mac;
145     wl_mac_list_ctrl_t nv_by_mac;
146     wl_chip_nv_path_list_ctrl_t nv_by_chip;
147     conf_country_list_t country_list;
148     int band;
149     int bw_cap[2];
150     wl_country_t cspec;
151     wl_channel_list_t channels;
152     uint roam_off;
153     uint roam_off_suspend;
154     int roam_trigger[2];
155     int roam_scan_period[2];
156     int roam_delta[2];
157     int fullroamperiod;
158     uint keep_alive_period;
159     int force_wme_ac;
160     wme_param_t wme_sta;
161     wme_param_t wme_ap;
162     int phy_oclscdenable;
163 #ifdef PKT_FILTER_SUPPORT
164     conf_pkt_filter_add_t pkt_filter_add;
165     conf_pkt_filter_del_t pkt_filter_del;
166     char *magic_pkt_filter_add;
167 #endif
168     int srl;
169     int lrl;
170     uint bcn_timeout;
171     int txbf;
172     int disable_proptx;
173     int dhd_poll;
174 #ifdef BCMSDIO
175     int use_rxchain;
176     bool bus_rxglom;
177     bool txglom_ext; /* Only for 43362/4330/43340/43341/43241 */
178     /* terence 20161011:
179         1) conf->tx_max_offset = 1 to fix credict issue in adaptivity testing
180         2) conf->tx_max_offset = 1 will cause to UDP Tx not work in rxglom supported,
181             but not happened in sw txglom
182     */
183     int tx_max_offset;
184     uint txglomsize;
185     int txctl_tmo_fix;
186     bool txglom_mode;
187     uint deferred_tx_len;
188     /*txglom_bucket_size:
189      * 43362/4330: 1680
190      * 43340/43341/43241: 1684
191      */
192     int txglom_bucket_size;
193     int txinrx_thres;
194     int dhd_txminmax; // -1=DATABUFCNT(bus)
195     uint sd_f2_blocksize;
196     bool oob_enabled_later;
197     int orphan_move;
198 #endif
199 #ifdef BCMPCIE
200     int bus_deepsleep_disable;
201 #endif
202     int dpc_cpucore;
203     int rxf_cpucore;
204     int frameburst;
205     bool deepsleep;
206     int pm;
207     int pm_in_suspend;
208     int suspend_bcn_li_dtim;
209 #ifdef DHDTCPACK_SUPPRESS
210     uint8 tcpack_sup_mode;
211 #endif
212     int pktprio8021x;
213     uint insuspend;
214     bool suspended;
215 #ifdef SUSPEND_EVENT
216     char resume_eventmask[WL_EVENTING_MASK_LEN];
217 #endif
218 #ifdef IDHCP
219     int dhcpc_enable;
220     int dhcpd_enable;
221     struct ipv4_addr dhcpd_ip_addr;
222     struct ipv4_addr dhcpd_ip_mask;
223     struct ipv4_addr dhcpd_ip_start;
224     struct ipv4_addr dhcpd_ip_end;
225 #endif
226 #ifdef ISAM_PREINIT
227     char isam_init[50];
228     char isam_config[300];
229     char isam_enable[50];
230 #endif
231     int ctrl_resched;
232     int dhd_ioctl_timeout_msec;
233     struct mchan_params mchan[MCHAN_MAX_NUM];
234     char *wl_preinit;
235     int tsq;
236     uint eapol_status;
237     uint in4way;
238     uint max_wait_gc_time;
239 } dhd_conf_t;
240 
241 #ifdef BCMSDIO
242 int dhd_conf_get_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, uint8 *mac);
243 void dhd_conf_set_fw_name_by_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, char *fw_path);
244 void dhd_conf_set_nv_name_by_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, char *nv_path);
245 #if defined(HW_OOB) || defined(FORCE_WOWLAN)
246 void dhd_conf_set_hw_oob_intr(bcmsdh_info_t *sdh, uint chip);
247 #endif
248 void dhd_conf_set_txglom_params(dhd_pub_t *dhd, bool enable);
249 int dhd_conf_set_blksize(bcmsdh_info_t *sdh);
250 #endif
251 void dhd_conf_set_fw_name_by_chip(dhd_pub_t *dhd, char *fw_path);
252 void dhd_conf_set_clm_name_by_chip(dhd_pub_t *dhd, char *clm_path);
253 void dhd_conf_set_nv_name_by_chip(dhd_pub_t *dhd, char *nv_path);
254 void dhd_conf_set_path(dhd_pub_t *dhd, char *dst_name, char *dst_path, char *src_path);
255 #ifdef CONFIG_PATH_AUTO_SELECT
256 void dhd_conf_set_conf_name_by_chip(dhd_pub_t *dhd, char *conf_path);
257 #endif
258 int dhd_conf_set_intiovar(dhd_pub_t *dhd, uint cmd, char *name, int val, int def, bool down);
259 uint dhd_conf_get_band(dhd_pub_t *dhd);
260 int dhd_conf_set_country(dhd_pub_t *dhd, wl_country_t *cspec);
261 int dhd_conf_get_country(dhd_pub_t *dhd, wl_country_t *cspec);
262 int dhd_conf_map_country_list(dhd_pub_t *dhd, wl_country_t *cspec);
263 int dhd_conf_fix_country(dhd_pub_t *dhd);
264 bool dhd_conf_match_channel(dhd_pub_t *dhd, uint32 channel);
265 void dhd_conf_set_wme(dhd_pub_t *dhd, int ifidx, int mode);
266 void dhd_conf_set_mchan_bw(dhd_pub_t *dhd, int go, int source);
267 void dhd_conf_add_pkt_filter(dhd_pub_t *dhd);
268 bool dhd_conf_del_pkt_filter(dhd_pub_t *dhd, uint32 id);
269 void dhd_conf_discard_pkt_filter(dhd_pub_t *dhd);
270 int dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path);
271 int dhd_conf_set_chiprev(dhd_pub_t *dhd, uint chip, uint chiprev);
272 uint dhd_conf_get_chip(void *context);
273 uint dhd_conf_get_chiprev(void *context);
274 int dhd_conf_get_pm(dhd_pub_t *dhd);
275 
276 #ifdef PROP_TXSTATUS
277 int dhd_conf_get_disable_proptx(dhd_pub_t *dhd);
278 #endif
279 uint dhd_conf_get_insuspend(dhd_pub_t *dhd);
280 int dhd_conf_set_suspend_resume(dhd_pub_t *dhd, int suspend);
281 void dhd_conf_postinit_ioctls(dhd_pub_t *dhd);
282 int dhd_conf_preinit(dhd_pub_t *dhd);
283 int dhd_conf_reset(dhd_pub_t *dhd);
284 int dhd_conf_attach(dhd_pub_t *dhd);
285 void dhd_conf_detach(dhd_pub_t *dhd);
286 void *dhd_get_pub(struct net_device *dev);
287 void *dhd_get_conf(struct net_device *dev);
288 #endif /* _dhd_config_ */
289