1 2 #ifndef _dhd_config_ 3 #define _dhd_config_ 4 5 #include <bcmdevs.h> 6 #include <siutils.h> 7 #include <dngl_stats.h> 8 #include <dhd.h> 9 #include <wlioctl.h> 10 #include <802.11.h> 11 12 #define FW_TYPE_STA 0 13 #define FW_TYPE_APSTA 1 14 #define FW_TYPE_P2P 2 15 #define FW_TYPE_MESH 3 16 #define FW_TYPE_EZMESH 4 17 #define FW_TYPE_ES 5 18 #define FW_TYPE_MFG 6 19 #define FW_TYPE_MINIME 7 20 #define FW_TYPE_G 0 21 #define FW_TYPE_AG 1 22 23 #define FW_PATH_AUTO_SELECT 1 24 extern char firmware_path[MOD_PARAM_PATHLEN]; 25 #if defined(BCMSDIO) || defined(BCMPCIE) 26 extern uint dhd_rxbound; 27 extern uint dhd_txbound; 28 #endif 29 #ifdef BCMSDIO 30 #define TXGLOM_RECV_OFFSET 8 31 extern uint dhd_doflow; 32 extern uint dhd_slpauto; 33 #endif 34 35 #ifdef SET_FWNV_BY_MAC 36 typedef struct wl_mac_range { 37 uint32 oui; 38 uint32 nic_start; 39 uint32 nic_end; 40 } wl_mac_range_t; 41 42 typedef struct wl_mac_list { 43 int count; 44 wl_mac_range_t *mac; 45 char name[MOD_PARAM_PATHLEN]; 46 } wl_mac_list_t; 47 48 typedef struct wl_mac_list_ctrl { 49 int count; 50 struct wl_mac_list *m_mac_list_head; 51 } wl_mac_list_ctrl_t; 52 #endif 53 54 typedef struct wl_chip_nv_path { 55 uint chip; 56 uint chiprev; 57 char name[MOD_PARAM_PATHLEN]; 58 } wl_chip_nv_path_t; 59 60 typedef struct wl_chip_nv_path_list_ctrl { 61 int count; 62 struct wl_chip_nv_path *m_chip_nv_path_head; 63 } wl_chip_nv_path_list_ctrl_t; 64 65 typedef struct wl_channel_list { 66 uint32 count; 67 uint32 channel[WL_NUMCHANNELS]; 68 } wl_channel_list_t; 69 70 typedef struct wmes_param { 71 int aifsn[AC_COUNT]; 72 int ecwmin[AC_COUNT]; 73 int ecwmax[AC_COUNT]; 74 int txop[AC_COUNT]; 75 } wme_param_t; 76 77 #ifdef PKT_FILTER_SUPPORT 78 #define DHD_CONF_FILTER_MAX 8 79 #define PKT_FILTER_LEN 300 80 #define MAGIC_PKT_FILTER_LEN 450 81 typedef struct conf_pkt_filter_add { 82 uint32 count; 83 char filter[DHD_CONF_FILTER_MAX][PKT_FILTER_LEN]; 84 } conf_pkt_filter_add_t; 85 86 typedef struct conf_pkt_filter_del { 87 uint32 count; 88 uint32 id[DHD_CONF_FILTER_MAX]; 89 } conf_pkt_filter_del_t; 90 #endif 91 92 #define CONFIG_COUNTRY_LIST_SIZE 500 93 typedef struct country_list { 94 struct country_list *next; 95 wl_country_t cspec; 96 } country_list_t; 97 98 /* mchan_params */ 99 #define MCHAN_MAX_NUM 4 100 #define MIRACAST_SOURCE 1 101 #define MIRACAST_SINK 2 102 typedef struct mchan_params { 103 struct mchan_params *next; 104 int bw; 105 int p2p_mode; 106 int miracast_mode; 107 } mchan_params_t; 108 109 #ifdef SCAN_SUPPRESS 110 enum scan_intput_flags { 111 NO_SCAN_INTPUT = (1 << (0)), 112 SCAN_CURCHAN_INTPUT = (1 << (1)), 113 SCAN_LIGHT_INTPUT = (1 << (2)), 114 }; 115 #endif 116 117 enum war_flags { 118 SET_CHAN_INCONN = (1 << (0)), 119 FW_REINIT_INCSA = (1 << (1)), 120 FW_REINIT_EMPTY_SCAN = (1 << (2)), 121 P2P_AP_MAC_CONFLICT = (1 << (3)) 122 }; 123 124 enum in4way_flags { 125 STA_NO_SCAN_IN4WAY = (1 << (0)), 126 STA_NO_BTC_IN4WAY = (1 << (1)), 127 STA_WAIT_DISCONNECTED = (1 << (2)), 128 STA_START_AUTH_DELAY = (1 << (3)), 129 AP_WAIT_STA_RECONNECT = (1 << (4)), 130 STA_FAKE_SCAN_IN_CONNECT = (1 << (5)), 131 }; 132 133 enum in_suspend_flags { 134 NO_EVENT_IN_SUSPEND = (1 << (0)), 135 NO_TXDATA_IN_SUSPEND = (1 << (1)), 136 NO_TXCTL_IN_SUSPEND = (1 << (2)), 137 AP_DOWN_IN_SUSPEND = (1 << (3)), 138 ROAM_OFFLOAD_IN_SUSPEND = (1 << (4)), 139 AP_FILTER_IN_SUSPEND = (1 << (5)), 140 WOWL_IN_SUSPEND = (1 << (6)), 141 ALL_IN_SUSPEND = 0xFFFFFFFF, 142 }; 143 144 enum in_suspend_mode { EARLY_SUSPEND = 0, PM_NOTIFIER = 1, SUSPEND_MODE_2 = 2 }; 145 146 #ifdef TPUT_MONITOR 147 enum data_drop_mode { 148 NO_DATA_DROP = -1, 149 FW_DROP = 0, 150 TXPKT_DROP = 1, 151 XMIT_DROP = 2 152 }; 153 #endif 154 155 enum eapol_status { 156 EAPOL_STATUS_NONE = 0, 157 EAPOL_STATUS_CONNECTING = 1, 158 EAPOL_STATUS_CONNECTED = 2, 159 EAPOL_STATUS_REQID = 3, 160 EAPOL_STATUS_RSPID = 4, 161 EAPOL_STATUS_WSC_START = 5, 162 EAPOL_STATUS_WPS_M1 = 6, 163 EAPOL_STATUS_WPS_M2 = 7, 164 EAPOL_STATUS_WPS_M3 = 8, 165 EAPOL_STATUS_WPS_M4 = 9, 166 EAPOL_STATUS_WPS_M5 = 10, 167 EAPOL_STATUS_WPS_M6 = 11, 168 EAPOL_STATUS_WPS_M7 = 12, 169 EAPOL_STATUS_WPS_M8 = 13, 170 EAPOL_STATUS_WSC_DONE = 14, 171 EAPOL_STATUS_4WAY_START = 15, 172 AUTH_SAE_COMMIT_M1 = 16, 173 AUTH_SAE_COMMIT_M2 = 17, 174 AUTH_SAE_CONFIRM_M3 = 18, 175 AUTH_SAE_CONFIRM_M4 = 19, 176 EAPOL_STATUS_4WAY_M1 = 20, 177 EAPOL_STATUS_4WAY_M2 = 21, 178 EAPOL_STATUS_4WAY_M3 = 22, 179 EAPOL_STATUS_4WAY_M4 = 23, 180 EAPOL_STATUS_GROUPKEY_M1 = 24, 181 EAPOL_STATUS_GROUPKEY_M2 = 25, 182 EAPOL_STATUS_4WAY_DONE = 26 183 }; 184 185 typedef struct dhd_conf { 186 uint devid; 187 uint chip; 188 uint chiprev; 189 #if defined(BCMPCIE) 190 uint svid; 191 uint ssid; 192 #endif 193 #ifdef GET_OTP_MODULE_NAME 194 char module_name[16]; 195 #endif 196 struct ether_addr otp_mac; 197 int fw_type; 198 #ifdef SET_FWNV_BY_MAC 199 wl_mac_list_ctrl_t fw_by_mac; 200 wl_mac_list_ctrl_t nv_by_mac; 201 #endif 202 wl_chip_nv_path_list_ctrl_t nv_by_chip; 203 country_list_t *country_head; 204 int band; 205 int bw_cap[2]; 206 wl_country_t cspec; 207 wl_channel_list_t channels; 208 uint roam_off; 209 uint roam_off_suspend; 210 int roam_trigger[2]; 211 int roam_scan_period[2]; 212 int roam_delta[2]; 213 int fullroamperiod; 214 uint keep_alive_period; 215 bool rekey_offload; 216 #ifdef ARP_OFFLOAD_SUPPORT 217 bool garp; 218 #endif 219 int force_wme_ac; 220 wme_param_t wme_sta; 221 wme_param_t wme_ap; 222 #ifdef PKT_FILTER_SUPPORT 223 conf_pkt_filter_add_t pkt_filter_add; 224 conf_pkt_filter_del_t pkt_filter_del; 225 char *magic_pkt_filter_add; 226 #endif 227 int srl; 228 int lrl; 229 uint bcn_timeout; 230 int disable_proptx; 231 int dhd_poll; 232 #ifdef BCMSDIO 233 int use_rxchain; 234 bool bus_rxglom; 235 bool txglom_ext; /* Only for 43362/4330/43340/43341/43241 */ 236 /* terence 20161011: 237 1) conf->tx_max_offset = 1 to fix credict issue in adaptivity testing 238 2) conf->tx_max_offset = 1 will cause to UDP Tx not work in rxglom 239 supported, but not happened in sw txglom 240 */ 241 int tx_max_offset; 242 uint txglomsize; 243 int txctl_tmo_fix; 244 bool txglom_mode; 245 uint deferred_tx_len; 246 /* txglom_bucket_size: 247 * 43362/4330: 1680 248 * 43340/43341/43241: 1684 249 */ 250 int txglom_bucket_size; 251 int txinrx_thres; 252 int dhd_txminmax; // -1=DATABUFCNT(bus) 253 #ifdef DYNAMIC_MAX_HDR_READ 254 int max_hdr_read; 255 #endif 256 bool oob_enabled_later; 257 #ifdef MINIME 258 uint32 ramsize; 259 #endif 260 #if defined(SDIO_ISR_THREAD) 261 bool intr_extn; 262 #endif 263 #ifdef BCMSDIO_RXLIM_POST 264 bool rxlim_en; 265 #endif 266 #ifdef BCMSDIO_TXSEQ_SYNC 267 bool txseq_sync; 268 #endif 269 #ifdef BCMSDIO_INTSTATUS_WAR 270 uint read_intr_mode; 271 #endif 272 int kso_try_max; 273 #ifdef KSO_DEBUG 274 uint kso_try_array[10]; 275 #endif 276 #endif 277 #ifdef BCMPCIE 278 int bus_deepsleep_disable; 279 int flow_ring_queue_threshold; 280 int d2h_intr_method; 281 #endif 282 int dpc_cpucore; 283 int rxf_cpucore; 284 int dhd_dpc_prio; 285 int frameburst; 286 bool deepsleep; 287 int pm; 288 int pm_in_suspend; 289 int suspend_mode; 290 int suspend_bcn_li_dtim; 291 #ifdef DHDTCPACK_SUPPRESS 292 uint8 tcpack_sup_mode; 293 uint32 tcpack_sup_ratio; 294 uint32 tcpack_sup_delay; 295 #endif 296 int pktprio8021x; 297 uint insuspend; 298 bool suspended; 299 struct ether_addr bssid_insuspend; 300 #ifdef SUSPEND_EVENT 301 char resume_eventmask[WL_EVENTING_MASK_LEN]; 302 bool wlfc; 303 #endif 304 #ifdef IDHCP 305 int dhcpc_enable; 306 int dhcpd_enable; 307 struct ipv4_addr dhcpd_ip_addr; 308 struct ipv4_addr dhcpd_ip_mask; 309 struct ipv4_addr dhcpd_ip_start; 310 struct ipv4_addr dhcpd_ip_end; 311 #endif 312 #ifdef ISAM_PREINIT 313 char isam_init[50]; 314 char isam_config[300]; 315 char isam_enable[50]; 316 #endif 317 int ctrl_resched; 318 uint rxcnt_timeout; 319 mchan_params_t *mchan; 320 char *wl_preinit; 321 char *wl_suspend; 322 char *wl_resume; 323 int tsq; 324 int orphan_move; 325 uint in4way; 326 uint war; 327 #ifdef WL_EXT_WOWL 328 uint wowl; 329 #endif 330 #ifdef GET_CUSTOM_MAC_FROM_CONFIG 331 char hw_ether[62]; 332 #endif 333 wait_queue_head_t event_complete; 334 #ifdef PROPTX_MAXCOUNT 335 int proptx_maxcnt_2g; 336 int proptx_maxcnt_5g; 337 #endif /* DYNAMIC_PROPTX_MAXCOUNT */ 338 #ifdef TPUT_MONITOR 339 int data_drop_mode; 340 unsigned long net_len; 341 uint tput_monitor_ms; 342 struct osl_timespec tput_ts; 343 unsigned long last_tx; 344 unsigned long last_rx; 345 unsigned long last_net_tx; 346 #endif 347 #ifdef SCAN_SUPPRESS 348 uint scan_intput; 349 int scan_busy_thresh; 350 int scan_busy_tmo; 351 int32 scan_tput_thresh; 352 #endif 353 #ifdef DHD_TPUT_PATCH 354 bool tput_patch; 355 int mtu; 356 bool pktsetsum; 357 #endif 358 #ifdef SET_XPS_CPUS 359 bool xps_cpus; 360 #endif 361 #ifdef SET_RPS_CPUS 362 bool rps_cpus; 363 #endif 364 #ifdef CHECK_DOWNLOAD_FW 365 bool fwchk; 366 #endif 367 char *vndr_ie_assocreq; 368 } dhd_conf_t; 369 370 #ifdef BCMSDIO 371 void dhd_conf_get_otp(dhd_pub_t *dhd, bcmsdh_info_t *sdh, si_t *sih); 372 #if defined(HW_OOB) || defined(FORCE_WOWLAN) 373 void dhd_conf_set_hw_oob_intr(bcmsdh_info_t *sdh, struct si_pub *sih); 374 #endif 375 void dhd_conf_set_txglom_params(dhd_pub_t *dhd, bool enable); 376 #endif 377 #ifdef BCMPCIE 378 int dhd_conf_get_otp(dhd_pub_t *dhd, si_t *sih); 379 bool dhd_conf_legacy_msi_chip(dhd_pub_t *dhd); 380 #endif 381 void dhd_conf_set_path_params(dhd_pub_t *dhd, char *fw_path, char *nv_path); 382 int dhd_conf_set_intiovar(dhd_pub_t *dhd, int ifidx, uint cmd, char *name, 383 int val, int def, bool down); 384 int dhd_conf_get_band(dhd_pub_t *dhd); 385 int dhd_conf_set_country(dhd_pub_t *dhd, wl_country_t *cspec); 386 int dhd_conf_get_country(dhd_pub_t *dhd, wl_country_t *cspec); 387 int dhd_conf_map_country_list(dhd_pub_t *dhd, wl_country_t *cspec); 388 #ifdef CCODE_LIST 389 int dhd_ccode_map_country_list(dhd_pub_t *dhd, wl_country_t *cspec); 390 #endif 391 int dhd_conf_fix_country(dhd_pub_t *dhd); 392 bool dhd_conf_match_channel(dhd_pub_t *dhd, uint32 channel); 393 void dhd_conf_set_wme(dhd_pub_t *dhd, int ifidx, int mode); 394 void dhd_conf_set_mchan_bw(dhd_pub_t *dhd, int go, int source); 395 void dhd_conf_add_pkt_filter(dhd_pub_t *dhd); 396 bool dhd_conf_del_pkt_filter(dhd_pub_t *dhd, uint32 id); 397 void dhd_conf_discard_pkt_filter(dhd_pub_t *dhd); 398 int dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path); 399 int dhd_conf_set_chiprev(dhd_pub_t *dhd, uint chip, uint chiprev); 400 uint dhd_conf_get_chip(void *context); 401 uint dhd_conf_get_chiprev(void *context); 402 int dhd_conf_get_pm(dhd_pub_t *dhd); 403 int dhd_conf_check_hostsleep(dhd_pub_t *dhd, int cmd, void *buf, int len, 404 int *hostsleep_set, int *hostsleep_val, int *ret); 405 void dhd_conf_get_hostsleep(dhd_pub_t *dhd, int hostsleep_set, 406 int hostsleep_val, int ret); 407 int dhd_conf_mkeep_alive(dhd_pub_t *dhd, int ifidx, int id, int period, 408 char *packet, bool bcast); 409 #ifdef ARP_OFFLOAD_SUPPORT 410 void dhd_conf_set_garp(dhd_pub_t *dhd, int ifidx, uint32 ipa, bool enable); 411 #endif 412 #ifdef PROP_TXSTATUS 413 int dhd_conf_get_disable_proptx(dhd_pub_t *dhd); 414 #endif 415 #ifdef TPUT_MONITOR 416 void dhd_conf_tput_monitor(dhd_pub_t *dhd); 417 #endif 418 uint dhd_conf_get_insuspend(dhd_pub_t *dhd, uint mask); 419 int dhd_conf_set_suspend_resume(dhd_pub_t *dhd, int suspend); 420 void dhd_conf_postinit_ioctls(dhd_pub_t *dhd); 421 int dhd_conf_preinit(dhd_pub_t *dhd); 422 int dhd_conf_reset(dhd_pub_t *dhd); 423 int dhd_conf_attach(dhd_pub_t *dhd); 424 void dhd_conf_detach(dhd_pub_t *dhd); 425 void *dhd_get_pub(struct net_device *dev); 426 int wl_pattern_atoh(char *src, char *dst); 427 int dhd_conf_suspend_resume_sta(dhd_pub_t *dhd, int ifidx, int suspend); 428 #ifdef BCMSDIO 429 extern int dhd_bus_sleep(dhd_pub_t *dhdp, bool sleep, uint32 *intstatus); 430 #endif 431 #endif /* _dhd_config_ */ 432