Lines Matching refs:dhd
381 static int dhd_suspend_resume_helper(struct dhd_info *dhd, int val, int force);
387 #define DBUS_RX_BUFFER_SIZE_DHD(net) (net->mtu + net->hard_header_len + dhd->pub.hdrlen)
389 #define DBUS_RX_BUFFER_SIZE_DHD(net) (net->mtu + net->hard_header_len + dhd->pub.hdrlen + 128)
394 extern void dhd_wlfc_plat_init(void *dhd);
395 extern void dhd_wlfc_plat_deinit(void *dhd);
399 extern int dhdsdio_func_blocksize(dhd_pub_t *dhd, int function_num, int block_size);
464 static void dhd_log_dump_init(dhd_pub_t *dhd);
465 static void dhd_log_dump_deinit(dhd_pub_t *dhd);
640 static void dhd_bridge_dev_set(dhd_info_t *dhd, int ifidx, struct net_device *sdev);
771 int dhdpcie_sssr_dump_get_before_after_len(dhd_pub_t *dhd, uint32 *arr_len);
875 static void gdb_proxy_fs_try_create(dhd_info_t *dhd, const char *dev_name);
876 static void gdb_proxy_fs_remove(dhd_info_t *dhd);
904 static void dhd_set_bandlock(dhd_pub_t * dhd);
930 static int dhd_get_pend_8021x_cnt(dhd_info_t *dhd);
936 static struct list_head * dhd_sta_list_snapshot(dhd_info_t *dhd, dhd_if_t *ifp,
938 static void dhd_sta_list_snapshot_free(dhd_info_t *dhd, struct list_head *snapshot_list);
939 #define DHD_IF_WMF_UCFORWARD_LOCK(dhd, ifp, slist) ({ dhd_sta_list_snapshot(dhd, ifp, slist); }) argument
940 #define DHD_IF_WMF_UCFORWARD_UNLOCK(dhd, slist) ({ dhd_sta_list_snapshot_free(dhd, slist); }) argument
1094 static void dhd_net_if_lock_local(dhd_info_t *dhd);
1095 static void dhd_net_if_unlock_local(dhd_info_t *dhd);
1109 void dhd_control_pm(dhd_pub_t *dhd, uint *);
1111 void sec_control_pm(dhd_pub_t *dhd, uint *);
1134 static int dhd_toe_get(dhd_info_t *dhd, int idx, uint32 *toe_ol);
1135 static int dhd_toe_set(dhd_info_t *dhd, int idx, uint32 toe_ol);
1138 static int dhd_wl_host_event(dhd_info_t *dhd, int ifidx, void *pktdata, uint16 pktlen,
1147 dhd_pub_t *dhd = &dhdinfo->pub; in dhd_pm_callback() local
1148 struct dhd_conf *conf = dhd->conf; in dhd_pm_callback()
1166 if(!dhd->early_suspended && suspend_mode != PM_NOTIFIER) { in dhd_pm_callback()
1175 DHD_OS_WAKE_LOCK_WAIVE(dhd); in dhd_pm_callback()
1179 dhd_wlfc_suspend(dhd); in dhd_pm_callback()
1182 dhd_conf_set_suspend_resume(dhd, suspend); in dhd_pm_callback()
1183 DHD_OS_WAKE_LOCK_RESTORE(dhd); in dhd_pm_callback()
1186 if (dhd->busstate == DHD_BUS_DATA) { in dhd_pm_callback()
1189 dhd_conf_set_suspend_resume(dhd, suspend); in dhd_pm_callback()
1191 dhd_wlfc_resume(dhd); in dhd_pm_callback()
1232 dhd_info_t * dhd; /* cached pointer to dhd_info in netdevice priv */ member
1240 #define DHD_DEV_INFO(dev) (((dhd_dev_priv_t *)DEV_PRIV(dev))->dhd)
1252 dev_priv->dhd = (dhd_info_t *)NULL; in dhd_dev_priv_clear()
1260 dhd_dev_priv_save(struct net_device * dev, dhd_info_t * dhd, dhd_if_t * ifp, in dhd_dev_priv_save() argument
1266 dev_priv->dhd = dhd; in dhd_dev_priv_save()
1775 dhd_sta_list_snapshot(dhd_info_t *dhd, dhd_if_t *ifp, struct list_head *snapshot_list) in dhd_sta_list_snapshot() argument
1786 snapshot = (dhd_sta_t *)MALLOC(dhd->pub.osh, sizeof(dhd_sta_t)); in dhd_sta_list_snapshot()
1804 dhd_sta_list_snapshot_free(dhd_info_t *dhd, struct list_head *snapshot_list) in dhd_sta_list_snapshot_free() argument
1810 MFREE(dhd->pub.osh, sta, sizeof(dhd_sta_t)); in dhd_sta_list_snapshot_free()
1926 dhd_info_t *dhd = dhdp->info; in dhd_axi_error_dispatch() local
1927 schedule_work(&dhd->axi_error_dispatcher_work); in dhd_axi_error_dispatch()
1932 struct dhd_info *dhd = in dhd_axi_error_dispatcher_fn() local
1934 dhd_axi_error(&dhd->pub); in dhd_axi_error_dispatcher_fn()
1942 dhd_info_t *dhd = dhdp->info; in dhd_bssidx2idx() local
1949 ifp = dhd->iflist[i]; in dhd_bssidx2idx()
2067 _turn_on_arp_filter(dhd_pub_t *dhd, int op_mode_param) in _turn_on_arp_filter() argument
2087 dhd_set_packet_filter(dhd_pub_t *dhd) in dhd_set_packet_filter() argument
2093 for (i = 0; i < dhd->pktfilter_count; i++) { in dhd_set_packet_filter()
2094 dhd_pktfilter_offload_set(dhd, dhd->pktfilter[i]); in dhd_set_packet_filter()
2100 dhd_enable_packet_filter(int value, dhd_pub_t *dhd) in dhd_enable_packet_filter() argument
2105 if ((dhd->op_mode & DHD_FLAG_HOSTAP_MODE) && value && in dhd_enable_packet_filter()
2106 !dhd_conf_get_insuspend(dhd, AP_FILTER_IN_SUSPEND)) { in dhd_enable_packet_filter()
2113 (dhd_support_sta_mode(dhd) && !dhd->dhcp_in_progress) || in dhd_enable_packet_filter()
2114 dhd_conf_get_insuspend(dhd, AP_FILTER_IN_SUSPEND))) in dhd_enable_packet_filter()
2116 for (i = 0; i < dhd->pktfilter_count; i++) { in dhd_enable_packet_filter()
2120 !_turn_on_arp_filter(dhd, dhd->op_mode)) { in dhd_enable_packet_filter()
2123 value, i, dhd->op_mode)); in dhd_enable_packet_filter()
2129 dhd->pktfilter[DHD_BROADCAST_ARP_FILTER_NUM]) { in dhd_enable_packet_filter()
2136 dhd_packet_filter_add_remove(dhd, FALSE, in dhd_enable_packet_filter()
2140 dhd_pktfilter_offload_enable(dhd, dhd->pktfilter[i], in dhd_enable_packet_filter()
2219 static int dhd_set_suspend(int value, dhd_pub_t *dhd) in dhd_set_suspend() argument
2268 if (!dhd) in dhd_set_suspend()
2272 dhdinfo = dhd->info; in dhd_set_suspend()
2276 __FUNCTION__, value, dhd->in_suspend)); in dhd_set_suspend()
2278 dhd_suspend_lock(dhd); in dhd_set_suspend()
2283 dhd_set_cpucore(dhd, TRUE); in dhd_set_suspend()
2285 if (dhd->up) { in dhd_set_suspend()
2286 if (value && dhd->in_suspend) { in dhd_set_suspend()
2287 dhd->early_suspended = 1; in dhd_set_suspend()
2292 dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char *)&power_mode, in dhd_set_suspend()
2300 dhd_enable_packet_filter(1, dhd); in dhd_set_suspend()
2302 dhd_dev_apf_enable_filter(dhd_linux_get_primary_netdev(dhd)); in dhd_set_suspend()
2306 if (dhd->arpoe_enable) { in dhd_set_suspend()
2307 dhd_arp_offload_enable(dhd, TRUE); in dhd_set_suspend()
2315 ret = dhd_iovar(dhd, i, "allmulti", in dhd_set_suspend()
2333 if (dhd->tdls_mode) { in dhd_set_suspend()
2338 bcn_li_dtim = dhd_get_suspend_bcn_li_dtim(dhd, &dtim_period, in dhd_set_suspend()
2340 ret = dhd_iovar(dhd, 0, "bcn_li_dtim", (char *)&bcn_li_dtim, in dhd_set_suspend()
2354 ret = dhd_iovar(dhd, 0, "lpas", (char *)&lpas, sizeof(lpas), in dhd_set_suspend()
2372 ret = dhd_iovar(dhd, 0, "bcn_to_dly", (char *)&bcn_to_dly, in dhd_set_suspend()
2385 bcn_li_dtim = dhd_get_suspend_bcn_li_dtim(dhd); in dhd_set_suspend()
2386 if (dhd_iovar(dhd, 0, "bcn_li_dtim", (char *)&bcn_li_dtim, in dhd_set_suspend()
2394 ret = dhd_iovar(dhd, 0, "bcn_timeout", (char *)&bcn_timeout, in dhd_set_suspend()
2403 ret = dhd_iovar(dhd, 0, "roam_time_thresh", in dhd_set_suspend()
2413 ret = dhd_iovar(dhd, 0, "roam_off", (char *)&roamvar, in dhd_set_suspend()
2424 ret = dhd_iovar(dhd, 0, "bcn_li_bcn", (char *)&bcn_li_bcn, in dhd_set_suspend()
2431 ret = wl_android_bcnrecv_suspend(dhd_linux_get_primary_netdev(dhd)); in dhd_set_suspend()
2438 if (dhd->ndo_enable) { in dhd_set_suspend()
2439 if (!dhd->ndo_host_ip_overflow) { in dhd_set_suspend()
2441 ret = dhd_ndo_enable(dhd, TRUE); in dhd_set_suspend()
2453 if (FW_SUPPORTED(dhd, ndoe)) in dhd_set_suspend()
2455 if (FW_SUPPORTED(dhd, ndoe) && !FW_SUPPORTED(dhd, apf)) in dhd_set_suspend()
2460 ret = dhd_iovar(dhd, 0, "nd_ra_filter_enable", in dhd_set_suspend()
2467 dhd_os_suppress_logging(dhd, TRUE); in dhd_set_suspend()
2470 ret = dhd_iovar(dhd, 0, "ipmcast_l2filter", in dhd_set_suspend()
2479 ret = dhd_iovar(dhd, 0, "bus:intr_width", (char *)&intr_width, in dhd_set_suspend()
2487 ret = dhd_iovar(dhd, 0, "const_awake_thresh", in dhd_set_suspend()
2496 if (!dhd->sroamed) { in dhd_set_suspend()
2497 ret = dhd_sroam_set_mon(dhd, TRUE); in dhd_set_suspend()
2503 dhd->sroamed = FALSE; in dhd_set_suspend()
2507 dhd->early_suspended = 0; in dhd_set_suspend()
2512 ret = dhd_iovar(dhd, 0, "bus:intr_width", (char *)&intr_width, in dhd_set_suspend()
2520 dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char *)&power_mode, in dhd_set_suspend()
2524 ret = wl_android_bcnrecv_resume(dhd_linux_get_primary_netdev(dhd)); in dhd_set_suspend()
2531 if (dhd->arpoe_enable) { in dhd_set_suspend()
2532 dhd_arp_offload_enable(dhd, FALSE); in dhd_set_suspend()
2537 dhd_enable_packet_filter(0, dhd); in dhd_set_suspend()
2539 dhd_dev_apf_disable_filter(dhd_linux_get_primary_netdev(dhd)); in dhd_set_suspend()
2546 ret = dhd_iovar(dhd, i, "allmulti", in dhd_set_suspend()
2558 ret = dhd_iovar(dhd, 0, "bcn_li_dtim", (char *)&bcn_li_dtim, in dhd_set_suspend()
2564 ret = dhd_iovar(dhd, 0, "lpas", (char *)&lpas, sizeof(lpas), NULL, in dhd_set_suspend()
2574 ret = dhd_iovar(dhd, 0, "bcn_to_dly", (char *)&bcn_to_dly, in dhd_set_suspend()
2587 ret = dhd_iovar(dhd, 0, "bcn_li_dtim", (char *)&bcn_li_dtim, in dhd_set_suspend()
2596 ret = dhd_iovar(dhd, 0, "bcn_timeout", (char *)&bcn_timeout, in dhd_set_suspend()
2605 ret = dhd_iovar(dhd, 0, "roam_time_thresh", in dhd_set_suspend()
2616 ret = dhd_iovar(dhd, 0, "roam_off", (char *)&roamvar, in dhd_set_suspend()
2623 ret = dhd_iovar(dhd, 0, "bcn_li_bcn", (char *)&bcn_li_bcn, in dhd_set_suspend()
2631 if (dhd->ndo_enable) { in dhd_set_suspend()
2633 ret = dhd_ndo_enable(dhd, FALSE); in dhd_set_suspend()
2641 if (FW_SUPPORTED(dhd, ndoe)) in dhd_set_suspend()
2643 if (FW_SUPPORTED(dhd, ndoe) && !FW_SUPPORTED(dhd, apf)) in dhd_set_suspend()
2648 ret = dhd_iovar(dhd, 0, "nd_ra_filter_enable", in dhd_set_suspend()
2656 dhd_os_suppress_logging(dhd, FALSE); in dhd_set_suspend()
2659 ret = dhd_iovar(dhd, 0, "ipmcast_l2filter", in dhd_set_suspend()
2667 ret = dhd_iovar(dhd, 0, "const_awake_thresh", in dhd_set_suspend()
2676 ret = dhd_sroam_set_mon(dhd, FALSE); in dhd_set_suspend()
2684 dhd_suspend_unlock(dhd); in dhd_set_suspend()
2689 static int dhd_suspend_resume_helper(struct dhd_info *dhd, int val, int force) in dhd_suspend_resume_helper() argument
2691 dhd_pub_t *dhdp = &dhd->pub; in dhd_suspend_resume_helper()
2711 struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend); in dhd_early_suspend() local
2714 if (dhd && (dhd->pub.conf->suspend_mode == EARLY_SUSPEND || in dhd_early_suspend()
2715 dhd->pub.conf->suspend_mode == SUSPEND_MODE_2)) { in dhd_early_suspend()
2716 dhd_suspend_resume_helper(dhd, 1, 0); in dhd_early_suspend()
2717 if (dhd->pub.conf->suspend_mode == EARLY_SUSPEND) in dhd_early_suspend()
2718 dhd_conf_set_suspend_resume(&dhd->pub, 1); in dhd_early_suspend()
2724 struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend); in dhd_late_resume() local
2727 if (dhd && (dhd->pub.conf->suspend_mode == EARLY_SUSPEND || in dhd_late_resume()
2728 dhd->pub.conf->suspend_mode == SUSPEND_MODE_2)) { in dhd_late_resume()
2729 dhd_conf_set_suspend_resume(&dhd->pub, 0); in dhd_late_resume()
2730 if (dhd->pub.conf->suspend_mode == EARLY_SUSPEND) in dhd_late_resume()
2731 dhd_suspend_resume_helper(dhd, 0, 0); in dhd_late_resume()
2794 dhd_net2idx(dhd_info_t *dhd, struct net_device *net) in dhd_net2idx() argument
2798 if (!dhd) { in dhd_net2idx()
2804 if (dhd->iflist[i] && dhd->iflist[i]->net && (dhd->iflist[i]->net == net)) in dhd_net2idx()
2826 dhd_ifname2idx(dhd_info_t *dhd, char *name) in dhd_ifname2idx() argument
2830 ASSERT(dhd); in dhd_ifname2idx()
2836 if (dhd->iflist[i] && !strncmp(dhd->iflist[i]->dngl_name, name, IFNAMSIZ)) in dhd_ifname2idx()
2847 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_ifname() local
2849 ASSERT(dhd); in dhd_ifname()
2856 if (dhd->iflist[ifidx] == NULL) { in dhd_ifname()
2861 if (dhd->iflist[ifidx]->net) in dhd_ifname()
2862 return dhd->iflist[ifidx]->net->name; in dhd_ifname()
2871 dhd_info_t *dhd = (dhd_info_t *)dhdp; in dhd_bssidx2bssid() local
2873 ASSERT(dhd); in dhd_bssidx2bssid()
2875 if (dhd->iflist[i] && dhd->iflist[i]->bssidx == idx) in dhd_bssidx2bssid()
2876 return dhd->iflist[i]->mac_addr; in dhd_bssidx2bssid()
2882 _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx) in _dhd_set_multicast_list() argument
2904 if (dhd->iflist[i]) { in _dhd_set_multicast_list()
2905 dev = dhd->iflist[i]->net; in _dhd_set_multicast_list()
2918 if (!dhd->iflist[ifidx]) { in _dhd_set_multicast_list()
2922 dev = dhd->iflist[ifidx]->net; in _dhd_set_multicast_list()
2940 if (!dhd->pub.early_suspended) in _dhd_set_multicast_list()
2952 if (!(bufp = buf = MALLOC(dhd->pub.osh, buflen))) { in _dhd_set_multicast_list()
2954 dhd_ifname(&dhd->pub, ifidx), cnt)); in _dhd_set_multicast_list()
2967 if (dhd->iflist[i]) { in _dhd_set_multicast_list()
2969 dev = dhd->iflist[i]->net; in _dhd_set_multicast_list()
3015 ret = dhd_wl_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len); in _dhd_set_multicast_list()
3018 dhd_ifname(&dhd->pub, ifidx), cnt)); in _dhd_set_multicast_list()
3022 MFREE(dhd->pub.osh, buf, buflen); in _dhd_set_multicast_list()
3030 ret = dhd_iovar(&dhd->pub, ifidx, "allmulti", (char *)&allmulti, in _dhd_set_multicast_list()
3034 dhd_ifname(&dhd->pub, ifidx), ltoh32(allmulti))); in _dhd_set_multicast_list()
3042 if (dhd->iflist[i]) { in _dhd_set_multicast_list()
3043 dev = dhd->iflist[i]->net; in _dhd_set_multicast_list()
3059 ret = dhd_wl_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len); in _dhd_set_multicast_list()
3062 dhd_ifname(&dhd->pub, ifidx), ltoh32(allmulti))); in _dhd_set_multicast_list()
3067 _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, uint8 *addr, bool skip_stop) in _dhd_set_mac_address() argument
3073 WL_MSG(dhd_ifname(&dhd->pub, ifidx), "close dev for mac changing\n"); in _dhd_set_mac_address()
3074 dhd->pub.skip_dhd_stop = TRUE; in _dhd_set_mac_address()
3075 dev_close(dhd->iflist[ifidx]->net); in _dhd_set_mac_address()
3079 ret = dhd_iovar(&dhd->pub, ifidx, "cur_etheraddr", (char *)addr, in _dhd_set_mac_address()
3083 dhd_ifname(&dhd->pub, ifidx), addr, ret)); in _dhd_set_mac_address()
3086 dev_addr_set(dhd->iflist[ifidx]->net, addr); in _dhd_set_mac_address()
3088 memcpy(dhd->pub.mac.octet, addr, ETHER_ADDR_LEN); in _dhd_set_mac_address()
3089 WL_MSG(dhd_ifname(&dhd->pub, ifidx), "MACID %pM is overwritten\n", addr); in _dhd_set_mac_address()
3096 dev_open(dhd->iflist[ifidx]->net, NULL); in _dhd_set_mac_address()
3098 dev_open(dhd->iflist[ifidx]->net); in _dhd_set_mac_address()
3100 dhd->pub.skip_dhd_stop = FALSE; in _dhd_set_mac_address()
3101 WL_MSG(dhd_ifname(&dhd->pub, ifidx), "notify mac changed done\n"); in _dhd_set_mac_address()
3108 int dhd_update_rand_mac_addr(dhd_pub_t *dhd) in dhd_update_rand_mac_addr() argument
3112 if (_dhd_set_mac_address(dhd->info, 0, mac_addr.octet, TRUE) != 0) { in dhd_update_rand_mac_addr()
3162 dhd_info_t *dhd = dhdp->info; in dhd_get_wmf_psta_disable() local
3165 ifp = dhd->iflist[idx]; in dhd_get_wmf_psta_disable()
3172 dhd_info_t *dhd = dhdp->info; in dhd_set_wmf_psta_disable() local
3175 ifp = dhd->iflist[idx]; in dhd_set_wmf_psta_disable()
3185 dhd_info_t *dhd = dhdp->info; in dhd_get_psta_mode() local
3186 return (int)dhd->psta_mode; in dhd_get_psta_mode()
3191 dhd_info_t *dhd = dhdp->info; in dhd_set_psta_mode() local
3192 dhd->psta_mode = val; in dhd_set_psta_mode()
3201 dhd_info_t *dhd = dhdp->info; in dhd_update_rx_pkt_chainable_state() local
3206 ifp = dhd->iflist[idx]; in dhd_update_rx_pkt_chainable_state()
3213 (dhd->wet_mode) || in dhd_update_rx_pkt_chainable_state()
3228 dhd_info_t *dhd = dhdp->info; in dhd_get_wet_mode() local
3229 return (int)dhd->wet_mode; in dhd_get_wet_mode()
3235 dhd_info_t *dhd = dhdp->info; in dhd_set_wet_mode() local
3236 dhd->wet_mode = val; in dhd_set_wet_mode()
3268 dhd_info_t *dhd = handle; in dhd_ifadd_event_handler() local
3290 if (!dhd) { in dhd_ifadd_event_handler()
3300 dhd_net_if_lock_local(dhd); in dhd_ifadd_event_handler()
3301 DHD_OS_WAKE_LOCK(&dhd->pub); in dhd_ifadd_event_handler()
3310 dhd->pub.awdl_ifidx = ifidx; in dhd_ifadd_event_handler()
3330 if ((ndev = wl_cfg80211_post_ifcreate(dhd->pub.info->iflist[0]->net, in dhd_ifadd_event_handler()
3333 if (wl_cfg80211_post_ifcreate(dhd->pub.info->iflist[0]->net, in dhd_ifadd_event_handler()
3347 ndev = dhd_allocate_if(&dhd->pub, ifidx, if_event->name, in dhd_ifadd_event_handler()
3355 ret = dhd_register_if(&dhd->pub, ifidx, TRUE); in dhd_ifadd_event_handler()
3358 dhd_remove_if(&dhd->pub, ifidx, TRUE); in dhd_ifadd_event_handler()
3366 if (FW_SUPPORTED((&dhd->pub), ap) && (if_event->event.role != WLC_E_IF_ROLE_STA)) { in dhd_ifadd_event_handler()
3368 ret = dhd_iovar(&dhd->pub, ifidx, "ap_isolate", (char *)&var_int, sizeof(var_int), in dhd_ifadd_event_handler()
3372 dhd_remove_if(&dhd->pub, ifidx, TRUE); in dhd_ifadd_event_handler()
3378 dhd_bridge_dev_set(dhd, ifidx, ndev); in dhd_ifadd_event_handler()
3384 dhd->pub.awdl_ifidx = 0; in dhd_ifadd_event_handler()
3388 MFREE(dhd->pub.osh, if_event, sizeof(dhd_if_event_t)); in dhd_ifadd_event_handler()
3390 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ifadd_event_handler()
3391 dhd_net_if_unlock_local(dhd); in dhd_ifadd_event_handler()
3397 dhd_info_t *dhd = handle; in dhd_ifdel_event_handler() local
3406 if (!dhd) { in dhd_ifdel_event_handler()
3416 dhd_net_if_lock_local(dhd); in dhd_ifdel_event_handler()
3417 DHD_OS_WAKE_LOCK(&dhd->pub); in dhd_ifdel_event_handler()
3422 if (!dhd->pub.info->iflist[ifidx]) { in dhd_ifdel_event_handler()
3428 dhd_bridge_dev_set(dhd, ifidx, NULL); in dhd_ifdel_event_handler()
3433 if (wl_cfg80211_post_ifdel(dhd->pub.info->iflist[ifidx]->net, in dhd_ifdel_event_handler()
3441 dhd_remove_if(&dhd->pub, ifidx, TRUE); in dhd_ifdel_event_handler()
3445 dhd->pub.awdl_ifidx = 0; in dhd_ifdel_event_handler()
3452 MFREE(dhd->pub.osh, if_event, sizeof(dhd_if_event_t)); in dhd_ifdel_event_handler()
3453 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ifdel_event_handler()
3454 dhd_net_if_unlock_local(dhd); in dhd_ifdel_event_handler()
3461 dhd_info_t *dhd = handle; in dhd_ifupdate_event_handler() local
3470 if (!dhd) { in dhd_ifupdate_event_handler()
3480 dhd_net_if_lock_local(dhd); in dhd_ifupdate_event_handler()
3481 DHD_OS_WAKE_LOCK(&dhd->pub); in dhd_ifupdate_event_handler()
3486 dhd_op_if_update(&dhd->pub, ifidx); in dhd_ifupdate_event_handler()
3488 MFREE(dhd->pub.osh, if_event, sizeof(dhd_if_event_t)); in dhd_ifupdate_event_handler()
3490 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ifupdate_event_handler()
3491 dhd_net_if_unlock_local(dhd); in dhd_ifupdate_event_handler()
3541 dhd_info_t *dhd = handle; in dhd_set_mac_addr_handler() local
3548 if (!dhd) { in dhd_set_mac_addr_handler()
3553 dhd_net_if_lock_local(dhd); in dhd_set_mac_addr_handler()
3554 DHD_OS_WAKE_LOCK(&dhd->pub); in dhd_set_mac_addr_handler()
3560 if (ifp == NULL || !dhd->pub.up) { in dhd_set_mac_addr_handler()
3571 if (_dhd_set_mac_address(dhd, ifp->idx, ifp->mac_addr, TRUE) == 0) in dhd_set_mac_addr_handler()
3581 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_set_mac_addr_handler()
3582 dhd_net_if_unlock_local(dhd); in dhd_set_mac_addr_handler()
3588 dhd_info_t *dhd = handle; in dhd_set_mcast_list_handler() local
3597 if (!dhd) { in dhd_set_mcast_list_handler()
3602 dhd_net_if_lock_local(dhd); in dhd_set_mcast_list_handler()
3603 DHD_OS_WAKE_LOCK(&dhd->pub); in dhd_set_mcast_list_handler()
3605 ifp = dhd->iflist[ifidx]; in dhd_set_mcast_list_handler()
3607 if (ifp == NULL || !dhd->pub.up) { in dhd_set_mcast_list_handler()
3612 if (ifp == NULL || !dhd->pub.up) { in dhd_set_mcast_list_handler()
3623 _dhd_set_multicast_list(dhd, ifidx); in dhd_set_mcast_list_handler()
3627 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_set_mcast_list_handler()
3628 dhd_net_if_unlock_local(dhd); in dhd_set_mcast_list_handler()
3636 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_set_mac_address() local
3643 dhd_pub_t *dhdp = &dhd->pub; in dhd_set_mac_address()
3654 dhd_net_if_lock_local(dhd); in dhd_set_mac_address()
3657 dhd_net_if_unlock_local(dhd); in dhd_set_mac_address()
3685 return _dhd_set_mac_address(dhd, ifidx, dhdif->mac_addr, TRUE); in dhd_set_mac_address()
3689 dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)dhdif, DHD_WQ_WORK_SET_MAC, in dhd_set_mac_address()
3697 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_set_multicast_list() local
3700 ifidx = dhd_net2idx(dhd, dev); in dhd_set_multicast_list()
3704 dhd->iflist[ifidx]->set_multicast = TRUE; in dhd_set_multicast_list()
3705 dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)((long int)ifidx), in dhd_set_multicast_list()
3709 dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)dhd->iflist[ifidx], in dhd_set_multicast_list()
3718 dhd_info_t *dhd = dhdp->info; in dhd_get_ucode_path() local
3719 return dhd->uc_path; in dhd_get_ucode_path()
3763 dhd_monitor_enabled(dhd_pub_t *dhd, int ifidx);
3915 dhd_info_t *dhd = (dhd_info_t *)(dhdp->info); in BCMFASTPATH() local
3999 atomic_inc(&dhd->pend_8021x_cnt); in BCMFASTPATH()
4058 dhd_update_sock_flows(dhd, pktbuf); in BCMFASTPATH()
4088 PKTCFREE(dhd->pub.osh, pktbuf, TRUE); in BCMFASTPATH()
4252 dhd_info_t *dhd = DHD_DEV_INFO(net); in BCMFASTPATH() local
4283 prio = dhd->pub.flow_prio_map[skb->priority]; in BCMFASTPATH()
4286 dhd->pktcnt_qac_histo[qidx][prio]++; in BCMFASTPATH()
4287 dhd->pktcnt_per_ac[prio]++; in BCMFASTPATH()
4288 dhd->cpu_qstats[qidx][cpuid]++; in BCMFASTPATH()
4291 if (dhd_query_bus_erros(&dhd->pub)) { in BCMFASTPATH()
4295 DHD_GENERAL_LOCK(&dhd->pub, flags); in BCMFASTPATH()
4296 DHD_BUS_BUSY_SET_IN_TX(&dhd->pub); in BCMFASTPATH()
4297 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in BCMFASTPATH()
4300 if (dhdpcie_runtime_bus_wake(&dhd->pub, FALSE, dhd_start_xmit)) { in BCMFASTPATH()
4303 DHD_GENERAL_LOCK(&dhd->pub, flags); in BCMFASTPATH()
4304 if (!dhdpcie_is_resume_done(&dhd->pub)) { in BCMFASTPATH()
4305 dhd_bus_stop_queue(dhd->pub.bus); in BCMFASTPATH()
4307 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub); in BCMFASTPATH()
4308 dhd_os_busbusy_wake(&dhd->pub); in BCMFASTPATH()
4309 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in BCMFASTPATH()
4314 DHD_GENERAL_LOCK(&dhd->pub, flags); in BCMFASTPATH()
4316 if (DHD_BUS_CHECK_SUSPEND_OR_SUSPEND_IN_PROGRESS(&dhd->pub)) { in BCMFASTPATH()
4318 __FUNCTION__, dhd->pub.busstate, dhd->pub.dhd_bus_busy_state)); in BCMFASTPATH()
4319 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub); in BCMFASTPATH()
4322 if (DHD_BUS_CHECK_ANY_SUSPEND_IN_PROGRESS(&dhd->pub)) { in BCMFASTPATH()
4323 dhd_bus_stop_queue(dhd->pub.bus); in BCMFASTPATH()
4326 dhd_os_busbusy_wake(&dhd->pub); in BCMFASTPATH()
4327 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in BCMFASTPATH()
4331 if (DHD_BUS_CHECK_SUSPEND_OR_SUSPEND_IN_PROGRESS(&dhd->pub)) { in BCMFASTPATH()
4333 __FUNCTION__, dhd->pub.busstate, dhd->pub.dhd_bus_busy_state)); in BCMFASTPATH()
4337 DHD_OS_WAKE_LOCK(&dhd->pub); in BCMFASTPATH()
4340 if (dhd->pub.req_hang_type == HANG_REASON_BUS_DOWN) { in BCMFASTPATH()
4342 dhd->pub.busstate = DHD_BUS_DOWN; in BCMFASTPATH()
4350 if (dhd->pub.hang_was_sent || DHD_BUS_CHECK_DOWN_OR_DOWN_IN_PROGRESS(&dhd->pub)) { in BCMFASTPATH()
4352 __FUNCTION__, dhd->pub.up, dhd->pub.busstate)); in BCMFASTPATH()
4356 if (dhd->pub.up && !dhd->pub.hang_was_sent && !DHD_BUS_CHECK_REMOVE(&dhd->pub)) { in BCMFASTPATH()
4358 dhd->pub.hang_reason = HANG_REASON_BUS_DOWN; in BCMFASTPATH()
4362 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub); in BCMFASTPATH()
4363 dhd_os_busbusy_wake(&dhd->pub); in BCMFASTPATH()
4364 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in BCMFASTPATH()
4365 DHD_OS_WAKE_UNLOCK(&dhd->pub); in BCMFASTPATH()
4377 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub); in BCMFASTPATH()
4378 dhd_os_busbusy_wake(&dhd->pub); in BCMFASTPATH()
4379 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in BCMFASTPATH()
4380 DHD_OS_WAKE_UNLOCK(&dhd->pub); in BCMFASTPATH()
4384 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in BCMFASTPATH()
4387 if (dhd->pub.tput_data.tput_test_running) { in BCMFASTPATH()
4391 ASSERT(ifidx == dhd_net2idx(dhd, net)); in BCMFASTPATH()
4392 ASSERT((ifp != NULL) && ((ifidx < DHD_MAX_IFS) && (ifp == dhd->iflist[ifidx]))); in BCMFASTPATH()
4400 PKTPUSH(dhd->pub.osh, skb, 1); in BCMFASTPATH()
4402 PKTSETLEN(dhd->pub.osh, skb, length); in BCMFASTPATH()
4405 datalen = PKTLEN(dhd->pub.osh, skb); in BCMFASTPATH()
4408 if (dhd->pub.conf->tput_monitor_ms) { in BCMFASTPATH()
4409 dhd_os_sdlock_txq(&dhd->pub); in BCMFASTPATH()
4410 dhd->pub.conf->net_len += datalen; in BCMFASTPATH()
4411 dhd_os_sdunlock_txq(&dhd->pub); in BCMFASTPATH()
4412 if ((dhd->pub.conf->data_drop_mode == XMIT_DROP) && in BCMFASTPATH()
4413 (PKTLEN(dhd->pub.osh, skb) > 500)) { in BCMFASTPATH()
4421 if (skb_headroom(skb) < dhd->pub.hdrlen + htsfdlystat_sz) { in BCMFASTPATH()
4425 dhd_ifname(&dhd->pub, ifidx))); in BCMFASTPATH()
4426 dhd->pub.tx_realloc++; in BCMFASTPATH()
4429 skb2 = skb_realloc_headroom(skb, dhd->pub.hdrlen + htsfdlystat_sz); in BCMFASTPATH()
4434 dhd_ifname(&dhd->pub, ifidx))); in BCMFASTPATH()
4443 if (dhd->pub.conf->orphan_move == 2) in BCMFASTPATH()
4444 PKTORPHAN(skb, dhd->pub.conf->tsq); in BCMFASTPATH()
4445 else if (dhd->pub.conf->orphan_move == 3) in BCMFASTPATH()
4449 if (!(pktbuf = PKTFRMNATIVE(dhd->pub.osh, skb))) { in BCMFASTPATH()
4451 dhd_ifname(&dhd->pub, ifidx))); in BCMFASTPATH()
4462 if (WET_ENABLED(&dhd->pub) && in BCMFASTPATH()
4463 (dhd_wet_send_proc(dhd->pub.wet_info, pktbuf, &pktbuf) < 0)) { in BCMFASTPATH()
4465 __FUNCTION__, dhd_ifname(&dhd->pub, ifidx))); in BCMFASTPATH()
4466 PKTFREE(dhd->pub.osh, pktbuf, FALSE); in BCMFASTPATH()
4473 eh = (struct ether_header *)PKTDATA(dhd->pub.osh, pktbuf); in BCMFASTPATH()
4481 ((IPV4_PROT(iph) == IP_PROT_IGMP) && dhd->pub.wmf_ucast_igmp))) { in BCMFASTPATH()
4489 ucast_convert = dhd->pub.wmf_ucast_upnp && MCAST_ADDR_UPNP_SSDP(dest_ip); in BCMFASTPATH()
4492 ucast_convert |= dhd->pub.wmf_ucast_igmp_query && in BCMFASTPATH()
4507 wmf_ucforward_list = DHD_IF_WMF_UCFORWARD_LOCK(dhd, ifp, &snapshot_list); in BCMFASTPATH()
4517 if ((sdu_clone = PKTDUP(dhd->pub.osh, pktbuf)) == NULL) { in BCMFASTPATH()
4523 DHD_IF_WMF_UCFORWARD_UNLOCK(dhd, wmf_ucforward_list); in BCMFASTPATH()
4525 DHD_GENERAL_LOCK(&dhd->pub, flags); in BCMFASTPATH()
4526 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub); in BCMFASTPATH()
4527 dhd_os_busbusy_wake(&dhd->pub); in BCMFASTPATH()
4528 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in BCMFASTPATH()
4529 DHD_OS_WAKE_UNLOCK(&dhd->pub); in BCMFASTPATH()
4532 PKTFREE(dhd->pub.osh, pktbuf, TRUE); in BCMFASTPATH()
4541 ret = dhd_wmf_packets_handle(&dhd->pub, pktbuf, NULL, ifidx, 0); in BCMFASTPATH()
4549 DHD_GENERAL_LOCK(&dhd->pub, flags); in BCMFASTPATH()
4550 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub); in BCMFASTPATH()
4551 dhd_os_busbusy_wake(&dhd->pub); in BCMFASTPATH()
4552 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in BCMFASTPATH()
4553 DHD_OS_WAKE_UNLOCK(&dhd->pub); in BCMFASTPATH()
4566 if (PSR_ENABLED(&dhd->pub) && in BCMFASTPATH()
4570 (dhd_psta_proc(&dhd->pub, ifidx, &pktbuf, TRUE) < 0)) { in BCMFASTPATH()
4573 dhd_ifname(&dhd->pub, ifidx))); in BCMFASTPATH()
4587 if (dhd_tcpdata_get_flag(&dhd->pub, pktbuf) == FLAG_SYNCACK) { in BCMFASTPATH()
4593 if (dhd->pub.tcpack_sup_mode == TCPACK_SUP_HOLD) { in BCMFASTPATH()
4595 if (dhd_tcpack_hold(&dhd->pub, pktbuf, ifidx)) { in BCMFASTPATH()
4601 if (dhd_tcpack_suppress(&dhd->pub, pktbuf)) { in BCMFASTPATH()
4613 ret = dhd_lb_sendpkt(dhd, net, ifidx, pktbuf); in BCMFASTPATH()
4615 ret = __dhd_sendpkt(&dhd->pub, ifidx, pktbuf); in BCMFASTPATH()
4624 dhd->pub.tx_dropped++; in BCMFASTPATH()
4628 if (!dhd_wlfc_is_supported(&dhd->pub)) in BCMFASTPATH()
4631 dhd->pub.tx_packets++; in BCMFASTPATH()
4635 dhd->pub.actual_tx_pkts++; in BCMFASTPATH()
4638 DHD_GENERAL_LOCK(&dhd->pub, flags); in BCMFASTPATH()
4639 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub); in BCMFASTPATH()
4641 dhd_os_tx_completion_wake(&dhd->pub); in BCMFASTPATH()
4642 dhd_os_busbusy_wake(&dhd->pub); in BCMFASTPATH()
4643 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in BCMFASTPATH()
4644 DHD_OS_WAKE_UNLOCK(&dhd->pub); in BCMFASTPATH()
4683 dhd_info_t *dhd; in dhd_start_xmit_wq_adapter() local
4688 dhd = DHD_DEV_INFO(work->net); in dhd_start_xmit_wq_adapter()
4690 bus = dhd->pub.bus; in dhd_start_xmit_wq_adapter()
4692 if (atomic_read(&dhd->pub.block_bus)) { in dhd_start_xmit_wq_adapter()
4717 dhd_info_t *dhd = DHD_DEV_INFO(net); in BCMFASTPATH() local
4719 if (dhd->pub.busstate == DHD_BUS_SUSPEND) { in BCMFASTPATH()
4722 dhd_netif_stop_queue(dhd->pub.bus); in BCMFASTPATH()
4737 queue_work(dhd->tx_wq, &start_xmit_work->work); in BCMFASTPATH()
4740 } else if (dhd->pub.busstate == DHD_BUS_DATA) { in BCMFASTPATH()
4754 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_bus_wakeup_work() local
4764 queue_work(dhd->rx_wq, &rx_work->work); in dhd_bus_wakeup_work()
4800 dhd_info_t *dhd = dhdp->info; in dhd_txflowcontrol() local
4806 ASSERT(dhd); in dhd_txflowcontrol()
4818 flags = dhd_os_sdlock_txoff(&dhd->pub); in dhd_txflowcontrol()
4821 if (dhd->iflist[i]) { in dhd_txflowcontrol()
4822 net = dhd->iflist[i]->net; in dhd_txflowcontrol()
4827 if (dhd->iflist[ifidx]) { in dhd_txflowcontrol()
4828 net = dhd->iflist[ifidx]->net; in dhd_txflowcontrol()
4833 dhd_os_sdunlock_txoff(&dhd->pub, flags); in dhd_txflowcontrol()
4842 dhd_info_t *dhd = dhdp->info; in dhd_ctf_dump() local
4845 ctf_dump(dhd->cih, strbuf); in dhd_ctf_dump()
4851 dhd_info_t *dhd = dhdp->info; in BCMFASTPATH() local
4852 dhd_if_t *ifp = dhd->iflist[ifidx]; in BCMFASTPATH()
4862 dhd_info_t *dhd = dhdp->info; in BCMFASTPATH() local
4863 dhd_if_t *ifp = dhd->iflist[ifidx]; in BCMFASTPATH()
4885 dhd_info_t *dhd = dhdp->info; in BCMFASTPATH() local
4886 dhd_if_t *ifp = dhd->iflist[ifidx]; in BCMFASTPATH()
4890 if (!dhd->brc_hot) in BCMFASTPATH()
4893 return CTF_HOTBRC_CMP(dhd->brc_hot, (eh), (void *)(ifp->net)); in BCMFASTPATH()
4904 BCMFASTPATH(dhd_ctf_forward)(dhd_info_t *dhd, struct sk_buff *skb, void **pnext) in BCMFASTPATH()
4906 dhd_pub_t *dhdp = &dhd->pub; in BCMFASTPATH()
4911 if (!CTF_ENAB(dhd->cih) || (ctf_forward(dhd->cih, skb, skb->dev) == BCME_ERROR)) { in BCMFASTPATH()
4958 dhd_info_t *dhd = dhdp->info; in dhd_is_rxthread_enabled() local
4960 return dhd->rxthread_enabled; in dhd_is_rxthread_enabled()
5004 struct dhd_info *dhd; in dhd_dpc_tasklet_dispatcher_work() local
5007 dhd = container_of(dw, struct dhd_info, dhd_dpc_dispatcher_work); in dhd_dpc_tasklet_dispatcher_work()
5012 tasklet_schedule(&dhd->tasklet); in dhd_dpc_tasklet_dispatcher_work()
5018 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_schedule_delayed_dpc_on_dpc_cpu() local
5019 int dpc_cpu = atomic_read(&dhd->dpc_cpu); in dhd_schedule_delayed_dpc_on_dpc_cpu()
5023 schedule_delayed_work_on(dpc_cpu, &dhd->dhd_dpc_dispatcher_work, delay); in dhd_schedule_delayed_dpc_on_dpc_cpu()
5044 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_event_logtrace_pkt_process() local
5074 dhd_dbg_trace_evnt_handler(dhdp, data, &dhd->event_data, datalen); in dhd_event_logtrace_pkt_process()
5088 dhd_event_logtrace_process_items(dhd_info_t *dhd) in dhd_event_logtrace_process_items() argument
5095 if (!dhd) { in dhd_event_logtrace_process_items()
5100 dhdp = &dhd->pub; in dhd_event_logtrace_process_items()
5113 qlen = skb_queue_len(&dhd->evt_trace_queue); in dhd_event_logtrace_process_items()
5119 skb = skb_dequeue(&dhd->evt_trace_queue); in dhd_event_logtrace_process_items()
5131 dhd_event_logtrace_infobuf_pkt_process(dhdp, skb, &dhd->event_data); in dhd_event_logtrace_process_items()
5167 skb->dev = dhd->iflist[0]->net; in dhd_event_logtrace_process_items()
5191 dhd_info_t *dhd = (dhd_info_t *)tsk->parent; in dhd_logtrace_thread() local
5192 dhd_pub_t *dhdp = (dhd_pub_t *)&dhd->pub; in dhd_logtrace_thread()
5200 if (dhd->pub.dongle_reset == FALSE) { in dhd_logtrace_thread()
5209 if (dhd->pub.dongle_edl_support) { in dhd_logtrace_thread()
5210 ret = dhd_prot_process_edl_complete(&dhd->pub, in dhd_logtrace_thread()
5211 &dhd->event_data); in dhd_logtrace_thread()
5213 ret = dhd_event_logtrace_process_items(dhd); in dhd_logtrace_thread()
5216 ret = dhd_event_logtrace_process_items(dhd); in dhd_logtrace_thread()
5258 struct dhd_info *dhd; in dhd_event_logtrace_process() local
5261 dhd = container_of(dw, struct dhd_info, event_log_dispatcher_work); in dhd_event_logtrace_process()
5265 if (dhd->pub.dongle_edl_support) { in dhd_event_logtrace_process()
5266 ret = dhd_prot_process_edl_complete(&dhd->pub, &dhd->event_data); in dhd_event_logtrace_process()
5268 ret = dhd_event_logtrace_process_items(dhd); in dhd_event_logtrace_process()
5271 ret = dhd_event_logtrace_process_items(dhd); in dhd_event_logtrace_process()
5275 schedule_delayed_work(&(dhd)->event_log_dispatcher_work, in dhd_event_logtrace_process()
5285 dhd_info_t *dhd = (dhd_info_t *)dhd_info; in dhd_schedule_logtrace() local
5288 if (dhd->thr_logtrace_ctl.thr_pid >= 0) { in dhd_schedule_logtrace()
5289 binary_sema_up(&dhd->thr_logtrace_ctl); in dhd_schedule_logtrace()
5292 dhd->thr_logtrace_ctl.thr_pid)); in dhd_schedule_logtrace()
5295 schedule_delayed_work(&dhd->event_log_dispatcher_work, 0); in dhd_schedule_logtrace()
5301 dhd_cancel_logtrace_process_sync(dhd_info_t *dhd) in dhd_cancel_logtrace_process_sync() argument
5304 if (dhd->thr_logtrace_ctl.thr_pid >= 0) { in dhd_cancel_logtrace_process_sync()
5305 PROC_STOP_USING_BINARY_SEMA(&dhd->thr_logtrace_ctl); in dhd_cancel_logtrace_process_sync()
5308 dhd->thr_logtrace_ctl.thr_pid)); in dhd_cancel_logtrace_process_sync()
5311 cancel_delayed_work_sync(&dhd->event_log_dispatcher_work); in dhd_cancel_logtrace_process_sync()
5316 dhd_flush_logtrace_process(dhd_info_t *dhd) in dhd_flush_logtrace_process() argument
5319 if (dhd->thr_logtrace_ctl.thr_pid >= 0) { in dhd_flush_logtrace_process()
5320 PROC_FLUSH_USING_BINARY_SEMA(&dhd->thr_logtrace_ctl); in dhd_flush_logtrace_process()
5323 dhd->thr_logtrace_ctl.thr_pid)); in dhd_flush_logtrace_process()
5326 flush_delayed_work(&dhd->event_log_dispatcher_work); in dhd_flush_logtrace_process()
5331 dhd_init_logtrace_process(dhd_info_t *dhd) in dhd_init_logtrace_process() argument
5334 dhd->thr_logtrace_ctl.thr_pid = DHD_PID_KT_INVALID; in dhd_init_logtrace_process()
5335 PROC_START(dhd_logtrace_thread, dhd, &dhd->thr_logtrace_ctl, 0, "dhd_logtrace_thread"); in dhd_init_logtrace_process()
5336 if (dhd->thr_logtrace_ctl.thr_pid < 0) { in dhd_init_logtrace_process()
5341 dhd->thr_logtrace_ctl.thr_pid)); in dhd_init_logtrace_process()
5344 INIT_DELAYED_WORK(&dhd->event_log_dispatcher_work, dhd_event_logtrace_process); in dhd_init_logtrace_process()
5350 dhd_reinit_logtrace_process(dhd_info_t *dhd) in dhd_reinit_logtrace_process() argument
5356 if (dhd->thr_logtrace_ctl.thr_pid < 0) { in dhd_reinit_logtrace_process()
5357 PROC_START(dhd_logtrace_thread, dhd, &dhd->thr_logtrace_ctl, in dhd_reinit_logtrace_process()
5359 if (dhd->thr_logtrace_ctl.thr_pid < 0) { in dhd_reinit_logtrace_process()
5364 dhd->thr_logtrace_ctl.thr_pid)); in dhd_reinit_logtrace_process()
5378 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_event_logtrace_enqueue() local
5384 skb_queue_tail(&dhd->evt_trace_queue, pktbuf); in dhd_event_logtrace_enqueue()
5386 dhd_schedule_logtrace(dhd); in dhd_event_logtrace_enqueue()
5394 dhd_info_t *dhd = (dhd_info_t *) dhdp->info; in dhd_event_logtrace_enqueue_fwtrace() local
5397 dhd_schedule_logtrace(dhd); in dhd_event_logtrace_enqueue_fwtrace()
5407 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_event_logtrace_flush_queue() local
5410 while ((skb = skb_dequeue(&dhd->evt_trace_queue)) != NULL) { in dhd_event_logtrace_flush_queue()
5427 dhd_info_t *dhd = dhdp->info; in dhd_sendup_info_buf() local
5448 skb->dev = dhd->iflist[0]->net; in dhd_sendup_info_buf()
5460 struct dhd_info *dhd; in dhd_bt_log_process() local
5466 dhd = container_of(work, struct dhd_info, bt_log_dispatcher_work); in dhd_bt_log_process()
5469 if (!dhd) { in dhd_bt_log_process()
5474 dhdp = &dhd->pub; in dhd_bt_log_process()
5484 while ((skb = skb_dequeue(&dhd->bt_log_queue)) != NULL) { in dhd_bt_log_process()
5497 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_rx_bt_log() local
5499 skb_queue_tail(&dhd->bt_log_queue, pkt); in dhd_rx_bt_log()
5502 schedule_work(&dhd->bt_log_dispatcher_work); in dhd_rx_bt_log()
5524 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_schedule_edl_work() local
5525 schedule_delayed_work(&dhd->edl_dispatcher_work, msecs_to_jiffies(delay_ms)); in dhd_schedule_edl_work()
5727 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_rx_frame() local
5768 ifp = dhd->iflist[ifidx]; in dhd_rx_frame()
5851 if (dhd->pub.tput_data.tput_test_running && in dhd_rx_frame()
5852 dhd->pub.tput_data.direction == TPUT_DIR_RX && in dhd_rx_frame()
5855 PKTFREE(dhd->pub.osh, pktbuf, FALSE); in dhd_rx_frame()
5874 ifp = dhd->iflist[ifidx]; in dhd_rx_frame()
5895 if ((!ifp->net || ifp->net->reg_state != NETREG_REGISTERED || !dhd->pub.up) && in dhd_rx_frame()
6037 if (WET_ENABLED(&dhd->pub) && (dhd_wet_recv_proc(dhd->pub.wet_info, in dhd_rx_frame()
6085 if (dhd_ctf_forward(dhd, skb, &pnext) == BCME_OK) { in dhd_rx_frame()
6192 if (dhd->pub.loopback) { in dhd_rx_frame()
6248 dhd->pub.rx_multicast++; in dhd_rx_frame()
6329 ret_event = dhd_wl_host_event(dhd, ifidx, pkt_data, len, &event, &data); in dhd_rx_frame()
6379 ASSERT(ifidx < DHD_MAX_IFS && dhd->iflist[ifidx]); in dhd_rx_frame()
6380 ifp = dhd->iflist[ifidx]; in dhd_rx_frame()
6385 dhd->pub.up)) in dhd_rx_frame()
6525 napi_gro_receive(&dhd->rx_napi_struct, skb); in dhd_rx_frame()
6541 if (dhd->rxthread_enabled) { in dhd_rx_frame()
6559 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF); in dhd_rx_frame()
6565 napi_gro_receive(&dhd->rx_napi_struct, skb); in dhd_rx_frame()
6579 if (dhd->rxthread_enabled && skbhead) in dhd_rx_frame()
6589 dhd_event(struct dhd_info *dhd, char *evpkt, int evlen, int ifidx) in dhd_event() argument
6598 dhd_info_t *dhd = (dhd_info_t *)(dhdp->info); in dhd_txcomplete() local
6630 atomic_dec(&dhd->pend_8021x_cnt); in dhd_txcomplete()
6635 dhd_if_t *ifp = dhd->iflist[DHD_PKTTAG_IF(PKTTAG(txp))]; in dhd_txcomplete()
6636 uint datalen = PKTLEN(dhd->pub.osh, txp); in dhd_txcomplete()
6639 dhd->pub.tx_packets++; in dhd_txcomplete()
6649 dhd->pub.tot_txcpl++; in dhd_txcomplete()
6680 dhd_info_t *dhd = DHD_DEV_INFO(net); in dhd_get_stats() local
6685 if (!dhd) { in dhd_get_stats()
6690 ifp = dhd_get_ifp_by_ndev(&dhd->pub, net); in dhd_get_stats()
6697 if (dhd->pub.up) { in dhd_get_stats()
6699 dhd_prot_dstats(&dhd->pub); in dhd_get_stats()
6713 dhd_info_t *dhd = (dhd_info_t *)tsk->parent; in dhd_watchdog_thread() local
6730 DHD_OS_WD_WAKE_LOCK(&dhd->pub); in dhd_watchdog_thread()
6736 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub); in dhd_watchdog_thread()
6741 if (dhd->pub.dongle_reset == FALSE) { in dhd_watchdog_thread()
6743 dhd_analyze_sock_flows(dhd, dhd_watchdog_ms); in dhd_watchdog_thread()
6744 dhd_bus_watchdog(&dhd->pub); in dhd_watchdog_thread()
6748 dhd_timesync_watchdog(&dhd->pub); in dhd_watchdog_thread()
6752 if (CTF_ENAB(dhd->cih)) in dhd_watchdog_thread()
6753 osl_ctfpool_replenish(dhd->pub.osh, CTFPOOL_REFILL_THRESH); in dhd_watchdog_thread()
6756 DHD_GENERAL_LOCK(&dhd->pub, flags); in dhd_watchdog_thread()
6758 dhd->pub.tickcnt++; in dhd_watchdog_thread()
6760 dhd_l2_filter_watchdog(&dhd->pub); in dhd_watchdog_thread()
6765 if (dhd->wd_timer_valid) { in dhd_watchdog_thread()
6766 mod_timer(&dhd->timer, in dhd_watchdog_thread()
6771 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in dhd_watchdog_thread()
6774 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub); in dhd_watchdog_thread()
6786 dhd_info_t *dhd = (dhd_info_t *)data; in dhd_watchdog() local
6789 if (dhd->pub.dongle_reset) { in dhd_watchdog()
6793 if (dhd->thr_wdt_ctl.thr_pid >= 0) { in dhd_watchdog()
6794 up(&dhd->thr_wdt_ctl.sema); in dhd_watchdog()
6799 DHD_OS_WD_WAKE_LOCK(&dhd->pub); in dhd_watchdog()
6802 dhd_bus_watchdog(&dhd->pub); in dhd_watchdog()
6806 dhd_timesync_watchdog(&dhd->pub); in dhd_watchdog()
6809 DHD_GENERAL_LOCK(&dhd->pub, flags); in dhd_watchdog()
6811 dhd->pub.tickcnt++; in dhd_watchdog()
6814 dhd_l2_filter_watchdog(&dhd->pub); in dhd_watchdog()
6817 if (dhd->wd_timer_valid) in dhd_watchdog()
6818 mod_timer(&dhd->timer, jiffies + msecs_to_jiffies(dhd_watchdog_ms)); in dhd_watchdog()
6819 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in dhd_watchdog()
6821 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub); in dhd_watchdog()
6825 if (CTF_ENAB(dhd->cih)) in dhd_watchdog()
6826 osl_ctfpool_replenish(dhd->pub.osh, CTFPOOL_REFILL_THRESH); in dhd_watchdog()
6835 dhd_info_t *dhd = (dhd_info_t *)tsk->parent; in dhd_rpm_state_thread() local
6848 if (dhd->pub.dongle_reset == FALSE) { in dhd_rpm_state_thread()
6850 if (dhd->pub.up) { in dhd_rpm_state_thread()
6852 dhd_bus_dw_deassert(&dhd->pub); in dhd_rpm_state_thread()
6854 if (dhd_get_rpm_state(&dhd->pub)) { in dhd_rpm_state_thread()
6855 dhd_runtimepm_state(&dhd->pub); in dhd_rpm_state_thread()
6858 DHD_GENERAL_LOCK(&dhd->pub, flags); in dhd_rpm_state_thread()
6862 if (dhd->rpm_timer_valid) { in dhd_rpm_state_thread()
6863 mod_timer(&dhd->rpm_timer, in dhd_rpm_state_thread()
6869 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in dhd_rpm_state_thread()
6881 dhd_info_t *dhd = (dhd_info_t *)data; in dhd_runtimepm() local
6883 if (dhd->pub.dongle_reset) { in dhd_runtimepm()
6887 if (dhd->thr_rpm_ctl.thr_pid >= 0) { in dhd_runtimepm()
6888 up(&dhd->thr_rpm_ctl.sema); in dhd_runtimepm()
6930 dhd_info_t *dhd = container_of(nb, struct dhd_info, freq_trans); in dhd_cpufreq_notifier() local
6932 if (dhd) { in dhd_cpufreq_notifier()
6933 if (!dhd->new_freq) in dhd_cpufreq_notifier()
6938 *per_cpu_ptr(dhd->new_freq, freq->cpu) = freq->new; in dhd_cpufreq_notifier()
6950 dhd_info_t *dhd = (dhd_info_t *)tsk->parent; in dhd_dpc_thread() local
6966 dhd->pub.current_dpc = current; in dhd_dpc_thread()
6970 if (dhd->pub.conf->dpc_cpucore >= 0) { in dhd_dpc_thread()
6971 printf("%s: set dpc_cpucore %d\n", __FUNCTION__, dhd->pub.conf->dpc_cpucore); in dhd_dpc_thread()
6972 set_cpus_allowed_ptr(current, cpumask_of(dhd->pub.conf->dpc_cpucore)); in dhd_dpc_thread()
6973 dhd->pub.conf->dpc_cpucore = -1; in dhd_dpc_thread()
6975 if (dhd->pub.conf->dhd_dpc_prio >= 0) { in dhd_dpc_thread()
6977 printf("%s: set dhd_dpc_prio %d\n", __FUNCTION__, dhd->pub.conf->dhd_dpc_prio); in dhd_dpc_thread()
6978 param.sched_priority = (dhd->pub.conf->dhd_dpc_prio < MAX_RT_PRIO)? in dhd_dpc_thread()
6979 dhd->pub.conf->dhd_dpc_prio:(MAX_RT_PRIO-1); in dhd_dpc_thread()
6981 dhd->pub.conf->dhd_dpc_prio = -1; in dhd_dpc_thread()
6989 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_dpc_thread()
6994 if (dhd->pub.busstate != DHD_BUS_DOWN) { in dhd_dpc_thread()
6998 dhd_os_wd_timer_extend(&dhd->pub, TRUE); in dhd_dpc_thread()
6999 while (dhd_bus_dpc(dhd->pub.bus)) { in dhd_dpc_thread()
7007 dhd->pub.dhd_bug_on = true; in dhd_dpc_thread()
7013 dhd_os_wd_timer_extend(&dhd->pub, FALSE); in dhd_dpc_thread()
7014 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_dpc_thread()
7016 if (dhd->pub.up) in dhd_dpc_thread()
7017 dhd_bus_stop(dhd->pub.bus, TRUE); in dhd_dpc_thread()
7018 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_dpc_thread()
7031 dhd_info_t *dhd = (dhd_info_t *)tsk->parent; in dhd_rxf_thread() local
7036 dhd_pub_t *pub = &dhd->pub; in dhd_rxf_thread()
7049 dhd->pub.current_rxf = current; in dhd_rxf_thread()
7053 if (dhd->pub.conf->rxf_cpucore >= 0) { in dhd_rxf_thread()
7054 printf("%s: set rxf_cpucore %d\n", __FUNCTION__, dhd->pub.conf->rxf_cpucore); in dhd_rxf_thread()
7055 set_cpus_allowed_ptr(current, cpumask_of(dhd->pub.conf->rxf_cpucore)); in dhd_rxf_thread()
7056 dhd->pub.conf->rxf_cpucore = -1; in dhd_rxf_thread()
7107 dhd_info_t *dhd; in dhd_dpc_enable() local
7111 dhd = dhdp->info; in dhd_dpc_enable()
7115 __skb_queue_head_init(&dhd->rx_pend_queue); in dhd_dpc_enable()
7119 skb_queue_head_init(&dhd->tx_pend_queue); in dhd_dpc_enable()
7128 dhd_info_t *dhd; in dhd_dpc_kill() local
7134 dhd = dhdp->info; in dhd_dpc_kill()
7136 if (!dhd) { in dhd_dpc_kill()
7140 if (dhd->thr_dpc_ctl.thr_pid < 0) { in dhd_dpc_kill()
7141 tasklet_kill(&dhd->tasklet); in dhd_dpc_kill()
7145 cancel_delayed_work_sync(&dhd->dhd_dpc_dispatcher_work); in dhd_dpc_kill()
7148 cancel_work_sync(&dhd->rx_napi_dispatcher_work); in dhd_dpc_kill()
7149 __skb_queue_purge(&dhd->rx_pend_queue); in dhd_dpc_kill()
7152 cancel_work_sync(&dhd->tx_dispatcher_work); in dhd_dpc_kill()
7153 skb_queue_purge(&dhd->tx_pend_queue); in dhd_dpc_kill()
7154 tasklet_kill(&dhd->tx_tasklet); in dhd_dpc_kill()
7162 dhd_info_t *dhd; in dhd_dpc_tasklet_kill() local
7168 dhd = dhdp->info; in dhd_dpc_tasklet_kill()
7170 if (!dhd) { in dhd_dpc_tasklet_kill()
7174 if (dhd->thr_dpc_ctl.thr_pid < 0) { in dhd_dpc_tasklet_kill()
7175 tasklet_kill(&dhd->tasklet); in dhd_dpc_tasklet_kill()
7183 dhd_info_t *dhd = (dhd_info_t *)data; in dhd_dpc() local
7189 atomic_set(&dhd->dpc_cpu, curr_cpu); in dhd_dpc()
7196 if (dhd->pub.busstate != DHD_BUS_DOWN) { in dhd_dpc()
7198 DHD_LB_STATS_INCR(dhd->dhd_dpc_cnt); in dhd_dpc()
7200 if (dhd_bus_dpc(dhd->pub.bus)) { in dhd_dpc()
7201 tasklet_schedule(&dhd->tasklet); in dhd_dpc()
7204 dhd_bus_stop(dhd->pub.bus, TRUE); in dhd_dpc()
7208 atomic_set(&dhd->prev_dpc_cpu, curr_cpu); in dhd_dpc()
7215 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_sched_dpc() local
7217 if (dhd->thr_dpc_ctl.thr_pid >= 0) { in dhd_sched_dpc()
7222 if (!binary_sema_up(&dhd->thr_dpc_ctl)) { in dhd_sched_dpc()
7227 tasklet_schedule(&dhd->tasklet); in dhd_sched_dpc()
7235 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_sched_rxf() local
7266 if (dhd->thr_rxf_ctl.thr_pid >= 0) { in dhd_sched_rxf()
7267 up(&dhd->thr_rxf_ctl.sema); in dhd_sched_rxf()
7275 if (dhd->thr_rxf_ctl.thr_pid >= 0) { in dhd_sched_rxf()
7276 up(&dhd->thr_rxf_ctl.sema); in dhd_sched_rxf()
7290 dhd_toe_get(dhd_info_t *dhd, int ifidx, uint32 *toe_ol) in dhd_toe_get() argument
7295 ret = dhd_iovar(&dhd->pub, ifidx, "toe_ol", NULL, 0, (char *)&buf, sizeof(buf), FALSE); in dhd_toe_get()
7299 DHD_ERROR(("%s: toe not supported by device\n", dhd_ifname(&dhd->pub, in dhd_toe_get()
7304 DHD_INFO(("%s: could not get toe_ol: ret=%d\n", dhd_ifname(&dhd->pub, ifidx), ret)); in dhd_toe_get()
7314 dhd_toe_set(dhd_info_t *dhd, int ifidx, uint32 toe_ol) in dhd_toe_set() argument
7319 ret = dhd_iovar(&dhd->pub, ifidx, "toe_ol", (char *)&toe_ol, sizeof(toe_ol), NULL, 0, TRUE); in dhd_toe_set()
7322 dhd_ifname(&dhd->pub, ifidx), ret)); in dhd_toe_set()
7328 ret = dhd_iovar(&dhd->pub, ifidx, "toe", (char *)&toe, sizeof(toe), NULL, 0, TRUE); in dhd_toe_set()
7330 DHD_ERROR(("%s: could not set toe: ret=%d\n", dhd_ifname(&dhd->pub, ifidx), ret)); in dhd_toe_set()
7339 void dhd_set_scb_probe(dhd_pub_t *dhd) in dhd_set_scb_probe() argument
7345 if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE) { in dhd_set_scb_probe()
7349 ret = dhd_iovar(dhd, 0, "scb_probe", NULL, 0, iovbuf, sizeof(iovbuf), FALSE); in dhd_set_scb_probe()
7358 ret = dhd_iovar(dhd, 0, "scb_probe", (char *)&scb_probe, sizeof(wl_scb_probe_t), NULL, 0, in dhd_set_scb_probe()
7370 dhd_info_t *dhd = DHD_DEV_INFO(net); in dhd_ethtool_get_drvinfo() local
7373 snprintf(info->version, sizeof(info->version), "%lu", dhd->pub.drv_version); in dhd_ethtool_get_drvinfo()
7381 dhd_ethtool(dhd_info_t *dhd, void *uaddr) in dhd_ethtool() argument
7422 else if (!dhd->pub.up) { in dhd_ethtool()
7428 else if (dhd->pub.iswl) in dhd_ethtool()
7433 snprintf(info.version, sizeof(info.version), "%lu", dhd->pub.drv_version); in dhd_ethtool()
7444 if ((ret = dhd_toe_get(dhd, 0, &toe_cmpnt)) < 0) in dhd_ethtool()
7463 if ((ret = dhd_toe_get(dhd, 0, &toe_cmpnt)) < 0) in dhd_ethtool()
7473 if ((ret = dhd_toe_set(dhd, 0, toe_cmpnt)) < 0) in dhd_ethtool()
7479 dhd->iflist[0]->net->features |= NETIF_F_IP_CSUM; in dhd_ethtool()
7481 dhd->iflist[0]->net->features &= ~NETIF_F_IP_CSUM; in dhd_ethtool()
7549 dhd_monitor_enabled(dhd_pub_t *dhd, int ifidx) in dhd_monitor_enabled() argument
7551 return (dhd->info->monitor_type != 0); in dhd_monitor_enabled()
7558 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_rx_mon_pkt_sdio() local
7560 if (!dhd->monitor_skb) { in dhd_rx_mon_pkt_sdio()
7561 if ((dhd->monitor_skb = PKTTONATIVE(dhdp->osh, pkt)) == NULL) in dhd_rx_mon_pkt_sdio()
7565 if (dhd->monitor_type && dhd->monitor_dev) in dhd_rx_mon_pkt_sdio()
7566 dhd->monitor_skb->dev = dhd->monitor_dev; in dhd_rx_mon_pkt_sdio()
7569 dhd->monitor_skb = NULL; in dhd_rx_mon_pkt_sdio()
7573 dhd->monitor_skb->protocol = in dhd_rx_mon_pkt_sdio()
7574 eth_type_trans(dhd->monitor_skb, dhd->monitor_skb->dev); in dhd_rx_mon_pkt_sdio()
7575 dhd->monitor_len = 0; in dhd_rx_mon_pkt_sdio()
7577 netif_rx_ni(dhd->monitor_skb); in dhd_rx_mon_pkt_sdio()
7579 dhd->monitor_skb = NULL; in dhd_rx_mon_pkt_sdio()
7586 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_rx_mon_pkt() local
7588 if (dhd->host_radiotap_conv) { in dhd_rx_mon_pkt()
7595 if (!dhd->monitor_skb) { in dhd_rx_mon_pkt()
7596 if ((dhd->monitor_skb = dev_alloc_skb(MAX_MON_PKT_SIZE)) == NULL) in dhd_rx_mon_pkt()
7600 len = bcmwifi_monitor(dhd->monitor_info, &pkt_info, PKTDATA(dhdp->osh, pkt), in dhd_rx_mon_pkt()
7601 PKTLEN(dhdp->osh, pkt), PKTDATA(dhdp->osh, dhd->monitor_skb), &offset); in dhd_rx_mon_pkt()
7603 if (dhd->monitor_type && dhd->monitor_dev) in dhd_rx_mon_pkt()
7604 dhd->monitor_skb->dev = dhd->monitor_dev; in dhd_rx_mon_pkt()
7607 dev_kfree_skb(dhd->monitor_skb); in dhd_rx_mon_pkt()
7617 skb_put(dhd->monitor_skb, len); in dhd_rx_mon_pkt()
7618 skb_pull(dhd->monitor_skb, offset); in dhd_rx_mon_pkt()
7620 dhd->monitor_skb->protocol = eth_type_trans(dhd->monitor_skb, in dhd_rx_mon_pkt()
7621 dhd->monitor_skb->dev); in dhd_rx_mon_pkt()
7631 if (!dhd->monitor_skb) { in dhd_rx_mon_pkt()
7632 if ((dhd->monitor_skb = PKTTONATIVE(dhdp->osh, pkt)) in dhd_rx_mon_pkt()
7636 if (dhd->monitor_type && dhd->monitor_dev) in dhd_rx_mon_pkt()
7637 dhd->monitor_skb->dev = dhd->monitor_dev; in dhd_rx_mon_pkt()
7640 dhd->monitor_skb = NULL; in dhd_rx_mon_pkt()
7643 dhd->monitor_skb->protocol = in dhd_rx_mon_pkt()
7644 eth_type_trans(dhd->monitor_skb, dhd->monitor_skb->dev); in dhd_rx_mon_pkt()
7645 dhd->monitor_len = 0; in dhd_rx_mon_pkt()
7649 if (!dhd->monitor_skb) { in dhd_rx_mon_pkt()
7650 if ((dhd->monitor_skb = dev_alloc_skb(MAX_MON_PKT_SIZE)) in dhd_rx_mon_pkt()
7653 dhd->monitor_len = 0; in dhd_rx_mon_pkt()
7655 if (dhd->monitor_type && dhd->monitor_dev) in dhd_rx_mon_pkt()
7656 dhd->monitor_skb->dev = dhd->monitor_dev; in dhd_rx_mon_pkt()
7659 dev_kfree_skb(dhd->monitor_skb); in dhd_rx_mon_pkt()
7662 memcpy(PKTDATA(dhdp->osh, dhd->monitor_skb), in dhd_rx_mon_pkt()
7664 dhd->monitor_len = PKTLEN(dhdp->osh, pkt); in dhd_rx_mon_pkt()
7669 memcpy(PKTDATA(dhdp->osh, dhd->monitor_skb) + dhd->monitor_len, in dhd_rx_mon_pkt()
7671 dhd->monitor_len += PKTLEN(dhdp->osh, pkt); in dhd_rx_mon_pkt()
7676 memcpy(PKTDATA(dhdp->osh, dhd->monitor_skb) + dhd->monitor_len, in dhd_rx_mon_pkt()
7678 dhd->monitor_len += PKTLEN(dhdp->osh, pkt); in dhd_rx_mon_pkt()
7680 skb_put(dhd->monitor_skb, dhd->monitor_len); in dhd_rx_mon_pkt()
7681 dhd->monitor_skb->protocol = in dhd_rx_mon_pkt()
7682 eth_type_trans(dhd->monitor_skb, dhd->monitor_skb->dev); in dhd_rx_mon_pkt()
7683 dhd->monitor_len = 0; in dhd_rx_mon_pkt()
7688 if (skb_headroom(dhd->monitor_skb) < ETHER_HDR_LEN) { in dhd_rx_mon_pkt()
7692 dhd_ifname(&dhd->pub, ifidx))); in dhd_rx_mon_pkt()
7694 skb2 = skb_realloc_headroom(dhd->monitor_skb, ETHER_HDR_LEN); in dhd_rx_mon_pkt()
7696 dev_kfree_skb(dhd->monitor_skb); in dhd_rx_mon_pkt()
7697 if ((dhd->monitor_skb = skb2) == NULL) { in dhd_rx_mon_pkt()
7699 dhd_ifname(&dhd->pub, ifidx))); in dhd_rx_mon_pkt()
7703 PKTPUSH(dhd->pub.osh, dhd->monitor_skb, ETHER_HDR_LEN); in dhd_rx_mon_pkt()
7709 netif_rx(dhd->monitor_skb); in dhd_rx_mon_pkt()
7717 bcm_object_trace_opr(dhd->monitor_skb, BCM_OBJDBG_REMOVE, in dhd_rx_mon_pkt()
7720 netif_rx_ni(dhd->monitor_skb); in dhd_rx_mon_pkt()
7723 dhd->monitor_skb = NULL; in dhd_rx_mon_pkt()
7764 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_bus_get() local
7767 mutex_lock(&dhd->bus_user_lock); in dhd_bus_get()
7768 ++dhd->bus_user_count; in dhd_bus_get()
7769 if (dhd->bus_user_count < 0) { in dhd_bus_get()
7775 if (dhd->bus_user_count == 1) { in dhd_bus_get()
7777 dhd->pub.hang_was_sent = 0; in dhd_bus_get()
7782 if (!wifi_platform_set_power(dhd->adapter, TRUE, WIFI_TURNON_DELAY)) { in dhd_bus_get()
7796 dhd_update_fw_nv_path(dhd); in dhd_bus_get()
7798 dhd_bus_update_fw_nv_path(dhd->pub.bus, in dhd_bus_get()
7799 dhd->fw_path, dhd->nv_path); in dhd_bus_get()
7805 if (dhd_sync_with_dongle(&dhd->pub) < 0) { in dhd_bus_get()
7814 __FUNCTION__, dhd->bus_user_count)); in dhd_bus_get()
7817 mutex_unlock(&dhd->bus_user_lock); in dhd_bus_get()
7830 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_bus_put() local
7834 mutex_lock(&dhd->bus_user_lock); in dhd_bus_put()
7835 --dhd->bus_user_count; in dhd_bus_put()
7836 if (dhd->bus_user_count < 0) { in dhd_bus_put()
7838 dhd->bus_user_count = 0; in dhd_bus_put()
7843 if (dhd->bus_user_count == 0) { in dhd_bus_put()
7848 if (dhd->pub.wlfc_enabled) { in dhd_bus_put()
7849 dhd_wlfc_deinit(&dhd->pub); in dhd_bus_put()
7853 if (dhd->pub.pno_state) { in dhd_bus_put()
7854 dhd_pno_deinit(&dhd->pub); in dhd_bus_put()
7858 if (dhd->pub.rtt_state) { in dhd_bus_put()
7859 dhd_rtt_deinit(&dhd->pub); in dhd_bus_put()
7865 wifi_platform_set_power(dhd->adapter, FALSE, WIFI_TURNOFF_DELAY); in dhd_bus_put()
7869 __FUNCTION__, dhd->bus_user_count)); in dhd_bus_put()
7872 mutex_unlock(&dhd->bus_user_lock); in dhd_bus_put()
7880 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_net_bus_get() local
7881 return dhd_bus_get(&dhd->pub, WLAN_MODULE); in dhd_net_bus_get()
7887 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_net_bus_put() local
7888 return dhd_bus_put(&dhd->pub, WLAN_MODULE); in dhd_net_bus_put()
7960 dhd_info_t *dhd = (dhd_info_t*)dhdp->info; in dhd_bus_retry_hang_recovery() local
7964 dhd_os_send_hang_message(&dhd->pub); in dhd_bus_retry_hang_recovery()
7990 dhd_add_monitor_if(dhd_info_t *dhd) in dhd_add_monitor_if() argument
7995 dhd_pub_t *dhdp = (dhd_pub_t *)&dhd->pub; in dhd_add_monitor_if()
8000 if (!dhd) { in dhd_add_monitor_if()
8005 if (dhd->monitor_dev) { in dhd_add_monitor_if()
8018 snprintf(dev->name, sizeof(dev->name), "%s%u", devname, dhd->unit); in dhd_add_monitor_if()
8043 if (FW_SUPPORTED((&dhd->pub), monitor)) { in dhd_add_monitor_if()
8046 DHD_DISABLE_RUNTIME_PM(&dhd->pub); in dhd_add_monitor_if()
8051 ret = dhd_iovar(&dhd->pub, 0, "scansuppress", (char *)&scan_suppress, in dhd_add_monitor_if()
8059 bcmwifi_monitor_create(&dhd->monitor_info); in dhd_add_monitor_if()
8060 bcmwifi_set_corerev_major(dhd->monitor_info, dhdpcie_get_corerev_major(dhdp)); in dhd_add_monitor_if()
8061 bcmwifi_set_corerev_minor(dhd->monitor_info, dhdpcie_get_corerev_minor(dhdp)); in dhd_add_monitor_if()
8063 dhd->monitor_dev = dev; in dhd_add_monitor_if()
8067 dhd_del_monitor_if(dhd_info_t *dhd) in dhd_del_monitor_if() argument
8072 if (!dhd) { in dhd_del_monitor_if()
8077 if (!dhd->monitor_dev) { in dhd_del_monitor_if()
8082 if (FW_SUPPORTED((&dhd->pub), monitor)) { in dhd_del_monitor_if()
8085 DHD_ENABLE_RUNTIME_PM(&dhd->pub); in dhd_del_monitor_if()
8090 ret = dhd_iovar(&dhd->pub, 0, "scansuppress", (char *)&scan_suppress, in dhd_del_monitor_if()
8097 if (dhd->monitor_dev) { in dhd_del_monitor_if()
8098 if (dhd->monitor_dev->reg_state == NETREG_UNINITIALIZED) { in dhd_del_monitor_if()
8099 free_netdev(dhd->monitor_dev); in dhd_del_monitor_if()
8102 unregister_netdevice(dhd->monitor_dev); in dhd_del_monitor_if()
8104 unregister_netdev(dhd->monitor_dev); in dhd_del_monitor_if()
8107 dhd->monitor_dev = NULL; in dhd_del_monitor_if()
8110 if (dhd->monitor_info) { in dhd_del_monitor_if()
8111 bcmwifi_monitor_delete(dhd->monitor_info); in dhd_del_monitor_if()
8112 dhd->monitor_info = NULL; in dhd_del_monitor_if()
8120 dhd_info_t *dhd = pub->info; in dhd_set_monitor() local
8124 dhd_net_if_lock_local(dhd); in dhd_set_monitor()
8127 dhd_del_monitor_if(dhd); in dhd_set_monitor()
8130 dhd_add_monitor_if(dhd); in dhd_set_monitor()
8132 dhd->monitor_type = val; in dhd_set_monitor()
8133 dhd_net_if_unlock_local(dhd); in dhd_set_monitor()
8157 dhd_pub_t *dhd; in dhd_deferred_work_rte_log_time_sync() local
8169 dhd = &dhd_info->pub; in dhd_deferred_work_rte_log_time_sync()
8178 dhd_h2d_log_time_sync(dhd); in dhd_deferred_work_rte_log_time_sync()
8411 dhd_info_t *dhd = DHD_DEV_INFO(net); in dhd_ioctl_entry() local
8426 DHD_OS_WAKE_LOCK(&dhd->pub); in dhd_ioctl_entry()
8430 if (!dhd_download_fw_on_driverload && dhd->pub.up == FALSE) { in dhd_ioctl_entry()
8432 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ioctl_entry()
8437 ifidx = dhd_net2idx(dhd, net); in dhd_ioctl_entry()
8442 if (dhd_is_static_ndev(&dhd->pub, net) && !(net->flags & IFF_UP)) { in dhd_ioctl_entry()
8443 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ioctl_entry()
8450 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ioctl_entry()
8459 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ioctl_entry()
8465 ret = dhd_ethtool(dhd, (void*)ifr->ifr_data); in dhd_ioctl_entry()
8466 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ioctl_entry()
8473 dhd_check_hang(net, &dhd->pub, ret); in dhd_ioctl_entry()
8474 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ioctl_entry()
8481 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ioctl_entry()
8581 if (!(local_buf = MALLOC(dhd->pub.osh, buflen+1))) { in dhd_ioctl_entry()
8602 if (ioc.driver != DHD_IOCTL_MAGIC && dhd->pub.hang_was_sent) { in dhd_ioctl_entry()
8604 DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_ENABLE(&dhd->pub, DHD_EVENT_TIMEOUT_MS); in dhd_ioctl_entry()
8611 bcmerror = dhd_nho_ioctl_process(&dhd->pub, ifidx, &ioc, local_buf); in dhd_ioctl_entry()
8613 bcmerror = dhd_ioctl_process(&dhd->pub, ifidx, &ioc, local_buf); in dhd_ioctl_entry()
8625 MFREE(dhd->pub.osh, local_buf, buflen+1); in dhd_ioctl_entry()
8627 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ioctl_entry()
8640 static int dhd_init_cpufreq_fix(dhd_info_t *dhd) in dhd_init_cpufreq_fix() argument
8642 if (dhd) { in dhd_init_cpufreq_fix()
8643 mutex_init(&dhd->cpufreq_fix); in dhd_init_cpufreq_fix()
8644 dhd->cpufreq_fix_status = FALSE; in dhd_init_cpufreq_fix()
8649 static void dhd_fix_cpu_freq(dhd_info_t *dhd) in dhd_fix_cpu_freq() argument
8651 mutex_lock(&dhd->cpufreq_fix); in dhd_fix_cpu_freq()
8652 if (dhd && !dhd->cpufreq_fix_status) { in dhd_fix_cpu_freq()
8653 pm_qos_add_request(&dhd->dhd_cpu_qos, PM_QOS_CPU_FREQ_MIN, 300000); in dhd_fix_cpu_freq()
8655 pm_qos_add_request(&dhd->dhd_bus_qos, PM_QOS_BUS_THROUGHPUT, 400000); in dhd_fix_cpu_freq()
8659 dhd->cpufreq_fix_status = TRUE; in dhd_fix_cpu_freq()
8661 mutex_unlock(&dhd->cpufreq_fix); in dhd_fix_cpu_freq()
8664 static void dhd_rollback_cpu_freq(dhd_info_t *dhd) in dhd_rollback_cpu_freq() argument
8666 mutex_lock(&dhd ->cpufreq_fix); in dhd_rollback_cpu_freq()
8667 if (dhd && dhd->cpufreq_fix_status != TRUE) { in dhd_rollback_cpu_freq()
8668 mutex_unlock(&dhd->cpufreq_fix); in dhd_rollback_cpu_freq()
8672 pm_qos_remove_request(&dhd->dhd_cpu_qos); in dhd_rollback_cpu_freq()
8674 pm_qos_remove_request(&dhd->dhd_bus_qos); in dhd_rollback_cpu_freq()
8678 dhd->cpufreq_fix_status = FALSE; in dhd_rollback_cpu_freq()
8679 mutex_unlock(&dhd->cpufreq_fix); in dhd_rollback_cpu_freq()
8692 dhd_info_t *dhd = DHD_DEV_INFO(net); in dhd_ioctl_entry_wrapper() local
8694 if (atomic_read(&dhd->pub.block_bus)) in dhd_ioctl_entry_wrapper()
8697 if (pm_runtime_get_sync(dhd_bus_to_dev(dhd->pub.bus)) < 0) in dhd_ioctl_entry_wrapper()
8706 pm_runtime_mark_last_busy(dhd_bus_to_dev(dhd->pub.bus)); in dhd_ioctl_entry_wrapper()
8707 pm_runtime_put_autosuspend(dhd_bus_to_dev(dhd->pub.bus)); in dhd_ioctl_entry_wrapper()
8740 dhd_info_t *dhd = DHD_DEV_INFO(net); in dhd_stop() local
8742 DHD_OS_WAKE_LOCK(&dhd->pub); in dhd_stop()
8744 dhd->pub.rxcnt_timeout = 0; in dhd_stop()
8745 dhd->pub.txcnt_timeout = 0; in dhd_stop()
8748 dhd->pub.d3ackcnt_timeout = 0; in dhd_stop()
8751 mutex_lock(&dhd->pub.ndev_op_sync); in dhd_stop()
8752 if (dhd->pub.up == 0) { in dhd_stop()
8756 if (dhd->pub.req_hang_type) { in dhd_stop()
8758 __FUNCTION__, dhd->pub.req_hang_type)); in dhd_stop()
8759 dhd->pub.req_hang_type = 0; in dhd_stop()
8764 if (!dhd->wl_accel_force_reg_on && dhd_query_bus_erros(&dhd->pub)) { in dhd_stop()
8766 dhd->wl_accel_force_reg_on = TRUE; in dhd_stop()
8771 if (dhd_get_fw_mode(dhd) == DHD_FLAG_HOSTAP_MODE) in dhd_stop()
8772 dhd_rollback_cpu_freq(dhd); in dhd_stop()
8775 ifidx = dhd_net2idx(dhd, net); in dhd_stop()
8782 if ((!dhd->pub.hang_was_sent) && wl_cfg80211_static_if_active(cfg)) { in dhd_stop()
8790 if (!dhd->pub.hang_was_sent && dhd->pub.skip_dhd_stop) { in dhd_stop()
8808 DHD_STOP_RPM_TIMER(&dhd->pub); in dhd_stop()
8810 DHD_UP_LOCK(&dhd->pub.up_lock, flags); in dhd_stop()
8811 dhd->pub.up = 0; in dhd_stop()
8812 DHD_UP_UNLOCK(&dhd->pub.up_lock, flags); in dhd_stop()
8814 dhd->pub.up = 0; in dhd_stop()
8817 dhd_bus_inform_ep_loaded_to_rc(&dhd->pub, dhd->pub.up); in dhd_stop()
8820 ifp = dhd->iflist[0]; in dhd_stop()
8826 DHD_STATLOG_CTRL(&dhd->pub, ST(WLAN_POWER_OFF), ifidx, 0); in dhd_stop()
8827 if ((dhd->dhd_state & DHD_ATTACH_STATE_ADD_IF) && in dhd_stop()
8828 (dhd->dhd_state & DHD_ATTACH_STATE_CFG80211)) { in dhd_stop()
8831 dhd_cleanup_m4_state_work(&dhd->pub, ifidx); in dhd_stop()
8834 dhd_dump_pkt_clear(&dhd->pub); in dhd_stop()
8837 dhd_net_if_lock_local(dhd); in dhd_stop()
8839 dhd_remove_if(&dhd->pub, i, FALSE); in dhd_stop()
8856 dhd_net_if_unlock_local(dhd); in dhd_stop()
8860 cancel_work_sync(dhd->dhd_deferred_wq); in dhd_stop()
8865 dhd_cancel_logtrace_process_sync(dhd); in dhd_stop()
8870 cancel_work_sync(&dhd->bt_log_dispatcher_work); in dhd_stop()
8874 cancel_delayed_work_sync(&dhd->edl_dispatcher_work); in dhd_stop()
8878 __skb_queue_purge(&dhd->rx_pend_queue); in dhd_stop()
8882 skb_queue_purge(&dhd->tx_pend_queue); in dhd_stop()
8886 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF); in dhd_stop()
8889 if (ifp && ifp->net == dhd->rx_napi_netdev) { in dhd_stop()
8891 __FUNCTION__, &dhd->rx_napi_struct, net, net->name)); in dhd_stop()
8892 skb_queue_purge(&dhd->rx_napi_queue); in dhd_stop()
8893 napi_disable(&dhd->rx_napi_struct); in dhd_stop()
8894 netif_napi_del(&dhd->rx_napi_struct); in dhd_stop()
8895 dhd->rx_napi_netdev = NULL; in dhd_stop()
8902 dhd_wlfc_cleanup(&dhd->pub, NULL, 0); in dhd_stop()
8907 dhd_event_logtrace_flush_queue(&dhd->pub); in dhd_stop()
8908 if (dhd->dhd_state & DHD_ATTACH_LOGTRACE_INIT) { in dhd_stop()
8909 if (dhd->event_data.fmts) { in dhd_stop()
8910 MFREE(dhd->pub.osh, dhd->event_data.fmts, in dhd_stop()
8911 dhd->event_data.fmts_size); in dhd_stop()
8913 if (dhd->event_data.raw_fmts) { in dhd_stop()
8914 MFREE(dhd->pub.osh, dhd->event_data.raw_fmts, in dhd_stop()
8915 dhd->event_data.raw_fmts_size); in dhd_stop()
8917 if (dhd->event_data.raw_sstr) { in dhd_stop()
8918 MFREE(dhd->pub.osh, dhd->event_data.raw_sstr, in dhd_stop()
8919 dhd->event_data.raw_sstr_size); in dhd_stop()
8921 if (dhd->event_data.rom_raw_sstr) { in dhd_stop()
8922 MFREE(dhd->pub.osh, dhd->event_data.rom_raw_sstr, in dhd_stop()
8923 dhd->event_data.rom_raw_sstr_size); in dhd_stop()
8925 dhd->dhd_state &= ~DHD_ATTACH_LOGTRACE_INIT; in dhd_stop()
8931 dhd_os_reset_logging(&dhd->pub); in dhd_stop()
8938 dhd_prot_stop(&dhd->pub); in dhd_stop()
8950 wl_android_wifi_accel_off(net, dhd->wl_accel_force_reg_on); in dhd_stop()
8953 dhd_bus_put(&dhd->pub, WLAN_MODULE); in dhd_stop()
8981 dhd->pub.hang_was_sent = 0; in dhd_stop()
8982 dhd->pub.hang_was_pending = 0; in dhd_stop()
8986 dhd->pub.dhd_cspec.country_abbrev[0] = 0x00; in dhd_stop()
8987 dhd->pub.dhd_cspec.rev = 0; in dhd_stop()
8988 dhd->pub.dhd_cspec.ccode[0] = 0x00; in dhd_stop()
8996 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_stop()
9000 (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT) && in dhd_stop()
9002 DHD_OS_WAKE_LOCK_DESTROY(dhd); in dhd_stop()
9003 dhd->dhd_state &= ~DHD_ATTACH_STATE_WAKELOCKS_INIT; in dhd_stop()
9011 mutex_unlock(&dhd->pub.ndev_op_sync); in dhd_stop()
9021 static int dhd_interworking_enable(dhd_pub_t *dhd) in dhd_interworking_enable() argument
9026 ret = dhd_iovar(dhd, 0, "interworking", (char *)&enable, sizeof(enable), NULL, 0, TRUE); in dhd_interworking_enable()
9037 dhd_verify_firmware_mode_change(dhd_info_t *dhd) in dhd_verify_firmware_mode_change() argument
9046 dhd_update_fw_nv_path(dhd); in dhd_verify_firmware_mode_change()
9048 DHD_INFO(("%s : check monitor mode with fw_path : %s\n", __FUNCTION__, dhd->fw_path)); in dhd_verify_firmware_mode_change()
9050 if (strstr(dhd->fw_path, "_mon") != NULL) { in dhd_verify_firmware_mode_change()
9052 dhd->wl_accel_force_reg_on = TRUE; in dhd_verify_firmware_mode_change()
9054 } else if (dhd->pub.monitor_enable == TRUE) { in dhd_verify_firmware_mode_change()
9056 dhd->wl_accel_force_reg_on = TRUE; in dhd_verify_firmware_mode_change()
9060 current_mode = dhd_get_fw_mode(dhd); in dhd_verify_firmware_mode_change()
9063 current_mode, dhd->pub.op_mode)); in dhd_verify_firmware_mode_change()
9065 if (!(dhd->pub.op_mode & current_mode)) { in dhd_verify_firmware_mode_change()
9067 dhd->wl_accel_force_reg_on = TRUE; in dhd_verify_firmware_mode_change()
9101 struct dhd_info *dhd; in dhd_wifi_accel_on_work_cb() local
9106 dhd = container_of(dw, struct dhd_info, wl_accel_work); in dhd_wifi_accel_on_work_cb()
9112 dhd->wl_accel_force_reg_on = TRUE; in dhd_wifi_accel_on_work_cb()
9115 if (!dhd->fs_check_retry--) { in dhd_wifi_accel_on_work_cb()
9119 schedule_delayed_work(&dhd->wl_accel_work, in dhd_wifi_accel_on_work_cb()
9124 net = dhd->iflist[0]->net; in dhd_wifi_accel_on_work_cb()
9137 ret = dhd_wl_ioctl_set_intiovar(&dhd->pub, "bus:host_access", 0, WLC_SET_VAR, TRUE, 0); in dhd_wifi_accel_on_work_cb()
9151 dhd->wl_accel_force_reg_on = FALSE; in dhd_wifi_accel_on_work_cb()
9155 dhd->wl_accel_boot_on_done = TRUE; in dhd_wifi_accel_on_work_cb()
9164 dhd_info_t *dhd = DHD_DEV_INFO(net); in dhd_open() local
9182 if (dhd->pub.hang_was_sent == 1) { in dhd_open()
9187 if (!dhd_download_fw_on_driverload && dhd->pub.up == 1) { in dhd_open()
9196 mutex_lock(&dhd->pub.ndev_op_sync); in dhd_open()
9199 wl_ext_reset_scan_busy(&dhd->pub); in dhd_open()
9202 if (dhd->pub.up == 1) { in dhd_open()
9205 mutex_unlock(&dhd->pub.ndev_op_sync); in dhd_open()
9211 if (dhd->wl_accel_boot_on_done == FALSE) { in dhd_open()
9213 dhd_wifi_accel_on_work_cb(&dhd->wl_accel_work.work); in dhd_open()
9216 mutex_unlock(&dhd->pub.ndev_op_sync); in dhd_open()
9220 if (!dhd->wl_accel_force_reg_on && dhd_query_bus_erros(&dhd->pub)) { in dhd_open()
9222 dhd->wl_accel_force_reg_on = TRUE; in dhd_open()
9227 mutex_unlock(&dhd->pub.ndev_op_sync); in dhd_open()
9236 if (!(dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) { in dhd_open()
9237 DHD_OS_WAKE_LOCK_INIT(dhd); in dhd_open()
9238 dhd->dhd_state |= DHD_ATTACH_STATE_WAKELOCKS_INIT; in dhd_open()
9242 skb_queue_head_init(&dhd->evt_trace_queue); in dhd_open()
9244 if (!(dhd->dhd_state & DHD_ATTACH_LOGTRACE_INIT)) { in dhd_open()
9245 ret = dhd_init_logstrs_array(dhd->pub.osh, &dhd->event_data); in dhd_open()
9247 dhd_init_static_strs_array(dhd->pub.osh, &dhd->event_data, in dhd_open()
9249 dhd_init_static_strs_array(dhd->pub.osh, &dhd->event_data, in dhd_open()
9251 dhd->dhd_state |= DHD_ATTACH_LOGTRACE_INIT; in dhd_open()
9257 DHD_OS_WAKE_LOCK(&dhd->pub); in dhd_open()
9258 dhd->pub.dongle_trap_occured = 0; in dhd_open()
9260 dhd->pub.dongle_trap_due_to_bt = 0; in dhd_open()
9262 dhd->pub.hang_was_sent = 0; in dhd_open()
9263 dhd->pub.hang_was_pending = 0; in dhd_open()
9264 dhd->pub.hang_reason = 0; in dhd_open()
9265 dhd->pub.iovar_timeout_occured = 0; in dhd_open()
9267 dhd->pub.d3ack_timeout_occured = 0; in dhd_open()
9268 dhd->pub.livelock_occured = 0; in dhd_open()
9269 dhd->pub.pktid_audit_failed = 0; in dhd_open()
9271 dhd->pub.iface_op_failed = 0; in dhd_open()
9272 dhd->pub.scan_timeout_occurred = 0; in dhd_open()
9273 dhd->pub.scan_busy_occurred = 0; in dhd_open()
9274 dhd->pub.smmu_fault_occurred = 0; in dhd_open()
9276 dhd->pub.dequeue_prec_map = ALLPRIO; in dhd_open()
9279 dhd->pub.permitted_gro = TRUE; in dhd_open()
9296 ifidx = dhd_net2idx(dhd, net); in dhd_open()
9305 if (!dhd->iflist[ifidx]) { in dhd_open()
9314 dhd_verify_firmware_mode_change(dhd); in dhd_open()
9318 atomic_set(&dhd->pend_8021x_cnt, 0); in dhd_open()
9320 DHD_STATLOG_CTRL(&dhd->pub, ST(WLAN_POWER_ON), ifidx, 0); in dhd_open()
9322 wl_ext_event_attach_netdev(net, ifidx, dhd->iflist[ifidx]->bssidx); in dhd_open()
9328 wl_ext_iapsta_attach_netdev(net, ifidx, dhd->iflist[ifidx]->bssidx); in dhd_open()
9340 if (dhd_reinit_logtrace_process(dhd) != BCME_OK) { in dhd_open()
9345 ret = wl_android_wifi_accel_on(net, dhd->wl_accel_force_reg_on); in dhd_open()
9348 dhd->wl_accel_force_reg_on = TRUE; in dhd_open()
9350 dhd->wl_accel_force_reg_on = FALSE; in dhd_open()
9354 ret = dhd_bus_get(&dhd->pub, WLAN_MODULE); in dhd_open()
9383 if (dhd_get_fw_mode(dhd) == DHD_FLAG_HOSTAP_MODE) { in dhd_open()
9384 dhd_init_cpufreq_fix(dhd); in dhd_open()
9385 dhd_fix_cpu_freq(dhd); in dhd_open()
9389 if (dhd->pub.conf->dpc_cpucore >= 0) { in dhd_open()
9390 dhd_bus_get_ids(dhd->pub.bus, &bus_type, &bus_num, &slot_num); in dhd_open()
9393 printf("%s: set irq affinity hit %d\n", __FUNCTION__, dhd->pub.conf->dpc_cpucore); in dhd_open()
9394 irq_set_affinity_hint(adapter->irq_num, cpumask_of(dhd->pub.conf->dpc_cpucore)); in dhd_open()
9399 if (dhd->pub.busstate != DHD_BUS_DATA) { in dhd_open()
9401 dhd_set_path(&dhd->pub); in dhd_open()
9403 wait_event_interruptible_timeout(dhd->adapter->status_event, in dhd_open()
9404 wifi_get_adapter_status(dhd->adapter, WIFI_STATUS_FW_READY), in dhd_open()
9407 if ((ret = dbus_up(dhd->pub.bus)) != 0) { in dhd_open()
9411 dhd->pub.busstate = DHD_BUS_DATA; in dhd_open()
9413 if ((ret = dhd_sync_with_dongle(&dhd->pub)) < 0) { in dhd_open()
9421 if (pm_runtime_get_sync(dhd_bus_to_dev(dhd->pub.bus)) >= 0) { in dhd_open()
9422 ret = dhd_bus_start(&dhd->pub); in dhd_open()
9423 pm_runtime_mark_last_busy(dhd_bus_to_dev(dhd->pub.bus)); in dhd_open()
9424 pm_runtime_put_autosuspend(dhd_bus_to_dev(dhd->pub.bus)); in dhd_open()
9427 ret = dhd_bus_start(&dhd->pub); in dhd_open()
9443 if (dhd->pub.is_bt_recovery_required) { in dhd_open()
9447 dhd->pub.is_bt_recovery_required = FALSE; in dhd_open()
9451 dev_addr_set(net, dhd->pub.mac.octet); in dhd_open()
9455 if (dhd_toe_get(dhd, ifidx, &toe_ol) >= 0 && (toe_ol & TOE_TX_CSUM_OL) != 0) { in dhd_open()
9456 dhd->iflist[ifidx]->net->features |= NETIF_F_IP_CSUM; in dhd_open()
9458 dhd->iflist[ifidx]->net->features &= ~NETIF_F_IP_CSUM; in dhd_open()
9464 dhd->iflist[ifidx]->net->features |= NETIF_F_GRO; in dhd_open()
9468 dhd->iflist[ifidx]->net->needed_headroom = DOT11_LLC_SNAP_HDR_LEN; in dhd_open()
9472 __skb_queue_head_init(&dhd->rx_pend_queue); in dhd_open()
9473 if (dhd->rx_napi_netdev == NULL) { in dhd_open()
9474 dhd->rx_napi_netdev = dhd->iflist[ifidx]->net; in dhd_open()
9475 memset(&dhd->rx_napi_struct, 0, sizeof(struct napi_struct)); in dhd_open()
9476 netif_napi_add(dhd->rx_napi_netdev, &dhd->rx_napi_struct, in dhd_open()
9479 __FUNCTION__, &dhd->rx_napi_struct, net, in dhd_open()
9481 napi_enable(&dhd->rx_napi_struct); in dhd_open()
9483 skb_queue_head_init(&dhd->rx_napi_queue); in dhd_open()
9484 __skb_queue_head_init(&dhd->rx_process_queue); in dhd_open()
9490 skb_queue_head_init(&dhd->tx_pend_queue); in dhd_open()
9492 dhd->dhd_lb_candidacy_override = FALSE; in dhd_open()
9506 dhd->pend_ipaddr = 0; in dhd_open()
9521 dhd_bus_aspm_enable_rc_ep(dhd->pub.bus, TRUE); in dhd_open()
9524 dhd_irq_set_affinity(&dhd->pub, cpumask_of(0)); in dhd_open()
9527 dhd_set_scb_probe(&dhd->pub); in dhd_open()
9539 if (dhd->pub.conf) { in dhd_open()
9540 wl_android_ext_priv_cmd(net, dhd->pub.conf->isam_init, 0, &bytes_written); in dhd_open()
9541 wl_android_ext_priv_cmd(net, dhd->pub.conf->isam_config, 0, &bytes_written); in dhd_open()
9542 wl_android_ext_priv_cmd(net, dhd->pub.conf->isam_enable, 0, &bytes_written); in dhd_open()
9548 dhd->pub.up = 1; in dhd_open()
9550 dhd_bus_inform_ep_loaded_to_rc(&dhd->pub, dhd->pub.up); in dhd_open()
9552 DHD_START_RPM_TIMER(&dhd->pub); in dhd_open()
9556 dhd->pub.wl_event_enabled = true; in dhd_open()
9558 dhd->pub.wl_event_enabled = false; in dhd_open()
9563 dhd->pub.logtrace_pkt_sendup = true; in dhd_open()
9565 dhd->pub.logtrace_pkt_sendup = false; in dhd_open()
9571 dhd_dbgfs_init(&dhd->pub); in dhd_open()
9575 mutex_unlock(&dhd->pub.ndev_op_sync); in dhd_open()
9588 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_open()
9671 dhd_info_t *dhd = DHD_DEV_INFO(net); in dhd_static_if_open() local
9690 dhd->pub.conf->fw_type = FW_TYPE_EZMESH; in dhd_static_if_open()
9721 dhd_info_t *dhd = DHD_DEV_INFO(net); in dhd_static_if_stop() local
9731 if (dhd->pub.skip_dhd_stop) { in dhd_static_if_stop()
9740 dhd_net_if_lock_local(dhd); in dhd_static_if_stop()
9742 dhd_net_if_unlock_local(dhd); in dhd_static_if_stop()
9744 if (dhd->pub.up == 0) { in dhd_static_if_stop()
9754 if (dhd->pub.conf->fw_type == FW_TYPE_EZMESH) { in dhd_static_if_stop()
9756 dhd->pub.conf->fw_type = FW_TYPE_STA; in dhd_static_if_stop()
9772 dhd_info_t *dhd = NULL; in dhd_do_driver_init() local
9784 dhd = DHD_DEV_INFO(net); in dhd_do_driver_init()
9788 if (dhd->pub.busstate == DHD_BUS_DATA) { in dhd_do_driver_init()
9907 dhd_info_t *dhd = handle; in dhd_natoe_ct_event_hanlder() local
9909 dhd_nfct_info_t *nfct = dhd->pub.nfct; in dhd_natoe_ct_event_hanlder()
9916 if (!dhd) { in dhd_natoe_ct_event_hanlder()
9939 dhd_natoe_ct_event(dhd_pub_t *dhd, char *data) in dhd_natoe_ct_event() argument
9943 if (dhd->nfct) { in dhd_natoe_ct_event()
9944 wl_event_data_natoe_t *natoe = dhd->nfct->natoe_info; in dhd_natoe_ct_event()
9947 spin_lock_bh(&dhd->nfct_lock); in dhd_natoe_ct_event()
9949 spin_unlock_bh(&dhd->nfct_lock); in dhd_natoe_ct_event()
9952 dhd_deferred_schedule_work(dhd->info->dhd_deferred_wq, in dhd_natoe_ct_event()
9966 dhd_info_t *dhd = handle; in dhd_natoe_ct_ioctl_handler() local
9974 if (!dhd) { in dhd_natoe_ct_ioctl_handler()
9979 if (dhd_natoe_prep_send_exception_port_ioctl(&dhd->pub, ct_ioc) < 0) { in dhd_natoe_ct_ioctl_handler()
9988 dhd_natoe_ct_ioctl_schedule_work(dhd_pub_t *dhd, dhd_ct_ioc_t *ioc) in dhd_natoe_ct_ioctl_schedule_work() argument
9991 dhd_deferred_schedule_work(dhd->info->dhd_deferred_wq, (void *)ioc, in dhd_natoe_ct_ioctl_schedule_work()
10486 dhd_info_t *dhd = dhdp->info; in dhd_set_qosmap_up_table() local
10490 ifp = dhd->iflist[idx]; in dhd_set_qosmap_up_table()
10565 dhd_info_t *dhd = (dhd_info_t *)arg; in dhd_ctf_detach() local
10566 dhd->cih = NULL; in dhd_ctf_detach()
10570 osl_ctfpool_cleanup(dhd->pub.osh); in dhd_ctf_detach()
11386 dhd_info_t *dhd = NULL; in dhd_get_rxsz() local
11390 dhd = pub->info; in dhd_get_rxsz()
11391 net = dhd->iflist[0]->net; in dhd_get_rxsz()
11401 dhd_info_t *dhd = NULL; in dhd_set_path() local
11403 dhd = pub->info; in dhd_set_path()
11406 if (dhd_update_fw_nv_path(dhd) && dhd->pub.bus) { in dhd_set_path()
11408 __FUNCTION__, dhd->fw_path, dhd->nv_path, dhd->conf_path)); in dhd_set_path()
11409 dhd_bus_update_fw_nv_path(dhd->pub.bus, in dhd_set_path()
11410 dhd->fw_path, dhd->nv_path, dhd->clm_path, dhd->conf_path); in dhd_set_path()
11423 dhd_info_t *dhd = NULL; in dhd_attach() local
11456 dhd = wifi_platform_prealloc(adapter, DHD_PREALLOC_DHD_INFO, sizeof(dhd_info_t)); in dhd_attach()
11457 if (dhd == NULL) { in dhd_attach()
11458 dhd = MALLOC(osh, sizeof(dhd_info_t)); in dhd_attach()
11459 if (dhd == NULL) { in dhd_attach()
11464 memset(dhd, 0, sizeof(dhd_info_t)); in dhd_attach()
11467 dhd->unit = dhd_found + instance_base; /* do not increment dhd_found, yet */ in dhd_attach()
11469 dhd->pub.osh = osh; in dhd_attach()
11471 dll_init(&(dhd->pub.dump_iovlist_head)); in dhd_attach()
11474 dhd->pub.dhd_console_ms = dhd_console_ms; /* assigns default value */ in dhd_attach()
11476 dhd->adapter = adapter; in dhd_attach()
11477 dhd->pub.adapter = (void *)adapter; in dhd_attach()
11479 dhd->pub.is_bt_recovery_required = FALSE; in dhd_attach()
11480 mutex_init(&dhd->bus_user_lock); in dhd_attach()
11483 g_dhd_pub = &dhd->pub; in dhd_attach()
11486 dll_init(&(dhd->pub.mw_list_head)); in dhd_attach()
11490 dhd->pub.dhd_cflags |= WLAN_PLAT_NODFS_FLAG; in dhd_attach()
11491 dhd->pub.force_country_change = TRUE; in dhd_attach()
11494 get_customized_country_code(dhd->adapter, in dhd_attach()
11495 dhd->pub.dhd_cspec.country_abbrev, &dhd->pub.dhd_cspec, in dhd_attach()
11496 dhd->pub.dhd_cflags); in dhd_attach()
11499 dhd->thr_dpc_ctl.thr_pid = DHD_PID_KT_TL_INVALID; in dhd_attach()
11500 dhd->thr_wdt_ctl.thr_pid = DHD_PID_KT_INVALID; in dhd_attach()
11502 dhd->pub.wet_info = dhd_get_wet_info(&dhd->pub); in dhd_attach()
11506 if (bcm_nanho_init(&dhd->pub.nanhoi, &dhd->pub, in dhd_attach()
11512 sema_init(&dhd->sdsem, 1); in dhd_attach()
11515 dhd->host_radiotap_conv = FALSE; in dhd_attach()
11517 dhd->pub.pcie_txs_metadata_enable = pcie_txs_metadata_enable; in dhd_attach()
11520 dhd->pub.info = dhd; in dhd_attach()
11523 dhd->pub.bus = bus; in dhd_attach()
11524 dhd->pub.hdrlen = bus_hdrlen; in dhd_attach()
11525 dhd->pub.txoff = FALSE; in dhd_attach()
11527 dhd->pub.check_trap_rot = TRUE; in dhd_attach()
11529 dhd->pub.check_trap_rot = FALSE; in dhd_attach()
11535 if (dhd_conf_attach(&dhd->pub) != 0) { in dhd_attach()
11540 dhd_conf_reset(&dhd->pub); in dhd_attach()
11541 dhd_conf_set_chiprev(&dhd->pub, dhd_bus_chip(bus), dhd_bus_chiprev(bus)); in dhd_attach()
11542 dhd_conf_preinit(&dhd->pub); in dhd_attach()
11549 dhd_update_fw_nv_path(dhd); in dhd_attach()
11564 net = dhd_allocate_if(&dhd->pub, 0, if_name, NULL, 0, TRUE, NULL); in dhd_attach()
11568 mutex_init(&dhd->pub.ndev_op_sync); in dhd_attach()
11573 dhd->pub.l2_filter_cnt = 0; in dhd_attach()
11577 mutex_init(&dhd->dhd_iovar_mutex); in dhd_attach()
11578 sema_init(&dhd->proto_sem, 1); in dhd_attach()
11581 dhd->pub.req_hang_type = 0; in dhd_attach()
11585 spin_lock_init(&dhd->wlfc_spinlock); in dhd_attach()
11587 dhd->pub.skip_fc = dhd_wlfc_skip_fc; in dhd_attach()
11588 dhd->pub.plat_init = dhd_wlfc_plat_init; in dhd_attach()
11589 dhd->pub.plat_deinit = dhd_wlfc_plat_deinit; in dhd_attach()
11592 init_waitqueue_head(&dhd->pub.wlfc_wqhead); in dhd_attach()
11593 dhd->pub.wlfc_thread = kthread_create(dhd_wlfc_transfer_packets, &dhd->pub, "wlfc-thread"); in dhd_attach()
11594 if (IS_ERR(dhd->pub.wlfc_thread)) { in dhd_attach()
11598 wake_up_process(dhd->pub.wlfc_thread); in dhd_attach()
11606 init_waitqueue_head(&dhd->ioctl_resp_wait); in dhd_attach()
11607 init_waitqueue_head(&dhd->pub.tx_tput_test_wait); in dhd_attach()
11608 init_waitqueue_head(&dhd->d3ack_wait); in dhd_attach()
11610 init_waitqueue_head(&dhd->ds_exit_wait); in dhd_attach()
11612 init_waitqueue_head(&dhd->ctrl_wait); in dhd_attach()
11613 init_waitqueue_head(&dhd->dhd_bus_busy_state_wait); in dhd_attach()
11614 init_waitqueue_head(&dhd->dmaxfer_wait); in dhd_attach()
11616 init_waitqueue_head(&dhd->quiesce_wait); in dhd_attach()
11618 init_waitqueue_head(&dhd->pub.tx_completion_wait); in dhd_attach()
11619 dhd->pub.dhd_bus_busy_state = 0; in dhd_attach()
11621 spin_lock_init(&dhd->sdlock); in dhd_attach()
11622 spin_lock_init(&dhd->txqlock); in dhd_attach()
11623 spin_lock_init(&dhd->dhd_lock); in dhd_attach()
11624 spin_lock_init(&dhd->txoff_lock); in dhd_attach()
11625 spin_lock_init(&dhd->rxf_lock); in dhd_attach()
11627 spin_lock_init(&dhd->pub.tdls_lock); in dhd_attach()
11630 dhd->rxthread_enabled = TRUE; in dhd_attach()
11634 spin_lock_init(&dhd->tcpack_lock); in dhd_attach()
11638 spin_lock_init(&dhd->hp2p_lock); in dhd_attach()
11641 spin_lock_init(&dhd->wakelock_spinlock); in dhd_attach()
11642 spin_lock_init(&dhd->wakelock_evt_spinlock); in dhd_attach()
11643 DHD_OS_WAKE_LOCK_INIT(dhd); in dhd_attach()
11644 dhd->wakelock_counter = 0; in dhd_attach()
11647 dhd_wake_lock_init(dhd->wl_wdwake, dhd_bus_to_dev(bus), "wlan_wd_wake"); in dhd_attach()
11651 mutex_init(&dhd->dhd_net_if_mutex); in dhd_attach()
11652 mutex_init(&dhd->dhd_suspend_mutex); in dhd_attach()
11654 mutex_init(&dhd->dhd_apf_mutex); in dhd_attach()
11660 if (dhd_prot_attach(&dhd->pub) != 0) { in dhd_attach()
11668 if (dhd_timesync_attach(&dhd->pub) != 0) { in dhd_attach()
11676 spin_lock_init(&dhd->pub.up_lock); in dhd_attach()
11678 if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) { in dhd_attach()
11683 dhd_monitor_init(&dhd->pub); in dhd_attach()
11728 ret = dhd_init_logstrs_array(osh, &dhd->event_data); in dhd_attach()
11730 dhd_init_static_strs_array(osh, &dhd->event_data, st_str_file_path, map_file_path); in dhd_attach()
11731 dhd_init_static_strs_array(osh, &dhd->event_data, rom_st_str_file_path, in dhd_attach()
11738 if (dhd_os_dbg_attach(&dhd->pub)) { in dhd_attach()
11745 dhd_os_start_logging(&dhd->pub, FW_VERBOSE_RING_NAME, 3, 0, 0, 0); in dhd_attach()
11750 dhd_os_start_logging(&dhd->pub, BT_LOG_RING_NAME, 3, 0, 0, 0); in dhd_attach()
11753 dhd->pub.dbg->pkt_mon_lock = osl_spin_lock_init(dhd->pub.osh); in dhd_attach()
11755 dhd_os_dbg_attach_pkt_monitor(&dhd->pub); in dhd_attach()
11762 dhd->pub.mem_stats_lock = osl_spin_lock_init(dhd->pub.osh); in dhd_attach()
11763 dhd->pub.txpath_mem = 0; in dhd_attach()
11764 dhd->pub.rxpath_mem = 0; in dhd_attach()
11768 dhd->pub.awdl_stats_lock = osl_spin_lock_init(dhd->pub.osh); in dhd_attach()
11772 dhd->pub.statlog = dhd_attach_statlog(&dhd->pub, MAX_STATLOG_ITEM, in dhd_attach()
11774 if (dhd->pub.statlog == NULL) { in dhd_attach()
11780 dhd_log_dump_init(&dhd->pub); in dhd_attach()
11783 dhd_dump_pkt_init(&dhd->pub); in dhd_attach()
11786 dhd_os_attach_pktlog(&dhd->pub); in dhd_attach()
11790 dhd->pub.hang_info = MALLOCZ(osh, VENDOR_SEND_HANG_EXT_INFO_LEN); in dhd_attach()
11791 if (dhd->pub.hang_info == NULL) { in dhd_attach()
11795 if (dhd_sta_pool_init(&dhd->pub, DHD_MAX_STA) != BCME_OK) { in dhd_attach()
11802 dhd->cih = ctf_attach(dhd->pub.osh, "dhd", &dhd_msg_level, dhd_ctf_detach, dhd); in dhd_attach()
11803 if (!dhd->cih) { in dhd_attach()
11809 if (CTF_ENAB(dhd->cih) && (osl_ctfpool_init(dhd->pub.osh, in dhd_attach()
11819 dhd->tx_wq = alloc_workqueue("bcmdhd-tx-wq", WQ_HIGHPRI | WQ_UNBOUND | WQ_MEM_RECLAIM, 1); in dhd_attach()
11820 if (!dhd->tx_wq) { in dhd_attach()
11824 dhd->rx_wq = alloc_workqueue("bcmdhd-rx-wq", WQ_HIGHPRI | WQ_UNBOUND | WQ_MEM_RECLAIM, 1); in dhd_attach()
11825 if (!dhd->rx_wq) { in dhd_attach()
11827 destroy_workqueue(dhd->tx_wq); in dhd_attach()
11828 dhd->tx_wq = NULL; in dhd_attach()
11835 init_timer_compat(&dhd->timer, dhd_watchdog, dhd); in dhd_attach()
11836 dhd->default_wd_interval = dhd_watchdog_ms; in dhd_attach()
11840 PROC_START(dhd_watchdog_thread, dhd, &dhd->thr_wdt_ctl, 0, "dhd_watchdog_thread"); in dhd_attach()
11841 if (dhd->thr_wdt_ctl.thr_pid < 0) { in dhd_attach()
11846 dhd->thr_wdt_ctl.thr_pid = -1; in dhd_attach()
11851 init_timer_compat(&dhd->rpm_timer, dhd_runtimepm, dhd); in dhd_attach()
11852 dhd->rpm_timer_valid = FALSE; in dhd_attach()
11854 dhd->thr_rpm_ctl.thr_pid = DHD_PID_KT_INVALID; in dhd_attach()
11855 PROC_START(dhd_rpm_state_thread, dhd, &dhd->thr_rpm_ctl, 0, "dhd_rpm_state_thread"); in dhd_attach()
11856 if (dhd->thr_rpm_ctl.thr_pid < 0) { in dhd_attach()
11862 skb_queue_head_init(&dhd->bt_log_queue); in dhd_attach()
11866 mutex_init(&dhd->quiesce_flr_lock); in dhd_attach()
11867 mutex_init(&dhd->quiesce_lock); in dhd_attach()
11873 PROC_START(dhd_dpc_thread, dhd, &dhd->thr_dpc_ctl, 0, "dhd_dpc"); in dhd_attach()
11874 if (dhd->thr_dpc_ctl.thr_pid < 0) { in dhd_attach()
11879 tasklet_init(&dhd->tasklet, dhd_dpc, (ulong)dhd); in dhd_attach()
11880 dhd->thr_dpc_ctl.thr_pid = -1; in dhd_attach()
11883 if (dhd->rxthread_enabled) { in dhd_attach()
11884 bzero(&dhd->pub.skbbuf[0], sizeof(void *) * MAXSKBPEND); in dhd_attach()
11886 PROC_START(dhd_rxf_thread, dhd, &dhd->thr_rxf_ctl, 0, "dhd_rxf"); in dhd_attach()
11887 if (dhd->thr_rxf_ctl.thr_pid < 0) { in dhd_attach()
11894 skb_queue_head_init(&dhd->evt_trace_queue); in dhd_attach()
11897 dhd_dbg_ring_proc_create(&dhd->pub); in dhd_attach()
11905 dhd->pm_notifier.notifier_call = dhd_pm_callback; in dhd_attach()
11906 dhd->pm_notifier.priority = 10; in dhd_attach()
11907 register_pm_notifier(&dhd->pm_notifier); in dhd_attach()
11913 dhd->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20; in dhd_attach()
11914 dhd->early_suspend.suspend = dhd_early_suspend; in dhd_attach()
11915 dhd->early_suspend.resume = dhd_late_resume; in dhd_attach()
11916 register_early_suspend(&dhd->early_suspend); in dhd_attach()
11921 dhd->pend_ipaddr = 0; in dhd_attach()
11934 dhd->dhd_deferred_wq = dhd_deferred_work_init((void *)dhd); in dhd_attach()
11936 INIT_WORK(&dhd->dhd_hang_process_work, dhd_hang_process); in dhd_attach()
11939 dhd->new_freq = alloc_percpu(int); in dhd_attach()
11940 dhd->freq_trans.notifier_call = dhd_cpufreq_notifier; in dhd_attach()
11941 cpufreq_register_notifier(&dhd->freq_trans, CPUFREQ_TRANSITION_NOTIFIER); in dhd_attach()
11945 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_DELAYTX); in dhd_attach()
11950 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_HOLD); in dhd_attach()
11952 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF); in dhd_attach()
11960 register_page_corrupt_cb(dhd_page_corrupt_cb, &dhd->pub); in dhd_attach()
11963 INIT_DELAYED_WORK(&dhd->dhd_dpc_dispatcher_work, dhd_dpc_tasklet_dispatcher_work); in dhd_attach()
11967 dhd->permitted_primary_cpu = FALSE; in dhd_attach()
11969 dhd_lb_set_default_cpus(dhd); in dhd_attach()
11970 DHD_LB_STATS_INIT(&dhd->pub); in dhd_attach()
11973 if (dhd_cpumasks_init(dhd) == 0) { in dhd_attach()
11975 dhd_select_cpu_candidacy(dhd); in dhd_attach()
11978 dhd_register_cpuhp_callback(dhd); in dhd_attach()
11986 dhd->cpu_notifier.notifier_call = NULL; in dhd_attach()
11994 atomic_set(&dhd->lb_txp_active, 1); in dhd_attach()
11997 atomic_set(&dhd->lb_txp_active, 0); in dhd_attach()
12003 atomic_set(&dhd->lb_rxp_active, 1); in dhd_attach()
12008 __skb_queue_head_init(&dhd->rx_pend_queue); in dhd_attach()
12009 skb_queue_head_init(&dhd->rx_napi_queue); in dhd_attach()
12010 __skb_queue_head_init(&dhd->rx_process_queue); in dhd_attach()
12012 INIT_WORK(&dhd->rx_napi_dispatcher_work, dhd_rx_napi_dispatcher_work); in dhd_attach()
12018 INIT_WORK(&dhd->tx_dispatcher_work, dhd_tx_dispatcher_work); in dhd_attach()
12019 skb_queue_head_init(&dhd->tx_pend_queue); in dhd_attach()
12021 tasklet_init(&dhd->tx_tasklet, in dhd_attach()
12022 dhd_lb_tx_handler, (ulong)(dhd)); in dhd_attach()
12030 INIT_WORK(&dhd->axi_error_dispatcher_work, dhd_axi_error_dispatcher_fn); in dhd_attach()
12034 if (dhd_macdbg_attach(&dhd->pub) != BCME_OK) { in dhd_attach()
12041 init_dhd_timeouts(&dhd->pub); in dhd_attach()
12044 dhd->pub.extended_trap_data = MALLOCZ(osh, BCMPCIE_EXT_TRAP_DATA_MAXLEN); in dhd_attach()
12045 if (dhd->pub.extended_trap_data == NULL) { in dhd_attach()
12049 dhd->pub.axi_err_dump = MALLOCZ(osh, sizeof(dhd_axi_error_dump_t)); in dhd_attach()
12050 if (dhd->pub.axi_err_dump == NULL) { in dhd_attach()
12057 if (dhd_init_logtrace_process(dhd) != BCME_OK) { in dhd_attach()
12063 INIT_WORK(&dhd->bt_log_dispatcher_work, dhd_bt_log_process); in dhd_attach()
12067 INIT_DELAYED_WORK(&dhd->edl_dispatcher_work, dhd_edl_process_work); in dhd_attach()
12070 DHD_SSSR_MEMPOOL_INIT(&dhd->pub); in dhd_attach()
12071 DHD_SSSR_REG_INFO_INIT(&dhd->pub); in dhd_attach()
12074 dhd_sdtc_etb_mempool_init(&dhd->pub); in dhd_attach()
12079 if (DHD_EDL_MEM_INIT(&dhd->pub) != BCME_OK) { in dhd_attach()
12085 dhd_init_sock_flows_buf(dhd, dhd_watchdog_ms); in dhd_attach()
12087 (void)dhd_sysfs_init(dhd); in dhd_attach()
12091 dhd->pub.nfct = dhd_ct_open(&dhd->pub, NFNL_SUBSYS_CTNETLINK | NFNL_SUBSYS_CTNETLINK_EXP, in dhd_attach()
12095 dhd->pub.gdb_proxy_nodeadman = nodeadman != 0; in dhd_attach()
12098 dhd->dhd_state = dhd_state; in dhd_attach()
12103 dhd_csi_init(&dhd->pub); in dhd_attach()
12109 dhd->pub.memdump_enabled = DUMP_DISABLED; in dhd_attach()
12112 dhd->pub.memdump_enabled = DUMP_MEMFILE; in dhd_attach()
12114 dhd->pub.memdump_enabled = DUMP_MEMFILE_BUGON; in dhd_attach()
12117 dhd->pub.memdump_enabled = DUMP_MEMFILE; in dhd_attach()
12120 dhd_get_memdump_info(&dhd->pub); in dhd_attach()
12125 pom_handler = &dhd->pub.pom_wlan_handler; in dhd_attach()
12131 dhd->pub.pom_func_register = NULL; in dhd_attach()
12132 dhd->pub.pom_func_deregister = NULL; in dhd_attach()
12133 dhd->pub.pom_toggle_reg_on = NULL; in dhd_attach()
12135 dhd->pub.pom_func_register = symbol_get(pom_func_register); in dhd_attach()
12136 dhd->pub.pom_func_deregister = symbol_get(pom_func_deregister); in dhd_attach()
12137 dhd->pub.pom_toggle_reg_on = symbol_get(pom_toggle_reg_on); in dhd_attach()
12143 if (!dhd->pub.pom_func_register || in dhd_attach()
12144 !dhd->pub.pom_func_deregister || in dhd_attach()
12145 !dhd->pub.pom_toggle_reg_on) { in dhd_attach()
12151 dhd->pub.pom_func_register(pom_handler); in dhd_attach()
12152 dhd->pub.enable_erpom = TRUE; in dhd_attach()
12158 dhd->pub.dump_file_manage = in dhd_attach()
12159 (dhd_dump_file_manage_t *)MALLOCZ(dhd->pub.osh, sizeof(dhd_dump_file_manage_t)); in dhd_attach()
12160 if (unlikely(!dhd->pub.dump_file_manage)) { in dhd_attach()
12169 if (dhd_fwtrace_attach(&dhd->pub) != 0) { in dhd_attach()
12177 if (dhd_rtt_attach(&dhd->pub)) { in dhd_attach()
12184 if (dhd_tx_profile_attach(&dhd->pub) != BCME_OK) { in dhd_attach()
12190 return &dhd->pub; in dhd_attach()
12195 __FUNCTION__, dhd_state, &dhd->pub)); in dhd_attach()
12196 dhd->dhd_state = dhd_state; in dhd_attach()
12197 dhd_detach(&dhd->pub); in dhd_attach()
12198 dhd_free(&dhd->pub); in dhd_attach()
12563 dhd_info_t *dhd = (dhd_info_t*)dhdp->info; in dhd_download_btfw() local
12566 if (dhd->pub.busstate == DHD_BUS_DATA && dhd_update_btfw_path(dhd, btfw_path)) { in dhd_download_btfw()
12567 DHD_INFO(("%s: download btfw from: %s\n", __FUNCTION__, dhd->btfw_path)); in dhd_download_btfw()
12568 ret = dhd_bus_download_btfw(dhd->pub.bus, dhd->pub.osh, dhd->btfw_path); in dhd_download_btfw()
12571 __FUNCTION__, dhd->btfw_path)); in dhd_download_btfw()
12584 dhd_info_t *dhd = (dhd_info_t*)dhdp->info; in dhd_bus_start() local
12590 ASSERT(dhd); in dhd_bus_start()
12605 dhd->pub.dongle_trap_due_to_bt = 0; in dhd_bus_start()
12613 dhd->pub.iface_op_failed = 0; in dhd_bus_start()
12614 dhd->pub.scan_timeout_occurred = 0; in dhd_bus_start()
12615 dhd->pub.scan_busy_occurred = 0; in dhd_bus_start()
12617 if (dhd->pub.dhd_induce_error) { in dhd_bus_start()
12618 dhd->pub.dhd_induce_bh_error = dhd->pub.dhd_induce_error; in dhd_bus_start()
12620 dhd->pub.dhd_induce_error = DHD_INDUCE_ERROR_CLEAR; in dhd_bus_start()
12622 dhd->latency = 0; in dhd_bus_start()
12624 dhd->pub.tput_test_done = FALSE; in dhd_bus_start()
12629 uint chipid = dhd_bus_chip_id(&dhd->pub); in dhd_bus_start()
12630 uint revid = dhd_bus_chiprev_id(&dhd->pub); in dhd_bus_start()
12635 osl_flag_set(dhd->pub.osh, OSL_PHYS_MEM_LESS_THAN_16MB); in dhd_bus_start()
12640 if (dhd->pub.busstate == DHD_BUS_DOWN && dhd_update_fw_nv_path(dhd)) { in dhd_bus_start()
12642 dhd->pub.fw_download_status = FW_DOWNLOAD_IN_PROGRESS; in dhd_bus_start()
12644 __FUNCTION__, dhd->fw_path, dhd->nv_path, dhd->conf_path)); in dhd_bus_start()
12648 ret = dhd_bus_download_firmware(dhd->pub.bus, dhd->pub.osh, in dhd_bus_start()
12649 dhd->fw_path, dhd->nv_path, dhd->clm_path, dhd->conf_path); in dhd_bus_start()
12655 __FUNCTION__, dhd->fw_path)); in dhd_bus_start()
12659 dhd->pub.fw_download_status = FW_DOWNLOAD_DONE; in dhd_bus_start()
12661 if (dhd->pub.busstate != DHD_BUS_LOAD) { in dhd_bus_start()
12670 dhd->pub.tickcnt = 0; in dhd_bus_start()
12671 dhd_os_wd_timer(&dhd->pub, dhd_watchdog_ms); in dhd_bus_start()
12674 if ((ret = dhd_bus_init(&dhd->pub, FALSE)) != 0) { in dhd_bus_start()
12687 DHD_GENERAL_LOCK(&dhd->pub, flags); in dhd_bus_start()
12688 dhd->wd_timer_valid = FALSE; in dhd_bus_start()
12689 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in dhd_bus_start()
12690 del_timer_sync(&dhd->timer); in dhd_bus_start()
12693 DHD_STOP_RPM_TIMER(&dhd->pub); in dhd_bus_start()
12696 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub); in dhd_bus_start()
12704 dhd_enable_oob_intr(dhd->pub.bus, TRUE); in dhd_bus_start()
12708 dhd_enable_oob_intr(dhd->pub.bus, TRUE); in dhd_bus_start()
12713 uint32 max_h2d_rings = dhd_bus_max_h2d_queues(dhd->pub.bus); in dhd_bus_start()
12717 if ((ret = dhd_flow_rings_init(&dhd->pub, max_h2d_rings)) != BCME_OK) { in dhd_bus_start()
12738 ret = dhd_prot_init(&dhd->pub); in dhd_bus_start()
12740 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub); in dhd_bus_start()
12745 if (dhd->pub.busstate != DHD_BUS_DATA) { in dhd_bus_start()
12746 DHD_GENERAL_LOCK(&dhd->pub, flags); in dhd_bus_start()
12747 dhd->wd_timer_valid = FALSE; in dhd_bus_start()
12748 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in dhd_bus_start()
12749 del_timer_sync(&dhd->timer); in dhd_bus_start()
12751 DHD_STOP_RPM_TIMER(&dhd->pub); in dhd_bus_start()
12755 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub); in dhd_bus_start()
12768 if ((ret = dhd_sync_with_dongle(&dhd->pub)) < 0) { in dhd_bus_start()
12769 DHD_GENERAL_LOCK(&dhd->pub, flags); in dhd_bus_start()
12770 dhd->wd_timer_valid = FALSE; in dhd_bus_start()
12771 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in dhd_bus_start()
12772 del_timer_sync(&dhd->timer); in dhd_bus_start()
12774 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub); in dhd_bus_start()
12811 if (dhd->pend_ipaddr) { in dhd_bus_start()
12814 aoe_update_host_ipv4_table(&dhd->pub, dhd->pend_ipaddr, TRUE, 0); in dhd_bus_start()
12816 dhd->pend_ipaddr = 0; in dhd_bus_start()
12821 bzero(&dhd->pub.dhd_tm_dwm_tbl, sizeof(dhd_trf_mgmt_dwm_tbl_t)); in dhd_bus_start()
12828 int _dhd_tdls_enable(dhd_pub_t *dhd, bool tdls_on, bool auto_on, struct ether_addr *mac) in _dhd_tdls_enable() argument
12840 if (!FW_SUPPORTED(dhd, tdls)) in _dhd_tdls_enable()
12843 if (dhd->tdls_enable == tdls_on) in _dhd_tdls_enable()
12845 ret = dhd_iovar(dhd, 0, "tdls_enable", (char *)&tdls, sizeof(tdls), NULL, 0, TRUE); in _dhd_tdls_enable()
12850 dhd->tdls_enable = tdls_on; in _dhd_tdls_enable()
12854 ret = dhd_iovar(dhd, 0, "tdls_auto_op", (char *)&tdls_auto_op, sizeof(tdls_auto_op), NULL, in _dhd_tdls_enable()
12862 ret = dhd_iovar(dhd, 0, "tdls_idle_time", (char *)&tdls_idle_time, in _dhd_tdls_enable()
12868 ret = dhd_iovar(dhd, 0, "tdls_rssi_high", (char *)&tdls_rssi_high, in _dhd_tdls_enable()
12874 ret = dhd_iovar(dhd, 0, "tdls_rssi_low", (char *)&tdls_rssi_low, in _dhd_tdls_enable()
12880 ret = dhd_iovar(dhd, 0, "tdls_trigger_pktcnt_high", (char *)&tdls_pktcnt_high, in _dhd_tdls_enable()
12886 ret = dhd_iovar(dhd, 0, "tdls_trigger_pktcnt_low", (char *)&tdls_pktcnt_low, in _dhd_tdls_enable()
12900 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_tdls_enable() local
12902 if (dhd) in dhd_tdls_enable()
12903 ret = _dhd_tdls_enable(&dhd->pub, tdls_on, auto_on, mac); in dhd_tdls_enable()
12910 dhd_tdls_set_mode(dhd_pub_t *dhd, bool wfd_mode) in dhd_tdls_set_mode() argument
12925 ret = _dhd_tdls_enable(dhd, false, auto_on, NULL); in dhd_tdls_set_mode()
12931 ret = dhd_iovar(dhd, 0, "tdls_wfd_mode", (char *)&mode, sizeof(mode), NULL, 0, TRUE); in dhd_tdls_set_mode()
12937 ret = _dhd_tdls_enable(dhd, true, auto_on, NULL); in dhd_tdls_set_mode()
12943 dhd->tdls_mode = mode; in dhd_tdls_set_mode()
13026 bool dhd_is_concurrent_mode(dhd_pub_t *dhd) in dhd_is_concurrent_mode() argument
13028 if (!dhd) in dhd_is_concurrent_mode()
13031 if (dhd->op_mode & DHD_FLAG_CONCURR_MULTI_CHAN_MODE) in dhd_is_concurrent_mode()
13033 else if ((dhd->op_mode & DHD_FLAG_CONCURR_SINGLE_CHAN_MODE) == in dhd_is_concurrent_mode()
13046 dhd_get_concurrent_capabilites(dhd_pub_t *dhd) in dhd_get_concurrent_capabilites() argument
13054 if (dhd->op_mode & (DHD_FLAG_HOSTAP_MODE | DHD_FLAG_MFG_MODE)) in dhd_get_concurrent_capabilites()
13056 if (FW_SUPPORTED(dhd, vsdb)) { in dhd_get_concurrent_capabilites()
13059 if (!FW_SUPPORTED(dhd, p2p)) { in dhd_get_concurrent_capabilites()
13065 ret = dhd_iovar(dhd, 0, "p2p", NULL, 0, (char *)&buf, in dhd_get_concurrent_capabilites()
13078 if (FW_SUPPORTED(dhd, rsdb)) { in dhd_get_concurrent_capabilites()
13082 if (FW_SUPPORTED(dhd, mp2p)) { in dhd_get_concurrent_capabilites()
13149 static int dhd_preinit_proc(dhd_pub_t *dhd, int ifidx, char *name, char *value) in dhd_preinit_proc() argument
13162 if (dhd->is_blob) { in dhd_preinit_proc()
13178 get_customized_country_code(dhd->info->adapter, in dhd_preinit_proc()
13185 return dhd_iovar(dhd, 0, "country", (char*)&cspec, sizeof(cspec), NULL, 0, TRUE); in dhd_preinit_proc()
13188 return dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_SCAN_PERIOD, in dhd_preinit_proc()
13198 return dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_DELTA, &x, sizeof(x), TRUE, 0); in dhd_preinit_proc()
13205 ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_TRIGGER, &roam_trigger, in dhd_preinit_proc()
13210 if (dhd_iovar(dhd, 0, "roam_env_detection", in dhd_preinit_proc()
13213 dhd->roam_env_detection = TRUE; in dhd_preinit_proc()
13215 dhd->roam_env_detection = FALSE; in dhd_preinit_proc()
13224 ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, in dhd_preinit_proc()
13253 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_BAND, &var_int, in dhd_preinit_proc()
13263 ret = memcmp(&ea.octet, dhd->mac.octet, ETHER_ADDR_LEN); in dhd_preinit_proc()
13273 ret = dhd_iovar(dhd, 0, "cur_etheraddr", (char*)&ea, ETHER_ADDR_LEN, NULL, 0, TRUE); in dhd_preinit_proc()
13278 memcpy(dhd->mac.octet, (void *)&ea, ETHER_ADDR_LEN); in dhd_preinit_proc()
13284 if (dhd_wl_ioctl_cmd(dhd, WLC_DOWN, NULL, 0, TRUE, 0) < 0) { in dhd_preinit_proc()
13287 ret = dhd_iovar(dhd, 0, "lpc", (char *)&var_int, sizeof(var_int), NULL, 0, TRUE); in dhd_preinit_proc()
13291 if (dhd_wl_ioctl_cmd(dhd, WLC_UP, NULL, 0, TRUE, 0) < 0) { in dhd_preinit_proc()
13299 if (dhd_wl_ioctl_cmd(dhd, WLC_DOWN, NULL, 0, TRUE, 0) < 0) { in dhd_preinit_proc()
13302 ret = dhd_iovar(dhd, 0, "vht_features", (char *)&var_int, sizeof(var_int), NULL, 0, in dhd_preinit_proc()
13307 if (dhd_wl_ioctl_cmd(dhd, WLC_UP, NULL, 0, TRUE, 0) < 0) { in dhd_preinit_proc()
13319 return dhd_iovar(dhd, 0, name, (char *)&var_int, in dhd_preinit_proc()
13326 static int dhd_preinit_config(dhd_pub_t *dhd, int ifidx) in dhd_preinit_config() argument
13354 if (!(buf = MALLOC(dhd->osh, stat.size + 1))) { in dhd_preinit_config()
13361 if (!(fp = dhd_os_open_image1(dhd, config_path)) || in dhd_preinit_config()
13380 if ((ret = dhd_preinit_proc(dhd, ifidx, name, value)) < 0) { in dhd_preinit_config()
13392 dhd_os_close_image1(dhd, fp); in dhd_preinit_config()
13394 MFREE(dhd->osh, buf, stat.size+1); in dhd_preinit_config()
13405 dhd_preinit_aibss_ioctls(dhd_pub_t *dhd, char *iov_buf_smlen) in dhd_preinit_aibss_ioctls() argument
13417 ret = dhd_iovar(dhd, 0, "aibss", (char *)&aibss, sizeof(aibss), NULL, 0, TRUE); in dhd_preinit_aibss_ioctls()
13430 ret = dhd_iovar(dhd, 0, "aibss_ps", (char *)&aibss_ps, sizeof(aibss_ps), NULL, 0, TRUE); in dhd_preinit_aibss_ioctls()
13438 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_ATIM, in dhd_preinit_aibss_ioctls()
13453 ret = dhd_iovar(dhd, 0, "aibss_bcn_force_config", (char *)&bcn_config, in dhd_preinit_aibss_ioctls()
13463 ret = dhd_iovar(dhd, 0, "ibss_coalesce_allowed", (char *)&ibss_coalesce, in dhd_preinit_aibss_ioctls()
13471 dhd->op_mode |= DHD_FLAG_IBSS_MODE; in dhd_preinit_aibss_ioctls()
13479 dhd_check_adps_bad_ap(dhd_pub_t *dhd) in dhd_check_adps_bad_ap() argument
13486 if (!dhd_is_associated(dhd, 0, NULL)) { in dhd_check_adps_bad_ap()
13491 ndev = dhd_linux_get_primary_netdev(dhd); in dhd_check_adps_bad_ap()
13516 dhd_enable_adps(dhd_pub_t *dhd, uint8 on) in dhd_enable_adps() argument
13526 iov_buf = MALLOC(dhd->osh, len); in dhd_enable_adps()
13544 ret = dhd_iovar(dhd, 0, "adps", (char *)iov_buf, len, NULL, 0, TRUE); in dhd_enable_adps()
13561 dhd_check_adps_bad_ap(dhd); in dhd_enable_adps()
13567 MFREE(dhd->osh, iov_buf, len); in dhd_enable_adps()
13574 dhd_get_preserve_log_numbers(dhd_pub_t *dhd, uint32 *logset_mask) in dhd_get_preserve_log_numbers() argument
13584 if (!dhd || !logset_mask) in dhd_get_preserve_log_numbers()
13588 (sizeof(wl_el_set_type_v1_t) * dhd->event_log_max_sets); in dhd_get_preserve_log_numbers()
13590 logset_all_type_op = (wl_el_set_all_type_v1_t *) MALLOC(dhd->osh, el_set_all_type_len); in dhd_get_preserve_log_numbers()
13604 logset_type.set = dhd->event_log_max_sets; in dhd_get_preserve_log_numbers()
13605 err = dhd_iovar(dhd, 0, "event_log_set_type", (char *)&logset_type, sizeof(logset_type), in dhd_get_preserve_log_numbers()
13612 for (i = 0; i < dhd->event_log_max_sets; i++) { in dhd_get_preserve_log_numbers()
13617 err = dhd_iovar(dhd, 0, "event_log_set_type", (char *)&logset_type, in dhd_get_preserve_log_numbers()
13631 MFREE(dhd->osh, logset_all_type_op, el_set_all_type_len); in dhd_get_preserve_log_numbers()
13638 dhd_override_fwprenit(dhd_pub_t * dhd) in dhd_override_fwprenit() argument
13645 ret = dhd_iovar(dhd, 0, "bcn_li_bcn", (char *)&bcn_li_bcn, in dhd_override_fwprenit()
13656 ret = dhd_iovar(dhd, 0, "apsta", (char *)&apsta, in dhd_override_fwprenit()
13666 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_AP, (char *)&ap_mode, in dhd_override_fwprenit()
13675 dhd_get_fw_capabilities(dhd_pub_t * dhd) in dhd_get_fw_capabilities() argument
13679 uint32 cap_buf_size = sizeof(dhd->fw_capabilities); in dhd_get_fw_capabilities()
13680 memset(dhd->fw_capabilities, 0, cap_buf_size); in dhd_get_fw_capabilities()
13681 ret = dhd_iovar(dhd, 0, "cap", NULL, 0, dhd->fw_capabilities, (cap_buf_size - 1), in dhd_get_fw_capabilities()
13690 memmove(&dhd->fw_capabilities[1], dhd->fw_capabilities, (cap_buf_size - 1)); in dhd_get_fw_capabilities()
13691 dhd->fw_capabilities[0] = ' '; in dhd_get_fw_capabilities()
13692 dhd->fw_capabilities[cap_buf_size - 2] = ' '; in dhd_get_fw_capabilities()
13693 dhd->fw_capabilities[cap_buf_size - 1] = '\0'; in dhd_get_fw_capabilities()
13699 dhd_optimised_preinit_ioctls(dhd_pub_t * dhd) in dhd_optimised_preinit_ioctls() argument
13715 dhd_info_t *dhdinfo = (dhd_info_t*)dhd->info; in dhd_optimised_preinit_ioctls()
13757 dhd->apf_set = FALSE; in dhd_optimised_preinit_ioctls()
13760 dhd->suspend_bcn_li_dtim = CUSTOM_SUSPEND_BCN_LI_DTIM; in dhd_optimised_preinit_ioctls()
13762 dhd->max_dtim_enable = TRUE; in dhd_optimised_preinit_ioctls()
13764 dhd->max_dtim_enable = FALSE; in dhd_optimised_preinit_ioctls()
13766 dhd->disable_dtim_in_suspend = FALSE; in dhd_optimised_preinit_ioctls()
13768 dhd->ocl_off = FALSE; in dhd_optimised_preinit_ioctls()
13771 dhd->tid_mode = SET_TID_OFF; in dhd_optimised_preinit_ioctls()
13772 dhd->target_uid = 0; in dhd_optimised_preinit_ioctls()
13773 dhd->target_tid = 0; in dhd_optimised_preinit_ioctls()
13776 dhd->op_mode = 0; in dhd_optimised_preinit_ioctls()
13780 dhd->arpoe_enable = TRUE; in dhd_optimised_preinit_ioctls()
13781 dhd->arpol_configured = FALSE; in dhd_optimised_preinit_ioctls()
13786 dhd->dhd_cflags &= ~WLAN_PLAT_AP_FLAG; in dhd_optimised_preinit_ioctls()
13790 if (!dhd_validate_chipid(dhd)) { in dhd_optimised_preinit_ioctls()
13792 __FUNCTION__, dhd_bus_chip_id(dhd))); in dhd_optimised_preinit_ioctls()
13803 ret = dhd_iovar(dhd, 0, "ver", NULL, 0, (char *)&buf, sizeof(buf), FALSE); in dhd_optimised_preinit_ioctls()
13817 ret = dhd_iovar(dhd, 0, "wlc_ver", NULL, 0, (char *)&wlc_ver, in dhd_optimised_preinit_ioctls()
13822 dhd->wlc_ver_major = wlc_ver.wlc_ver_major; in dhd_optimised_preinit_ioctls()
13823 dhd->wlc_ver_minor = wlc_ver.wlc_ver_minor; in dhd_optimised_preinit_ioctls()
13832 ret = dhd_get_fw_capabilities(dhd); in dhd_optimised_preinit_ioctls()
13840 if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_MFG_MODE) || in dhd_optimised_preinit_ioctls()
13842 dhd->op_mode = DHD_FLAG_MFG_MODE; in dhd_optimised_preinit_ioctls()
13845 pm_runtime_disable(dhd_bus_to_dev(dhd->bus)); in dhd_optimised_preinit_ioctls()
13849 DHD_DISABLE_RUNTIME_PM(dhd); in dhd_optimised_preinit_ioctls()
13858 dhd->arpoe_enable = FALSE; in dhd_optimised_preinit_ioctls()
13864 if (FW_SUPPORTED(dhd, rsdb)) { in dhd_optimised_preinit_ioctls()
13867 ret = dhd_iovar(dhd, 0, "rsdb_mode", (char *)&rsdb_mode, sizeof(rsdb_mode), in dhd_optimised_preinit_ioctls()
13882 dhd->op_mode = DHD_FLAG_STA_MODE; in dhd_optimised_preinit_ioctls()
13886 if ((concurrent_mode = dhd_get_concurrent_capabilites(dhd))) { in dhd_optimised_preinit_ioctls()
13887 dhd->op_mode |= concurrent_mode; in dhd_optimised_preinit_ioctls()
13891 if (dhd->op_mode & DHD_FLAG_P2P_MODE) { in dhd_optimised_preinit_ioctls()
13892 memcpy(&p2p_ea, &dhd->mac, ETHER_ADDR_LEN); in dhd_optimised_preinit_ioctls()
13894 ret = dhd_iovar(dhd, 0, "p2p_da_override", (char *)&p2p_ea, sizeof(p2p_ea), in dhd_optimised_preinit_ioctls()
13906 ret = dhd_iovar(dhd, 0, "bus:hostwake_oob", NULL, 0, (char *)&hostwake_oob, in dhd_optimised_preinit_ioctls()
13923 ret = dhd_iovar(dhd, 0, "axierror_logbuf_addr", NULL, 0, (char *)&dhd->axierror_logbuf_addr, in dhd_optimised_preinit_ioctls()
13924 sizeof(dhd->axierror_logbuf_addr), FALSE); in dhd_optimised_preinit_ioctls()
13927 dhd->axierror_logbuf_addr = 0; in dhd_optimised_preinit_ioctls()
13930 __FUNCTION__, dhd->axierror_logbuf_addr)); in dhd_optimised_preinit_ioctls()
13935 ret = wifi_platform_get_mac_addr(dhd->info->adapter, ea_addr.octet, 0); in dhd_optimised_preinit_ioctls()
13937 ret = dhd_iovar(dhd, 0, "cur_etheraddr", (char *)&ea_addr, ETHER_ADDR_LEN, NULL, 0, in dhd_optimised_preinit_ioctls()
13944 memcpy(dhd->mac.octet, ea_addr.octet, ETHER_ADDR_LEN); in dhd_optimised_preinit_ioctls()
13949 ret = dhd_iovar(dhd, 0, "cur_etheraddr", NULL, 0, (char *)&buf, sizeof(buf), FALSE); in dhd_optimised_preinit_ioctls()
13968 memcpy(dhd->mac.octet, buf, ETHER_ADDR_LEN); in dhd_optimised_preinit_ioctls()
13971 if (ETHER_ISNULLADDR(dhd->mac.octet)) { in dhd_optimised_preinit_ioctls()
13976 (void)memcpy_s(dhd_linux_get_primary_netdev(dhd)->perm_addr, ETHER_ADDR_LEN, in dhd_optimised_preinit_ioctls()
13977 dhd->mac.octet, ETHER_ADDR_LEN); in dhd_optimised_preinit_ioctls()
13980 if ((ret = dhd_apply_default_clm(dhd, dhd->clm_path)) < 0) { in dhd_optimised_preinit_ioctls()
13986 dhd->op_mode, MAC2STRDBG(dhd->mac.octet))); in dhd_optimised_preinit_ioctls()
13987 dhd_set_version_info(dhd, fw_version); in dhd_optimised_preinit_ioctls()
13989 if (!dhd->is_blob) in dhd_optimised_preinit_ioctls()
13994 get_customized_country_code(dhd->info->adapter, dhd->dhd_cspec.country_abbrev, in dhd_optimised_preinit_ioctls()
13995 &dhd->dhd_cspec, dhd->dhd_cflags); in dhd_optimised_preinit_ioctls()
13997 get_customized_country_code(dhd->info->adapter, dhd->dhd_cspec.country_abbrev, in dhd_optimised_preinit_ioctls()
13998 &dhd->dhd_cspec); in dhd_optimised_preinit_ioctls()
14003 if (dhd->op_mode == DHD_FLAG_HOSTAP_MODE) in dhd_optimised_preinit_ioctls()
14004 dhd->info->rxthread_enabled = FALSE; in dhd_optimised_preinit_ioctls()
14006 dhd->info->rxthread_enabled = TRUE; in dhd_optimised_preinit_ioctls()
14009 if (dhd->dhd_cspec.ccode[0] != 0) { in dhd_optimised_preinit_ioctls()
14010 ret = dhd_iovar(dhd, 0, "country", (char *)&dhd->dhd_cspec, sizeof(wl_country_t), in dhd_optimised_preinit_ioctls()
14019 if (sec_get_param_wfa_cert(dhd, SET_PARAM_ROAMOFF, &roamvar) == BCME_OK) { in dhd_optimised_preinit_ioctls()
14025 ret = dhd_iovar(dhd, 0, "roam_off", (char *)&roamvar, sizeof(roamvar), NULL, 0, in dhd_optimised_preinit_ioctls()
14035 dhd->roam_env_detection = FALSE; in dhd_optimised_preinit_ioctls()
14036 ret = dhd_iovar(dhd, 0, "roam_env_detection", NULL, 0, (char *)&roam_env_mode, in dhd_optimised_preinit_ioctls()
14042 dhd->roam_env_detection = TRUE; in dhd_optimised_preinit_ioctls()
14047 ret = dhd_roam_rssi_limit_set(dhd, CUSTOM_ROAMRSSI_2G, CUSTOM_ROAMRSSI_5G); in dhd_optimised_preinit_ioctls()
14053 ret = dhd_roam_min_delta_set(dhd, CUSTOM_ROAM_MIN_DELTA, CUSTOM_ROAM_MIN_DELTA); in dhd_optimised_preinit_ioctls()
14061 dhd->tdls_enable = FALSE; in dhd_optimised_preinit_ioctls()
14063 ret = dhd_iovar(dhd, 0, "tdls_enable", NULL, 0, (char *)&dhd->tdls_enable, in dhd_optimised_preinit_ioctls()
14064 sizeof(dhd->tdls_enable), FALSE); in dhd_optimised_preinit_ioctls()
14065 DHD_ERROR(("%s: tdls_enable=%d ret=%d\n", __FUNCTION__, dhd->tdls_enable, ret)); in dhd_optimised_preinit_ioctls()
14070 dhd_control_pm(dhd, &power_mode); in dhd_optimised_preinit_ioctls()
14072 sec_control_pm(dhd, &power_mode); in dhd_optimised_preinit_ioctls()
14077 dhd_sel_ant_from_file(dhd); in dhd_optimised_preinit_ioctls()
14082 dhd_wl_ioctl_cmd(dhd, WLC_SET_DTIMPRD, (char *)&dtim, sizeof(dtim), TRUE, 0); in dhd_optimised_preinit_ioctls()
14088 if (!(dhd->op_mode & in dhd_optimised_preinit_ioctls()
14090 if ((ret = dhd_keep_alive_onoff(dhd)) < 0) in dhd_optimised_preinit_ioctls()
14096 ret = dhd_iovar(dhd, 0, "event_log_max_sets", NULL, 0, (char *)&event_log_max_sets, in dhd_optimised_preinit_ioctls()
14099 dhd->event_log_max_sets = event_log_max_sets; in dhd_optimised_preinit_ioctls()
14101 dhd->event_log_max_sets = NUM_EVENT_LOG_SETS; in dhd_optimised_preinit_ioctls()
14108 dhd->event_log_max_sets_queried = TRUE; in dhd_optimised_preinit_ioctls()
14110 __FUNCTION__, dhd->event_log_max_sets, ret)); in dhd_optimised_preinit_ioctls()
14112 ret = dhd_iovar(dhd, 0, "enable_memuse", (char *)&enable_memuse, in dhd_optimised_preinit_ioctls()
14125 if (sec_get_param_wfa_cert(dhd, SET_PARAM_FRAMEBURST, &frameburst) == BCME_OK) { in dhd_optimised_preinit_ioctls()
14134 if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE) { in dhd_optimised_preinit_ioctls()
14144 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_FAKEFRAG, (char *)&frameburst, in dhd_optimised_preinit_ioctls()
14151 iov_buf = (char*)MALLOC(dhd->osh, WLC_IOCTL_SMLEN); in dhd_optimised_preinit_ioctls()
14161 ret = dhd_iovar(dhd, 0, "sup_wpa", (char *)&sup_wpa, sizeof(sup_wpa), in dhd_optimised_preinit_ioctls()
14167 dhd->fw_4way_handshake = TRUE; in dhd_optimised_preinit_ioctls()
14168 DHD_TRACE(("4-way handshake mode is: %d\n", dhd->fw_4way_handshake)); in dhd_optimised_preinit_ioctls()
14173 dhd_update_flow_prio_map(dhd, DHD_FLOW_PRIO_LLR_MAP); in dhd_optimised_preinit_ioctls()
14177 dhd_update_flow_prio_map(dhd, DHD_FLOW_PRIO_LLR_MAP); in dhd_optimised_preinit_ioctls()
14181 dhd_update_sdio_data_prio_map(dhd); in dhd_optimised_preinit_ioctls()
14186 dhd->arpoe_enable, dhd->arpol_configured)); in dhd_optimised_preinit_ioctls()
14196 dhd->pktfilter_count = 6; in dhd_optimised_preinit_ioctls()
14197 dhd->pktfilter[DHD_BROADCAST_FILTER_NUM] = NULL; in dhd_optimised_preinit_ioctls()
14198 if (!FW_SUPPORTED(dhd, pf6)) { in dhd_optimised_preinit_ioctls()
14199 dhd->pktfilter[DHD_MULTICAST4_FILTER_NUM] = NULL; in dhd_optimised_preinit_ioctls()
14200 dhd->pktfilter[DHD_MULTICAST6_FILTER_NUM] = NULL; in dhd_optimised_preinit_ioctls()
14203 dhd->pktfilter[DHD_MULTICAST4_FILTER_NUM] = DISCARD_IPV4_MCAST; in dhd_optimised_preinit_ioctls()
14204 dhd->pktfilter[DHD_MULTICAST6_FILTER_NUM] = DISCARD_IPV6_MCAST; in dhd_optimised_preinit_ioctls()
14207 dhd->pktfilter[DHD_ARP_FILTER_NUM] = "105 0 0 12 0xFFFF 0x0806"; in dhd_optimised_preinit_ioctls()
14211 dhd->pktfilter[DHD_UNICAST_FILTER_NUM] = "100 0 0 0 " in dhd_optimised_preinit_ioctls()
14217 dhd->pktfilter[DHD_UNICAST_FILTER_NUM] = "100 0 0 0 0x01 0x00"; in dhd_optimised_preinit_ioctls()
14222 dhd->pktfilter[DHD_MDNS_FILTER_NUM] = "104 0 0 0 0xFFFFFF 0x01005E"; in dhd_optimised_preinit_ioctls()
14225 dhd->pktfilter[DHD_MDNS_FILTER_NUM] = NULL; in dhd_optimised_preinit_ioctls()
14227 if (FW_SUPPORTED(dhd, pf6)) { in dhd_optimised_preinit_ioctls()
14229 dhd->pktfilter[DHD_IP4BCAST_DROP_FILTER_NUM] = DISCARD_IPV4_BCAST; in dhd_optimised_preinit_ioctls()
14231 dhd->pktfilter[DHD_LLC_STP_DROP_FILTER_NUM] = DISCARD_LLC_STP; in dhd_optimised_preinit_ioctls()
14233 dhd->pktfilter[DHD_LLC_XID_DROP_FILTER_NUM] = DISCARD_LLC_XID; in dhd_optimised_preinit_ioctls()
14235 dhd->pktfilter[DHD_UDPNETBIOS_DROP_FILTER_NUM] = DISCARD_UDPNETBIOS; in dhd_optimised_preinit_ioctls()
14236 dhd->pktfilter_count = 11; in dhd_optimised_preinit_ioctls()
14240 dhd->pktfilter_count = 4; in dhd_optimised_preinit_ioctls()
14243 dhd->pktfilter[DHD_UNICAST_FILTER_NUM] = "100 0 0 0 0xffffff 0xffffff"; in dhd_optimised_preinit_ioctls()
14245 dhd->pktfilter[DHD_BROADCAST_FILTER_NUM] = "102 0 0 36 0xffffffff 0x11940009"; in dhd_optimised_preinit_ioctls()
14247 dhd->pktfilter[DHD_MULTICAST4_FILTER_NUM] = "104 0 0 38 0xffffffff 0x11940009"; in dhd_optimised_preinit_ioctls()
14248 dhd->pktfilter[DHD_MULTICAST6_FILTER_NUM] = NULL; in dhd_optimised_preinit_ioctls()
14251 dhd_conf_discard_pkt_filter(dhd); in dhd_optimised_preinit_ioctls()
14252 dhd_conf_add_pkt_filter(dhd); in dhd_optimised_preinit_ioctls()
14257 dhd_enable_packet_filter(0, dhd); in dhd_optimised_preinit_ioctls()
14260 dhd_set_packet_filter(dhd); in dhd_optimised_preinit_ioctls()
14265 ret = dhd_iovar(dhd, 0, "clmver", NULL, 0, buf, sizeof(buf), FALSE); in dhd_optimised_preinit_ioctls()
14329 sec_save_wlinfo(fw_version, EPI_VERSION_STR, dhd->info->nv_path, clm_version); in dhd_optimised_preinit_ioctls()
14337 if (!dhd->pno_state) { in dhd_optimised_preinit_ioctls()
14338 dhd_pno_init(dhd); in dhd_optimised_preinit_ioctls()
14344 if (dhd_wl_ioctl_get_intiovar(dhd, "bus:metadata_info", &val, in dhd_optimised_preinit_ioctls()
14355 dhd->pkt_metadata_version = 0; in dhd_optimised_preinit_ioctls()
14356 dhd->pkt_metadata_buflen = 0; in dhd_optimised_preinit_ioctls()
14358 dhd->pkt_metadata_version = GET_METADATA_VER(val); in dhd_optimised_preinit_ioctls()
14359 dhd->pkt_metadata_buflen = GET_METADATA_BUFLEN(val); in dhd_optimised_preinit_ioctls()
14363 ret = dhd_set_pktts_enab(dhd, TRUE); in dhd_optimised_preinit_ioctls()
14370 if (dhd->rtt_state) { in dhd_optimised_preinit_ioctls()
14371 ret = dhd_rtt_init(dhd); in dhd_optimised_preinit_ioctls()
14380 if (FW_SUPPORTED(dhd, fie) && in dhd_optimised_preinit_ioctls()
14381 !(dhd->op_mode & (DHD_FLAG_HOSTAP_MODE | DHD_FLAG_MFG_MODE))) { in dhd_optimised_preinit_ioctls()
14382 dhd_read_from_file(dhd); in dhd_optimised_preinit_ioctls()
14387 dhd->ndo_enable = FALSE; in dhd_optimised_preinit_ioctls()
14388 dhd->ndo_host_ip_overflow = FALSE; in dhd_optimised_preinit_ioctls()
14389 dhd->ndo_max_host_ip = NDO_MAX_HOST_IP_ENTRIES; in dhd_optimised_preinit_ioctls()
14393 dhd->ndo_version = dhd_ndo_get_version(dhd); in dhd_optimised_preinit_ioctls()
14396 dhd->wbtext_support = FALSE; in dhd_optimised_preinit_ioctls()
14397 if (dhd_wl_ioctl_get_intiovar(dhd, "wnm_bsstrans_resp", &wnm_bsstrans_resp, in dhd_optimised_preinit_ioctls()
14401 dhd->wbtext_policy = wnm_bsstrans_resp; in dhd_optimised_preinit_ioctls()
14402 if (dhd->wbtext_policy == WL_BSSTRANS_POLICY_PRODUCT_WBTEXT) { in dhd_optimised_preinit_ioctls()
14403 dhd->wbtext_support = TRUE; in dhd_optimised_preinit_ioctls()
14407 if (dhd->wbtext_support) { in dhd_optimised_preinit_ioctls()
14408 if (dhd_wl_ioctl_set_intiovar(dhd, "wnm_bsstrans_resp", in dhd_optimised_preinit_ioctls()
14418 if (dhd->op_mode == DHD_FLAG_MFG_MODE && in dhd_optimised_preinit_ioctls()
14419 (dhd_bus_dmaxfer_lpbk(dhd, M2M_NON_DMA_LPBK) < 0)) { in dhd_optimised_preinit_ioctls()
14429 if (dhd_wl_ioctl_set_intiovar(dhd, "recreate_bi_timeout", in dhd_optimised_preinit_ioctls()
14438 if (dhd_iovar(dhd, 0, "rrm_bcn_req_thrtl_win", in dhd_optimised_preinit_ioctls()
14443 if (dhd_iovar(dhd, 0, "rrm_bcn_req_max_off_chan_time", in dhd_optimised_preinit_ioctls()
14458 if ((ret2 = dhd_wl_ioctl_cmd(dhd, WLC_GET_MONITOR, iovbuf, in dhd_optimised_preinit_ioctls()
14467 if (FW_SUPPORTED(dhd, monitor)) { in dhd_optimised_preinit_ioctls()
14468 dhd->monitor_enable = TRUE; in dhd_optimised_preinit_ioctls()
14471 dhd->monitor_enable = FALSE; in dhd_optimised_preinit_ioctls()
14477 if (dhd_get_preserve_log_numbers(dhd, &dhd->logset_prsrv_mask) in dhd_optimised_preinit_ioctls()
14483 dhd->sroam_turn_on = TRUE; in dhd_optimised_preinit_ioctls()
14484 dhd->sroamed = FALSE; in dhd_optimised_preinit_ioctls()
14489 dhd_override_fwprenit(dhd); in dhd_optimised_preinit_ioctls()
14491 dhd_set_bandlock(dhd); in dhd_optimised_preinit_ioctls()
14494 dhd_conf_postinit_ioctls(dhd); in dhd_optimised_preinit_ioctls()
14496 MFREE(dhd->osh, iov_buf, WLC_IOCTL_SMLEN); in dhd_optimised_preinit_ioctls()
14502 dhd_legacy_preinit_ioctls(dhd_pub_t *dhd) in dhd_legacy_preinit_ioctls() argument
14523 dhd_info_t *dhdinfo = (dhd_info_t*)dhd->info; in dhd_legacy_preinit_ioctls()
14703 dhd->arpoe_enable = TRUE; in dhd_legacy_preinit_ioctls()
14704 dhd->arpol_configured = FALSE; in dhd_legacy_preinit_ioctls()
14711 dhd->apf_set = FALSE; in dhd_legacy_preinit_ioctls()
14714 dhd->suspend_bcn_li_dtim = CUSTOM_SUSPEND_BCN_LI_DTIM; in dhd_legacy_preinit_ioctls()
14716 dhd->max_dtim_enable = TRUE; in dhd_legacy_preinit_ioctls()
14718 dhd->max_dtim_enable = FALSE; in dhd_legacy_preinit_ioctls()
14720 dhd->disable_dtim_in_suspend = FALSE; in dhd_legacy_preinit_ioctls()
14722 dhd->ocl_off = FALSE; in dhd_legacy_preinit_ioctls()
14725 dhd->tid_mode = SET_TID_OFF; in dhd_legacy_preinit_ioctls()
14726 dhd->target_uid = 0; in dhd_legacy_preinit_ioctls()
14727 dhd->target_tid = 0; in dhd_legacy_preinit_ioctls()
14730 dhd_tcpack_suppress_set(dhd, dhd->conf->tcpack_sup_mode); in dhd_legacy_preinit_ioctls()
14732 dhd->op_mode = 0; in dhd_legacy_preinit_ioctls()
14736 dhd->dhd_cflags &= ~WLAN_PLAT_AP_FLAG; in dhd_legacy_preinit_ioctls()
14740 if (!dhd_validate_chipid(dhd)) { in dhd_legacy_preinit_ioctls()
14742 __FUNCTION__, dhd_bus_chip_id(dhd))); in dhd_legacy_preinit_ioctls()
14753 ret = dhd_iovar(dhd, 0, "ver", NULL, 0, (char *)&buf, sizeof(buf), FALSE); in dhd_legacy_preinit_ioctls()
14770 if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_MFG_MODE) || in dhd_legacy_preinit_ioctls()
14772 dhd->op_mode = DHD_FLAG_MFG_MODE; in dhd_legacy_preinit_ioctls()
14775 pm_runtime_disable(dhd_bus_to_dev(dhd->bus)); in dhd_legacy_preinit_ioctls()
14779 DHD_DISABLE_RUNTIME_PM(dhd); in dhd_legacy_preinit_ioctls()
14791 ret = dhd_iovar(dhd, 0, "bus:hostwake_oob", NULL, 0, (char *)&hostwake_oob, in dhd_legacy_preinit_ioctls()
14808 ret = dhd_iovar(dhd, 0, "axierror_logbuf_addr", NULL, 0, (char *)&dhd->axierror_logbuf_addr, in dhd_legacy_preinit_ioctls()
14809 sizeof(dhd->axierror_logbuf_addr), FALSE); in dhd_legacy_preinit_ioctls()
14812 dhd->axierror_logbuf_addr = 0; in dhd_legacy_preinit_ioctls()
14815 __FUNCTION__, dhd->axierror_logbuf_addr)); in dhd_legacy_preinit_ioctls()
14820 ret = dhd_iovar(dhd, 0, "event_log_rate_hc", (char *)&event_log_rate_hc, in dhd_legacy_preinit_ioctls()
14832 ret = wifi_platform_get_mac_addr(dhd->info->adapter, hw_ether, 0); in dhd_legacy_preinit_ioctls()
14834 if (!memcmp(ðer_null, &dhd->conf->hw_ether, ETHER_ADDR_LEN)) { in dhd_legacy_preinit_ioctls()
14841 memcpy(hw_ether, &dhd->conf->hw_ether, sizeof(dhd->conf->hw_ether)); in dhd_legacy_preinit_ioctls()
14845 ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, buf, sizeof(buf), TRUE, 0); in dhd_legacy_preinit_ioctls()
14849 ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, buf, sizeof(buf), TRUE, 0); in dhd_legacy_preinit_ioctls()
14865 ret = dhd_iovar(dhd, 0, "cur_etheraddr", NULL, 0, (char *)&buf, sizeof(buf), FALSE); in dhd_legacy_preinit_ioctls()
14884 memcpy(dhd->mac.octet, buf, ETHER_ADDR_LEN); in dhd_legacy_preinit_ioctls()
14886 if (ETHER_ISNULLADDR(dhd->mac.octet)) { in dhd_legacy_preinit_ioctls()
14891 (void)memcpy_s(dhd_linux_get_primary_netdev(dhd)->perm_addr, ETHER_ADDR_LEN, in dhd_legacy_preinit_ioctls()
14892 dhd->mac.octet, ETHER_ADDR_LEN); in dhd_legacy_preinit_ioctls()
14900 if ((ret = dhd_update_rand_mac_addr(dhd)) < 0) { in dhd_legacy_preinit_ioctls()
14907 if ((ret = dhd_apply_default_clm(dhd, dhd->clm_path)) < 0) { in dhd_legacy_preinit_ioctls()
14914 uint32 cap_buf_size = sizeof(dhd->fw_capabilities); in dhd_legacy_preinit_ioctls()
14915 memset(dhd->fw_capabilities, 0, cap_buf_size); in dhd_legacy_preinit_ioctls()
14916 ret = dhd_iovar(dhd, 0, "cap", NULL, 0, dhd->fw_capabilities, (cap_buf_size - 1), in dhd_legacy_preinit_ioctls()
14924 memmove(&dhd->fw_capabilities[1], dhd->fw_capabilities, (cap_buf_size - 1)); in dhd_legacy_preinit_ioctls()
14925 dhd->fw_capabilities[0] = ' '; in dhd_legacy_preinit_ioctls()
14926 dhd->fw_capabilities[cap_buf_size - 2] = ' '; in dhd_legacy_preinit_ioctls()
14927 dhd->fw_capabilities[cap_buf_size - 1] = '\0'; in dhd_legacy_preinit_ioctls()
14930 if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_HOSTAP_MODE) || in dhd_legacy_preinit_ioctls()
14935 dhd->op_mode = DHD_FLAG_HOSTAP_MODE; in dhd_legacy_preinit_ioctls()
14937 if (dhd_conf_get_insuspend(dhd, AP_FILTER_IN_SUSPEND)) in dhd_legacy_preinit_ioctls()
14952 ret = dhd_iovar(dhd, 0, "cur_etheraddr", (char *)&iovbuf, ETHER_ADDR_LEN, NULL, 0, in dhd_legacy_preinit_ioctls()
14957 memcpy(dhd->mac.octet, iovbuf, ETHER_ADDR_LEN); in dhd_legacy_preinit_ioctls()
14960 dhdsdio_func_blocksize(dhd, 2, DYNAMIC_F2_BLKSIZE_FOR_NONLEGACY); in dhd_legacy_preinit_ioctls()
14963 dhd_set_ap_powersave(dhd, 0, TRUE); in dhd_legacy_preinit_ioctls()
14966 ret = dhd_iovar(dhd, 0, "wme_apsd", (char *)&wme_apsd, sizeof(wme_apsd), NULL, 0, in dhd_legacy_preinit_ioctls()
14976 dhd->dhd_cflags |= WLAN_PLAT_AP_FLAG | WLAN_PLAT_NODFS_FLAG; in dhd_legacy_preinit_ioctls()
14978 } else if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_MFG_MODE) || in dhd_legacy_preinit_ioctls()
14981 dhd->arpoe_enable = FALSE; in dhd_legacy_preinit_ioctls()
14986 dhd->op_mode = DHD_FLAG_MFG_MODE; in dhd_legacy_preinit_ioctls()
14996 dhdsdio_func_blocksize(dhd, 2, DYNAMIC_F2_BLKSIZE_FOR_NONLEGACY); in dhd_legacy_preinit_ioctls()
14999 if (FW_SUPPORTED(dhd, rsdb)) { in dhd_legacy_preinit_ioctls()
15002 ret = dhd_iovar(dhd, 0, "rsdb_mode", (char *)&rsdb_mode, sizeof(rsdb_mode), in dhd_legacy_preinit_ioctls()
15012 if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_P2P_MODE) || in dhd_legacy_preinit_ioctls()
15017 dhd->op_mode = DHD_FLAG_P2P_MODE; in dhd_legacy_preinit_ioctls()
15018 } else if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_IBSS_MODE) || in dhd_legacy_preinit_ioctls()
15020 dhd->op_mode = DHD_FLAG_IBSS_MODE; in dhd_legacy_preinit_ioctls()
15022 dhd->op_mode = DHD_FLAG_STA_MODE; in dhd_legacy_preinit_ioctls()
15024 if (dhd->op_mode != DHD_FLAG_IBSS_MODE && in dhd_legacy_preinit_ioctls()
15025 (concurrent_mode = dhd_get_concurrent_capabilites(dhd))) { in dhd_legacy_preinit_ioctls()
15026 dhd->op_mode |= concurrent_mode; in dhd_legacy_preinit_ioctls()
15030 if (dhd->op_mode & DHD_FLAG_P2P_MODE) { in dhd_legacy_preinit_ioctls()
15031 ret = dhd_iovar(dhd, 0, "apsta", (char *)&apsta, sizeof(apsta), NULL, 0, in dhd_legacy_preinit_ioctls()
15037 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_AP, in dhd_legacy_preinit_ioctls()
15042 memcpy(&p2p_ea, &dhd->mac, ETHER_ADDR_LEN); in dhd_legacy_preinit_ioctls()
15044 ret = dhd_iovar(dhd, 0, "p2p_da_override", (char *)&p2p_ea, sizeof(p2p_ea), in dhd_legacy_preinit_ioctls()
15057 if (FW_SUPPORTED(dhd, rsdb)) { in dhd_legacy_preinit_ioctls()
15058 ret = dhd_iovar(dhd, 0, "scan_features", (char *)&scan_features, in dhd_legacy_preinit_ioctls()
15072 ret = dhd_iovar(dhd, 0, "scan_features", (char *)&scan_features, in dhd_legacy_preinit_ioctls()
15083 dhd->op_mode, MAC2STRDBG(dhd->mac.octet))); in dhd_legacy_preinit_ioctls()
15085 if (!dhd->is_blob) in dhd_legacy_preinit_ioctls()
15090 get_customized_country_code(dhd->info->adapter, dhd->dhd_cspec.country_abbrev, in dhd_legacy_preinit_ioctls()
15091 &dhd->dhd_cspec, dhd->dhd_cflags); in dhd_legacy_preinit_ioctls()
15093 get_customized_country_code(dhd->info->adapter, dhd->dhd_cspec.country_abbrev, in dhd_legacy_preinit_ioctls()
15094 &dhd->dhd_cspec); in dhd_legacy_preinit_ioctls()
15099 if (dhd->op_mode == DHD_FLAG_HOSTAP_MODE) in dhd_legacy_preinit_ioctls()
15100 dhd->info->rxthread_enabled = FALSE; in dhd_legacy_preinit_ioctls()
15102 dhd->info->rxthread_enabled = TRUE; in dhd_legacy_preinit_ioctls()
15105 if (dhd->dhd_cspec.ccode[0] != 0) { in dhd_legacy_preinit_ioctls()
15106 ret = dhd_iovar(dhd, 0, "country", (char *)&dhd->dhd_cspec, sizeof(wl_country_t), in dhd_legacy_preinit_ioctls()
15113 ret = dhd_iovar(dhd, 0, "vhtmode", (char *)&vhtmode, sizeof(vhtmode), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15119 ret = dhd_iovar(dhd, 0, "assoc_listen", (char *)&listen_interval, sizeof(listen_interval), in dhd_legacy_preinit_ioctls()
15126 if (sec_get_param_wfa_cert(dhd, SET_PARAM_ROAMOFF, &roamvar) == BCME_OK) { in dhd_legacy_preinit_ioctls()
15131 ret = dhd_iovar(dhd, 0, "roam_off", (char *)&roamvar, sizeof(roamvar), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15138 ret = dhd_iovar(dhd, 0, "roam_bcnloss_off", (char *)&roam_bcnloss_off, in dhd_legacy_preinit_ioctls()
15144 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_TRIGGER, roam_trigger, in dhd_legacy_preinit_ioctls()
15147 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_SCAN_PERIOD, roam_scan_period, in dhd_legacy_preinit_ioctls()
15150 if ((dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_DELTA, roam_delta, in dhd_legacy_preinit_ioctls()
15153 ret = dhd_iovar(dhd, 0, "fullroamperiod", (char *)&roam_fullscan_period, in dhd_legacy_preinit_ioctls()
15159 if (dhd_iovar(dhd, 0, "roam_env_detection", (char *)&roam_env_mode, in dhd_legacy_preinit_ioctls()
15161 dhd->roam_env_detection = TRUE; in dhd_legacy_preinit_ioctls()
15163 dhd->roam_env_detection = FALSE; in dhd_legacy_preinit_ioctls()
15167 ret = dhd_roam_rssi_limit_set(dhd, CUSTOM_ROAMRSSI_2G, CUSTOM_ROAMRSSI_5G); in dhd_legacy_preinit_ioctls()
15173 ret = dhd_roam_min_delta_set(dhd, CUSTOM_ROAM_MIN_DELTA, CUSTOM_ROAM_MIN_DELTA); in dhd_legacy_preinit_ioctls()
15182 ret = dhd_iovar(dhd, 0, "const_awake_thresh", (char *)&pm_awake_thresh, in dhd_legacy_preinit_ioctls()
15189 dhd_iovar(dhd, 0, "okc_enable", (char *)&okc, sizeof(okc), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15192 dhd_iovar(dhd, 0, "ccx_enable", (char *)&ccx, sizeof(ccx), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15196 dhd->tdls_enable = FALSE; in dhd_legacy_preinit_ioctls()
15197 dhd_tdls_set_mode(dhd, false); in dhd_legacy_preinit_ioctls()
15202 ret = dhd_iovar(dhd, 0, "lpc", (char *)&lpc, sizeof(lpc), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15208 ret = dhd_wl_ioctl_cmd(dhd, WLC_DOWN, in dhd_legacy_preinit_ioctls()
15212 ret = dhd_iovar(dhd, 0, "lpc", (char *)&lpc, sizeof(lpc), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15219 if (dhd->op_mode & DHD_FLAG_STA_MODE) { in dhd_legacy_preinit_ioctls()
15220 if ((ret = dhd_enable_adps(dhd, ADPS_ENABLE)) != BCME_OK && in dhd_legacy_preinit_ioctls()
15230 dhd_control_pm(dhd, &power_mode); in dhd_legacy_preinit_ioctls()
15232 sec_control_pm(dhd, &power_mode); in dhd_legacy_preinit_ioctls()
15236 (void) dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char *)&power_mode, sizeof(power_mode), TRUE, 0); in dhd_legacy_preinit_ioctls()
15241 ret = dhd_iovar(dhd, 0, "bus:txglomalign", (char *)&dongle_align, sizeof(dongle_align), in dhd_legacy_preinit_ioctls()
15248 if (sec_get_param_wfa_cert(dhd, SET_PARAM_BUS_TXGLOM_MODE, &glom) == BCME_OK) { in dhd_legacy_preinit_ioctls()
15254 ret = dhd_iovar(dhd, 0, "bus:txglom", (char *)&glom, sizeof(glom), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15262 ret = dhd_iovar(dhd, 0, "bcn_timeout", (char *)&bcn_timeout, sizeof(bcn_timeout), in dhd_legacy_preinit_ioctls()
15269 ret = dhd_iovar(dhd, 0, "assoc_retry_max", (char *)&retry_max, sizeof(retry_max), in dhd_legacy_preinit_ioctls()
15276 ret = dhd_iovar(dhd, 0, "apsta", (char *)&apsta, sizeof(apsta), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15284 dhd_sel_ant_from_file(dhd); in dhd_legacy_preinit_ioctls()
15289 dhd_wl_ioctl_cmd(dhd, WLC_SET_DTIMPRD, (char *)&dtim, sizeof(dtim), TRUE, 0); in dhd_legacy_preinit_ioctls()
15301 if (!(dhd->op_mode & in dhd_legacy_preinit_ioctls()
15303 if ((res = dhd_keep_alive_onoff(dhd)) < 0) in dhd_legacy_preinit_ioctls()
15311 ret = dhd_iovar(dhd, 0, "txbf", (char *)&txbf, sizeof(txbf), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15317 ret = dhd_iovar(dhd, 0, "scancache", (char *)&scancache_enab, sizeof(scancache_enab), NULL, in dhd_legacy_preinit_ioctls()
15324 if ((ret = dhd_apply_default_clm(dhd, dhd->clm_path)) < 0) { in dhd_legacy_preinit_ioctls()
15330 if (!(dhd->op_mode & in dhd_legacy_preinit_ioctls()
15332 if ((ret = dhd_keep_alive_onoff(dhd)) < 0) in dhd_legacy_preinit_ioctls()
15339 memset(dhd->fw_capabilities, 0, sizeof(dhd->fw_capabilities)); in dhd_legacy_preinit_ioctls()
15340 ret = dhd_iovar(dhd, 0, "cap", NULL, 0, dhd->fw_capabilities, sizeof(dhd->fw_capabilities), in dhd_legacy_preinit_ioctls()
15349 ret = dhd_iovar(dhd, 0, "event_log_max_sets", NULL, 0, (char *)&event_log_max_sets, in dhd_legacy_preinit_ioctls()
15352 dhd->event_log_max_sets = event_log_max_sets; in dhd_legacy_preinit_ioctls()
15354 dhd->event_log_max_sets = NUM_EVENT_LOG_SETS; in dhd_legacy_preinit_ioctls()
15360 dhd->event_log_max_sets_queried = TRUE; in dhd_legacy_preinit_ioctls()
15362 __FUNCTION__, dhd->event_log_max_sets, ret)); in dhd_legacy_preinit_ioctls()
15364 ret = dhd_iovar(dhd, 0, "enable_memuse", (char *)&enable_memuse, in dhd_legacy_preinit_ioctls()
15376 ret = dhd_iovar(dhd, 0, "txbf_bfr_cap", (char *)&txbf_bfr_cap, sizeof(txbf_bfr_cap), NULL, in dhd_legacy_preinit_ioctls()
15385 if (sec_get_param_wfa_cert(dhd, SET_PARAM_FRAMEBURST, &frameburst) == BCME_OK) { in dhd_legacy_preinit_ioctls()
15393 if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE) { in dhd_legacy_preinit_ioctls()
15398 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_FAKEFRAG, (char *)&frameburst, in dhd_legacy_preinit_ioctls()
15404 ret = dhd_iovar(dhd, 0, "ack_ratio", (char *)&ack_ratio, sizeof(ack_ratio), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15410 ret = dhd_iovar(dhd, 0, "ack_ratio_depth", (char *)&ack_ratio_depth, in dhd_legacy_preinit_ioctls()
15417 iov_buf = (char*)MALLOC(dhd->osh, WLC_IOCTL_SMLEN); in dhd_legacy_preinit_ioctls()
15428 if ((ret = dhd_preinit_aibss_ioctls(dhd, iov_buf)) != BCME_OK) { in dhd_legacy_preinit_ioctls()
15442 if (dhd->op_mode == DHD_FLAG_IBSS_MODE) in dhd_legacy_preinit_ioctls()
15446 ret = dhd_iovar(dhd, 0, "ampdu_ba_wsize", (char *)&du_ba_wsize, in dhd_legacy_preinit_ioctls()
15458 ret = dhd_iovar(dhd, 0, "ampdu_mpdu", (char *)&du_mpdu, sizeof(ampdu_mpdu), in dhd_legacy_preinit_ioctls()
15470 ret = dhd_iovar(dhd, 0, "ampdu_release", (char *)&du_release, in dhd_legacy_preinit_ioctls()
15482 ret = dhd_iovar(dhd, 0, "amsdu_aggsf", (char *)&amsdu_aggsf, sizeof(amsdu_aggsf), in dhd_legacy_preinit_ioctls()
15494 ret = dhd_iovar(dhd, 0, "sup_wpa", (char *)&sup_wpa, sizeof(sup_wpa), in dhd_legacy_preinit_ioctls()
15500 dhd->fw_4way_handshake = TRUE; in dhd_legacy_preinit_ioctls()
15501 DHD_TRACE(("4-way handshake mode is: %d\n", dhd->fw_4way_handshake)); in dhd_legacy_preinit_ioctls()
15505 ret = dhd_iovar(dhd, 0, "vht_features", (char *)&vht_features, sizeof(vht_features), in dhd_legacy_preinit_ioctls()
15519 ret = dhd_iovar(dhd, 0, "vht_features", (char *)&vht_features, sizeof(vht_features), in dhd_legacy_preinit_ioctls()
15524 ret = dhd_wl_ioctl_cmd(dhd, WLC_DOWN, in dhd_legacy_preinit_ioctls()
15530 ret = dhd_iovar(dhd, 0, "vht_features", (char *)&vht_features, in dhd_legacy_preinit_ioctls()
15545 ret = dhd_iovar(dhd, 0, "ht_features", (char *)&ht_features, sizeof(ht_features), NULL, 0, in dhd_legacy_preinit_ioctls()
15556 dhd_control_he_enab(dhd, control_he_enab); in dhd_legacy_preinit_ioctls()
15561 ret = dhd_iovar(dhd, 0, "pspretend_threshold", (char *)&pspretend_thr, in dhd_legacy_preinit_ioctls()
15570 ret = dhd_iovar(dhd, 0, "buf_key_b4_m4", (char *)&buf_key_b4_m4, sizeof(buf_key_b4_m4), in dhd_legacy_preinit_ioctls()
15576 ret = dhd_iovar(dhd, 0, "cac", (char *)&cac, sizeof(cac), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15583 eventmask_msg = (eventmsgs_ext_t*)MALLOC(dhd->osh, msglen); in dhd_legacy_preinit_ioctls()
15594 ret = dhd_iovar(dhd, 0, "event_msgs_ext", (char *)eventmask_msg, msglen, iov_buf, in dhd_legacy_preinit_ioctls()
15615 if (!(dhd->op_mode & DHD_FLAG_IBSS_MODE)) in dhd_legacy_preinit_ioctls()
15676 if (dhd->op_mode & DHD_FLAG_P2P_MODE) { in dhd_legacy_preinit_ioctls()
15685 if (dhd_logtrace_from_file(dhd)) { in dhd_legacy_preinit_ioctls()
15709 dhd_update_flow_prio_map(dhd, DHD_FLOW_PRIO_LLR_MAP); in dhd_legacy_preinit_ioctls()
15713 dhd_update_flow_prio_map(dhd, DHD_FLOW_PRIO_LLR_MAP); in dhd_legacy_preinit_ioctls()
15717 dhd_update_sdio_data_prio_map(dhd); in dhd_legacy_preinit_ioctls()
15765 ret = dhd_iovar(dhd, 0, "event_msgs_ext", (char *)eventmask_msg, msglen, NULL, 0, in dhd_legacy_preinit_ioctls()
15774 el_tag = (wl_el_tag_params_t *)MALLOC(dhd->osh, sizeof(wl_el_tag_params_t)); in dhd_legacy_preinit_ioctls()
15784 ret = dhd_iovar(dhd, 0, "event_log_tag_control", (char *)el_tag, sizeof(*el_tag), NULL, in dhd_legacy_preinit_ioctls()
15791 if (FW_SUPPORTED((dhd), event_log)) { in dhd_legacy_preinit_ioctls()
15792 if (dhd_iovar(dhd, 0, "privacy_mask", (char *)&privacy_mask, sizeof(privacy_mask), in dhd_legacy_preinit_ioctls()
15803 dhd_wl_ioctl_cmd(dhd, WLC_SET_SCAN_CHANNEL_TIME, (char *)&scan_assoc_time, in dhd_legacy_preinit_ioctls()
15805 dhd_wl_ioctl_cmd(dhd, WLC_SET_SCAN_UNASSOC_TIME, (char *)&scan_unassoc_time, in dhd_legacy_preinit_ioctls()
15807 dhd_wl_ioctl_cmd(dhd, WLC_SET_SCAN_PASSIVE_TIME, (char *)&scan_passive_time, in dhd_legacy_preinit_ioctls()
15812 dhd->arpoe_enable, dhd->arpol_configured)); in dhd_legacy_preinit_ioctls()
15818 dhd->pktfilter_count = 6; in dhd_legacy_preinit_ioctls()
15819 dhd->pktfilter[DHD_BROADCAST_FILTER_NUM] = NULL; in dhd_legacy_preinit_ioctls()
15820 if (!FW_SUPPORTED(dhd, pf6)) { in dhd_legacy_preinit_ioctls()
15821 dhd->pktfilter[DHD_MULTICAST4_FILTER_NUM] = NULL; in dhd_legacy_preinit_ioctls()
15822 dhd->pktfilter[DHD_MULTICAST6_FILTER_NUM] = NULL; in dhd_legacy_preinit_ioctls()
15825 dhd->pktfilter[DHD_MULTICAST4_FILTER_NUM] = DISCARD_IPV4_MCAST; in dhd_legacy_preinit_ioctls()
15826 dhd->pktfilter[DHD_MULTICAST6_FILTER_NUM] = DISCARD_IPV6_MCAST; in dhd_legacy_preinit_ioctls()
15829 dhd->pktfilter[DHD_ARP_FILTER_NUM] = "105 0 0 12 0xFFFF 0x0806"; in dhd_legacy_preinit_ioctls()
15833 dhd->pktfilter[DHD_UNICAST_FILTER_NUM] = "100 0 0 0 " in dhd_legacy_preinit_ioctls()
15839 dhd->pktfilter[DHD_UNICAST_FILTER_NUM] = "100 0 0 0 0x01 0x00"; in dhd_legacy_preinit_ioctls()
15844 dhd->pktfilter[DHD_MDNS_FILTER_NUM] = "104 0 0 0 0xFFFFFF 0x01005E"; in dhd_legacy_preinit_ioctls()
15847 dhd->pktfilter[DHD_MDNS_FILTER_NUM] = NULL; in dhd_legacy_preinit_ioctls()
15849 if (FW_SUPPORTED(dhd, pf6)) { in dhd_legacy_preinit_ioctls()
15851 dhd->pktfilter[DHD_IP4BCAST_DROP_FILTER_NUM] = DISCARD_IPV4_BCAST; in dhd_legacy_preinit_ioctls()
15852 dhd->pktfilter_count = 8; in dhd_legacy_preinit_ioctls()
15856 dhd->pktfilter_count = 4; in dhd_legacy_preinit_ioctls()
15859 dhd->pktfilter[DHD_UNICAST_FILTER_NUM] = "100 0 0 0 0xffffff 0xffffff"; in dhd_legacy_preinit_ioctls()
15861 dhd->pktfilter[DHD_BROADCAST_FILTER_NUM] = "102 0 0 36 0xffffffff 0x11940009"; in dhd_legacy_preinit_ioctls()
15863 dhd->pktfilter[DHD_MULTICAST4_FILTER_NUM] = "104 0 0 38 0xffffffff 0x11940009"; in dhd_legacy_preinit_ioctls()
15864 dhd->pktfilter[DHD_MULTICAST6_FILTER_NUM] = NULL; in dhd_legacy_preinit_ioctls()
15867 dhd_conf_discard_pkt_filter(dhd); in dhd_legacy_preinit_ioctls()
15868 dhd_conf_add_pkt_filter(dhd); in dhd_legacy_preinit_ioctls()
15873 dhd_enable_packet_filter(0, dhd); in dhd_legacy_preinit_ioctls()
15876 dhd_set_packet_filter(dhd); in dhd_legacy_preinit_ioctls()
15879 ret = dhd_iovar(dhd, 0, "nmode", (char *)&nmode, sizeof(nmode), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15885 ret = dhd_iovar(dhd, 0, "bcn_li_bcn", (char *)&bcn_li_bcn, sizeof(bcn_li_bcn), in dhd_legacy_preinit_ioctls()
15895 ret = dhd_iovar(dhd, 0, "ampdu_tid", (char *)&tid, sizeof(tid), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15902 ret = dhd_iovar(dhd, 0, "ampdu_tid", (char *)&tid, sizeof(tid), NULL, 0, TRUE); in dhd_legacy_preinit_ioctls()
15908 if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE) { in dhd_legacy_preinit_ioctls()
15910 dhd_bus_setidletime(dhd, (int)100); in dhd_legacy_preinit_ioctls()
15913 dhd_tcpack_suppress_set(dhd, TCPACK_SUP_OFF); in dhd_legacy_preinit_ioctls()
15921 ret = dhd_iovar(dhd, 0, "bus:txglom_auto_control", NULL, 0, buf, sizeof(buf), in dhd_legacy_preinit_ioctls()
15925 ret = dhd_iovar(dhd, 0, "bus:txglom", (char *)&glom, sizeof(glom), in dhd_legacy_preinit_ioctls()
15933 ret = dhd_iovar(dhd, 0, "bus:txglom_auto_control", (char *)&glom, in dhd_legacy_preinit_ioctls()
15946 ret = dhd_iovar(dhd, 0, "clmver", NULL, 0, buf, sizeof(buf), FALSE); in dhd_legacy_preinit_ioctls()
16015 dhd_set_version_info(dhd, fw_version); in dhd_legacy_preinit_ioctls()
16018 sec_save_wlinfo(fw_version, EPI_VERSION_STR, dhd->info->nv_path, clm_version); in dhd_legacy_preinit_ioctls()
16027 dhd_txglom_enable(dhd, dhd->conf->bus_rxglom); in dhd_legacy_preinit_ioctls()
16035 (dhd->op_mode != DHD_FLAG_HOSTAP_MODE && in dhd_legacy_preinit_ioctls()
16036 dhd->op_mode != DHD_FLAG_IBSS_MODE) || in dhd_legacy_preinit_ioctls()
16041 ret = dhd_conf_get_disable_proptx(dhd); in dhd_legacy_preinit_ioctls()
16054 if (sec_get_param_wfa_cert(dhd, SET_PARAM_PROPTX, &proptx) == BCME_OK) { in dhd_legacy_preinit_ioctls()
16062 ret = dhd_wl_ioctl_cmd(dhd, WLC_DOWN, (char *)&wl_down, sizeof(wl_down), TRUE, 0); in dhd_legacy_preinit_ioctls()
16063 ret2 = dhd_iovar(dhd, 0, "ampdu_hostreorder", (char *)&hostreorder, sizeof(hostreorder), in dhd_legacy_preinit_ioctls()
16072 ret2 = dhd_wl_ioctl_cmd(dhd, WLC_DOWN, (char *)&wl_down, in dhd_legacy_preinit_ioctls()
16077 ret2 = dhd_iovar(dhd, 0, "ampdu_hostreorder", (char *)&hostreorder, in dhd_legacy_preinit_ioctls()
16089 dhd_preinit_config(dhd, 0); in dhd_legacy_preinit_ioctls()
16093 dhd_wlfc_init(dhd); in dhd_legacy_preinit_ioctls()
16095 dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "ampdu_hostreorder", 1, 0, TRUE); in dhd_legacy_preinit_ioctls()
16099 dhd_wlfc_hostreorder_init(dhd); in dhd_legacy_preinit_ioctls()
16104 dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "ampdu_hostreorder", 0, 0, TRUE); in dhd_legacy_preinit_ioctls()
16109 if (FW_SUPPORTED(dhd, ap)) { in dhd_legacy_preinit_ioctls()
16111 ret = dhd_iovar(dhd, 0, "ap_isolate", (char *)&wl_ap_isolate, sizeof(wl_ap_isolate), in dhd_legacy_preinit_ioctls()
16118 if (!dhd->pno_state) { in dhd_legacy_preinit_ioctls()
16119 dhd_pno_init(dhd); in dhd_legacy_preinit_ioctls()
16125 if (dhd_wl_ioctl_get_intiovar(dhd, "bus:metadata_info", &val, in dhd_legacy_preinit_ioctls()
16136 dhd->pkt_metadata_version = 0; in dhd_legacy_preinit_ioctls()
16137 dhd->pkt_metadata_buflen = 0; in dhd_legacy_preinit_ioctls()
16139 dhd->pkt_metadata_version = GET_METADATA_VER(val); in dhd_legacy_preinit_ioctls()
16140 dhd->pkt_metadata_buflen = GET_METADATA_BUFLEN(val); in dhd_legacy_preinit_ioctls()
16144 ret = dhd_set_pktts_enab(dhd, TRUE); in dhd_legacy_preinit_ioctls()
16151 if (dhd->rtt_state) { in dhd_legacy_preinit_ioctls()
16152 ret = dhd_rtt_init(dhd); in dhd_legacy_preinit_ioctls()
16160 if (FW_SUPPORTED(dhd, fie) && in dhd_legacy_preinit_ioctls()
16161 !(dhd->op_mode & (DHD_FLAG_HOSTAP_MODE | DHD_FLAG_MFG_MODE))) { in dhd_legacy_preinit_ioctls()
16162 dhd_read_from_file(dhd); in dhd_legacy_preinit_ioctls()
16166 dhd_interworking_enable(dhd); in dhd_legacy_preinit_ioctls()
16170 dhd->ndo_enable = FALSE; in dhd_legacy_preinit_ioctls()
16171 dhd->ndo_host_ip_overflow = FALSE; in dhd_legacy_preinit_ioctls()
16172 dhd->ndo_max_host_ip = NDO_MAX_HOST_IP_ENTRIES; in dhd_legacy_preinit_ioctls()
16176 dhd->ndo_version = dhd_ndo_get_version(dhd); in dhd_legacy_preinit_ioctls()
16177 if (dhd->ndo_version > 0) { in dhd_legacy_preinit_ioctls()
16178 DHD_INFO(("%s: ndo version %d\n", __FUNCTION__, dhd->ndo_version)); in dhd_legacy_preinit_ioctls()
16182 ret = dhd_ndo_unsolicited_na_filter_enable(dhd, 1); in dhd_legacy_preinit_ioctls()
16190 dhd->wbtext_support = FALSE; in dhd_legacy_preinit_ioctls()
16191 if (dhd_wl_ioctl_get_intiovar(dhd, "wnm_bsstrans_resp", &wnm_bsstrans_resp, in dhd_legacy_preinit_ioctls()
16195 dhd->wbtext_policy = wnm_bsstrans_resp; in dhd_legacy_preinit_ioctls()
16196 if (dhd->wbtext_policy == WL_BSSTRANS_POLICY_PRODUCT_WBTEXT) { in dhd_legacy_preinit_ioctls()
16197 dhd->wbtext_support = TRUE; in dhd_legacy_preinit_ioctls()
16201 if (dhd->wbtext_support) { in dhd_legacy_preinit_ioctls()
16202 if (dhd_wl_ioctl_set_intiovar(dhd, "wnm_bsstrans_resp", in dhd_legacy_preinit_ioctls()
16212 if (dhd->op_mode == DHD_FLAG_MFG_MODE && in dhd_legacy_preinit_ioctls()
16213 (dhd_bus_dmaxfer_lpbk(dhd, M2M_NON_DMA_LPBK) < 0)) { in dhd_legacy_preinit_ioctls()
16228 if (FW_SUPPORTED(dhd, estm)) { in dhd_legacy_preinit_ioctls()
16232 if (dhd_iovar(dhd, 0, "wnm", (char *)&wnm_cap, sizeof(wnm_cap), NULL, 0, TRUE) < 0) { in dhd_legacy_preinit_ioctls()
16241 if (dhd_wl_ioctl_set_intiovar(dhd, "recreate_bi_timeout", in dhd_legacy_preinit_ioctls()
16249 if (dhd_iovar(dhd, 0, "wnm_btmdelta", (char *)&btmdelta, sizeof(btmdelta), in dhd_legacy_preinit_ioctls()
16255 if (dhd_iovar(dhd, 0, "rrm_bcn_req_thrtl_win", in dhd_legacy_preinit_ioctls()
16260 if (dhd_iovar(dhd, 0, "rrm_bcn_req_max_off_chan_time", in dhd_legacy_preinit_ioctls()
16276 if ((ret2 = dhd_wl_ioctl_cmd(dhd, WLC_GET_MONITOR, iovbuf, in dhd_legacy_preinit_ioctls()
16285 if (FW_SUPPORTED(dhd, monitor)) { in dhd_legacy_preinit_ioctls()
16286 dhd->monitor_enable = TRUE; in dhd_legacy_preinit_ioctls()
16289 dhd->monitor_enable = FALSE; in dhd_legacy_preinit_ioctls()
16295 if (dhd_get_preserve_log_numbers(dhd, &dhd->logset_prsrv_mask) in dhd_legacy_preinit_ioctls()
16300 if (FW_SUPPORTED(dhd, ecounters) && enable_ecounter) { in dhd_legacy_preinit_ioctls()
16301 dhd_ecounter_configure(dhd, TRUE); in dhd_legacy_preinit_ioctls()
16305 dhd->sroam_turn_on = TRUE; in dhd_legacy_preinit_ioctls()
16306 dhd->sroamed = FALSE; in dhd_legacy_preinit_ioctls()
16308 dhd_set_bandlock(dhd); in dhd_legacy_preinit_ioctls()
16310 dhd_conf_postinit_ioctls(dhd); in dhd_legacy_preinit_ioctls()
16314 MFREE(dhd->osh, eventmask_msg, msglen); in dhd_legacy_preinit_ioctls()
16317 MFREE(dhd->osh, iov_buf, WLC_IOCTL_SMLEN); in dhd_legacy_preinit_ioctls()
16321 MFREE(dhd->osh, el_tag, sizeof(wl_el_tag_params_t)); in dhd_legacy_preinit_ioctls()
16331 dhd_preinit_ioctls(dhd_pub_t *dhd) in dhd_preinit_ioctls() argument
16337 ret = dhd_iovar(dhd, 0, "preinit_status", NULL, 0, (char *)&preinit_status, in dhd_preinit_ioctls()
16343 dhd->fw_preinit = TRUE; in dhd_preinit_ioctls()
16344 ret = dhd_optimised_preinit_ioctls(dhd); in dhd_preinit_ioctls()
16348 dhd->fw_preinit = FALSE; in dhd_preinit_ioctls()
16349 ret = dhd_legacy_preinit_ioctls(dhd); in dhd_preinit_ioctls()
16355 dhd->fw_preinit = FALSE; in dhd_preinit_ioctls()
16356 ret = dhd_legacy_preinit_ioctls(dhd); in dhd_preinit_ioctls()
16393 struct dhd_info *dhd = dhdp->info; in dhd_change_mtu() local
16396 ASSERT(dhd && dhd->iflist[ifidx]); in dhd_change_mtu()
16397 dev = dhd->iflist[ifidx]->net; in dhd_change_mtu()
16550 dhd_info_t *dhd; in dhd_inetaddr_notifier_call() local
16566 dhd = DHD_DEV_INFO(ifa->ifa_dev->dev); in dhd_inetaddr_notifier_call()
16567 if (!dhd) in dhd_inetaddr_notifier_call()
16570 dhd_pub = &dhd->pub; in dhd_inetaddr_notifier_call()
16581 if (dhd->iflist[idx] && dhd->iflist[idx]->net == ifa->ifa_dev->dev) in dhd_inetaddr_notifier_call()
16585 DHD_TRACE(("ifidx : %p %s %d\n", dhd->iflist[idx]->net, in dhd_inetaddr_notifier_call()
16586 dhd->iflist[idx]->name, dhd->iflist[idx]->idx)); in dhd_inetaddr_notifier_call()
16602 if (DHD_BUS_CHECK_DOWN_OR_DOWN_IN_PROGRESS(&dhd->pub) || in dhd_inetaddr_notifier_call()
16603 dhd->pub.busstate == DHD_BUS_LOAD) { in dhd_inetaddr_notifier_call()
16605 __FUNCTION__, dhd->pub.busstate)); in dhd_inetaddr_notifier_call()
16606 if (dhd->pend_ipaddr) { in dhd_inetaddr_notifier_call()
16608 __FUNCTION__, dhd->pend_ipaddr)); in dhd_inetaddr_notifier_call()
16610 dhd->pend_ipaddr = ifa->ifa_address; in dhd_inetaddr_notifier_call()
16626 dhd->pend_ipaddr = 0; in dhd_inetaddr_notifier_call()
16638 dhd_aoe_hostip_clr(&dhd->pub, idx); in dhd_inetaddr_notifier_call()
16639 dhd_aoe_arp_clr(&dhd->pub, idx); in dhd_inetaddr_notifier_call()
16659 dhd_info_t *dhd = (dhd_info_t *)dhd_info; in dhd_inet6_work_handler() local
16663 if (!dhd) { in dhd_inet6_work_handler()
16667 dhdp = &dhd->pub; in dhd_inet6_work_handler()
16757 dhd_info_t *dhd; in dhd_inet6addr_notifier_call() local
16768 dhd = DHD_DEV_INFO(inet6_ifa->idev->dev); in dhd_inet6addr_notifier_call()
16769 if (!dhd) { in dhd_inet6addr_notifier_call()
16772 dhdp = &dhd->pub; in dhd_inet6addr_notifier_call()
16775 idx = dhd_net2idx(dhd, inet6_ifa->idev->dev); in dhd_inet6addr_notifier_call()
16797 dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)ndo_info, DHD_WQ_WORK_IPV6_NDO, in dhd_inet6addr_notifier_call()
16847 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; in dhd_register_if() local
16855 if (dhd == NULL || dhd->iflist[ifidx] == NULL) { in dhd_register_if()
16860 ASSERT(dhd && dhd->iflist[ifidx]); in dhd_register_if()
16861 ifp = dhd->iflist[ifidx]; in dhd_register_if()
16874 if (!ETHER_ISNULLADDR(dhd->pub.mac.octet)) in dhd_register_if()
16875 memcpy(temp_addr, dhd->pub.mac.octet, ETHER_ADDR_LEN); in dhd_register_if()
16887 if (!memcmp(temp_addr, dhd->iflist[0]->mac_addr, in dhd_register_if()
16896 net->hard_header_len = ETH_HLEN + dhd->pub.hdrlen; in dhd_register_if()
16936 dhd->pub.rxsz = DBUS_RX_BUFFER_SIZE_DHD(net); in dhd_register_if()
16957 if (dhd->pub.up == 1) { in dhd_register_if()
16958 if (_dhd_set_mac_address(dhd, ifidx, net->dev_addr, FALSE) == 0) in dhd_register_if()
16981 if ((ctf_dev_register(dhd->cih, net, FALSE) != BCME_OK) || in dhd_register_if()
16982 (ctf_enable(dhd->cih, net, TRUE, &dhd->brc_hot) != BCME_OK)) { in dhd_register_if()
17013 MAC2STRDBG(dhd->pub.mac.octet)); in dhd_register_if()
17028 __skb_queue_purge(&dhd->rx_pend_queue); in dhd_register_if()
17032 skb_queue_purge(&dhd->tx_pend_queue); in dhd_register_if()
17045 dhd->fs_check_retry = DHD_FS_CHECK_RETRIES; in dhd_register_if()
17046 dhd->wl_accel_boot_on_done = FALSE; in dhd_register_if()
17047 INIT_DELAYED_WORK(&dhd->wl_accel_work, dhd_wifi_accel_on_work_cb); in dhd_register_if()
17053 schedule_delayed_work(&dhd->wl_accel_work, in dhd_register_if()
17059 dhd_bus_put(&dhd->pub, WLAN_MODULE); in dhd_register_if()
17082 dhd_info_t *dhd; in dhd_bus_detach() local
17087 dhd = (dhd_info_t *)dhdp->info; in dhd_bus_detach()
17088 if (dhd) { in dhd_bus_detach()
17094 if (dhd->pub.busstate != DHD_BUS_DOWN && dhd_download_fw_on_driverload) { in dhd_bus_detach()
17096 dhd_prot_stop(&dhd->pub); in dhd_bus_detach()
17104 dbus_stop(dhd->pub.bus); in dhd_bus_detach()
17106 dhd->pub.busstate = DHD_BUS_DOWN; in dhd_bus_detach()
17108 dhd_bus_stop(dhd->pub.bus, TRUE); in dhd_bus_detach()
17121 dhd_info_t *dhd; in dhd_detach() local
17132 dhd = (dhd_info_t *)dhdp->info; in dhd_detach()
17133 if (!dhd) in dhd_detach()
17137 gdb_proxy_fs_remove(dhd); in dhd_detach()
17141 ifp = dhd->iflist[0]; in dhd_detach()
17149 if (dhd->dhd_state & DHD_ATTACH_STATE_CFG80211) { in dhd_detach()
17165 DHD_TRACE(("%s: Enter state 0x%x\n", __FUNCTION__, dhd->dhd_state)); in dhd_detach()
17171 dhd->pub.up = 0; in dhd_detach()
17172 if (!(dhd->dhd_state & DHD_ATTACH_STATE_DONE)) { in dhd_detach()
17179 dhd_free_wet_info(&dhd->pub, dhd->pub.wet_info); in dhd_detach()
17183 bcm_nanho_deinit(dhd->pub.nanhoi); in dhd_detach()
17190 if (dhd->pub.wlfc_thread) { in dhd_detach()
17191 kthread_stop(dhd->pub.wlfc_thread); in dhd_detach()
17195 dhd->pub.wlfc_thread = NULL; in dhd_detach()
17200 if (dhd->dhd_state & DHD_ATTACH_TIMESYNC_ATTACH_DONE) { in dhd_detach()
17205 if (dhd->dhd_state & DHD_ATTACH_STATE_PROT_ATTACH) { in dhd_detach()
17243 if (dhd->dhd_state & DHD_ATTACH_STATE_EARLYSUSPEND_DONE) { in dhd_detach()
17244 if (dhd->early_suspend.suspend) in dhd_detach()
17245 unregister_early_suspend(&dhd->early_suspend); in dhd_detach()
17250 if (dhd->dhd_state & DHD_ATTACH_STATE_WL_ATTACH) { in dhd_detach()
17272 if (dhd->dhd_state & DHD_ATTACH_STATE_ADD_IF) { in dhd_detach()
17276 dhd_net_if_lock_local(dhd); in dhd_detach()
17278 if (dhd->iflist[i]) { in dhd_detach()
17279 dhd_remove_if(&dhd->pub, i, TRUE); in dhd_detach()
17282 dhd_net_if_unlock_local(dhd); in dhd_detach()
17287 if (dhd->cih) in dhd_detach()
17288 ctf_dev_unregister(dhd->cih, ifp->net); in dhd_detach()
17335 MFREE(dhd->pub.osh, ifp, sizeof(*ifp)); in dhd_detach()
17345 DHD_GENERAL_LOCK(&dhd->pub, flags); in dhd_detach()
17346 timer_valid = dhd->wd_timer_valid; in dhd_detach()
17347 dhd->wd_timer_valid = FALSE; in dhd_detach()
17348 DHD_GENERAL_UNLOCK(&dhd->pub, flags); in dhd_detach()
17350 del_timer_sync(&dhd->timer); in dhd_detach()
17351 DHD_STOP_RPM_TIMER(&dhd->pub); in dhd_detach()
17354 tasklet_kill(&dhd->tasklet); in dhd_detach()
17356 if (dhd->dhd_state & DHD_ATTACH_STATE_THREADS_CREATED) { in dhd_detach()
17358 if (dhd->thr_rpm_ctl.thr_pid >= 0) { in dhd_detach()
17359 PROC_STOP(&dhd->thr_rpm_ctl); in dhd_detach()
17362 if (dhd->thr_wdt_ctl.thr_pid >= 0) { in dhd_detach()
17363 PROC_STOP(&dhd->thr_wdt_ctl); in dhd_detach()
17366 if (dhd->rxthread_enabled && dhd->thr_rxf_ctl.thr_pid >= 0) { in dhd_detach()
17367 PROC_STOP(&dhd->thr_rxf_ctl); in dhd_detach()
17370 if (dhd->thr_dpc_ctl.thr_pid >= 0) { in dhd_detach()
17371 PROC_STOP(&dhd->thr_dpc_ctl); in dhd_detach()
17374 tasklet_kill(&dhd->tasklet); in dhd_detach()
17380 if (dhd->pub.nfct) { in dhd_detach()
17381 dhd_ct_close(dhd->pub.nfct); in dhd_detach()
17385 cancel_delayed_work_sync(&dhd->dhd_dpc_dispatcher_work); in dhd_detach()
17387 if (dhd->dhd_state & DHD_ATTACH_STATE_LB_ATTACH_DONE) { in dhd_detach()
17389 dhd->dhd_state &= ~DHD_ATTACH_STATE_LB_ATTACH_DONE; in dhd_detach()
17393 cancel_work_sync(&dhd->rx_napi_dispatcher_work); in dhd_detach()
17394 __skb_queue_purge(&dhd->rx_pend_queue); in dhd_detach()
17397 cancel_work_sync(&dhd->tx_dispatcher_work); in dhd_detach()
17398 tasklet_kill(&dhd->tx_tasklet); in dhd_detach()
17399 __skb_queue_purge(&dhd->tx_pend_queue); in dhd_detach()
17403 dhd_unregister_cpuhp_callback(dhd); in dhd_detach()
17405 dhd_cpumasks_deinit(dhd); in dhd_detach()
17406 DHD_LB_STATS_DEINIT(&dhd->pub); in dhd_detach()
17415 cancel_work_sync(&dhd->axi_error_dispatcher_work); in dhd_detach()
17418 DHD_SSSR_REG_INFO_DEINIT(&dhd->pub); in dhd_detach()
17419 DHD_SSSR_MEMPOOL_DEINIT(&dhd->pub); in dhd_detach()
17422 dhd_sdtc_etb_mempool_deinit(&dhd->pub); in dhd_detach()
17433 if (dhd->dhd_state & DHD_ATTACH_STATE_CFG80211) { in dhd_detach()
17445 destroy_workqueue(dhd->tx_wq); in dhd_detach()
17446 dhd->tx_wq = NULL; in dhd_detach()
17447 destroy_workqueue(dhd->rx_wq); in dhd_detach()
17448 dhd->rx_wq = NULL; in dhd_detach()
17454 osl_spin_lock_deinit(dhd->pub.osh, dhd->pub.dbg->pkt_mon_lock); in dhd_detach()
17462 osl_spin_lock_deinit(dhd->pub.osh, dhd->pub.mem_stats_lock); in dhd_detach()
17466 osl_spin_lock_deinit(dhd->pub.osh, dhd->pub.awdl_stats_lock); in dhd_detach()
17478 if (dhd->pub.hang_info) { in dhd_detach()
17479 MFREE(dhd->pub.osh, dhd->pub.hang_info, VENDOR_SEND_HANG_EXT_INFO_LEN); in dhd_detach()
17487 dhd_cancel_logtrace_process_sync(dhd); in dhd_detach()
17490 dhd_dbg_ring_proc_destroy(&dhd->pub); in dhd_detach()
17492 if (dhd->dhd_state & DHD_ATTACH_LOGTRACE_INIT) { in dhd_detach()
17493 if (dhd->event_data.fmts) { in dhd_detach()
17494 MFREE(dhd->pub.osh, dhd->event_data.fmts, in dhd_detach()
17495 dhd->event_data.fmts_size); in dhd_detach()
17497 if (dhd->event_data.raw_fmts) { in dhd_detach()
17498 MFREE(dhd->pub.osh, dhd->event_data.raw_fmts, in dhd_detach()
17499 dhd->event_data.raw_fmts_size); in dhd_detach()
17501 if (dhd->event_data.raw_sstr) { in dhd_detach()
17502 MFREE(dhd->pub.osh, dhd->event_data.raw_sstr, in dhd_detach()
17503 dhd->event_data.raw_sstr_size); in dhd_detach()
17505 if (dhd->event_data.rom_raw_sstr) { in dhd_detach()
17506 MFREE(dhd->pub.osh, dhd->event_data.rom_raw_sstr, in dhd_detach()
17507 dhd->event_data.rom_raw_sstr_size); in dhd_detach()
17509 dhd->dhd_state &= ~DHD_ATTACH_LOGTRACE_INIT; in dhd_detach()
17513 skb_queue_purge(&dhd->bt_log_queue); in dhd_detach()
17526 unregister_pm_notifier(&dhd->pm_notifier); in dhd_detach()
17532 if (dhd->new_freq) in dhd_detach()
17533 free_percpu(dhd->new_freq); in dhd_detach()
17534 dhd->new_freq = NULL; in dhd_detach()
17535 cpufreq_unregister_notifier(&dhd->freq_trans, CPUFREQ_TRANSITION_NOTIFIER); in dhd_detach()
17537 DHD_TRACE(("wd wakelock count:%d\n", dhd->wakelock_wd_counter)); in dhd_detach()
17539 dhd->wakelock_wd_counter = 0; in dhd_detach()
17540 dhd_wake_lock_destroy(dhd->wl_wdwake); in dhd_detach()
17542 if (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT) { in dhd_detach()
17543 DHD_OS_WAKE_LOCK_DESTROY(dhd); in dhd_detach()
17548 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF); in dhd_detach()
17567 osl_ctfpool_cleanup(dhd->pub.osh); in dhd_detach()
17571 if (dhd->cih) in dhd_detach()
17572 ctf_detach(dhd->cih); in dhd_detach()
17586 dhd_del_monitor_if(dhd); in dhd_detach()
17595 cancel_work_sync(&dhd->dhd_hang_process_work); in dhd_detach()
17600 dhd_deferred_work_deinit(dhd->dhd_deferred_wq); in dhd_detach()
17601 dhd->dhd_deferred_wq = NULL; in dhd_detach()
17605 dhd_log_dump_deinit(&dhd->pub); in dhd_detach()
17624 cancel_work_sync(&dhd->bt_log_dispatcher_work); in dhd_detach()
17628 cancel_delayed_work_sync(&dhd->edl_dispatcher_work); in dhd_detach()
17631 (void)dhd_deinit_sock_flows_buf(dhd); in dhd_detach()
17634 if (dhd->pub.dump_file_manage) { in dhd_detach()
17635 MFREE(dhd->pub.osh, dhd->pub.dump_file_manage, in dhd_detach()
17640 dhd_sysfs_exit(dhd); in dhd_detach()
17641 dhd->pub.fw_download_status = FW_UNLOADED; in dhd_detach()
17644 mutex_destroy(&dhd->bus_user_lock); in dhd_detach()
17663 dhd_info_t *dhd; in dhd_free() local
17685 dhd = (dhd_info_t *)dhdp->info; in dhd_free()
17708 if (dhd != NULL) { in dhd_free()
17710 deinit_dhd_timeouts(&dhd->pub); in dhd_free()
17714 if (dhd != (dhd_info_t *)dhd_os_prealloc(dhdp, in dhd_free()
17716 MFREE(dhd->pub.osh, dhd, sizeof(*dhd)); in dhd_free()
17717 dhd = NULL; in dhd_free()
18001 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_proto_block() local
18003 if (dhd) { in dhd_os_proto_block()
18004 down(&dhd->proto_sem); in dhd_os_proto_block()
18015 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_proto_unblock() local
18017 if (dhd) { in dhd_os_proto_unblock()
18018 up(&dhd->proto_sem); in dhd_os_proto_unblock()
18028 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_dhdiovar_lock() local
18030 if (dhd) { in dhd_os_dhdiovar_lock()
18031 mutex_lock(&dhd->dhd_iovar_mutex); in dhd_os_dhdiovar_lock()
18038 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_dhdiovar_unlock() local
18040 if (dhd) { in dhd_os_dhdiovar_unlock()
18041 mutex_unlock(&dhd->dhd_iovar_mutex); in dhd_os_dhdiovar_unlock()
18048 dhd_info_t *dhd = NULL; in dhd_os_logdump_lock() local
18053 dhd = (dhd_info_t *)(pub->info); in dhd_os_logdump_lock()
18055 if (dhd) { in dhd_os_logdump_lock()
18056 mutex_lock(&dhd->logdump_lock); in dhd_os_logdump_lock()
18063 dhd_info_t *dhd = NULL; in dhd_os_logdump_unlock() local
18068 dhd = (dhd_info_t *)(pub->info); in dhd_os_logdump_unlock()
18070 if (dhd) { in dhd_os_logdump_unlock()
18071 mutex_unlock(&dhd->logdump_lock); in dhd_os_logdump_unlock()
18112 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_ioctl_resp_wait() local
18123 timeout = wait_event_timeout(dhd->ioctl_resp_wait, (*condition), timeout); in dhd_os_ioctl_resp_wait()
18131 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_ioctl_resp_wake() local
18133 wake_up(&dhd->ioctl_resp_wait); in dhd_os_ioctl_resp_wake()
18140 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_d3ack_wait() local
18149 timeout = wait_event_timeout(dhd->d3ack_wait, (*condition), timeout); in dhd_os_d3ack_wait()
18158 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_ds_exit_wait() local
18167 timeout = wait_event_timeout(dhd->ds_exit_wait, (*condition), timeout); in dhd_os_ds_exit_wait()
18175 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_ds_exit_wake() local
18177 wake_up_all(&dhd->ds_exit_wait); in dhd_os_ds_exit_wake()
18186 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_d3ack_wake() local
18188 wake_up(&dhd->d3ack_wait); in dhd_os_d3ack_wake()
18195 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_busbusy_wait_negation() local
18205 timeout = wait_event_timeout(dhd->dhd_bus_busy_state_wait, !(*condition), timeout); in dhd_os_busbusy_wait_negation()
18218 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_busbusy_wait_condition() local
18224 timeout = wait_event_timeout(dhd->dhd_bus_busy_state_wait, (*var == condition), timeout); in dhd_os_busbusy_wait_condition()
18238 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_busbusy_wait_bitmask() local
18244 timeout = wait_event_timeout(dhd->dhd_bus_busy_state_wait, in dhd_os_busbusy_wait_bitmask()
18254 dhd_info_t * dhd = (dhd_info_t *)(pub->info); in dhd_os_dmaxfer_wait() local
18259 ret = wait_event_timeout(dhd->dmaxfer_wait, (*condition), timeout); in dhd_os_dmaxfer_wait()
18268 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_dmaxfer_wake() local
18270 wake_up(&dhd->dmaxfer_wait); in dhd_os_dmaxfer_wake()
18275 dhd_os_tx_completion_wake(dhd_pub_t *dhd) in dhd_os_tx_completion_wake() argument
18279 wake_up(&dhd->tx_completion_wait); in dhd_os_tx_completion_wake()
18286 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_busbusy_wake() local
18289 wake_up(&dhd->dhd_bus_busy_state_wait); in dhd_os_busbusy_wake()
18298 dhd_info_t *dhd = (dhd_info_t *)pub->info; in dhd_os_wd_timer_extend() local
18303 dhd_os_wd_timer(bus, dhd->default_wd_interval); in dhd_os_wd_timer_extend()
18312 dhd_info_t *dhd = (dhd_info_t *)pub->info; in dhd_os_wd_timer() local
18317 if (!dhd) { in dhd_os_wd_timer()
18336 if (!wdtick && dhd->wd_timer_valid == TRUE) { in dhd_os_wd_timer()
18337 dhd->wd_timer_valid = FALSE; in dhd_os_wd_timer()
18339 del_timer_sync(&dhd->timer); in dhd_os_wd_timer()
18352 mod_timer(&dhd->timer, jiffies + msecs_to_jiffies(dhd_watchdog_ms)); in dhd_os_wd_timer()
18353 dhd->wd_timer_valid = TRUE; in dhd_os_wd_timer()
18364 dhd_info_t *dhd = (dhd_info_t *)pub->info; in dhd_os_runtimepm_timer() local
18369 if (!dhd) { in dhd_os_runtimepm_timer()
18385 if (dhd->rpm_timer_valid == FALSE) { in dhd_os_runtimepm_timer()
18386 mod_timer(&dhd->rpm_timer, jiffies + msecs_to_jiffies(dhd_runtimepm_ms)); in dhd_os_runtimepm_timer()
18387 dhd->rpm_timer_valid = TRUE; in dhd_os_runtimepm_timer()
18393 if (dhd->rpm_timer_valid == TRUE) { in dhd_os_runtimepm_timer()
18394 dhd->rpm_timer_valid = FALSE; in dhd_os_runtimepm_timer()
18396 del_timer_sync(&dhd->rpm_timer); in dhd_os_runtimepm_timer()
18550 dhd_info_t *dhd; in dhd_os_sdlock() local
18552 dhd = (dhd_info_t *)(pub->info); in dhd_os_sdlock()
18555 spin_lock_bh(&dhd->sdlock); in dhd_os_sdlock()
18558 down(&dhd->sdsem); in dhd_os_sdlock()
18560 spin_lock_bh(&dhd->sdlock); in dhd_os_sdlock()
18567 dhd_info_t *dhd; in dhd_os_sdunlock() local
18569 dhd = (dhd_info_t *)(pub->info); in dhd_os_sdunlock()
18572 spin_unlock_bh(&dhd->sdlock); in dhd_os_sdunlock()
18575 up(&dhd->sdsem); in dhd_os_sdunlock()
18577 spin_unlock_bh(&dhd->sdlock); in dhd_os_sdunlock()
18584 dhd_info_t *dhd; in dhd_os_sdlock_txq() local
18586 dhd = (dhd_info_t *)(pub->info); in dhd_os_sdlock_txq()
18588 spin_lock_irqsave(&dhd->txqlock, dhd->txqlock_flags); in dhd_os_sdlock_txq()
18590 spin_lock_bh(&dhd->txqlock); in dhd_os_sdlock_txq()
18597 dhd_info_t *dhd; in dhd_os_sdunlock_txq() local
18599 dhd = (dhd_info_t *)(pub->info); in dhd_os_sdunlock_txq()
18601 spin_unlock_irqrestore(&dhd->txqlock, dhd->txqlock_flags); in dhd_os_sdunlock_txq()
18603 spin_unlock_bh(&dhd->txqlock); in dhd_os_sdunlock_txq()
18610 dhd_info_t *dhd; in dhd_os_sdlock_txoff() local
18613 dhd = (dhd_info_t *)(pub->info); in dhd_os_sdlock_txoff()
18614 spin_lock_irqsave(&dhd->txoff_lock, flags); in dhd_os_sdlock_txoff()
18622 dhd_info_t *dhd; in dhd_os_sdunlock_txoff() local
18624 dhd = (dhd_info_t *)(pub->info); in dhd_os_sdunlock_txoff()
18625 spin_unlock_irqrestore(&dhd->txoff_lock, flags); in dhd_os_sdunlock_txoff()
18641 dhd_info_t *dhd; in dhd_os_rxflock() local
18643 dhd = (dhd_info_t *)(pub->info); in dhd_os_rxflock()
18644 spin_lock_bh(&dhd->rxf_lock); in dhd_os_rxflock()
18651 dhd_info_t *dhd; in dhd_os_rxfunlock() local
18653 dhd = (dhd_info_t *)(pub->info); in dhd_os_rxfunlock()
18654 spin_unlock_bh(&dhd->rxf_lock); in dhd_os_rxfunlock()
18661 dhd_info_t *dhd; in dhd_os_tcpacklock() local
18664 dhd = (dhd_info_t *)(pub->info); in dhd_os_tcpacklock()
18666 if (dhd) { in dhd_os_tcpacklock()
18668 spin_lock_bh(&dhd->tcpack_lock); in dhd_os_tcpacklock()
18670 flags = osl_spin_lock(&dhd->tcpack_lock); in dhd_os_tcpacklock()
18680 dhd_info_t *dhd; in dhd_os_tcpackunlock() local
18686 dhd = (dhd_info_t *)(pub->info); in dhd_os_tcpackunlock()
18688 if (dhd) { in dhd_os_tcpackunlock()
18690 spin_unlock_bh(&dhd->tcpack_lock); in dhd_os_tcpackunlock()
18692 osl_spin_unlock(&dhd->tcpack_lock, flags); in dhd_os_tcpackunlock()
18719 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_get_wireless_stats() local
18721 if (!dhd->pub.up) { in dhd_get_wireless_stats()
18729 res = wl_iw_get_wireless_stats(dev, &dhd->iw.wstats); in dhd_get_wireless_stats()
18732 return &dhd->iw.wstats; in dhd_get_wireless_stats()
18739 dhd_wl_host_event(dhd_info_t *dhd, int ifidx, void *pktdata, uint16 pktlen, in dhd_wl_host_event() argument
18746 ASSERT(dhd != NULL); in dhd_wl_host_event()
18749 bcmerror = wl_process_host_event(&dhd->pub, &ifidx, pktdata, pktlen, event, data, in dhd_wl_host_event()
18750 &dhd->event_data); in dhd_wl_host_event()
18752 bcmerror = wl_process_host_event(&dhd->pub, &ifidx, pktdata, pktlen, event, data, in dhd_wl_host_event()
18768 wl_ext_event_send(dhd->pub.event_params, event, *data); in dhd_wl_host_event()
18772 if (dhd->iflist[ifidx]->net) { in dhd_wl_host_event()
18773 DHD_UP_LOCK(&dhd->pub.up_lock, flags); in dhd_wl_host_event()
18774 if (dhd->pub.up) { in dhd_wl_host_event()
18775 wl_cfg80211_event(dhd->iflist[ifidx]->net, event, *data); in dhd_wl_host_event()
18777 DHD_UP_UNLOCK(&dhd->pub.up_lock, flags); in dhd_wl_host_event()
18803 dhd_info_t *dhd; in dhd_sendup_log() local
18809 dhd = dhdp->info; in dhd_sendup_log()
18825 ifidx = dhd_ifname2idx(dhd, "wlan0"); in dhd_sendup_log()
18826 ifp = dhd->iflist[ifidx]; in dhd_sendup_log()
18828 ifp = dhd->iflist[0]; in dhd_sendup_log()
18854 void dhd_wait_for_event(dhd_pub_t *dhd, bool *lockvar) in dhd_wait_for_event() argument
18857 struct dhd_info *dhdinfo = dhd->info; in dhd_wait_for_event()
18861 dhd_os_sdunlock(dhd); in dhd_wait_for_event()
18863 dhd_os_sdlock(dhd); in dhd_wait_for_event()
18868 void dhd_wait_event_wakeup(dhd_pub_t *dhd) in dhd_wait_event_wakeup() argument
18871 struct dhd_info *dhdinfo = dhd->info; in dhd_wait_event_wakeup()
18884 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_net_bus_devreset() local
18887 if (pm_runtime_get_sync(dhd_bus_to_dev(dhd->pub.bus)) < 0) in dhd_net_bus_devreset()
18894 if (dhd_wl_ioctl_cmd(&dhd->pub, WLC_DOWN, NULL, 0, TRUE, 0) < 0) { in dhd_net_bus_devreset()
18899 if (dhd->pub.wlfc_enabled) { in dhd_net_bus_devreset()
18900 dhd_wlfc_deinit(&dhd->pub); in dhd_net_bus_devreset()
18904 if (dhd->pub.pno_state) { in dhd_net_bus_devreset()
18905 dhd_pno_deinit(&dhd->pub); in dhd_net_bus_devreset()
18909 if (dhd->pub.rtt_state) { in dhd_net_bus_devreset()
18910 dhd_rtt_deinit(&dhd->pub); in dhd_net_bus_devreset()
18914 DHD_SSSR_DUMP_DEINIT(&dhd->pub); in dhd_net_bus_devreset()
18916 if (dhd->pub.sdtc_etb_inited) { in dhd_net_bus_devreset()
18917 dhd_sdtc_etb_deinit(&dhd->pub); in dhd_net_bus_devreset()
18926 dhd_os_dbg_detach_pkt_monitor(&dhd->pub); in dhd_net_bus_devreset()
18936 dhd_update_fw_nv_path(dhd); in dhd_net_bus_devreset()
18938 dhd_bus_update_fw_nv_path(dhd->pub.bus, in dhd_net_bus_devreset()
18939 dhd->fw_path, dhd->nv_path, dhd->clm_path, dhd->conf_path); in dhd_net_bus_devreset()
18949 if (flag == FALSE && dhd->pub.busstate == DHD_BUS_DOWN) { in dhd_net_bus_devreset()
18959 ret = dhd_bus_devreset(&dhd->pub, flag); in dhd_net_bus_devreset()
18962 pm_runtime_mark_last_busy(dhd_bus_to_dev(dhd->pub.bus)); in dhd_net_bus_devreset()
18963 pm_runtime_put_autosuspend(dhd_bus_to_dev(dhd->pub.bus)); in dhd_net_bus_devreset()
18968 dhd->pub.dongle_trap_occured = 0; in dhd_net_bus_devreset()
18970 dhd->pub.dongle_trap_due_to_bt = 0; in dhd_net_bus_devreset()
18972 dhd->pub.iovar_timeout_occured = 0; in dhd_net_bus_devreset()
18974 dhd->pub.d3ack_timeout_occured = 0; in dhd_net_bus_devreset()
18975 dhd->pub.livelock_occured = 0; in dhd_net_bus_devreset()
18976 dhd->pub.pktid_audit_failed = 0; in dhd_net_bus_devreset()
18978 dhd->pub.smmu_fault_occurred = 0; in dhd_net_bus_devreset()
18979 dhd->pub.iface_op_failed = 0; in dhd_net_bus_devreset()
18980 dhd->pub.scan_timeout_occurred = 0; in dhd_net_bus_devreset()
18981 dhd->pub.scan_busy_occurred = 0; in dhd_net_bus_devreset()
18995 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_net_bus_suspend() local
18996 return dhd_bus_suspend(&dhd->pub); in dhd_net_bus_suspend()
19002 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_net_bus_resume() local
19003 return dhd_bus_resume(&dhd->pub, stage); in dhd_net_bus_resume()
19011 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_set_suspend_disable() local
19014 if (dhd) { in net_os_set_suspend_disable()
19015 ret = dhd->pub.suspend_disable_flag; in net_os_set_suspend_disable()
19016 dhd->pub.suspend_disable_flag = val; in net_os_set_suspend_disable()
19024 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_set_suspend() local
19026 if (dhd && (dhd->pub.conf->suspend_mode == EARLY_SUSPEND || in net_os_set_suspend()
19027 dhd->pub.conf->suspend_mode == SUSPEND_MODE_2)) { in net_os_set_suspend()
19028 if (dhd->pub.conf->suspend_mode == EARLY_SUSPEND && !val) in net_os_set_suspend()
19029 dhd_conf_set_suspend_resume(&dhd->pub, val); in net_os_set_suspend()
19031 ret = dhd_set_suspend(val, &dhd->pub); in net_os_set_suspend()
19033 ret = dhd_suspend_resume_helper(dhd, val, force); in net_os_set_suspend()
19038 if (dhd->pub.conf->suspend_mode == EARLY_SUSPEND && val) in net_os_set_suspend()
19039 dhd_conf_set_suspend_resume(&dhd->pub, val); in net_os_set_suspend()
19046 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_set_suspend_bcn_li_dtim() local
19048 if (dhd) { in net_os_set_suspend_bcn_li_dtim()
19051 dhd->pub.suspend_bcn_li_dtim = val; in net_os_set_suspend_bcn_li_dtim()
19059 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_set_max_dtim_enable() local
19061 if (dhd) { in net_os_set_max_dtim_enable()
19065 dhd->pub.max_dtim_enable = TRUE; in net_os_set_max_dtim_enable()
19067 dhd->pub.max_dtim_enable = FALSE; in net_os_set_max_dtim_enable()
19079 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_set_disable_dtim_in_suspend() local
19081 if (dhd) { in net_os_set_disable_dtim_in_suspend()
19085 dhd->pub.disable_dtim_in_suspend = TRUE; in net_os_set_disable_dtim_in_suspend()
19087 dhd->pub.disable_dtim_in_suspend = FALSE; in net_os_set_disable_dtim_in_suspend()
19103 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_rxfilter_add_remove() local
19108 if (!dhd || (num == DHD_UNICAST_FILTER_NUM)) { in net_os_rxfilter_add_remove()
19119 if (num >= dhd->pub.pktfilter_count) { in net_os_rxfilter_add_remove()
19123 ret = dhd_packet_filter_add_remove(&dhd->pub, add_remove, num); in net_os_rxfilter_add_remove()
19158 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_enable_packet_filter() local
19161 return dhd_os_enable_packet_filter(&dhd->pub, val); in net_os_enable_packet_filter()
19168 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_init_ioctl() local
19171 if ((ret = dhd_sync_with_dongle(&dhd->pub)) < 0) in dhd_dev_init_ioctl()
19182 dhd_pub_t *dhd = (&ptr->pub); in dhd_dev_get_feature_set() local
19186 if (dhd_get_fw_capabilities(dhd) < 0) { in dhd_dev_get_feature_set()
19190 if (FW_SUPPORTED(dhd, sta)) in dhd_dev_get_feature_set()
19192 if (FW_SUPPORTED(dhd, dualband)) in dhd_dev_get_feature_set()
19194 if (FW_SUPPORTED(dhd, p2p)) in dhd_dev_get_feature_set()
19196 if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE) in dhd_dev_get_feature_set()
19198 if (FW_SUPPORTED(dhd, tdls)) in dhd_dev_get_feature_set()
19200 if (FW_SUPPORTED(dhd, vsdb)) in dhd_dev_get_feature_set()
19202 if (FW_SUPPORTED(dhd, nan)) { in dhd_dev_get_feature_set()
19205 if (FW_SUPPORTED(dhd, rttd2d)) in dhd_dev_get_feature_set()
19209 if (dhd->rtt_supported) { in dhd_dev_get_feature_set()
19219 if (dhd_is_pno_supported(dhd)) { in dhd_dev_get_feature_set()
19235 if (FW_SUPPORTED(dhd, rssi_mon)) { in dhd_dev_get_feature_set()
19252 if (FW_SUPPORTED(dhd, fie)) { in dhd_dev_get_feature_set()
19331 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_set_nodfs() local
19334 dhd->pub.dhd_cflags |= WLAN_PLAT_NODFS_FLAG; in dhd_dev_set_nodfs()
19336 dhd->pub.dhd_cflags &= ~WLAN_PLAT_NODFS_FLAG; in dhd_dev_set_nodfs()
19337 dhd->pub.force_country_change = TRUE; in dhd_dev_set_nodfs()
19346 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_ndo_cfg() local
19347 dhd_pub_t *dhdp = &dhd->pub; in dhd_dev_ndo_cfg()
19408 dhd_info_t *dhd; in dhd_dev_ndo_update_inet6addr() local
19432 dhd = DHD_DEV_INFO(dev); in dhd_dev_ndo_update_inet6addr()
19433 if (!dhd) { in dhd_dev_ndo_update_inet6addr()
19437 dhdp = &dhd->pub; in dhd_dev_ndo_update_inet6addr()
19439 if (dhd_net2idx(dhd, dev) != 0) { in dhd_dev_ndo_update_inet6addr()
19582 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_pno_stop_for_ssid() local
19584 return (dhd_pno_stop_for_ssid(&dhd->pub)); in dhd_dev_pno_stop_for_ssid()
19591 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_pno_set_for_ssid() local
19593 return (dhd_pno_set_for_ssid(&dhd->pub, ssids_local, nssid, scan_fr, in dhd_dev_pno_set_for_ssid()
19601 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_pno_enable() local
19603 return (dhd_pno_enable(&dhd->pub, enable)); in dhd_dev_pno_enable()
19611 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_pno_set_for_hotlist() local
19612 return (dhd_pno_set_for_hotlist(&dhd->pub, p_pfn_bssid, hotlist_params)); in dhd_dev_pno_set_for_hotlist()
19618 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_pno_stop_for_batch() local
19619 return (dhd_pno_stop_for_batch(&dhd->pub)); in dhd_dev_pno_stop_for_batch()
19626 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_pno_set_for_batch() local
19627 return (dhd_pno_set_for_batch(&dhd->pub, batch_params)); in dhd_dev_pno_set_for_batch()
19634 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_pno_get_for_batch() local
19635 return (dhd_pno_get_for_batch(&dhd->pub, buf, bufsize, PNO_STATUS_NORMAL)); in dhd_dev_pno_get_for_batch()
19644 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_is_legacy_pno_enabled() local
19646 return (dhd_is_legacy_pno_enabled(&dhd->pub)); in dhd_dev_is_legacy_pno_enabled()
19652 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_set_epno() local
19653 if (!dhd) { in dhd_dev_set_epno()
19656 return dhd_pno_set_epno(&dhd->pub); in dhd_dev_set_epno()
19661 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_dev_flush_fw_epno() local
19662 if (!dhd) { in dhd_dev_flush_fw_epno()
19665 return dhd_pno_flush_fw_epno(&dhd->pub); in dhd_dev_flush_fw_epno()
19673 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_pno_set_cfg_gscan() local
19675 return (dhd_pno_set_cfg_gscan(&dhd->pub, type, buf, flush)); in dhd_dev_pno_set_cfg_gscan()
19683 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_pno_get_gscan() local
19685 return (dhd_pno_get_gscan(&dhd->pub, type, info, len)); in dhd_dev_pno_get_gscan()
19692 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_wait_batch_results_complete() local
19694 return (dhd_wait_batch_results_complete(&dhd->pub)); in dhd_dev_wait_batch_results_complete()
19701 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_pno_lock_access_batch_results() local
19703 return (dhd_pno_lock_batch_results(&dhd->pub)); in dhd_dev_pno_lock_access_batch_results()
19709 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_pno_unlock_access_batch_results() local
19711 return (dhd_pno_unlock_batch_results(&dhd->pub)); in dhd_dev_pno_unlock_access_batch_results()
19718 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_pno_run_gscan() local
19720 return (dhd_pno_initiate_gscan_request(&dhd->pub, run, flush)); in dhd_dev_pno_run_gscan()
19727 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_pno_enable_full_scan_result() local
19729 return (dhd_pno_enable_full_scan_result(&dhd->pub, real_time_flag)); in dhd_dev_pno_enable_full_scan_result()
19737 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_hotlist_scan_event() local
19739 return (dhd_handle_hotlist_scan_evt(&dhd->pub, data, send_evt_bytes, type, buf_len)); in dhd_dev_hotlist_scan_event()
19747 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_process_full_gscan_result() local
19749 return (dhd_process_full_gscan_result(&dhd->pub, data, len, send_evt_bytes)); in dhd_dev_process_full_gscan_result()
19755 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_gscan_hotlist_cache_cleanup() local
19757 dhd_gscan_hotlist_cache_cleanup(&dhd->pub, type); in dhd_dev_gscan_hotlist_cache_cleanup()
19765 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_gscan_batch_cache_cleanup() local
19767 return (dhd_gscan_batch_cache_cleanup(&dhd->pub)); in dhd_dev_gscan_batch_cache_cleanup()
19774 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_retrieve_batch_scan() local
19776 return (dhd_retreive_batch_scan_results(&dhd->pub)); in dhd_dev_retrieve_batch_scan()
19783 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_process_epno_result() local
19785 return (dhd_pno_process_epno_result(&dhd->pub, data, event, send_evt_bytes)); in dhd_dev_process_epno_result()
19792 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_set_lazy_roam_cfg() local
19811 if (dhd->pub.lazy_roam_enable) { in dhd_dev_set_lazy_roam_cfg()
19814 err = dhd_iovar(&dhd->pub, 0, "roam_exp_params", in dhd_dev_set_lazy_roam_cfg()
19827 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_lazy_roam_enable() local
19836 err = dhd_iovar(&dhd->pub, 0, "roam_exp_params", in dhd_dev_lazy_roam_enable()
19842 dhd->pub.lazy_roam_enable = (enable != 0); in dhd_dev_lazy_roam_enable()
19853 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_set_lazy_roam_bssid_pref() local
19862 err = dhd_iovar(&dhd->pub, 0, "roam_exp_bssid_pref", in dhd_dev_set_lazy_roam_bssid_pref()
19877 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_set_blacklist_bssid() local
19881 err = dhd_wl_ioctl_cmd(&(dhd->pub), WLC_SET_MACLIST, (char *)blacklist, in dhd_dev_set_blacklist_bssid()
19890 err = dhd_wl_ioctl_cmd(&(dhd->pub), WLC_SET_MACMODE, (char *)&macmode, in dhd_dev_set_blacklist_bssid()
19903 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_set_whitelist_ssid() local
19917 err = dhd_iovar(&dhd->pub, 0, "roam_exp_ssid_whitelist", (char *)ssid_whitelist, len, NULL, in dhd_dev_set_whitelist_ssid()
19939 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_set_rssi_monitor_cfg() local
19945 err = dhd_iovar(&dhd->pub, 0, "rssi_monitor", (char *)&rssi_monitor, sizeof(rssi_monitor), in dhd_dev_set_rssi_monitor_cfg()
19959 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_set_tcpack_sup_mode_cfg() local
19961 err = dhd_tcpack_suppress_set(&dhd->pub, enable); in dhd_dev_set_tcpack_sup_mode_cfg()
19972 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_cfg_rand_mac_oui() local
19973 dhd_pub_t *dhdp = &dhd->pub; in dhd_dev_cfg_rand_mac_oui()
19993 dhd_set_rand_mac_oui(dhd_pub_t *dhd) in dhd_set_rand_mac_oui() argument
19997 uint8 *rand_mac_oui = dhd->rand_mac_oui; in dhd_set_rand_mac_oui()
20011 err = dhd_iovar(dhd, 0, "pfn_macaddr", (char *)&wl_cfg, sizeof(wl_cfg), NULL, 0, TRUE); in dhd_set_rand_mac_oui()
20023 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_rtt_set_cfg() local
20025 return (dhd_rtt_set_cfg(&dhd->pub, buf)); in dhd_dev_rtt_set_cfg()
20031 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_rtt_cancel_cfg() local
20033 return (dhd_rtt_stop(&dhd->pub, mac_list, mac_cnt)); in dhd_dev_rtt_cancel_cfg()
20039 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_rtt_register_noti_callback() local
20041 return (dhd_rtt_register_noti_callback(&dhd->pub, ctx, noti_fn)); in dhd_dev_rtt_register_noti_callback()
20047 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_rtt_unregister_noti_callback() local
20049 return (dhd_rtt_unregister_noti_callback(&dhd->pub, noti_fn)); in dhd_dev_rtt_unregister_noti_callback()
20055 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_rtt_capability() local
20057 return (dhd_rtt_capability(&dhd->pub, capa)); in dhd_dev_rtt_capability()
20063 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_rtt_avail_channel() local
20064 return (dhd_rtt_avail_channel(&dhd->pub, channel_info)); in dhd_dev_rtt_avail_channel()
20070 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_rtt_enable_responder() local
20071 return (dhd_rtt_enable_responder(&dhd->pub, channel_info)); in dhd_dev_rtt_enable_responder()
20076 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_dev_rtt_cancel_responder() local
20077 return (dhd_rtt_cancel_responder(&dhd->pub)); in dhd_dev_rtt_cancel_responder()
20082 static void _dhd_apf_lock_local(dhd_info_t *dhd) in _dhd_apf_lock_local() argument
20084 if (dhd) { in _dhd_apf_lock_local()
20085 mutex_lock(&dhd->dhd_apf_mutex); in _dhd_apf_lock_local()
20089 static void _dhd_apf_unlock_local(dhd_info_t *dhd) in _dhd_apf_unlock_local() argument
20091 if (dhd) { in _dhd_apf_unlock_local()
20092 mutex_unlock(&dhd->dhd_apf_mutex); in _dhd_apf_unlock_local()
20100 dhd_info_t *dhd = DHD_DEV_INFO(ndev); in __dhd_apf_add_filter() local
20101 dhd_pub_t *dhdp = &dhd->pub; in __dhd_apf_add_filter()
20109 ifidx = dhd_net2idx(dhd, ndev); in __dhd_apf_add_filter()
20162 dhd_info_t *dhd = DHD_DEV_INFO(ndev); in __dhd_apf_config_filter() local
20163 dhd_pub_t *dhdp = &dhd->pub; in __dhd_apf_config_filter()
20170 ifidx = dhd_net2idx(dhd, ndev); in __dhd_apf_config_filter()
20215 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev); in __dhd_apf_delete_filter() local
20216 dhd_pub_t *dhdp = &dhd->pub; in __dhd_apf_delete_filter()
20219 ifidx = dhd_net2idx(dhd, ndev); in __dhd_apf_delete_filter()
20237 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_apf_lock() local
20238 _dhd_apf_lock_local(dhd); in dhd_apf_lock()
20243 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_apf_unlock() local
20244 _dhd_apf_unlock_local(dhd); in dhd_apf_unlock()
20250 dhd_info_t *dhd = DHD_DEV_INFO(ndev); in dhd_dev_apf_get_version() local
20251 dhd_pub_t *dhdp = &dhd->pub; in dhd_dev_apf_get_version()
20265 ifidx = dhd_net2idx(dhd, ndev); in dhd_dev_apf_get_version()
20284 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev); in dhd_dev_apf_get_max_len() local
20285 dhd_pub_t *dhdp = &dhd->pub; in dhd_dev_apf_get_max_len()
20294 ifidx = dhd_net2idx(dhd, ndev); in dhd_dev_apf_get_max_len()
20314 dhd_info_t *dhd = DHD_DEV_INFO(ndev); in dhd_dev_apf_add_filter() local
20315 dhd_pub_t *dhdp = &dhd->pub; in dhd_dev_apf_add_filter()
20349 dhd_info_t *dhd = DHD_DEV_INFO(ndev); in dhd_dev_apf_enable_filter() local
20350 dhd_pub_t *dhdp = &dhd->pub; in dhd_dev_apf_enable_filter()
20372 dhd_info_t *dhd = DHD_DEV_INFO(ndev); in dhd_dev_apf_disable_filter() local
20373 dhd_pub_t *dhdp = &dhd->pub; in dhd_dev_apf_disable_filter()
20391 dhd_info_t *dhd = DHD_DEV_INFO(ndev); in dhd_dev_apf_delete_filter() local
20392 dhd_pub_t *dhdp = &dhd->pub; in dhd_dev_apf_delete_filter()
20418 struct dhd_info *dhd; in dhd_hang_process() local
20421 dhd = container_of(work_data, dhd_info_t, dhd_hang_process_work); in dhd_hang_process()
20424 if (!dhd || !dhd->iflist[0]) in dhd_hang_process()
20426 dev = dhd->iflist[0]->net; in dhd_hang_process()
20447 ndev = dhd->iflist[i] ? dhd->iflist[i]->net : NULL; in dhd_hang_process()
20576 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_send_hang_message() local
20579 if (dhd) { in net_os_send_hang_message()
20581 if (dhd->pub.hang_report) { in net_os_send_hang_message()
20585 ret = dhd_os_send_hang_message(&dhd->pub); in net_os_send_hang_message()
20601 dhd_info_t *dhd = NULL; in net_os_send_hang_message_reason() local
20605 dhd = DHD_DEV_INFO(dev); in net_os_send_hang_message_reason()
20606 if (dhd) { in net_os_send_hang_message_reason()
20607 dhdp = &dhd->pub; in net_os_send_hang_message_reason()
20610 if (!dhd || !dhdp) { in net_os_send_hang_message_reason()
20629 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_net_wifi_platform_set_power() local
20630 return wifi_platform_set_power(dhd->adapter, on, delay_msec); in dhd_net_wifi_platform_set_power()
20635 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_wifi_platform_set_power() local
20637 return wifi_platform_set_power(dhd->adapter, on, delay_msec); in dhd_wifi_platform_set_power()
20642 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_force_country_change() local
20644 if (dhd && dhd->pub.up) in dhd_force_country_change()
20645 return dhd->pub.force_country_change; in dhd_force_country_change()
20652 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_get_customized_country_code() local
20654 if (!dhd->pub.is_blob) in dhd_get_customized_country_code()
20658 get_customized_country_code(dhd->adapter, country_iso_code, cspec, in dhd_get_customized_country_code()
20659 dhd->pub.dhd_cflags); in dhd_get_customized_country_code()
20661 get_customized_country_code(dhd->adapter, country_iso_code, cspec); in dhd_get_customized_country_code()
20680 if (dhd->pub.is_blob) { in dhd_get_customized_country_code()
20681 if (strncmp(dhd->pub.vars_ccode, "J1", 3) == 0) { in dhd_get_customized_country_code()
20682 memcpy(cspec->ccode, dhd->pub.vars_ccode, in dhd_get_customized_country_code()
20683 sizeof(dhd->pub.vars_ccode)); in dhd_get_customized_country_code()
20688 if (strncmp(dhd->pub.vars_ccode, "JP", 3) == 0) { in dhd_get_customized_country_code()
20689 cspec->rev = dhd->pub.vars_regrev; in dhd_get_customized_country_code()
20694 BCM_REFERENCE(dhd); in dhd_get_customized_country_code()
20699 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_bus_country_set() local
20704 if (dhd && dhd->pub.up) { in dhd_bus_country_set()
20705 memcpy(&dhd->pub.dhd_cspec, cspec, sizeof(wl_country_t)); in dhd_bus_country_set()
20714 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_bus_band_set() local
20718 if (dhd && dhd->pub.up) { in dhd_bus_band_set()
20727 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_net_set_fw_path() local
20732 strlcpy(dhd->fw_path, fw, sizeof(dhd->fw_path)); in dhd_net_set_fw_path()
20748 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_net_if_lock() local
20749 dhd_net_if_lock_local(dhd); in dhd_net_if_lock()
20754 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_net_if_unlock() local
20755 dhd_net_if_unlock_local(dhd); in dhd_net_if_unlock()
20758 static void dhd_net_if_lock_local(dhd_info_t *dhd) in dhd_net_if_lock_local() argument
20761 if (dhd) in dhd_net_if_lock_local()
20762 mutex_lock(&dhd->dhd_net_if_mutex); in dhd_net_if_lock_local()
20766 static void dhd_net_if_unlock_local(dhd_info_t *dhd) in dhd_net_if_unlock_local() argument
20769 if (dhd) in dhd_net_if_unlock_local()
20770 mutex_unlock(&dhd->dhd_net_if_mutex); in dhd_net_if_unlock_local()
20777 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_suspend_lock() local
20778 if (dhd) in dhd_suspend_lock()
20779 mutex_lock(&dhd->dhd_suspend_mutex); in dhd_suspend_lock()
20786 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_suspend_unlock() local
20787 if (dhd) in dhd_suspend_unlock()
20788 mutex_unlock(&dhd->dhd_suspend_mutex); in dhd_suspend_unlock()
20794 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_general_spin_lock() local
20797 if (dhd) { in dhd_os_general_spin_lock()
20798 flags = osl_spin_lock(&dhd->dhd_lock); in dhd_os_general_spin_lock()
20806 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_general_spin_unlock() local
20808 if (dhd) { in dhd_os_general_spin_unlock()
20809 osl_spin_unlock(&dhd->dhd_lock, flags); in dhd_os_general_spin_unlock()
20837 dhd_get_pend_8021x_cnt(dhd_info_t *dhd) in dhd_get_pend_8021x_cnt() argument
20839 return (atomic_read(&dhd->pend_8021x_cnt)); in dhd_get_pend_8021x_cnt()
20847 dhd_info_t *dhd = DHD_DEV_INFO(dev); in dhd_wait_pend8021x() local
20850 int pend = dhd_get_pend_8021x_cnt(dhd); in dhd_wait_pend8021x()
20859 pend = dhd_get_pend_8021x_cnt(dhd); in dhd_wait_pend8021x()
20863 atomic_set(&dhd->pend_8021x_cnt, 0); in dhd_wait_pend8021x()
21052 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev); in dhd_get_memdump_filename() local
21053 dhd_pub_t *dhdp = &dhd->pub; in dhd_get_memdump_filename()
21074 write_dump_to_file(dhd_pub_t *dhd, uint8 *buf, int size, char *fname) in write_dump_to_file() argument
21084 dhd_convert_memdump_type_to_str(dhd->memdump_type, memdump_type, DHD_MEMDUMP_TYPE_STR_LEN, in write_dump_to_file()
21085 dhd->debug_dump_subcmd); in write_dump_to_file()
21086 clear_debug_dump_time(dhd->debug_dump_time_str); in write_dump_to_file()
21087 get_debug_dump_time(dhd->debug_dump_time_str); in write_dump_to_file()
21090 DHD_COMMON_DUMP_PATH, fname, memdump_type, dhd->debug_dump_time_str); in write_dump_to_file()
21111 "/data/", fname, memdump_type, dhd->debug_dump_time_str); in write_dump_to_file()
21124 dhd_print_buf_addr(dhd, "write_dump_to_file", buf, size); in write_dump_to_file()
21132 dhd_dump_file_manage_enqueue(dhd, memdump_path, fname); in write_dump_to_file()
21142 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_wake_lock_timeout() local
21146 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) { in dhd_os_wake_lock_timeout()
21147 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_timeout()
21148 ret = dhd->wakelock_rx_timeout_enable > dhd->wakelock_ctrl_timeout_enable ? in dhd_os_wake_lock_timeout()
21149 dhd->wakelock_rx_timeout_enable : dhd->wakelock_ctrl_timeout_enable; in dhd_os_wake_lock_timeout()
21151 if (dhd->wakelock_rx_timeout_enable) in dhd_os_wake_lock_timeout()
21152 dhd_wake_lock_timeout(dhd->wl_rxwake, in dhd_os_wake_lock_timeout()
21153 msecs_to_jiffies(dhd->wakelock_rx_timeout_enable)); in dhd_os_wake_lock_timeout()
21154 if (dhd->wakelock_ctrl_timeout_enable) in dhd_os_wake_lock_timeout()
21155 dhd_wake_lock_timeout(dhd->wl_ctrlwake, in dhd_os_wake_lock_timeout()
21156 msecs_to_jiffies(dhd->wakelock_ctrl_timeout_enable)); in dhd_os_wake_lock_timeout()
21158 dhd->wakelock_rx_timeout_enable = 0; in dhd_os_wake_lock_timeout()
21159 dhd->wakelock_ctrl_timeout_enable = 0; in dhd_os_wake_lock_timeout()
21160 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_timeout()
21167 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_wake_lock_timeout() local
21170 if (dhd) in net_os_wake_lock_timeout()
21171 ret = dhd_os_wake_lock_timeout(&dhd->pub); in net_os_wake_lock_timeout()
21177 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_wake_lock_rx_timeout_enable() local
21180 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) { in dhd_os_wake_lock_rx_timeout_enable()
21181 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_rx_timeout_enable()
21182 if (val > dhd->wakelock_rx_timeout_enable) in dhd_os_wake_lock_rx_timeout_enable()
21183 dhd->wakelock_rx_timeout_enable = val; in dhd_os_wake_lock_rx_timeout_enable()
21184 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_rx_timeout_enable()
21191 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_wake_lock_ctrl_timeout_enable() local
21194 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) { in dhd_os_wake_lock_ctrl_timeout_enable()
21195 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_ctrl_timeout_enable()
21196 if (val > dhd->wakelock_ctrl_timeout_enable) in dhd_os_wake_lock_ctrl_timeout_enable()
21197 dhd->wakelock_ctrl_timeout_enable = val; in dhd_os_wake_lock_ctrl_timeout_enable()
21198 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_ctrl_timeout_enable()
21205 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_wake_lock_ctrl_timeout_cancel() local
21208 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) { in dhd_os_wake_lock_ctrl_timeout_cancel()
21209 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_ctrl_timeout_cancel()
21210 dhd->wakelock_ctrl_timeout_enable = 0; in dhd_os_wake_lock_ctrl_timeout_cancel()
21212 if (dhd_wake_lock_active(dhd->wl_ctrlwake)) in dhd_os_wake_lock_ctrl_timeout_cancel()
21213 dhd_wake_unlock(dhd->wl_ctrlwake); in dhd_os_wake_lock_ctrl_timeout_cancel()
21215 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_ctrl_timeout_cancel()
21222 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_wake_lock_rx_timeout_enable() local
21225 if (dhd) in net_os_wake_lock_rx_timeout_enable()
21226 ret = dhd_os_wake_lock_rx_timeout_enable(&dhd->pub, val); in net_os_wake_lock_rx_timeout_enable()
21232 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_wake_lock_ctrl_timeout_enable() local
21235 if (dhd) in net_os_wake_lock_ctrl_timeout_enable()
21236 ret = dhd_os_wake_lock_ctrl_timeout_enable(&dhd->pub, val); in net_os_wake_lock_ctrl_timeout_enable()
21311 wklock_info->counter = dhd->wakelock_counter; \
21324 wklock_info->counter = dhd->wakelock_counter; \
21372 static void dhd_wk_lock_trace_init(struct dhd_info *dhd) in dhd_wk_lock_trace_init() argument
21379 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_wk_lock_trace_init()
21386 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_wk_lock_trace_init()
21390 static void dhd_wk_lock_trace_deinit(struct dhd_info *dhd) in dhd_wk_lock_trace_deinit() argument
21401 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_wk_lock_trace_deinit()
21419 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_wk_lock_trace_deinit()
21424 dhd_info_t *dhd = (dhd_info_t *)(dhdp->info); in dhd_wk_lock_stats_dump() local
21428 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_wk_lock_stats_dump()
21430 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_wk_lock_stats_dump()
21439 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_wake_lock() local
21443 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) { in dhd_os_wake_lock()
21444 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock()
21445 if (dhd->wakelock_counter == 0 && !dhd->waive_wakelock) { in dhd_os_wake_lock()
21447 dhd_wake_lock(dhd->wl_wifi); in dhd_os_wake_lock()
21457 dhd->wakelock_counter++; in dhd_os_wake_lock()
21458 ret = dhd->wakelock_counter; in dhd_os_wake_lock()
21459 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock()
21467 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_event_wake_lock() local
21469 if (dhd) { in dhd_event_wake_lock()
21471 dhd_wake_lock(dhd->wl_evtwake); in dhd_event_wake_lock()
21482 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_pm_wake_lock_timeout() local
21484 if (dhd) { in dhd_pm_wake_lock_timeout()
21485 dhd_wake_lock_timeout(dhd->wl_pmwake, msecs_to_jiffies(val)); in dhd_pm_wake_lock_timeout()
21494 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_txfl_wake_lock_timeout() local
21496 if (dhd) { in dhd_txfl_wake_lock_timeout()
21497 dhd_wake_lock_timeout(dhd->wl_txflwake, msecs_to_jiffies(val)); in dhd_txfl_wake_lock_timeout()
21506 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_nan_wake_lock_timeout() local
21508 if (dhd) { in dhd_nan_wake_lock_timeout()
21509 dhd_wake_lock_timeout(dhd->wl_nanwake, msecs_to_jiffies(val)); in dhd_nan_wake_lock_timeout()
21516 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_wake_lock() local
21519 if (dhd) in net_os_wake_lock()
21520 ret = dhd_os_wake_lock(&dhd->pub); in net_os_wake_lock()
21526 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_wake_unlock() local
21531 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) { in dhd_os_wake_unlock()
21532 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_unlock()
21534 if (dhd->wakelock_counter > 0) { in dhd_os_wake_unlock()
21535 dhd->wakelock_counter--; in dhd_os_wake_unlock()
21541 if (dhd->wakelock_counter == 0 && !dhd->waive_wakelock) { in dhd_os_wake_unlock()
21543 dhd_wake_unlock(dhd->wl_wifi); in dhd_os_wake_unlock()
21548 ret = dhd->wakelock_counter; in dhd_os_wake_unlock()
21550 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_unlock()
21557 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_event_wake_unlock() local
21559 if (dhd) { in dhd_event_wake_unlock()
21561 dhd_wake_unlock(dhd->wl_evtwake); in dhd_event_wake_unlock()
21571 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_pm_wake_unlock() local
21573 if (dhd) { in dhd_pm_wake_unlock()
21575 if (dhd_wake_lock_active(dhd->wl_pmwake)) { in dhd_pm_wake_unlock()
21576 dhd_wake_unlock(dhd->wl_pmwake); in dhd_pm_wake_unlock()
21585 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_txfl_wake_unlock() local
21587 if (dhd) { in dhd_txfl_wake_unlock()
21589 if (dhd_wake_lock_active(dhd->wl_txflwake)) { in dhd_txfl_wake_unlock()
21590 dhd_wake_unlock(dhd->wl_txflwake); in dhd_txfl_wake_unlock()
21599 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_nan_wake_unlock() local
21601 if (dhd) { in dhd_nan_wake_unlock()
21603 if (dhd_wake_lock_active(dhd->wl_nanwake)) { in dhd_nan_wake_unlock()
21604 dhd_wake_unlock(dhd->wl_nanwake); in dhd_nan_wake_unlock()
21617 dhd_info_t *dhd; in dhd_os_check_wakelock() local
21621 dhd = (dhd_info_t *)(pub->info); in dhd_os_check_wakelock()
21622 if (!dhd) { in dhd_os_check_wakelock()
21628 c = dhd->wakelock_counter; in dhd_os_check_wakelock()
21629 l1 = dhd_wake_lock_active(dhd->wl_wifi); in dhd_os_check_wakelock()
21630 l2 = dhd_wake_lock_active(dhd->wl_wdwake); in dhd_os_check_wakelock()
21639 if (dhd && (dhd->wakelock_counter > 0) && dhd_bus_dev_pm_enabled(pub)) { in dhd_os_check_wakelock()
21640 DHD_ERROR(("%s wakelock c-%d\n", __FUNCTION__, dhd->wakelock_counter)); in dhd_os_check_wakelock()
21656 dhd_info_t *dhd; in dhd_os_check_wakelock_all() local
21665 dhd = (dhd_info_t *)(pub->info); in dhd_os_check_wakelock_all()
21666 if (!dhd) { in dhd_os_check_wakelock_all()
21672 c = dhd->wakelock_counter; in dhd_os_check_wakelock_all()
21673 l1 = dhd_wake_lock_active(dhd->wl_wifi); in dhd_os_check_wakelock_all()
21674 l2 = dhd_wake_lock_active(dhd->wl_wdwake); in dhd_os_check_wakelock_all()
21675 l3 = dhd_wake_lock_active(dhd->wl_rxwake); in dhd_os_check_wakelock_all()
21676 l4 = dhd_wake_lock_active(dhd->wl_ctrlwake); in dhd_os_check_wakelock_all()
21677 l7 = dhd_wake_lock_active(dhd->wl_evtwake); in dhd_os_check_wakelock_all()
21679 l5 = dhd_wake_lock_active(dhd->wl_intrwake); in dhd_os_check_wakelock_all()
21682 l6 = dhd_wake_lock_active(dhd->wl_scanwake); in dhd_os_check_wakelock_all()
21684 l8 = dhd_wake_lock_active(dhd->wl_pmwake); in dhd_os_check_wakelock_all()
21685 l9 = dhd_wake_lock_active(dhd->wl_txflwake); in dhd_os_check_wakelock_all()
21686 l10 = dhd_wake_lock_active(dhd->wl_nanwake); in dhd_os_check_wakelock_all()
21697 if (dhd && (dhd->wakelock_counter > 0) && dhd_bus_dev_pm_enabled(pub)) { in dhd_os_check_wakelock_all()
21698 DHD_ERROR(("%s wakelock c-%d\n", __FUNCTION__, dhd->wakelock_counter)); in dhd_os_check_wakelock_all()
21707 dhd_info_t *dhd = DHD_DEV_INFO(dev); in net_os_wake_unlock() local
21710 if (dhd) in net_os_wake_unlock()
21711 ret = dhd_os_wake_unlock(&dhd->pub); in net_os_wake_unlock()
21717 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_wd_wake_lock() local
21721 if (dhd) { in dhd_os_wd_wake_lock()
21722 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wd_wake_lock()
21723 if (dhd->wakelock_wd_counter == 0 && !dhd->waive_wakelock) { in dhd_os_wd_wake_lock()
21726 dhd_wake_lock(dhd->wl_wdwake); in dhd_os_wd_wake_lock()
21729 dhd->wakelock_wd_counter++; in dhd_os_wd_wake_lock()
21730 ret = dhd->wakelock_wd_counter; in dhd_os_wd_wake_lock()
21731 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wd_wake_lock()
21738 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_wd_wake_unlock() local
21742 if (dhd) { in dhd_os_wd_wake_unlock()
21743 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wd_wake_unlock()
21744 if (dhd->wakelock_wd_counter > 0) { in dhd_os_wd_wake_unlock()
21745 dhd->wakelock_wd_counter = 0; in dhd_os_wd_wake_unlock()
21746 if (!dhd->waive_wakelock) { in dhd_os_wd_wake_unlock()
21748 dhd_wake_unlock(dhd->wl_wdwake); in dhd_os_wd_wake_unlock()
21752 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wd_wake_unlock()
21762 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_oob_irq_wake_lock_timeout() local
21764 if (dhd) { in dhd_os_oob_irq_wake_lock_timeout()
21765 dhd_wake_lock_timeout(dhd->wl_intrwake, msecs_to_jiffies(val)); in dhd_os_oob_irq_wake_lock_timeout()
21774 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_oob_irq_wake_unlock() local
21776 if (dhd) { in dhd_os_oob_irq_wake_unlock()
21778 if (dhd_wake_lock_active(dhd->wl_intrwake)) { in dhd_os_oob_irq_wake_unlock()
21779 dhd_wake_unlock(dhd->wl_intrwake); in dhd_os_oob_irq_wake_unlock()
21791 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_scan_wake_lock_timeout() local
21793 if (dhd) { in dhd_os_scan_wake_lock_timeout()
21794 dhd_wake_lock_timeout(dhd->wl_scanwake, msecs_to_jiffies(val)); in dhd_os_scan_wake_lock_timeout()
21803 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_scan_wake_unlock() local
21805 if (dhd) { in dhd_os_scan_wake_unlock()
21807 if (dhd_wake_lock_active(dhd->wl_scanwake)) { in dhd_os_scan_wake_unlock()
21808 dhd_wake_unlock(dhd->wl_scanwake); in dhd_os_scan_wake_unlock()
21820 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_wake_lock_waive() local
21824 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) { in dhd_os_wake_lock_waive()
21825 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_waive()
21828 if (dhd->waive_wakelock == FALSE) { in dhd_os_wake_lock_waive()
21835 dhd->wakelock_before_waive = dhd->wakelock_counter; in dhd_os_wake_lock_waive()
21836 dhd->waive_wakelock = TRUE; in dhd_os_wake_lock_waive()
21838 ret = dhd->wakelock_wd_counter; in dhd_os_wake_lock_waive()
21839 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_waive()
21846 dhd_info_t *dhd = (dhd_info_t *)(pub->info); in dhd_os_wake_lock_restore() local
21850 if (!dhd) in dhd_os_wake_lock_restore()
21852 if ((dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT) == 0) in dhd_os_wake_lock_restore()
21855 DHD_WAKE_SPIN_LOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_restore()
21858 if (!dhd->waive_wakelock) in dhd_os_wake_lock_restore()
21861 dhd->waive_wakelock = FALSE; in dhd_os_wake_lock_restore()
21872 if (dhd->wakelock_before_waive == 0 && dhd->wakelock_counter > 0) { in dhd_os_wake_lock_restore()
21874 dhd_wake_lock(dhd->wl_wifi); in dhd_os_wake_lock_restore()
21876 dhd_bus_dev_pm_stay_awake(&dhd->pub); in dhd_os_wake_lock_restore()
21878 } else if (dhd->wakelock_before_waive > 0 && dhd->wakelock_counter == 0) { in dhd_os_wake_lock_restore()
21880 dhd_wake_unlock(dhd->wl_wifi); in dhd_os_wake_lock_restore()
21882 dhd_bus_dev_pm_relax(&dhd->pub); in dhd_os_wake_lock_restore()
21885 dhd->wakelock_before_waive = 0; in dhd_os_wake_lock_restore()
21887 ret = dhd->wakelock_wd_counter; in dhd_os_wake_lock_restore()
21888 DHD_WAKE_SPIN_UNLOCK(&dhd->wakelock_spinlock, flags); in dhd_os_wake_lock_restore()
21892 void dhd_os_wake_lock_init(struct dhd_info *dhd) in dhd_os_wake_lock_init() argument
21895 dhd->wakelock_counter = 0; in dhd_os_wake_lock_init()
21896 dhd->wakelock_rx_timeout_enable = 0; in dhd_os_wake_lock_init()
21897 dhd->wakelock_ctrl_timeout_enable = 0; in dhd_os_wake_lock_init()
21900 dhd_wake_lock_init(dhd->wl_wifi, dhd_bus_to_dev(dhd->pub.bus), "wlan_wake"); in dhd_os_wake_lock_init()
21901 dhd_wake_lock_init(dhd->wl_rxwake, dhd_bus_to_dev(dhd->pub.bus), "wlan_rx_wake"); in dhd_os_wake_lock_init()
21902 dhd_wake_lock_init(dhd->wl_ctrlwake, dhd_bus_to_dev(dhd->pub.bus), "wlan_ctrl_wake"); in dhd_os_wake_lock_init()
21903 dhd_wake_lock_init(dhd->wl_evtwake, dhd_bus_to_dev(dhd->pub.bus), "wlan_evt_wake"); in dhd_os_wake_lock_init()
21904 dhd_wake_lock_init(dhd->wl_pmwake, dhd_bus_to_dev(dhd->pub.bus), "wlan_pm_wake"); in dhd_os_wake_lock_init()
21905 dhd_wake_lock_init(dhd->wl_txflwake, dhd_bus_to_dev(dhd->pub.bus), "wlan_txfl_wake"); in dhd_os_wake_lock_init()
21907 dhd_wake_lock_init(dhd->wl_intrwake, dhd_bus_to_dev(dhd->pub.bus), "wlan_oob_irq_wake"); in dhd_os_wake_lock_init()
21910 dhd_wake_lock_init(dhd->wl_scanwake, dhd_bus_to_dev(dhd->pub.bus), "wlan_scan_wake"); in dhd_os_wake_lock_init()
21912 dhd_wake_lock_init(dhd->wl_nanwake, dhd_bus_to_dev(dhd->pub.bus), "wlan_nan_wake"); in dhd_os_wake_lock_init()
21915 dhd_wk_lock_trace_init(dhd); in dhd_os_wake_lock_init()
21919 void dhd_os_wake_lock_destroy(struct dhd_info *dhd) in dhd_os_wake_lock_destroy() argument
21923 dhd->wakelock_counter = 0; in dhd_os_wake_lock_destroy()
21924 dhd->wakelock_rx_timeout_enable = 0; in dhd_os_wake_lock_destroy()
21925 dhd->wakelock_ctrl_timeout_enable = 0; in dhd_os_wake_lock_destroy()
21926 dhd_wake_lock_destroy(dhd->wl_wifi); in dhd_os_wake_lock_destroy()
21927 dhd_wake_lock_destroy(dhd->wl_rxwake); in dhd_os_wake_lock_destroy()
21928 dhd_wake_lock_destroy(dhd->wl_ctrlwake); in dhd_os_wake_lock_destroy()
21929 dhd_wake_lock_destroy(dhd->wl_evtwake); in dhd_os_wake_lock_destroy()
21930 dhd_wake_lock_destroy(dhd->wl_pmwake); in dhd_os_wake_lock_destroy()
21931 dhd_wake_lock_destroy(dhd->wl_txflwake); in dhd_os_wake_lock_destroy()
21933 dhd_wake_lock_destroy(dhd->wl_intrwake); in dhd_os_wake_lock_destroy()
21936 dhd_wake_lock_destroy(dhd->wl_scanwake); in dhd_os_wake_lock_destroy()
21938 dhd_wake_lock_destroy(dhd->wl_nanwake); in dhd_os_wake_lock_destroy()
21940 dhd_wk_lock_trace_deinit(dhd); in dhd_os_wake_lock_destroy()
21943 if (dhd->wakelock_counter > 0) { in dhd_os_wake_lock_destroy()
21945 __FUNCTION__, dhd->wakelock_counter)); in dhd_os_wake_lock_destroy()
21946 while (dhd_os_wake_unlock(&dhd->pub)); in dhd_os_wake_lock_destroy()
21982 dhd_info_t *dhd = NULL; in dhd_ioctl_entry_local() local
21990 dhd = DHD_DEV_INFO(net); in dhd_ioctl_entry_local()
21991 if (!dhd) in dhd_ioctl_entry_local()
21994 ifidx = dhd_net2idx(dhd, net); in dhd_ioctl_entry_local()
22000 DHD_OS_WAKE_LOCK(&dhd->pub); in dhd_ioctl_entry_local()
22002 ret = dhd_wl_ioctl(&dhd->pub, ifidx, ioc, ioc->buf, ioc->len); in dhd_ioctl_entry_local()
22003 dhd_check_hang(net, &dhd->pub, ret); in dhd_ioctl_entry_local()
22005 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_ioctl_entry_local()
22035 dhd_info_t *dhd; in dhd_deepsleep() local
22040 dhd = DHD_DEV_INFO(dev); in dhd_deepsleep()
22041 dhdp = &dhd->pub; in dhd_deepsleep()
22110 void dhd_wlfc_plat_init(void *dhd) in dhd_wlfc_plat_init() argument
22113 dhdsdio_func_blocksize((dhd_pub_t *)dhd, 2, DYNAMIC_F2_BLKSIZE_FOR_NONLEGACY); in dhd_wlfc_plat_init()
22118 void dhd_wlfc_plat_deinit(void *dhd) in dhd_wlfc_plat_deinit() argument
22121 dhdsdio_func_blocksize((dhd_pub_t *)dhd, 2, sd_f2_blocksize); in dhd_wlfc_plat_deinit()
22283 void dhd_set_cpucore(dhd_pub_t *dhd, int set) in dhd_set_cpucore() argument
22287 if (!(dhd->chan_isvht80)) { in dhd_set_cpucore()
22288 DHD_ERROR(("%s: chan_status(%d) cpucore!!!\n", __FUNCTION__, dhd->chan_isvht80)); in dhd_set_cpucore()
22295 e_dpc = set_cpus_allowed_ptr(dhd->current_dpc, in dhd_set_cpucore()
22298 e_dpc = set_cpus_allowed_ptr(dhd->current_dpc, in dhd_set_cpucore()
22312 e_rxf = set_cpus_allowed_ptr(dhd->current_rxf, in dhd_set_cpucore()
22315 e_rxf = set_cpus_allowed_ptr(dhd->current_rxf, in dhd_set_cpucore()
22378 dhd_info_t *dhd = dhdp->info; in dhd_get_mcast_regen_bss_enable() local
22383 ifp = dhd->iflist[idx]; in dhd_get_mcast_regen_bss_enable()
22391 dhd_info_t *dhd = dhdp->info; in dhd_set_mcast_regen_bss_enable() local
22396 ifp = dhd->iflist[idx]; in dhd_set_mcast_regen_bss_enable()
22411 dhd_info_t *dhd = dhdp->info; in dhd_get_ap_isolate() local
22416 ifp = dhd->iflist[idx]; in dhd_get_ap_isolate()
22424 dhd_info_t *dhd = dhdp->info; in dhd_set_ap_isolate() local
22429 ifp = dhd->iflist[idx]; in dhd_set_ap_isolate()
22463 dhd_get_rnd_info(dhd_pub_t *dhd) in dhd_get_rnd_info() argument
22498 ret = dhd_vfs_read(fp, (char *)&dhd->rnd_len, sizeof(dhd->rnd_len), &pos); in dhd_get_rnd_info()
22504 dhd->rnd_buf = MALLOCZ(dhd->osh, dhd->rnd_len); in dhd_get_rnd_info()
22505 if (!dhd->rnd_buf) { in dhd_get_rnd_info()
22510 ret = dhd_vfs_read(fp, (char *)dhd->rnd_buf, dhd->rnd_len, &pos); in dhd_get_rnd_info()
22523 MFREE(dhd->osh, dhd->rnd_buf, dhd->rnd_len); in dhd_get_rnd_info()
22524 dhd->rnd_buf = NULL; in dhd_get_rnd_info()
22533 dhd_dump_rnd_info(dhd_pub_t *dhd, uint8 *rnd_buf, uint32 rnd_len) in dhd_dump_rnd_info() argument
22675 dhd_info_t *dhd = handle; in dhd_mem_dump() local
22692 if (!dhd) { in dhd_mem_dump()
22697 dhdp = &dhd->pub; in dhd_mem_dump()
22751 if (write_dump_to_file(&dhd->pub, dump->buf, dump->bufsize, "mem_dump")) { in dhd_mem_dump()
22771 if (wifi_platform_set_coredump(dhd->adapter, dump->buf, dump->bufsize, dhdp->memdump_str)) { in dhd_mem_dump()
22774 dhd->pub.memdump_success = FALSE; in dhd_mem_dump()
22790 dhd_d2h_minidump(&dhd->pub); in dhd_mem_dump()
22796 if (write_dump_to_file(&dhd->pub, dump->buf, dump->bufsize, "mem_dump")) { in dhd_mem_dump()
22799 dhd->pub.memdump_success = FALSE; in dhd_mem_dump()
22804 if (write_dump_to_file(&dhd->pub, dump->hscb_buf, in dhd_mem_dump()
22808 dhd->pub.memdump_success = FALSE; in dhd_mem_dump()
22825 if (dhd->scheduled_memdump && in dhd_mem_dump()
22832 dhd_log_dump(dhd, flush_type, 0); in dhd_mem_dump()
22841 if (dhd->scheduled_memdump) { in dhd_mem_dump()
22860 if (dhd->pub.memdump_enabled == DUMP_MEMFILE_BUGON && in dhd_mem_dump()
22863 dhd->wl_accel_boot_on_done == TRUE && in dhd_mem_dump()
22866 dhd->pub.memdump_type != DUMP_TYPE_BY_SYSDUMP && in dhd_mem_dump()
22868 dhd->pub.memdump_type != DUMP_TYPE_BY_USER && in dhd_mem_dump()
22870 dhd->pub.memdump_success == TRUE && in dhd_mem_dump()
22873 dhd->pub.memdump_type != DUMP_TYPE_DONGLE_HOST_EVENT && in dhd_mem_dump()
22875 dhd->pub.memdump_type != DUMP_TYPE_CFG_VENDOR_TRIGGERED) { in dhd_mem_dump()
22878 dhd_flush_logtrace_process(dhd); in dhd_mem_dump()
22883 cancel_work_sync(&dhd->bt_log_dispatcher_work); in dhd_mem_dump()
22887 cancel_delayed_work_sync(&dhd->edl_dispatcher_work); in dhd_mem_dump()
22898 MFREE(dhd->pub.osh, dump, sizeof(dhd_dump_t)); in dhd_mem_dump()
22901 DHD_BUS_BUSY_CLEAR_IN_MEMDUMP(&dhd->pub); in dhd_mem_dump()
22904 dhd->scheduled_memdump = FALSE; in dhd_mem_dump()
23188 dhd_info_t *dhd = dhdinfo; in dhd_sssr_dump_to_file() local
23202 if (!dhd) { in dhd_sssr_dump_to_file()
23207 dhdp = &dhd->pub; in dhd_sssr_dump_to_file()
23315 dhd_sdtc_etb_dump(dhd_pub_t *dhd) in dhd_sdtc_etb_dump() argument
23323 if (!dhd->sdtc_etb_inited) { in dhd_sdtc_etb_dump()
23330 if ((ret = dhd_bus_get_etb_info(dhd, dhd->etb_addr_info.etbinfo_addr, &etb_info))) { in dhd_sdtc_etb_dump()
23354 sdtc_etb_mempool = dhd->sdtc_etb_mempool; in dhd_sdtc_etb_dump()
23357 if ((ret = dhd_bus_get_sdtc_etb(dhd, sdtc_etb_dump, etb_info.addr, etb_info.read_bytes))) { in dhd_sdtc_etb_dump()
23362 if (write_dump_to_file(dhd, (uint8 *)sdtc_etb_mempool, in dhd_sdtc_etb_dump()
23374 dhd_info_t *dhd = handle; in dhd_log_dump() local
23377 if (!dhd || !type) { in dhd_log_dump()
23384 wl_flush_fw_log_buffer(dhd_linux_get_primary_netdev(&dhd->pub), in dhd_log_dump()
23399 dhd_os_logdump_lock(&dhd->pub); in dhd_log_dump()
23400 DHD_OS_WAKE_LOCK(&dhd->pub); in dhd_log_dump()
23401 if (do_dhd_log_dump(&dhd->pub, type) != BCME_OK) { in dhd_log_dump()
23404 DHD_OS_WAKE_UNLOCK(&dhd->pub); in dhd_log_dump()
23405 dhd_os_logdump_unlock(&dhd->pub); in dhd_log_dump()
23581 dhdpcie_sssr_dump_get_before_after_len(dhd_pub_t *dhd, uint32 *arr_len) in dhdpcie_sssr_dump_get_before_after_len() argument
23591 if (dhd->sssr_d11_before[i] && dhd->sssr_d11_outofreset[i] && in dhdpcie_sssr_dump_get_before_after_len()
23592 (dhd->sssr_dump_mode == SSSR_DUMP_MODE_SSSR)) { in dhdpcie_sssr_dump_get_before_after_len()
23594 arr_len[SSSR_C0_D11_BEFORE] = dhd_sssr_mac_buf_size(dhd, i); in dhdpcie_sssr_dump_get_before_after_len()
23598 dhd_print_buf_addr(dhd, "SSSR_C0_D11_BEFORE", in dhdpcie_sssr_dump_get_before_after_len()
23599 dhd->sssr_d11_before[i], arr_len[SSSR_C0_D11_BEFORE]); in dhdpcie_sssr_dump_get_before_after_len()
23603 if (dhd->sssr_d11_after[i] && dhd->sssr_d11_outofreset[i]) { in dhdpcie_sssr_dump_get_before_after_len()
23604 arr_len[SSSR_C0_D11_AFTER] = dhd_sssr_mac_buf_size(dhd, i); in dhdpcie_sssr_dump_get_before_after_len()
23608 dhd_print_buf_addr(dhd, "SSSR_C0_D11_AFTER", in dhdpcie_sssr_dump_get_before_after_len()
23609 dhd->sssr_d11_after[i], arr_len[SSSR_C0_D11_AFTER]); in dhdpcie_sssr_dump_get_before_after_len()
23616 if (dhd->sssr_d11_before[i] && dhd->sssr_d11_outofreset[i] && in dhdpcie_sssr_dump_get_before_after_len()
23617 (dhd->sssr_dump_mode == SSSR_DUMP_MODE_SSSR)) { in dhdpcie_sssr_dump_get_before_after_len()
23618 arr_len[SSSR_C1_D11_BEFORE] = dhd_sssr_mac_buf_size(dhd, i); in dhdpcie_sssr_dump_get_before_after_len()
23622 dhd_print_buf_addr(dhd, "SSSR_C1_D11_BEFORE", in dhdpcie_sssr_dump_get_before_after_len()
23623 dhd->sssr_d11_before[i], arr_len[SSSR_C1_D11_BEFORE]); in dhdpcie_sssr_dump_get_before_after_len()
23627 if (dhd->sssr_d11_after[i] && dhd->sssr_d11_outofreset[i]) { in dhdpcie_sssr_dump_get_before_after_len()
23628 arr_len[SSSR_C1_D11_AFTER] = dhd_sssr_mac_buf_size(dhd, i); in dhdpcie_sssr_dump_get_before_after_len()
23632 dhd_print_buf_addr(dhd, "SSSR_C1_D11_AFTER", in dhdpcie_sssr_dump_get_before_after_len()
23633 dhd->sssr_d11_after[i], arr_len[SSSR_C1_D11_AFTER]); in dhdpcie_sssr_dump_get_before_after_len()
23638 if (dhd->sssr_reg_info->rev2.version >= SSSR_REG_INFO_VER_2) { in dhdpcie_sssr_dump_get_before_after_len()
23641 if (dhd->sssr_d11_before[i] && dhd->sssr_d11_outofreset[i] && in dhdpcie_sssr_dump_get_before_after_len()
23642 (dhd->sssr_dump_mode == SSSR_DUMP_MODE_SSSR)) { in dhdpcie_sssr_dump_get_before_after_len()
23643 arr_len[SSSR_C2_D11_BEFORE] = dhd_sssr_mac_buf_size(dhd, i); in dhdpcie_sssr_dump_get_before_after_len()
23647 dhd_print_buf_addr(dhd, "SSSR_C2_D11_BEFORE", in dhdpcie_sssr_dump_get_before_after_len()
23648 dhd->sssr_d11_before[i], arr_len[SSSR_C2_D11_BEFORE]); in dhdpcie_sssr_dump_get_before_after_len()
23652 if (dhd->sssr_d11_after[i] && dhd->sssr_d11_outofreset[i]) { in dhdpcie_sssr_dump_get_before_after_len()
23653 arr_len[SSSR_C2_D11_AFTER] = dhd_sssr_mac_buf_size(dhd, i); in dhdpcie_sssr_dump_get_before_after_len()
23657 dhd_print_buf_addr(dhd, "SSSR_C2_D11_AFTER", in dhdpcie_sssr_dump_get_before_after_len()
23658 dhd->sssr_d11_after[i], arr_len[SSSR_C2_D11_AFTER]); in dhdpcie_sssr_dump_get_before_after_len()
23664 dig_buf_size = dhd_sssr_dig_buf_size(dhd); in dhdpcie_sssr_dump_get_before_after_len()
23666 arr_len[SSSR_DIG_BEFORE] = (dhd->sssr_dig_buf_before) ? dig_buf_size : 0; in dhdpcie_sssr_dump_get_before_after_len()
23670 if (dhd->sssr_dig_buf_before) { in dhdpcie_sssr_dump_get_before_after_len()
23671 dhd_print_buf_addr(dhd, "SSSR_DIG_BEFORE", in dhdpcie_sssr_dump_get_before_after_len()
23672 dhd->sssr_dig_buf_before, arr_len[SSSR_DIG_BEFORE]); in dhdpcie_sssr_dump_get_before_after_len()
23677 arr_len[SSSR_DIG_AFTER] = (dhd->sssr_dig_buf_after) ? dig_buf_size : 0; in dhdpcie_sssr_dump_get_before_after_len()
23681 if (dhd->sssr_dig_buf_after) { in dhdpcie_sssr_dump_get_before_after_len()
23682 dhd_print_buf_addr(dhd, "SSSR_DIG_AFTER", in dhdpcie_sssr_dump_get_before_after_len()
23683 dhd->sssr_dig_buf_after, arr_len[SSSR_DIG_AFTER]); in dhdpcie_sssr_dump_get_before_after_len()
24814 dhd_info_t *dhd = handle; in dhd_inform_dhd_monitor_handler() local
24817 if (!dhd) { in dhd_inform_dhd_monitor_handler()
24833 MFREE(dhd->pub.osh, wf, sizeof(dhd_write_file_t)); in dhd_inform_dhd_monitor_handler()
24844 __FUNCTION__, dhd->unit)); in dhd_inform_dhd_monitor_handler()
24852 __FUNCTION__, dhd->unit)); in dhd_inform_dhd_monitor_handler()
24860 __FUNCTION__, dhd->unit)); in dhd_inform_dhd_monitor_handler()
24873 dhd_info_t *dhd = handle; in _dhd_schedule_macdbg_dump() local
24874 dhd_pub_t *dhdp = &dhd->pub; in _dhd_schedule_macdbg_dump()
24886 __FUNCTION__, dhd->unit)); in _dhd_schedule_macdbg_dump()
24964 dhd_deferred_work_set_skip(dhd->dhd_deferred_wq, in _dhd_schedule_macdbg_dump()
24989 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_os_socram_dump() local
24990 dhd_pub_t *dhdp = &dhd->pub; in dhd_os_socram_dump()
25020 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_os_get_socram_dump() local
25021 dhd_pub_t *dhdp = &dhd->pub; in dhd_os_get_socram_dump()
25093 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_os_get_pktlog_dump() local
25094 dhd_pub_t *dhdp = &dhd->pub; in dhd_os_get_pktlog_dump()
25112 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_os_get_pktlog_dump_size() local
25113 dhd_pub_t *dhdp = &dhd->pub; in dhd_os_get_pktlog_dump_size()
25125 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_os_get_pktlogdump_filename() local
25126 dhd_pub_t *dhdp = &dhd->pub; in dhd_os_get_pktlogdump_filename()
25136 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); in dhd_os_get_axi_error_dump() local
25137 dhd_pub_t *dhdp = &dhd->pub; in dhd_os_get_axi_error_dump()
25177 dhd_info_t *dhd = dhdp->info; in dhd_wmf_conf() local
25182 ifp = dhd->iflist[idx]; in dhd_wmf_conf()
25235 dhd_info_t *dhd = dhdp->info; in dhd_get_ifp_arp_table_handle() local
25240 ifp = dhd->iflist[bssidx]; in dhd_get_ifp_arp_table_handle()
25246 dhd_info_t *dhd = dhdp->info; in dhd_get_parp_status() local
25251 ifp = dhd->iflist[idx]; in dhd_get_parp_status()
25262 dhd_info_t *dhd = dhdp->info; in dhd_set_parp_status() local
25265 ifp = dhd->iflist[idx]; in dhd_set_parp_status()
25287 dhd_info_t *dhd = dhdp->info; in dhd_parp_discard_is_enabled() local
25292 ifp = dhd->iflist[idx]; in dhd_parp_discard_is_enabled()
25301 dhd_info_t *dhd = dhdp->info; in dhd_parp_allnode_is_enabled() local
25306 ifp = dhd->iflist[idx]; in dhd_parp_allnode_is_enabled()
25315 dhd_info_t *dhd = dhdp->info; in dhd_get_dhcp_unicast_status() local
25320 ifp = dhd->iflist[idx]; in dhd_get_dhcp_unicast_status()
25329 dhd_info_t *dhd = dhdp->info; in dhd_set_dhcp_unicast_status() local
25332 ifp = dhd->iflist[idx]; in dhd_set_dhcp_unicast_status()
25342 dhd_info_t *dhd = dhdp->info; in dhd_get_block_ping_status() local
25347 ifp = dhd->iflist[idx]; in dhd_get_block_ping_status()
25356 dhd_info_t *dhd = dhdp->info; in dhd_set_block_ping_status() local
25359 ifp = dhd->iflist[idx]; in dhd_set_block_ping_status()
25373 dhd_info_t *dhd = dhdp->info; in dhd_get_grat_arp_status() local
25378 ifp = dhd->iflist[idx]; in dhd_get_grat_arp_status()
25387 dhd_info_t *dhd = dhdp->info; in dhd_set_grat_arp_status() local
25390 ifp = dhd->iflist[idx]; in dhd_set_grat_arp_status()
25401 dhd_info_t *dhd = dhdp->info; in dhd_get_block_tdls_status() local
25406 ifp = dhd->iflist[idx]; in dhd_get_block_tdls_status()
25415 dhd_info_t *dhd = dhdp->info; in dhd_set_block_tdls_status() local
25418 ifp = dhd->iflist[idx]; in dhd_set_block_tdls_status()
25431 dhd_info_t *dhd = DHD_DEV_INFO(net); in dhd_xps_cpus_enable() local
25436 ifidx = dhd_net2idx(dhd, net); in dhd_xps_cpus_enable()
25442 if (!dhd->pub.conf->xps_cpus) in dhd_xps_cpus_enable()
25446 if (dhd->pub.op_mode == DHD_FLAG_IBSS_MODE) { in dhd_xps_cpus_enable()
25461 ifp = dhd->iflist[ifidx]; in dhd_xps_cpus_enable()
25534 dhd_info_t *dhd = DHD_DEV_INFO(net); in dhd_rps_cpus_enable() local
25539 ifidx = dhd_net2idx(dhd, net); in dhd_rps_cpus_enable()
25545 if (!dhd->pub.conf->rps_cpus) in dhd_rps_cpus_enable()
25549 if (dhd->pub.op_mode == DHD_FLAG_IBSS_MODE) { in dhd_rps_cpus_enable()
25564 ifp = dhd->iflist[ifidx]; in dhd_rps_cpus_enable()
25825 dhd_info_t *dhd = dhdp->info; in dhd_linux_get_primary_netdev() local
25827 if (dhd->iflist[0] && dhd->iflist[0]->net) in dhd_linux_get_primary_netdev()
25828 return dhd->iflist[0]->net; in dhd_linux_get_primary_netdev()
26153 dhd_log_dump_init(dhd_pub_t *dhd) in dhd_log_dump_init() argument
26164 dhd_info_t *dhd_info = dhd->info; in dhd_log_dump_init()
26209 prealloc_buf = DHD_OS_PREALLOC(dhd, prealloc_idx++, LOG_DUMP_TOTAL_BUFSIZE); in dhd_log_dump_init()
26210 dld_buf_special->buffer = DHD_OS_PREALLOC(dhd, prealloc_idx++, in dhd_log_dump_init()
26213 prealloc_buf = MALLOCZ(dhd->osh, LOG_DUMP_TOTAL_BUFSIZE); in dhd_log_dump_init()
26214 dld_buf_special->buffer = MALLOCZ(dhd->osh, dld_buf_size[DLD_BUF_TYPE_SPECIAL]); in dhd_log_dump_init()
26233 dld_buf->dhd_pub = dhd; in dhd_log_dump_init()
26250 dhd->ecntr_dbg_ring = dhd_dbg_ring_alloc_init(dhd, in dhd_log_dump_init()
26254 if (!dhd->ecntr_dbg_ring) { in dhd_log_dump_init()
26263 dhd->rtt_dbg_ring = dhd_dbg_ring_alloc_init(dhd, in dhd_log_dump_init()
26267 if (!dhd->rtt_dbg_ring) { in dhd_log_dump_init()
26276 dhd->bcm_trace_dbg_ring = dhd_dbg_ring_alloc_init(dhd, in dhd_log_dump_init()
26280 if (!dhd->bcm_trace_dbg_ring) { in dhd_log_dump_init()
26295 dhd->concise_dbg_buf = MALLOC(dhd->osh, CONCISE_DUMP_BUFLEN); in dhd_log_dump_init()
26296 if (!dhd->concise_dbg_buf) { in dhd_log_dump_init()
26304 ret = dhd_event_log_filter_init(dhd, in dhd_log_dump_init()
26313 cookie_buf = MALLOC(dhd->osh, LOG_DUMP_COOKIE_BUFSIZE); in dhd_log_dump_init()
26320 ret = dhd_logdump_cookie_init(dhd, cookie_buf, LOG_DUMP_COOKIE_BUFSIZE); in dhd_log_dump_init()
26322 MFREE(dhd->osh, cookie_buf, LOG_DUMP_COOKIE_BUFSIZE); in dhd_log_dump_init()
26332 if (dhd->event_log_filter) { in dhd_log_dump_init()
26333 dhd_event_log_filter_deinit(dhd); in dhd_log_dump_init()
26337 if (dhd->concise_dbg_buf) { in dhd_log_dump_init()
26338 MFREE(dhd->osh, dhd->concise_dbg_buf, CONCISE_DUMP_BUFLEN); in dhd_log_dump_init()
26342 if (dhd->logdump_cookie) { in dhd_log_dump_init()
26343 dhd_logdump_cookie_deinit(dhd); in dhd_log_dump_init()
26344 MFREE(dhd->osh, dhd->logdump_cookie, LOG_DUMP_COOKIE_BUFSIZE); in dhd_log_dump_init()
26345 dhd->logdump_cookie = NULL; in dhd_log_dump_init()
26351 DHD_OS_PREFREE(dhd, prealloc_buf, LOG_DUMP_TOTAL_BUFSIZE); in dhd_log_dump_init()
26354 DHD_OS_PREFREE(dhd, dld_buf_special->buffer, in dhd_log_dump_init()
26359 MFREE(dhd->osh, prealloc_buf, LOG_DUMP_TOTAL_BUFSIZE); in dhd_log_dump_init()
26362 MFREE(dhd->osh, dld_buf_special->buffer, in dhd_log_dump_init()
26375 dhd_log_dump_deinit(dhd_pub_t *dhd)
26379 dhd_info_t *dhd_info = dhd->info;
26384 if (dhd->concise_dbg_buf) {
26385 MFREE(dhd->osh, dhd->concise_dbg_buf, CONCISE_DUMP_BUFLEN);
26386 dhd->concise_dbg_buf = NULL;
26390 if (dhd->logdump_cookie) {
26391 dhd_logdump_cookie_deinit(dhd);
26392 MFREE(dhd->osh, dhd->logdump_cookie, LOG_DUMP_COOKIE_BUFSIZE);
26393 dhd->logdump_cookie = NULL;
26396 if (dhd->ecntr_dbg_ring) {
26397 dhd_dbg_ring_dealloc_deinit(&dhd->ecntr_dbg_ring, dhd);
26402 if (dhd->rtt_dbg_ring) {
26403 dhd_dbg_ring_dealloc_deinit(&dhd->rtt_dbg_ring, dhd);
26408 if (dhd->bcm_trace_dbg_ring) {
26409 dhd_dbg_ring_dealloc_deinit(&dhd->bcm_trace_dbg_ring, dhd);
26418 DHD_OS_PREFREE(dhd, dld_buf->buffer, LOG_DUMP_TOTAL_BUFSIZE);
26421 DHD_OS_PREFREE(dhd, dld_buf_special->buffer,
26426 MFREE(dhd->osh, dld_buf->buffer, LOG_DUMP_TOTAL_BUFSIZE);
26429 MFREE(dhd->osh, dld_buf_special->buffer,
26559 dhd_info_t * dhd;
26562 dhd = dhdp->info;
26563 if (dhd) {
26564 flush_workqueue(dhd->tx_wq);
26565 flush_workqueue(dhd->rx_wq);
26577 dhd_info_t *dhd = DHD_DEV_INFO(dev);
26579 if (dhd->duart_execute) {
26694 struct dhd_info *dhd = NULL;
26720 dhd = dhdp->info;
26723 dhd->permitted_primary_cpu = FALSE;
26726 dhd->permitted_primary_cpu = TRUE;
26728 dhd_select_cpu_candidacy(dhd);
26735 napi_disable(&dhd->rx_napi_struct);
26736 napi_enable(&dhd->rx_napi_struct);
26897 int dhd_read_from_file(dhd_pub_t *dhd)
26902 NULL_CHECK(dhd, "dhd is NULL", ret);
26904 buf = MALLOCZ(dhd->osh, FILE_BLOCK_READ_SIZE);
26911 fd = dhd_os_open_image1(dhd, FILTER_IE_PATH);
26920 if ((ret = dhd_parse_filter_ie(dhd, buf)) < 0) {
26927 dhd_os_close_image1(dhd, fd);
26930 MFREE(dhd->osh, buf, FILE_BLOCK_READ_SIZE);
26959 int dhd_parse_oui(dhd_pub_t *dhd, uint8 *inbuf, uint8 *oui, int len)
27011 int dhd_parse_filter_ie(dhd_pub_t *dhd, uint8 *buf)
27021 element_count = dhd_get_filter_ie_count(dhd, buf);
27025 p_filter_iov = MALLOCZ(dhd->osh, filter_iovsize);
27052 if (dhd_check_valid_ie(dhd, token, strlen(token)) == BCME_ERROR) {
27062 if ((ele_token == NULL) || (dhd_check_valid_ie(dhd, ele_token,
27071 oui_size = dhd_parse_oui(dhd, token, &(data[len]), strlen(token));
27082 dhd_parse_oui(dhd, oui_token,
27090 if (dhd_check_valid_ie(dhd, token,
27100 if ((type == NULL) || (dhd_check_valid_ie(dhd, type,
27109 (dhd_check_valid_ie(dhd, token,
27137 ret = dhd_iovar(dhd, 0, "filter_ie", (void *)p_filter_iov,
27145 MFREE(dhd->osh, p_filter_iov, filter_iovsize);
27175 dhd_info_t *dhd = NULL;
27179 dhd = DHD_DEV_INFO(dev);
27181 if (dhd) {
27182 dhdp = &dhd->pub;
27185 if (!dhd || !dhdp) {
27269 dhd_info_t * dhd = (dhd_info_t *)(dhdp->info);
27277 mutex_lock(&dhd->quiesce_lock);
27278 DHD_ERROR(("%s: start quiesce_state = %d\n", __FUNCTION__, dhd->dhd_quiesce_state));
27279 if (dhd->dhd_quiesce_state != DHD_QUIESCE_INIT) {
27280 DHD_ERROR(("%s: start quiesce_state = %d\n", __FUNCTION__, dhd->dhd_quiesce_state));
27281 mutex_unlock(&dhd->quiesce_lock);
27284 dhd->dhd_quiesce_state = REQUEST_BT_QUIESCE;
27287 timeout = wait_event_timeout(dhd->quiesce_wait,
27288 (dhd->dhd_quiesce_state == RESPONSE_BT_QUIESCE), timeout);
27290 DHD_ERROR(("%s: after wait quiesce_state = %d\n", __FUNCTION__, dhd->dhd_quiesce_state));
27292 mutex_unlock(&dhd->quiesce_lock);
27295 __FUNCTION__, dhd->dhd_quiesce_state));
27304 dhd_info_t * dhd = (dhd_info_t *)(dhdp->info);
27312 DHD_ERROR(("%s: start quiesce_state = %d\n", __FUNCTION__, dhd->dhd_quiesce_state));
27313 mutex_lock(&dhd->quiesce_lock);
27314 if (dhd->dhd_quiesce_state != RESPONSE_BT_QUIESCE) {
27315 mutex_unlock(&dhd->quiesce_lock);
27318 dhd->dhd_quiesce_state = REQUEST_BT_RESUME;
27321 timeout = wait_event_timeout(dhd->quiesce_wait,
27322 (dhd->dhd_quiesce_state == RESPONSE_BT_RESUME), timeout);
27324 DHD_ERROR(("%s: after wait quiesce_state = %d\n", __FUNCTION__, dhd->dhd_quiesce_state));
27326 dhd->dhd_quiesce_state = DHD_QUIESCE_INIT;
27327 mutex_unlock(&dhd->quiesce_lock);
27330 __FUNCTION__, dhd->dhd_quiesce_state));
27340 dhd_info_t * dhd = (dhd_info_t *)(dhdp->info);
27342 if (dhd->dhd_quiesce_state == REQUEST_BT_QUIESCE) {
27343 dhd->dhd_quiesce_state = RESPONSE_BT_QUIESCE;
27344 wake_up(&dhd->quiesce_wait);
27348 if (dhd->dhd_quiesce_state == REQUEST_BT_RESUME) {
27349 dhd->dhd_quiesce_state = RESPONSE_BT_RESUME;
27350 wake_up(&dhd->quiesce_wait);
27355 __FUNCTION__, quiesce, dhd->dhd_quiesce_state));
27364 dhd_info_t * dhd = (dhd_info_t *)(dhdp->info);
27366 mutex_lock(&dhd->quiesce_flr_lock);
27367 dhd->dhd_quiesce_state = DHD_QUIESCE_INIT;
27391 mutex_unlock(&dhd->quiesce_flr_lock);
27407 mutex_unlock(&dhd->quiesce_flr_lock);
27418 mutex_unlock(&dhd->quiesce_flr_lock);
27436 mutex_unlock(&dhd->quiesce_flr_lock);
27655 dhd_print_kirqstats(dhd_pub_t *dhd, unsigned int irq_num)
27705 dhd_show_kirqstats(dhd_pub_t *dhd)
27709 dhdpcie_get_pcieirq(dhd->bus, &irq);
27712 irq = ((wifi_adapter_info_t *)dhd->info->adapter)->irq_num;
27717 dhd_print_kirqstats(dhd, irq);
27724 irq = dhd_bus_get_oob_irq_num(dhd);
27727 dhd_print_kirqstats(dhd, irq);
27733 dhd_print_tasklet_status(dhd_pub_t *dhd)
27737 if (!dhd) {
27742 dhdinfo = dhd->info;
27756 dhd_info_t *dhd = NULL;
27762 dhd = dhdp->info;
27769 bcm_bprintf(strbuf, "%-10d\t", dhd->pktcnt_per_ac[i]);
27777 bcm_bprintf(strbuf, "%-8d\t", dhd->pktcnt_qac_histo[i][j]);
27787 bcm_bprintf(strbuf, "%-8d\t", dhd->cpu_qstats[i][j]);
27860 dhd_info_t *dhd = (dhd_info_t *)PDE_DATA(file_inode(fp));
27877 err = dhd_bus_iovar_op(&(dhd->pub), iovar,
27893 err = dhd_bus_iovar_op(&(dhd->pub), iovar, NULL, 0,
27897 err = dhd_bus_iovar_op(&(dhd->pub), iovar, (char *)read_params, (uint)read_plen,
27992 dhd_info_t *dhd = (dhd_info_t *)PDE_DATA(file_inode(fp));
28013 err = dhd_bus_iovar_op(&(dhd->pub), iovar, NULL, 0, (char *)buf, sizeof(*buf) * 3,
28021 err = dhd_bus_iovar_op(&(dhd->pub), iovar, (char *)buf, sizeof(*buf) * 2,
28092 gdb_proxy_fs_try_create(dhd_info_t *dhd, const char *dev_name)
28094 char dir_name[sizeof(dhd->gdb_proxy_fs_root_name)] = "dhd_gdb_proxy_";
28106 if (!dev_name || !*dev_name || dhd->gdb_proxy_fs_root) {
28118 fileinfos[i].fops, dhd);
28123 dhd->gdb_proxy_fs_root = root_dentry;
28124 memcpy_s(dhd->gdb_proxy_fs_root_name, sizeof(dhd->gdb_proxy_fs_root_name),
28125 dir_name, sizeof(dhd->gdb_proxy_fs_root_name));
28135 gdb_proxy_fs_remove(dhd_info_t *dhd)
28137 if (dhd->gdb_proxy_fs_root) {
28138 remove_proc_subtree(dhd->gdb_proxy_fs_root_name, NULL);
28139 dhd->gdb_proxy_fs_root = NULL;
28140 bzero(dhd->gdb_proxy_fs_root_name, sizeof(dhd->gdb_proxy_fs_root_name));
28190 dhd_info_t *dhd = dhdp->info;
28196 return memcpy_s(arg, len, &dhd->config[0], sizeof(dhd->config));
28203 dhd_info_t *dhd = dhdp->info;
28244 if (dhd->config[idx].chksum == 0) {
28257 memset(&dhd->config[idx], 0, sizeof(dhd->config[idx]));
28259 ret = memcpy_s(&dhd->config[idx], sizeof(dhd->config[idx]),
28262 dhd->config[idx].chksum = checksum;
28280 dhd_info_t *dhd = dhdp->info;
28285 if (dhd->config[i].chksum) {
28289 if (checksum && (dhd->config[i].chksum == checksum)) {
28290 flow = &dhd->config[i];
28302 if (dhd->config[i].chksum) {
28313 dhd_info_t *dhd = dhdp->info;
28315 return dhd->latency;
28321 dhd_info_t *dhd = dhdp->info;
28353 dhd->latency = val;
28363 dhd_info_t *dhd = handle;
28367 if (!dhd) {
28372 dhdp = &dhd->pub;
28374 if (!(dhd->dhd_state & DHD_ATTACH_STATE_DONE)) {
28461 dhd_info_t *dhd = handle;
28463 if (!dhd) {
28468 if (dhd_pktlog_dump_write_file(&dhd->pub)) {
28552 dhd_info_t *dhd = (dhd_info_t *)(dhdp->info);
28566 ifp = dhd->iflist[ifidx];
29735 dhd_dump_file_manage_enqueue(dhd_pub_t *dhd, char *dump_path, char *fname)
29742 if (!dhd || !dhd->dump_file_manage) {
29744 __FUNCTION__, dhd, (dhd ? dhd->dump_file_manage : NULL)));
29748 fm_ptr = dhd->dump_file_manage;
29787 dhd_info_t *dhd;
29790 dhd = (dhd_info_t *)(pub->info);
29792 if (dhd) {
29793 flags = osl_spin_lock(&dhd->hp2p_lock);
29802 dhd_info_t *dhd;
29804 dhd = (dhd_info_t *)(pub->info);
29806 if (dhd) {
29807 osl_spin_unlock(&dhd->hp2p_lock, flags);
29815 dhd_info_t *dhd = (dhd_info_t *)handle;
29818 if (!dhd) {
29823 dhdp = &dhd->pub;
29919 dhd_info_t *dhd = handle;
29922 if (!dhd) {
29928 dhdp = &dhd->pub;
30017 static void dhd_set_bandlock(dhd_pub_t * dhd)
30021 if (dhd_wl_ioctl_cmd(dhd, WLC_SET_BAND, &band, sizeof(band), TRUE, 0) < 0) {
30029 if (dhd_wl_ioctl_cmd(dhd, WLC_SET_BAND, &band, sizeof(band), TRUE, 0) < 0) {
30041 dhd_net_del_flowrings_sta(dhd_pub_t *dhd, struct net_device *ndev)
30045 ifp = dhd_get_ifp_by_ndev(dhd, ndev);
30057 dhd_del_all_sta(dhd, ifp->idx);
30058 dhd_flow_rings_delete(dhd, ifp->idx);
30106 dhd_info_t *dhd = (dhd_info_t *)pub->info;
30109 if (!dhd) {
30113 return dhd->wd_timer_valid;
30119 dhd_bridge_dev_set(dhd_info_t *dhd, int ifidx, struct net_device *sdev)
30127 if (dhd->iflist[i]->bssidx == dhd->iflist[ifidx]->bssidx) {
30128 pdev = dhd->pub.info->iflist[i]->net;
30138 pdev = dhd->iflist[ifidx]->net;