Lines Matching refs:dhd
271 #define DBUS_RX_BUFFER_SIZE_DHD(net) (net->mtu + net->hard_header_len + dhd->pub.hdrlen)
273 #define DBUS_RX_BUFFER_SIZE_DHD(net) (net->mtu + net->hard_header_len + dhd->pub.hdrlen + 128)
278 extern void dhd_wlfc_plat_init(void *dhd);
279 extern void dhd_wlfc_plat_deinit(void *dhd);
283 extern int dhdsdio_func_blocksize(dhd_pub_t *dhd, int function_num, int block_size);
354 static void dhd_log_dump_init(dhd_pub_t *dhd);
355 static void dhd_log_dump_deinit(dhd_pub_t *dhd);
631 int dhdpcie_sssr_dump_get_before_after_len(dhd_pub_t *dhd, uint32 *arr_len);
745 static int dhd_get_pend_8021x_cnt(dhd_info_t *dhd);
759 static struct list_head * dhd_sta_list_snapshot(dhd_info_t *dhd, dhd_if_t *ifp,
761 static void dhd_sta_list_snapshot_free(dhd_info_t *dhd, struct list_head *snapshot_list);
762 #define DHD_IF_WMF_UCFORWARD_LOCK(dhd, ifp, slist) ({ dhd_sta_list_snapshot(dhd, ifp, slist); }) argument
763 #define DHD_IF_WMF_UCFORWARD_UNLOCK(dhd, slist) ({ dhd_sta_list_snapshot_free(dhd, slist); }) argument
889 static void dhd_net_if_lock_local(dhd_info_t *dhd);
890 static void dhd_net_if_unlock_local(dhd_info_t *dhd);
903 void sec_control_pm(dhd_pub_t *dhd, uint *);
919 static int dhd_toe_get(dhd_info_t *dhd, int idx, uint32 *toe_ol);
920 static int dhd_toe_set(dhd_info_t *dhd, int idx, uint32 toe_ol);
923 static int dhd_wl_host_event(dhd_info_t *dhd, int ifidx, void *pktdata, uint16 pktlen,
993 dhd_info_t * dhd; /* cached pointer to dhd_info in netdevice priv */ member
1001 #define DHD_DEV_INFO(dev) (((dhd_dev_priv_t *)DEV_PRIV(dev))->dhd)
1016 dev_priv->dhd = (dhd_info_t *)NULL; in dhd_dev_priv_clear()
1024 dhd_dev_priv_save(struct net_device * dev, dhd_info_t * dhd, dhd_if_t * ifp, in dhd_dev_priv_save() argument
1030 dev_priv->dhd = dhd; in dhd_dev_priv_save()
1532 dhd_sta_list_snapshot(dhd_info_t *dhd, dhd_if_t *ifp, struct list_head *snapshot_list) in dhd_sta_list_snapshot() argument
1543 snapshot = (dhd_sta_t *)MALLOC(dhd->pub.osh, sizeof(dhd_sta_t)); in dhd_sta_list_snapshot()
1561 dhd_sta_list_snapshot_free(dhd_info_t *dhd, struct list_head *snapshot_list) in dhd_sta_list_snapshot_free() argument
1567 MFREE(dhd->pub.osh, sta, sizeof(dhd_sta_t)); in dhd_sta_list_snapshot_free()
1576 dhd_info_t *dhd = dhdp->info; in dhd_axi_error_dispatch() local
1577 schedule_work(&dhd->axi_error_dispatcher_work); in dhd_axi_error_dispatch()
1582 struct dhd_info *dhd = in dhd_axi_error_dispatcher_fn() local
1584 dhd_axi_error(&dhd->pub); in dhd_axi_error_dispatcher_fn()
1592 dhd_info_t *dhd = dhdp->info; in dhd_bssidx2idx() local
1599 ifp = dhd->iflist[i]; in dhd_bssidx2idx()
1754 _turn_on_arp_filter(dhd_pub_t *dhd, int op_mode_param) in _turn_on_arp_filter() argument
1774 dhd_set_packet_filter(dhd_pub_t *dhd) in dhd_set_packet_filter() argument
1780 for (i = 0; i < dhd->pktfilter_count; i++) { in dhd_set_packet_filter()
1781 dhd_pktfilter_offload_set(dhd, dhd->pktfilter[i]); in dhd_set_packet_filter()
1787 dhd_enable_packet_filter(int value, dhd_pub_t *dhd) in dhd_enable_packet_filter() argument
1792 if ((dhd->op_mode & DHD_FLAG_HOSTAP_MODE) && value) { in dhd_enable_packet_filter()
1799 (dhd_support_sta_mode(dhd) && !dhd->dhcp_in_progress))) in dhd_enable_packet_filter()
1801 for (i = 0; i < dhd->pktfilter_count; i++) { in dhd_enable_packet_filter()
1804 !_turn_on_arp_filter(dhd, dhd->op_mode)) { in dhd_enable_packet_filter()
1807 value, i, dhd->op_mode)); in dhd_enable_packet_filter()
1811 dhd_pktfilter_offload_enable(dhd, dhd->pktfilter[i], in dhd_enable_packet_filter()
1890 static int dhd_set_suspend(int value, dhd_pub_t *dhd) argument
1943 if (!dhd)
1947 dhdinfo = dhd->info;
1951 __FUNCTION__, value, dhd->in_suspend));
1953 dhd_suspend_lock(dhd);
1958 dhd_set_cpucore(dhd, TRUE);
1960 if (dhd->up) {
1961 if (value && dhd->in_suspend) {
1963 dhd->early_suspended = 1;
1969 dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char *)&power_mode,
1977 dhd_enable_packet_filter(1, dhd);
1979 dhd_dev_apf_enable_filter(dhd_linux_get_primary_netdev(dhd));
1983 dhd_arp_offload_enable(dhd, TRUE);
1990 ret = dhd_iovar(dhd, i, "allmulti",
2008 if (dhd->tdls_mode) {
2013 bcn_li_dtim = dhd_get_suspend_bcn_li_dtim(dhd, &dtim_period,
2015 ret = dhd_iovar(dhd, 0, "bcn_li_dtim", (char *)&bcn_li_dtim,
2029 ret = dhd_iovar(dhd, 0, "lpas", (char *)&lpas, sizeof(lpas),
2042 ret = dhd_iovar(dhd, 0, "bcn_to_dly", (char *)&bcn_to_dly,
2050 ret = dhd_iovar(dhd, 0, "bcn_timeout", (char *)&bcn_timeout,
2058 bcn_li_dtim = dhd_get_suspend_bcn_li_dtim(dhd);
2059 if (dhd_iovar(dhd, 0, "bcn_li_dtim", (char *)&bcn_li_dtim,
2066 dhd_linux_get_primary_netdev(dhd), FALSE);
2074 ret = dhd_iovar(dhd, 0, "bcn_timeout", (char *)&bcn_timeout,
2083 ret = dhd_iovar(dhd, 0, "roam_time_thresh",
2093 ret = dhd_iovar(dhd, 0, "roam_off", (char *)&roamvar,
2104 ret = dhd_iovar(dhd, 0, "bcn_li_bcn", (char *)&bcn_li_bcn,
2111 ret = wl_android_bcnrecv_suspend(dhd_linux_get_primary_netdev(dhd));
2118 if (dhd->ndo_enable) {
2119 if (!dhd->ndo_host_ip_overflow) {
2121 ret = dhd_ndo_enable(dhd, TRUE);
2133 if (FW_SUPPORTED(dhd, ndoe)) {
2135 if (FW_SUPPORTED(dhd, ndoe) && !FW_SUPPORTED(dhd, apf)) {
2139 ret = dhd_iovar(dhd, 0, "nd_ra_filter_enable",
2146 dhd_os_suppress_logging(dhd, TRUE);
2149 ret = dhd_iovar(dhd, 0, "ipmcast_l2filter",
2158 ret = dhd_iovar(dhd, 0, "bus:intr_width", (char *)&intr_width,
2166 ret = dhd_iovar(dhd, 0, "const_awake_thresh",
2175 if (!dhd->sroamed) {
2176 ret = dhd_sroam_set_mon(dhd, TRUE);
2182 dhd->sroamed = FALSE;
2187 dhd->early_suspended = 0;
2193 ret = dhd_iovar(dhd, 0, "bus:intr_width", (char *)&intr_width,
2201 dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char *)&power_mode,
2205 ret = wl_android_bcnrecv_resume(dhd_linux_get_primary_netdev(dhd));
2212 dhd_arp_offload_enable(dhd, FALSE);
2216 dhd_enable_packet_filter(0, dhd);
2218 dhd_dev_apf_disable_filter(dhd_linux_get_primary_netdev(dhd));
2225 ret = dhd_iovar(dhd, i, "allmulti",
2237 ret = dhd_iovar(dhd, 0, "bcn_li_dtim", (char *)&bcn_li_dtim,
2243 ret = dhd_iovar(dhd, 0, "lpas", (char *)&lpas, sizeof(lpas), NULL,
2248 ret = dhd_iovar(dhd, 0, "bcn_to_dly", (char *)&bcn_to_dly,
2253 ret = dhd_iovar(dhd, 0, "bcn_timeout", (char *)&bcn_timeout,
2261 ret = dhd_iovar(dhd, 0, "bcn_li_dtim", (char *)&bcn_li_dtim,
2270 ret = dhd_iovar(dhd, 0, "bcn_timeout", (char *)&bcn_timeout,
2279 ret = dhd_iovar(dhd, 0, "roam_time_thresh",
2290 ret = dhd_iovar(dhd, 0, "roam_off", (char *)&roamvar,
2297 ret = dhd_iovar(dhd, 0, "bcn_li_bcn", (char *)&bcn_li_bcn,
2305 if (dhd->ndo_enable) {
2307 ret = dhd_ndo_enable(dhd, FALSE);
2315 if (FW_SUPPORTED(dhd, ndoe)) {
2317 if (FW_SUPPORTED(dhd, ndoe) && !FW_SUPPORTED(dhd, apf)) {
2321 ret = dhd_iovar(dhd, 0, "nd_ra_filter_enable",
2329 dhd_os_suppress_logging(dhd, FALSE);
2332 ret = dhd_iovar(dhd, 0, "ipmcast_l2filter",
2340 ret = dhd_iovar(dhd, 0, "const_awake_thresh",
2349 ret = dhd_sroam_set_mon(dhd, FALSE);
2358 dhd_linux_get_primary_netdev(dhd), TRUE);
2364 dhd_irq_set_affinity(dhd, dhd->info->cpumask_primary);
2368 dhd_suspend_unlock(dhd);
2373 static int dhd_suspend_resume_helper(struct dhd_info *dhd, int val, int force)
2375 dhd_pub_t *dhdp = &dhd->pub;
2397 struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend); local
2400 if (dhd)
2401 dhd_suspend_resume_helper(dhd, 1, 0);
2406 struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend); local
2409 if (dhd)
2410 dhd_suspend_resume_helper(dhd, 0, 0);
2469 dhd_net2idx(dhd_info_t *dhd, struct net_device *net)
2473 if (!dhd) {
2479 if (dhd->iflist[i] && dhd->iflist[i]->net && (dhd->iflist[i]->net == net))
2501 dhd_ifname2idx(dhd_info_t *dhd, char *name)
2505 ASSERT(dhd);
2511 if (dhd->iflist[i] && !strncmp(dhd->iflist[i]->dngl_name, name, IFNAMSIZ))
2522 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
2524 ASSERT(dhd);
2531 if (dhd->iflist[ifidx] == NULL) {
2536 if (dhd->iflist[ifidx]->net)
2537 return dhd->iflist[ifidx]->net->name;
2546 dhd_info_t *dhd = (dhd_info_t *)dhdp; local
2548 ASSERT(dhd);
2550 if (dhd->iflist[i] && dhd->iflist[i]->bssidx == idx)
2551 return dhd->iflist[i]->mac_addr;
2557 _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
2575 if (dhd->iflist[i]) {
2576 dev = dhd->iflist[i]->net;
2589 if (!dhd->iflist[ifidx]) {
2593 dev = dhd->iflist[ifidx]->net;
2606 if (!dhd->pub.early_suspended)
2614 if (!(bufp = buf = MALLOC(dhd->pub.osh, buflen))) {
2616 dhd_ifname(&dhd->pub, ifidx), cnt));
2630 if (dhd->iflist[i]) {
2632 dev = dhd->iflist[i]->net;
2680 ret = dhd_wl_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
2683 dhd_ifname(&dhd->pub, ifidx), cnt));
2687 MFREE(dhd->pub.osh, buf, buflen);
2695 ret = dhd_iovar(&dhd->pub, ifidx, "allmulti", (char *)&allmulti,
2699 dhd_ifname(&dhd->pub, ifidx), ltoh32(allmulti)));
2707 if (dhd->iflist[i]) {
2708 dev = dhd->iflist[i]->net;
2724 ret = dhd_wl_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
2727 dhd_ifname(&dhd->pub, ifidx), ltoh32(allmulti)));
2732 _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, uint8 *addr)
2736 ret = dhd_iovar(&dhd->pub, ifidx, "cur_etheraddr", (char *)addr,
2739 DHD_ERROR(("%s: set cur_etheraddr failed\n", dhd_ifname(&dhd->pub, ifidx)));
2741 memcpy(dhd->iflist[ifidx]->net->dev_addr, addr, ETHER_ADDR_LEN);
2743 memcpy(dhd->pub.mac.octet, addr, ETHER_ADDR_LEN);
2758 dhd_info_t *dhd = dhdp->info; local
2759 return (int)dhd->psta_mode;
2764 dhd_info_t *dhd = dhdp->info; local
2765 dhd->psta_mode = val;
2774 dhd_info_t *dhd = dhdp->info; local
2779 ifp = dhd->iflist[idx];
2786 (dhd->wet_mode) ||
2801 dhd_info_t *dhd = dhdp->info; local
2802 return (int)dhd->wet_mode;
2808 dhd_info_t *dhd = dhdp->info; local
2809 dhd->wet_mode = val;
2841 dhd_info_t *dhd = handle; local
2857 if (!dhd) {
2867 dhd_net_if_lock_local(dhd);
2868 DHD_OS_WAKE_LOCK(&dhd->pub);
2869 DHD_PERIM_LOCK(&dhd->pub);
2889 if (wl_cfg80211_post_ifcreate(dhd->pub.info->iflist[0]->net,
2900 ndev = dhd_allocate_if(&dhd->pub, ifidx, if_event->name,
2907 DHD_PERIM_UNLOCK(&dhd->pub);
2908 ret = dhd_register_if(&dhd->pub, ifidx, TRUE);
2909 DHD_PERIM_LOCK(&dhd->pub);
2912 dhd_remove_if(&dhd->pub, ifidx, TRUE);
2919 if (FW_SUPPORTED((&dhd->pub), ap) && (if_event->event.role != WLC_E_IF_ROLE_STA)) {
2921 ret = dhd_iovar(&dhd->pub, ifidx, "ap_isolate", (char *)&var_int, sizeof(var_int),
2925 dhd_remove_if(&dhd->pub, ifidx, TRUE);
2931 MFREE(dhd->pub.osh, if_event, sizeof(dhd_if_event_t));
2933 DHD_PERIM_UNLOCK(&dhd->pub);
2934 DHD_OS_WAKE_UNLOCK(&dhd->pub);
2935 dhd_net_if_unlock_local(dhd);
2941 dhd_info_t *dhd = handle; local
2950 if (!dhd) {
2960 dhd_net_if_lock_local(dhd);
2961 DHD_OS_WAKE_LOCK(&dhd->pub);
2962 DHD_PERIM_LOCK(&dhd->pub);
2967 DHD_PERIM_UNLOCK(&dhd->pub);
2968 if (!dhd->pub.info->iflist[ifidx]) {
2976 if (wl_cfg80211_post_ifdel(dhd->pub.info->iflist[ifidx]->net,
2984 dhd_remove_if(&dhd->pub, ifidx, TRUE);
2988 DHD_PERIM_LOCK(&dhd->pub);
2989 MFREE(dhd->pub.osh, if_event, sizeof(dhd_if_event_t));
2990 DHD_PERIM_UNLOCK(&dhd->pub);
2991 DHD_OS_WAKE_UNLOCK(&dhd->pub);
2992 dhd_net_if_unlock_local(dhd);
2999 dhd_info_t *dhd = handle; local
3006 if (!dhd) {
3011 dhd_net_if_lock_local(dhd);
3012 DHD_OS_WAKE_LOCK(&dhd->pub);
3013 DHD_PERIM_LOCK(&dhd->pub);
3019 DHD_GENERAL_LOCK(&dhd->pub, flags);
3021 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
3031 if (ifp == NULL || !dhd->pub.up) {
3038 if (_dhd_set_mac_address(dhd, ifp->idx, ifp->mac_addr) == 0)
3044 DHD_PERIM_UNLOCK(&dhd->pub);
3045 DHD_OS_WAKE_UNLOCK(&dhd->pub);
3046 dhd_net_if_unlock_local(dhd);
3053 dhd_info_t *dhd = handle; local
3062 if (!dhd) {
3067 dhd_net_if_lock_local(dhd);
3068 DHD_OS_WAKE_LOCK(&dhd->pub);
3069 DHD_PERIM_LOCK(&dhd->pub);
3071 ifp = dhd->iflist[ifidx];
3073 if (ifp == NULL || !dhd->pub.up) {
3082 DHD_GENERAL_LOCK(&dhd->pub, flags);
3084 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
3101 _dhd_set_multicast_list(dhd, ifidx);
3105 DHD_PERIM_UNLOCK(&dhd->pub);
3106 DHD_OS_WAKE_UNLOCK(&dhd->pub);
3107 dhd_net_if_unlock_local(dhd);
3115 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
3120 ifidx = dhd_net2idx(dhd, dev);
3124 dhdif = dhd->iflist[ifidx];
3126 dhd_net_if_lock_local(dhd);
3129 dhd_net_if_unlock_local(dhd);
3132 ret = _dhd_set_mac_address(dhd, ifidx, dhdif->mac_addr);
3135 dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)dhdif, DHD_WQ_WORK_SET_MAC,
3144 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
3147 ifidx = dhd_net2idx(dhd, dev);
3151 dhd->iflist[ifidx]->set_multicast = TRUE;
3152 dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)((long int)ifidx),
3161 dhd_info_t *dhd = dhdp->info; local
3162 return dhd->uc_path;
3240 dhd_info_t *dhd = (dhd_info_t *)(dhdp->info); local
3326 atomic_inc(&dhd->pend_8021x_cnt);
3389 atomic_dec(&dhd->pend_8021x_cnt);
3391 PKTCFREE(dhd->pub.osh, pktbuf, TRUE);
3515 dhd_info_t *dhd = DHD_DEV_INFO(net); local
3523 if (dhd_query_bus_erros(&dhd->pub)) {
3531 DHD_GENERAL_LOCK(&dhd->pub, flags);
3532 DHD_BUS_BUSY_SET_IN_TX(&dhd->pub);
3533 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
3536 if (dhdpcie_runtime_bus_wake(&dhd->pub, FALSE, dhd_start_xmit)) {
3539 DHD_GENERAL_LOCK(&dhd->pub, flags);
3540 if (!dhdpcie_is_resume_done(&dhd->pub)) {
3541 dhd_bus_stop_queue(dhd->pub.bus);
3543 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub);
3544 dhd_os_busbusy_wake(&dhd->pub);
3545 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
3550 DHD_GENERAL_LOCK(&dhd->pub, flags);
3551 if (DHD_BUS_CHECK_SUSPEND_OR_SUSPEND_IN_PROGRESS(&dhd->pub)) {
3553 __FUNCTION__, dhd->pub.busstate, dhd->pub.dhd_bus_busy_state));
3554 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub);
3557 if (DHD_BUS_CHECK_ANY_SUSPEND_IN_PROGRESS(&dhd->pub)) {
3558 dhd_bus_stop_queue(dhd->pub.bus);
3561 dhd_os_busbusy_wake(&dhd->pub);
3562 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
3566 DHD_OS_WAKE_LOCK(&dhd->pub);
3567 DHD_PERIM_LOCK_TRY(DHD_FWDER_UNIT(dhd), lock_taken);
3570 if (dhd->pub.req_hang_type == HANG_REASON_BUS_DOWN) {
3572 dhd->pub.busstate = DHD_BUS_DOWN;
3577 if (dhd->pub.hang_was_sent || DHD_BUS_CHECK_DOWN_OR_DOWN_IN_PROGRESS(&dhd->pub)) {
3579 __FUNCTION__, dhd->pub.up, dhd->pub.busstate));
3583 if (dhd->pub.up && !dhd->pub.hang_was_sent) {
3585 dhd->pub.hang_reason = HANG_REASON_BUS_DOWN;
3589 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub);
3590 dhd_os_busbusy_wake(&dhd->pub);
3591 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
3592 DHD_PERIM_UNLOCK_TRY(DHD_FWDER_UNIT(dhd), lock_taken);
3593 DHD_OS_WAKE_UNLOCK(&dhd->pub);
3604 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub);
3605 dhd_os_busbusy_wake(&dhd->pub);
3606 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
3607 DHD_PERIM_UNLOCK_TRY(DHD_FWDER_UNIT(dhd), lock_taken);
3608 DHD_OS_WAKE_UNLOCK(&dhd->pub);
3613 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
3615 ASSERT(ifidx == dhd_net2idx(dhd, net));
3616 ASSERT((ifp != NULL) && ((ifidx < DHD_MAX_IFS) && (ifp == dhd->iflist[ifidx])));
3624 PKTPUSH(dhd->pub.osh, skb, 1);
3626 PKTSETLEN(dhd->pub.osh, skb, length);
3629 datalen = PKTLEN(dhd->pub.osh, skb);
3632 if (skb_headroom(skb) < dhd->pub.hdrlen + htsfdlystat_sz) {
3636 dhd_ifname(&dhd->pub, ifidx)));
3637 dhd->pub.tx_realloc++;
3640 skb2 = skb_realloc_headroom(skb, dhd->pub.hdrlen + htsfdlystat_sz);
3645 dhd_ifname(&dhd->pub, ifidx)));
3653 if (!(pktbuf = PKTFRMNATIVE(dhd->pub.osh, skb))) {
3655 dhd_ifname(&dhd->pub, ifidx)));
3666 if (WET_ENABLED(&dhd->pub) &&
3667 (dhd_wet_send_proc(dhd->pub.wet_info, pktbuf, &pktbuf) < 0)) {
3669 __FUNCTION__, dhd_ifname(&dhd->pub, ifidx)));
3670 PKTFREE(dhd->pub.osh, pktbuf, FALSE);
3680 if (PSR_ENABLED(&dhd->pub) &&
3681 (dhd_psta_proc(&dhd->pub, ifidx, &pktbuf, TRUE) < 0)) {
3684 dhd_ifname(&dhd->pub, ifidx)));
3695 if (dhd_tcpdata_get_flag(&dhd->pub, pktbuf) == FLAG_SYNCACK) {
3701 if (dhd->pub.tcpack_sup_mode == TCPACK_SUP_HOLD) {
3703 if (dhd_tcpack_hold(&dhd->pub, pktbuf, ifidx)) {
3709 if (dhd_tcpack_suppress(&dhd->pub, pktbuf)) {
3721 ret = dhd_lb_sendpkt(dhd, net, ifidx, pktbuf);
3723 ret = __dhd_sendpkt(&dhd->pub, ifidx, pktbuf);
3729 dhd->pub.tx_dropped++;
3733 if (!dhd_wlfc_is_supported(&dhd->pub))
3736 dhd->pub.tx_packets++;
3742 DHD_GENERAL_LOCK(&dhd->pub, flags);
3743 DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub);
3745 dhd_os_tx_completion_wake(&dhd->pub);
3746 dhd_os_busbusy_wake(&dhd->pub);
3747 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
3748 DHD_PERIM_UNLOCK_TRY(DHD_FWDER_UNIT(dhd), lock_taken);
3749 DHD_OS_WAKE_UNLOCK(&dhd->pub);
3785 dhd_info_t *dhd; local
3790 dhd = DHD_DEV_INFO(work->net);
3792 bus = dhd->pub.bus;
3794 if (atomic_read(&dhd->pub.block_bus)) {
3823 dhd_info_t *dhd = DHD_DEV_INFO(net); local
3825 if (dhd->pub.busstate == DHD_BUS_SUSPEND) {
3828 dhd_netif_stop_queue(dhd->pub.bus);
3847 queue_work(dhd->tx_wq, &start_xmit_work->work);
3854 } else if (dhd->pub.busstate == DHD_BUS_DATA) {
3873 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
3883 queue_work(dhd->rx_wq, &rx_work->work);
3910 dhd_info_t *dhd = dhdp->info; local
3915 ASSERT(dhd);
3926 if (dhd->iflist[i]) {
3927 net = dhd->iflist[i]->net;
3932 if (dhd->iflist[ifidx]) {
3933 net = dhd->iflist[ifidx]->net;
3992 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
4022 dhd_dbg_trace_evnt_handler(dhdp, data, &dhd->event_data, datalen);
4036 dhd_event_logtrace_process_items(dhd_info_t *dhd)
4043 if (!dhd) {
4048 dhdp = &dhd->pub;
4055 qlen = skb_queue_len(&dhd->evt_trace_queue);
4061 skb = skb_dequeue(&dhd->evt_trace_queue);
4073 dhd_event_logtrace_infobuf_pkt_process(dhdp, skb, &dhd->event_data);
4109 skb->dev = dhd->iflist[0]->net;
4133 dhd_info_t *dhd = (dhd_info_t *)tsk->parent; local
4134 dhd_pub_t *dhdp = (dhd_pub_t *)&dhd->pub;
4142 if (dhd->pub.dongle_reset == FALSE) {
4151 if (dhd->pub.dongle_edl_support) {
4152 ret = dhd_prot_process_edl_complete(&dhd->pub,
4153 &dhd->event_data);
4155 ret = dhd_event_logtrace_process_items(dhd);
4158 ret = dhd_event_logtrace_process_items(dhd);
4205 struct dhd_info *dhd = local
4211 if (dhd->pub.dongle_edl_support) {
4212 ret = dhd_prot_process_edl_complete(&dhd->pub, &dhd->event_data);
4214 ret = dhd_event_logtrace_process_items(dhd);
4217 ret = dhd_event_logtrace_process_items(dhd);
4221 schedule_delayed_work(&(dhd)->event_log_dispatcher_work,
4232 dhd_info_t *dhd = (dhd_info_t *)dhd_info; local
4235 if (dhd->thr_logtrace_ctl.thr_pid >= 0) {
4236 binary_sema_up(&dhd->thr_logtrace_ctl);
4239 dhd->thr_logtrace_ctl.thr_pid));
4242 schedule_delayed_work(&dhd->event_log_dispatcher_work, 0);
4248 dhd_cancel_logtrace_process_sync(dhd_info_t *dhd)
4251 if (dhd->thr_logtrace_ctl.thr_pid >= 0) {
4252 PROC_STOP_USING_BINARY_SEMA(&dhd->thr_logtrace_ctl);
4255 dhd->thr_logtrace_ctl.thr_pid));
4258 cancel_delayed_work_sync(&dhd->event_log_dispatcher_work);
4263 dhd_flush_logtrace_process(dhd_info_t *dhd)
4266 if (dhd->thr_logtrace_ctl.thr_pid >= 0) {
4267 PROC_FLUSH_USING_BINARY_SEMA(&dhd->thr_logtrace_ctl);
4270 dhd->thr_logtrace_ctl.thr_pid));
4273 flush_delayed_work(&dhd->event_log_dispatcher_work);
4278 dhd_init_logtrace_process(dhd_info_t *dhd)
4281 dhd->thr_logtrace_ctl.thr_pid = DHD_PID_KT_INVALID;
4282 PROC_START(dhd_logtrace_thread, dhd, &dhd->thr_logtrace_ctl, 0, "dhd_logtrace_thread");
4283 if (dhd->thr_logtrace_ctl.thr_pid < 0) {
4288 dhd->thr_logtrace_ctl.thr_pid));
4291 INIT_DELAYED_WORK(&dhd->event_log_dispatcher_work, dhd_event_logtrace_process);
4297 dhd_reinit_logtrace_process(dhd_info_t *dhd)
4303 if (dhd->thr_logtrace_ctl.thr_pid < 0) {
4304 PROC_START(dhd_logtrace_thread, dhd, &dhd->thr_logtrace_ctl,
4306 if (dhd->thr_logtrace_ctl.thr_pid < 0) {
4311 dhd->thr_logtrace_ctl.thr_pid));
4325 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
4331 skb_queue_tail(&dhd->evt_trace_queue, pktbuf);
4333 dhd_schedule_logtrace(dhd);
4339 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
4342 while ((skb = skb_dequeue(&dhd->evt_trace_queue)) != NULL) {
4359 dhd_info_t *dhd = dhdp->info; local
4380 skb->dev = dhd->iflist[0]->net;
4392 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
4482 ifp = dhd->iflist[ifidx];
4503 if ((!ifp->net || ifp->net->reg_state != NETREG_REGISTERED || !dhd->pub.up) &&
4619 if (WET_ENABLED(&dhd->pub) && (dhd_wet_recv_proc(dhd->pub.wet_info,
4710 dhd->pub.rx_multicast++;
4765 ret_event = dhd_wl_host_event(dhd, ifidx, pkt_data, len, &event, &data);
4815 ASSERT(ifidx < DHD_MAX_IFS && dhd->iflist[ifidx]);
4816 ifp = dhd->iflist[ifidx];
4821 dhd->pub.up))
4934 DHD_PERIM_UNLOCK_ALL((dhd->fwder_unit % FWDER_MAX_UNIT));
4940 DHD_PERIM_LOCK_ALL((dhd->fwder_unit % FWDER_MAX_UNIT));
4942 if (dhd->rxthread_enabled) {
4963 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF);
4965 DHD_PERIM_UNLOCK_ALL((dhd->fwder_unit % FWDER_MAX_UNIT));
4971 DHD_PERIM_LOCK_ALL((dhd->fwder_unit % FWDER_MAX_UNIT));
4976 if (dhd->rxthread_enabled && skbhead)
4986 dhd_event(struct dhd_info *dhd, char *evpkt, int evlen, int ifidx)
4995 dhd_info_t *dhd = (dhd_info_t *)(dhdp->info); local
5005 atomic_dec(&dhd->pend_8021x_cnt);
5010 dhd_if_t *ifp = dhd->iflist[DHD_PKTTAG_IF(PKTTAG(txp))];
5011 uint datalen = PKTLEN(dhd->pub.osh, txp);
5014 dhd->pub.tx_packets++;
5028 dhd_info_t *dhd = DHD_DEV_INFO(net); local
5033 if (!dhd) {
5038 ifp = dhd_get_ifp_by_ndev(&dhd->pub, net);
5045 if (dhd->pub.up) {
5047 dhd_prot_dstats(&dhd->pub);
5060 dhd_info_t *dhd = (dhd_info_t *)tsk->parent; local
5077 DHD_OS_WD_WAKE_LOCK(&dhd->pub);
5083 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
5088 if (dhd->pub.dongle_reset == FALSE) {
5090 dhd_bus_watchdog(&dhd->pub);
5092 DHD_GENERAL_LOCK(&dhd->pub, flags);
5094 dhd->pub.tickcnt++;
5096 dhd_l2_filter_watchdog(&dhd->pub);
5101 if (dhd->wd_timer_valid) {
5102 mod_timer(&dhd->timer,
5107 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
5110 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
5122 dhd_info_t *dhd = (dhd_info_t *)data; local
5125 if (dhd->pub.dongle_reset) {
5129 if (dhd->thr_wdt_ctl.thr_pid >= 0) {
5130 up(&dhd->thr_wdt_ctl.sema);
5135 DHD_OS_WD_WAKE_LOCK(&dhd->pub);
5138 dhd_bus_watchdog(&dhd->pub);
5140 DHD_GENERAL_LOCK(&dhd->pub, flags);
5142 dhd->pub.tickcnt++;
5145 dhd_l2_filter_watchdog(&dhd->pub);
5148 if (dhd->wd_timer_valid)
5149 mod_timer(&dhd->timer, jiffies + msecs_to_jiffies(dhd_watchdog_ms));
5150 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
5152 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
5161 dhd_info_t *dhd = (dhd_info_t *)tsk->parent; local
5174 if (dhd->pub.dongle_reset == FALSE) {
5176 if (dhd->pub.up) {
5177 dhd_runtimepm_state(&dhd->pub);
5180 DHD_GENERAL_LOCK(&dhd->pub, flags);
5184 if (dhd->rpm_timer_valid) {
5185 mod_timer(&dhd->rpm_timer,
5191 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
5203 dhd_info_t *dhd = (dhd_info_t *)data; local
5205 if (dhd->pub.dongle_reset) {
5209 if (dhd->thr_rpm_ctl.thr_pid >= 0) {
5210 up(&dhd->thr_rpm_ctl.sema);
5252 dhd_info_t *dhd = container_of(nb, struct dhd_info, freq_trans); local
5254 if (dhd) {
5255 if (!dhd->new_freq)
5260 *per_cpu_ptr(dhd->new_freq, freq->cpu) = freq->new;
5271 dhd_info_t *dhd = (dhd_info_t *)tsk->parent; local
5287 dhd->pub.current_dpc = current;
5301 if (dhd->pub.busstate != DHD_BUS_DOWN) {
5305 dhd_os_wd_timer_extend(&dhd->pub, TRUE);
5306 while (dhd_bus_dpc(dhd->pub.bus)) {
5314 dhd->pub.dhd_bug_on = true;
5320 dhd_os_wd_timer_extend(&dhd->pub, FALSE);
5321 DHD_OS_WAKE_UNLOCK(&dhd->pub);
5323 if (dhd->pub.up)
5324 dhd_bus_stop(dhd->pub.bus, TRUE);
5325 DHD_OS_WAKE_UNLOCK(&dhd->pub);
5338 dhd_info_t *dhd = (dhd_info_t *)tsk->parent; local
5343 dhd_pub_t *pub = &dhd->pub;
5356 dhd->pub.current_rxf = current;
5403 dhd_info_t *dhd; local
5407 dhd = dhdp->info;
5411 __skb_queue_head_init(&dhd->rx_pend_queue);
5415 skb_queue_head_init(&dhd->tx_pend_queue);
5424 dhd_info_t *dhd; local
5430 dhd = dhdp->info;
5432 if (!dhd) {
5436 if (dhd->thr_dpc_ctl.thr_pid < 0) {
5437 tasklet_kill(&dhd->tasklet);
5443 cancel_work_sync(&dhd->rx_napi_dispatcher_work);
5444 __skb_queue_purge(&dhd->rx_pend_queue);
5447 cancel_work_sync(&dhd->tx_dispatcher_work);
5448 skb_queue_purge(&dhd->tx_pend_queue);
5453 tasklet_kill(&dhd->tx_compl_tasklet);
5456 tasklet_kill(&dhd->rx_compl_tasklet);
5459 tasklet_kill(&dhd->tx_tasklet);
5467 dhd_info_t *dhd; local
5473 dhd = dhdp->info;
5475 if (!dhd) {
5479 if (dhd->thr_dpc_ctl.thr_pid < 0) {
5480 tasklet_kill(&dhd->tasklet);
5488 dhd_info_t *dhd; local
5490 dhd = (dhd_info_t *)data;
5497 if (dhd->pub.busstate != DHD_BUS_DOWN) {
5499 DHD_LB_STATS_INCR(dhd->dhd_dpc_cnt);
5501 if (dhd_bus_dpc(dhd->pub.bus)) {
5502 tasklet_schedule(&dhd->tasklet);
5505 dhd_bus_stop(dhd->pub.bus, TRUE);
5512 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
5514 if (dhd->thr_dpc_ctl.thr_pid >= 0) {
5519 if (!binary_sema_up(&dhd->thr_dpc_ctl)) {
5525 tasklet_schedule(&dhd->tasklet);
5532 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
5541 if (dhd->thr_rxf_ctl.thr_pid >= 0) {
5542 up(&dhd->thr_rxf_ctl.sema);
5553 dhd_toe_get(dhd_info_t *dhd, int ifidx, uint32 *toe_ol)
5558 ret = dhd_iovar(&dhd->pub, ifidx, "toe_ol", NULL, 0, (char *)&buf, sizeof(buf), FALSE);
5562 DHD_ERROR(("%s: toe not supported by device\n", dhd_ifname(&dhd->pub,
5567 DHD_INFO(("%s: could not get toe_ol: ret=%d\n", dhd_ifname(&dhd->pub, ifidx), ret));
5577 dhd_toe_set(dhd_info_t *dhd, int ifidx, uint32 toe_ol)
5582 ret = dhd_iovar(&dhd->pub, ifidx, "toe_ol", (char *)&toe_ol, sizeof(toe_ol), NULL, 0, TRUE);
5585 dhd_ifname(&dhd->pub, ifidx), ret));
5591 ret = dhd_iovar(&dhd->pub, ifidx, "toe", (char *)&toe, sizeof(toe), NULL, 0, TRUE);
5593 DHD_ERROR(("%s: could not set toe: ret=%d\n", dhd_ifname(&dhd->pub, ifidx), ret));
5602 void dhd_set_scb_probe(dhd_pub_t *dhd)
5608 if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE) {
5612 ret = dhd_iovar(dhd, 0, "scb_probe", NULL, 0, iovbuf, sizeof(iovbuf), FALSE);
5621 ret = dhd_iovar(dhd, 0, "scb_probe", (char *)&scb_probe, sizeof(wl_scb_probe_t), NULL, 0,
5633 dhd_info_t *dhd = DHD_DEV_INFO(net); local
5636 snprintf(info->version, sizeof(info->version), "%lu", dhd->pub.drv_version);
5644 dhd_ethtool(dhd_info_t *dhd, void *uaddr)
5681 else if (!dhd->pub.up) {
5687 else if (dhd->pub.iswl)
5692 snprintf(info.version, sizeof(info.version), "%lu", dhd->pub.drv_version);
5703 if ((ret = dhd_toe_get(dhd, 0, &toe_cmpnt)) < 0)
5722 if ((ret = dhd_toe_get(dhd, 0, &toe_cmpnt)) < 0)
5732 if ((ret = dhd_toe_set(dhd, 0, toe_cmpnt)) < 0)
5738 dhd->iflist[0]->net->features |= NETIF_F_IP_CSUM;
5740 dhd->iflist[0]->net->features &= ~NETIF_F_IP_CSUM;
5805 dhd_monitor_enabled(dhd_pub_t *dhd, int ifidx)
5807 return (dhd->info->monitor_type != 0);
5813 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
5820 if (!dhd->monitor_skb) {
5821 if ((dhd->monitor_skb = PKTTONATIVE(dhdp->osh, pkt))
5825 if (dhd->monitor_type && dhd->monitor_dev)
5826 dhd->monitor_skb->dev = dhd->monitor_dev;
5829 dhd->monitor_skb = NULL;
5832 dhd->monitor_skb->protocol =
5833 eth_type_trans(dhd->monitor_skb, dhd->monitor_skb->dev);
5834 dhd->monitor_len = 0;
5838 if (!dhd->monitor_skb) {
5839 if ((dhd->monitor_skb = dev_alloc_skb(MAX_MON_PKT_SIZE))
5842 dhd->monitor_len = 0;
5844 if (dhd->monitor_type && dhd->monitor_dev)
5845 dhd->monitor_skb->dev = dhd->monitor_dev;
5848 dev_kfree_skb(dhd->monitor_skb);
5851 memcpy(PKTDATA(dhdp->osh, dhd->monitor_skb),
5853 dhd->monitor_len = PKTLEN(dhdp->osh, pkt);
5858 memcpy(PKTDATA(dhdp->osh, dhd->monitor_skb) + dhd->monitor_len,
5860 dhd->monitor_len += PKTLEN(dhdp->osh, pkt);
5865 memcpy(PKTDATA(dhdp->osh, dhd->monitor_skb) + dhd->monitor_len,
5867 dhd->monitor_len += PKTLEN(dhdp->osh, pkt);
5869 skb_put(dhd->monitor_skb, dhd->monitor_len);
5870 dhd->monitor_skb->protocol =
5871 eth_type_trans(dhd->monitor_skb, dhd->monitor_skb->dev);
5872 dhd->monitor_len = 0;
5880 DHD_PERIM_UNLOCK_ALL((dhd->fwder_unit % FWDER_MAX_UNIT));
5881 netif_rx(dhd->monitor_skb);
5882 DHD_PERIM_LOCK_ALL((dhd->fwder_unit % FWDER_MAX_UNIT));
5890 bcm_object_trace_opr(dhd->monitor_skb, BCM_OBJDBG_REMOVE,
5893 DHD_PERIM_UNLOCK_ALL((dhd->fwder_unit % FWDER_MAX_UNIT));
5894 netif_rx_ni(dhd->monitor_skb);
5895 DHD_PERIM_LOCK_ALL((dhd->fwder_unit % FWDER_MAX_UNIT));
5898 dhd->monitor_skb = NULL;
5946 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
5949 mutex_lock(&dhd->bus_user_lock);
5950 ++dhd->bus_user_count;
5951 if (dhd->bus_user_count < 0) {
5957 if (dhd->bus_user_count == 1) {
5959 dhd->pub.hang_was_sent = 0;
5964 if (!wifi_platform_set_power(dhd->adapter, TRUE, WIFI_TURNON_DELAY)) {
5974 dhd_update_fw_nv_path(dhd);
5976 dhd_bus_update_fw_nv_path(dhd->pub.bus,
5977 dhd->fw_path, dhd->nv_path);
5983 if (dhd_sync_with_dongle(&dhd->pub) < 0) {
5992 __FUNCTION__, dhd->bus_user_count));
5995 mutex_unlock(&dhd->bus_user_lock);
6008 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
6012 mutex_lock(&dhd->bus_user_lock);
6013 --dhd->bus_user_count;
6014 if (dhd->bus_user_count < 0) {
6016 dhd->bus_user_count = 0;
6021 if (dhd->bus_user_count == 0) {
6026 if (dhd->pub.wlfc_enabled) {
6027 dhd_wlfc_deinit(&dhd->pub);
6031 if (dhd->pub.pno_state) {
6032 dhd_pno_deinit(&dhd->pub);
6036 if (dhd->pub.rtt_state) {
6037 dhd_rtt_deinit(&dhd->pub);
6043 wifi_platform_set_power(dhd->adapter, FALSE, WIFI_TURNOFF_DELAY);
6047 __FUNCTION__, dhd->bus_user_count));
6050 mutex_unlock(&dhd->bus_user_lock);
6058 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
6059 return dhd_bus_get(&dhd->pub, WLAN_MODULE);
6065 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
6066 return dhd_bus_put(&dhd->pub, WLAN_MODULE);
6138 dhd_info_t *dhd = (dhd_info_t*)dhdp->info; local
6142 dhd_os_send_hang_message(&dhd->pub);
6168 dhd_add_monitor_if(dhd_info_t *dhd)
6175 if (!dhd) {
6180 if (dhd->monitor_dev) {
6193 snprintf(dev->name, sizeof(dev->name), "%s%u", devname, dhd->unit);
6214 if (FW_SUPPORTED((&dhd->pub), monitor)) {
6217 DHD_DISABLE_RUNTIME_PM(&dhd->pub);
6222 ret = dhd_iovar(&dhd->pub, 0, "scansuppress", (char *)&scan_suppress,
6229 dhd->monitor_dev = dev;
6233 dhd_del_monitor_if(dhd_info_t *dhd)
6238 if (!dhd) {
6243 if (!dhd->monitor_dev) {
6248 if (FW_SUPPORTED((&dhd->pub), monitor)) {
6251 DHD_ENABLE_RUNTIME_PM(&dhd->pub);
6256 ret = dhd_iovar(&dhd->pub, 0, "scansuppress", (char *)&scan_suppress,
6263 if (dhd->monitor_dev) {
6264 if (dhd->monitor_dev->reg_state == NETREG_UNINITIALIZED) {
6265 free_netdev(dhd->monitor_dev);
6267 unregister_netdevice(dhd->monitor_dev);
6269 dhd->monitor_dev = NULL;
6276 dhd_info_t *dhd = pub->info; local
6280 dhd_net_if_lock_local(dhd);
6283 dhd_del_monitor_if(dhd);
6286 dhd_add_monitor_if(dhd);
6288 dhd->monitor_type = val;
6289 dhd_net_if_unlock_local(dhd);
6313 dhd_pub_t *dhd; local
6325 dhd = &dhd_info->pub;
6334 dhd_h2d_log_time_sync(dhd);
6452 dhd_info_t *dhd = DHD_DEV_INFO(net); local
6470 DHD_OS_WAKE_LOCK(&dhd->pub);
6471 DHD_PERIM_LOCK(&dhd->pub);
6476 if (!dhd_download_fw_on_driverload && dhd->pub.up == FALSE) {
6478 DHD_PERIM_UNLOCK(&dhd->pub);
6479 DHD_OS_WAKE_UNLOCK(&dhd->pub);
6485 ifidx = dhd_net2idx(dhd, net);
6490 if (dhd_is_static_ndev(&dhd->pub, net) && !(net->flags & IFF_UP)) {
6491 DHD_PERIM_UNLOCK(&dhd->pub);
6492 DHD_OS_WAKE_UNLOCK(&dhd->pub);
6499 DHD_PERIM_UNLOCK(&dhd->pub);
6500 DHD_OS_WAKE_UNLOCK(&dhd->pub);
6509 DHD_PERIM_UNLOCK(&dhd->pub);
6510 DHD_OS_WAKE_UNLOCK(&dhd->pub);
6516 ret = dhd_ethtool(dhd, (void*)ifr->ifr_data);
6517 DHD_PERIM_UNLOCK(&dhd->pub);
6518 DHD_OS_WAKE_UNLOCK(&dhd->pub);
6525 dhd_check_hang(net, &dhd->pub, ret);
6526 DHD_PERIM_UNLOCK(&dhd->pub);
6527 DHD_OS_WAKE_UNLOCK(&dhd->pub);
6534 DHD_PERIM_UNLOCK(&dhd->pub);
6535 DHD_OS_WAKE_UNLOCK(&dhd->pub);
6566 if (!(local_buf = MALLOC(dhd->pub.osh, buflen+1))) {
6571 DHD_PERIM_UNLOCK(&dhd->pub);
6573 DHD_PERIM_LOCK(&dhd->pub);
6577 DHD_PERIM_LOCK(&dhd->pub);
6590 if (ioc.driver != DHD_IOCTL_MAGIC && dhd->pub.hang_was_sent) {
6592 DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_ENABLE(&dhd->pub, DHD_EVENT_TIMEOUT_MS);
6598 bcmerror = dhd_ioctl_process(&dhd->pub, ifidx, &ioc, local_buf);
6604 DHD_PERIM_UNLOCK(&dhd->pub);
6607 DHD_PERIM_LOCK(&dhd->pub);
6612 MFREE(dhd->pub.osh, local_buf, buflen+1);
6614 DHD_PERIM_UNLOCK(&dhd->pub);
6615 DHD_OS_WAKE_UNLOCK(&dhd->pub);
6628 static int dhd_init_cpufreq_fix(dhd_info_t *dhd)
6630 if (dhd) {
6632 mutex_init(&dhd->cpufreq_fix);
6634 dhd->cpufreq_fix_status = FALSE;
6639 static void dhd_fix_cpu_freq(dhd_info_t *dhd)
6642 mutex_lock(&dhd->cpufreq_fix);
6644 if (dhd && !dhd->cpufreq_fix_status) {
6645 pm_qos_add_request(&dhd->dhd_cpu_qos, PM_QOS_CPU_FREQ_MIN, 300000);
6647 pm_qos_add_request(&dhd->dhd_bus_qos, PM_QOS_BUS_THROUGHPUT, 400000);
6651 dhd->cpufreq_fix_status = TRUE;
6654 mutex_unlock(&dhd->cpufreq_fix);
6658 static void dhd_rollback_cpu_freq(dhd_info_t *dhd)
6661 mutex_lock(&dhd ->cpufreq_fix);
6663 if (dhd && dhd->cpufreq_fix_status != TRUE) {
6665 mutex_unlock(&dhd->cpufreq_fix);
6670 pm_qos_remove_request(&dhd->dhd_cpu_qos);
6672 pm_qos_remove_request(&dhd->dhd_bus_qos);
6676 dhd->cpufreq_fix_status = FALSE;
6678 mutex_unlock(&dhd->cpufreq_fix);
6688 dhd_info_t *dhd = DHD_DEV_INFO(net); local
6690 if (atomic_read(&dhd->pub.block_bus))
6693 if (pm_runtime_get_sync(dhd_bus_to_dev(dhd->pub.bus)) < 0)
6698 pm_runtime_mark_last_busy(dhd_bus_to_dev(dhd->pub.bus));
6699 pm_runtime_put_autosuspend(dhd_bus_to_dev(dhd->pub.bus));
6716 dhd_info_t *dhd = DHD_DEV_INFO(net); local
6717 DHD_OS_WAKE_LOCK(&dhd->pub);
6718 DHD_PERIM_LOCK(&dhd->pub);
6720 dhd->pub.rxcnt_timeout = 0;
6721 dhd->pub.txcnt_timeout = 0;
6724 dhd->pub.d3ackcnt_timeout = 0;
6727 mutex_lock(&dhd->pub.ndev_op_sync);
6729 if (dhd->pub.up == 0) {
6733 if (dhd->pub.req_hang_type) {
6735 __FUNCTION__, dhd->pub.req_hang_type));
6736 dhd->pub.req_hang_type = 0;
6743 if (dhd_get_fw_mode(dhd) == DHD_FLAG_HOSTAP_MODE)
6744 dhd_rollback_cpu_freq(dhd);
6747 ifidx = dhd_net2idx(dhd, net);
6775 DHD_DISABLE_RUNTIME_PM(&dhd->pub);
6777 spin_lock_irqsave(&dhd->pub.up_lock, flags);
6778 dhd->pub.up = 0;
6779 spin_unlock_irqrestore(&dhd->pub.up_lock, flags);
6781 dhd->pub.up = 0;
6789 ifp = dhd->iflist[0];
6795 DHD_STATLOG_CTRL(&dhd->pub, ST(WLAN_POWER_OFF), ifidx, 0);
6796 if ((dhd->dhd_state & DHD_ATTACH_STATE_ADD_IF) &&
6797 (dhd->dhd_state & DHD_ATTACH_STATE_CFG80211)) {
6803 dhd_cleanup_m4_state_work(&dhd->pub, ifidx);
6806 dhd_dump_pkt_clear(&dhd->pub);
6809 dhd_net_if_lock_local(dhd);
6811 dhd_remove_if(&dhd->pub, i, FALSE);
6828 dhd_net_if_unlock_local(dhd);
6830 cancel_work_sync(dhd->dhd_deferred_wq);
6834 dhd_cancel_logtrace_process_sync(dhd);
6838 __skb_queue_purge(&dhd->rx_pend_queue);
6842 skb_queue_purge(&dhd->tx_pend_queue);
6850 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF);
6853 if (ifp && ifp->net == dhd->rx_napi_netdev) {
6855 __FUNCTION__, &dhd->rx_napi_struct, net, net->name));
6856 skb_queue_purge(&dhd->rx_napi_queue);
6857 napi_disable(&dhd->rx_napi_struct);
6858 netif_napi_del(&dhd->rx_napi_struct);
6859 dhd->rx_napi_netdev = NULL;
6865 DHD_SSSR_DUMP_DEINIT(&dhd->pub);
6868 dhd_wlfc_cleanup(&dhd->pub, NULL, 0);
6873 dhd_event_logtrace_flush_queue(&dhd->pub);
6874 if (dhd->dhd_state & DHD_ATTACH_LOGTRACE_INIT) {
6875 if (dhd->event_data.fmts) {
6876 MFREE(dhd->pub.osh, dhd->event_data.fmts,
6877 dhd->event_data.fmts_size);
6878 dhd->event_data.fmts = NULL;
6880 if (dhd->event_data.raw_fmts) {
6881 MFREE(dhd->pub.osh, dhd->event_data.raw_fmts,
6882 dhd->event_data.raw_fmts_size);
6883 dhd->event_data.raw_fmts = NULL;
6885 if (dhd->event_data.raw_sstr) {
6886 MFREE(dhd->pub.osh, dhd->event_data.raw_sstr,
6887 dhd->event_data.raw_sstr_size);
6888 dhd->event_data.raw_sstr = NULL;
6890 if (dhd->event_data.rom_raw_sstr) {
6891 MFREE(dhd->pub.osh, dhd->event_data.rom_raw_sstr,
6892 dhd->event_data.rom_raw_sstr_size);
6893 dhd->event_data.rom_raw_sstr = NULL;
6895 dhd->dhd_state &= ~DHD_ATTACH_LOGTRACE_INIT;
6904 dhd_prot_stop(&dhd->pub);
6912 dhd_bus_put(&dhd->pub, WLAN_MODULE);
6931 dhd->pub.hang_was_sent = 0;
6932 dhd->pub.hang_was_pending = 0;
6936 dhd->pub.dhd_cspec.country_abbrev[0] = 0x00;
6937 dhd->pub.dhd_cspec.rev = 0;
6938 dhd->pub.dhd_cspec.ccode[0] = 0x00;
6946 DHD_PERIM_UNLOCK(&dhd->pub);
6947 DHD_OS_WAKE_UNLOCK(&dhd->pub);
6951 (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT) &&
6953 DHD_OS_WAKE_LOCK_DESTROY(dhd);
6954 dhd->dhd_state &= ~DHD_ATTACH_STATE_WAKELOCKS_INIT;
6957 mutex_unlock(&dhd->pub.ndev_op_sync);
6967 static int dhd_interworking_enable(dhd_pub_t *dhd)
6972 ret = dhd_iovar(dhd, 0, "interworking", (char *)&enable, sizeof(enable), NULL, 0, TRUE);
6984 dhd_info_t *dhd = DHD_DEV_INFO(net); local
6993 if (dhd->pub.hang_was_sent == 1) {
6998 if (!dhd_download_fw_on_driverload && dhd->pub.up == 1) {
7007 mutex_lock(&dhd->pub.ndev_op_sync);
7009 if (dhd->pub.up == 1) {
7012 mutex_unlock(&dhd->pub.ndev_op_sync);
7019 mutex_unlock(&dhd->pub.ndev_op_sync);
7023 if (!(dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) {
7024 DHD_OS_WAKE_LOCK_INIT(dhd);
7025 dhd->dhd_state |= DHD_ATTACH_STATE_WAKELOCKS_INIT;
7029 skb_queue_head_init(&dhd->evt_trace_queue);
7031 if (!(dhd->dhd_state & DHD_ATTACH_LOGTRACE_INIT)) {
7032 ret = dhd_init_logstrs_array(dhd->pub.osh, &dhd->event_data);
7034 dhd_init_static_strs_array(dhd->pub.osh, &dhd->event_data,
7036 dhd_init_static_strs_array(dhd->pub.osh, &dhd->event_data,
7038 dhd->dhd_state |= DHD_ATTACH_LOGTRACE_INIT;
7053 DHD_OS_WAKE_LOCK(&dhd->pub);
7054 DHD_PERIM_LOCK(&dhd->pub);
7055 dhd->pub.dongle_trap_occured = 0;
7056 dhd->pub.hang_was_sent = 0;
7057 dhd->pub.hang_was_pending = 0;
7058 dhd->pub.hang_reason = 0;
7059 dhd->pub.iovar_timeout_occured = 0;
7061 dhd->pub.d3ack_timeout_occured = 0;
7062 dhd->pub.livelock_occured = 0;
7063 dhd->pub.pktid_audit_failed = 0;
7065 dhd->pub.iface_op_failed = 0;
7066 dhd->pub.scan_timeout_occurred = 0;
7067 dhd->pub.scan_busy_occurred = 0;
7068 dhd->pub.smmu_fault_occurred = 0;
7071 dhd->pub.dequeue_prec_map = ALLPRIO;
7089 ifidx = dhd_net2idx(dhd, net);
7098 if (!dhd->iflist[ifidx]) {
7105 atomic_set(&dhd->pend_8021x_cnt, 0);
7109 DHD_STATLOG_CTRL(&dhd->pub, ST(WLAN_POWER_ON), ifidx, 0);
7120 if (dhd_reinit_logtrace_process(dhd) != BCME_OK) {
7125 ret = dhd_bus_get(&dhd->pub, WLAN_MODULE);
7153 if (dhd_get_fw_mode(dhd) == DHD_FLAG_HOSTAP_MODE) {
7154 dhd_init_cpufreq_fix(dhd);
7155 dhd_fix_cpu_freq(dhd);
7160 if (dhd->pub.busstate != DHD_BUS_DATA) {
7163 DHD_PERIM_UNLOCK(&dhd->pub);
7166 if (pm_runtime_get_sync(dhd_bus_to_dev(dhd->pub.bus)) >= 0) {
7167 ret = dhd_bus_start(&dhd->pub);
7168 pm_runtime_mark_last_busy(dhd_bus_to_dev(dhd->pub.bus));
7169 pm_runtime_put_autosuspend(dhd_bus_to_dev(dhd->pub.bus));
7172 ret = dhd_bus_start(&dhd->pub);
7175 DHD_PERIM_LOCK(&dhd->pub);
7185 if (dhd->pub.is_bt_recovery_required) {
7189 dhd->pub.is_bt_recovery_required = FALSE;
7193 memcpy(net->dev_addr, dhd->pub.mac.octet, ETHER_ADDR_LEN);
7197 if (dhd_toe_get(dhd, ifidx, &toe_ol) >= 0 && (toe_ol & TOE_TX_CSUM_OL) != 0) {
7198 dhd->iflist[ifidx]->net->features |= NETIF_F_IP_CSUM;
7200 dhd->iflist[ifidx]->net->features &= ~NETIF_F_IP_CSUM;
7205 __skb_queue_head_init(&dhd->rx_pend_queue);
7206 if (dhd->rx_napi_netdev == NULL) {
7207 dhd->rx_napi_netdev = dhd->iflist[ifidx]->net;
7208 memset(&dhd->rx_napi_struct, 0, sizeof(struct napi_struct));
7209 netif_napi_add(dhd->rx_napi_netdev, &dhd->rx_napi_struct,
7212 __FUNCTION__, &dhd->rx_napi_struct, net, net->name));
7213 napi_enable(&dhd->rx_napi_struct);
7215 skb_queue_head_init(&dhd->rx_napi_queue);
7221 skb_queue_head_init(&dhd->tx_pend_queue);
7232 dhd->pend_ipaddr = 0;
7247 dhd_bus_aspm_enable_rc_ep(dhd->pub.bus, TRUE);
7250 dhd_irq_set_affinity(&dhd->pub, cpumask_of(0));
7253 dhd_irq_set_affinity(&dhd->pub, dhd->cpumask_primary);
7260 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF);
7262 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF);
7266 dhd_set_scb_probe(&dhd->pub);
7271 dhd->pub.up = 1;
7275 dhd->pub.wl_event_enabled = true;
7277 dhd->pub.wl_event_enabled = false;
7282 dhd->pub.logtrace_pkt_sendup = true;
7284 dhd->pub.logtrace_pkt_sendup = false;
7290 dhd_dbgfs_init(&dhd->pub);
7294 mutex_unlock(&dhd->pub.ndev_op_sync);
7299 DHD_PERIM_UNLOCK(&dhd->pub);
7300 DHD_OS_WAKE_UNLOCK(&dhd->pub);
7398 dhd_info_t *dhd = DHD_DEV_INFO(net); local
7413 if (dhd->pub.up == 0) {
7434 dhd_info_t *dhd = NULL; local
7451 dhd = DHD_DEV_INFO(net);
7455 if (dhd->pub.busstate == DHD_BUS_DATA) {
7547 dhd_info_t *dhd = handle; local
7549 dhd_nfct_info_t *nfct = dhd->pub.nfct;
7556 if (!dhd) {
7579 dhd_natoe_ct_event(dhd_pub_t *dhd, char *data)
7583 if (dhd->nfct) {
7584 wl_event_data_natoe_t *natoe = dhd->nfct->natoe_info;
7587 spin_lock_bh(&dhd->nfct_lock);
7589 spin_unlock_bh(&dhd->nfct_lock);
7592 dhd_deferred_schedule_work(dhd->info->dhd_deferred_wq,
7606 dhd_info_t *dhd = handle; local
7614 if (!dhd) {
7619 if (dhd_natoe_prep_send_exception_port_ioctl(&dhd->pub, ct_ioc) < 0) {
7628 dhd_natoe_ct_ioctl_schedule_work(dhd_pub_t *dhd, dhd_ct_ioc_t *ioc)
7631 dhd_deferred_schedule_work(dhd->info->dhd_deferred_wq, (void *)ioc,
8394 dhd_info_t *dhd = NULL; local
8423 dhd = wifi_platform_prealloc(adapter, DHD_PREALLOC_DHD_INFO, sizeof(dhd_info_t));
8424 if (dhd == NULL) {
8425 dhd = MALLOC(osh, sizeof(dhd_info_t));
8426 if (dhd == NULL) {
8431 memset(dhd, 0, sizeof(dhd_info_t));
8434 dhd->unit = dhd_found + instance_base; /* do not increment dhd_found, yet */
8436 dhd->pub.osh = osh;
8438 dll_init(&(dhd->pub.dump_iovlist_head));
8440 dhd->pub.dhd_console_ms = dhd_console_ms; /* assigns default value */
8441 dhd->adapter = adapter;
8443 dhd->pub.is_bt_recovery_required = FALSE;
8444 mutex_init(&dhd->bus_user_lock);
8447 g_dhd_pub = &dhd->pub;
8450 dll_init(&(dhd->pub.mw_list_head));
8454 wifi_platform_get_mac_addr(dhd->adapter, dhd->pub.mac.octet);
8457 dhd->pub.dhd_cflags |= WLAN_PLAT_NODFS_FLAG;
8458 dhd->pub.force_country_change = TRUE;
8461 get_customized_country_code(dhd->adapter,
8462 dhd->pub.dhd_cspec.country_abbrev, &dhd->pub.dhd_cspec,
8463 dhd->pub.dhd_cflags);
8465 dhd->thr_dpc_ctl.thr_pid = DHD_PID_KT_TL_INVALID;
8466 dhd->thr_wdt_ctl.thr_pid = DHD_PID_KT_INVALID;
8468 dhd->pub.wet_info = dhd_get_wet_info(&dhd->pub);
8471 sema_init(&dhd->sdsem, 1);
8473 dhd->pub.pcie_txs_metadata_enable = pcie_txs_metadata_enable;
8476 dhd->pub.info = dhd;
8479 dhd->pub.bus = bus;
8480 dhd->pub.hdrlen = bus_hdrlen;
8481 dhd->pub.txoff = FALSE;
8487 dhd_update_fw_nv_path(dhd);
8502 net = dhd_allocate_if(&dhd->pub, 0, if_name, NULL, 0, TRUE, NULL);
8506 mutex_init(&dhd->pub.ndev_op_sync);
8511 dhd->pub.l2_filter_cnt = 0;
8515 mutex_init(&dhd->dhd_iovar_mutex);
8516 sema_init(&dhd->proto_sem, 1);
8518 if (!(dhd_ulp_init(osh, &dhd->pub)))
8523 dhd->pub.req_hang_type = 0;
8527 spin_lock_init(&dhd->wlfc_spinlock);
8529 dhd->pub.skip_fc = dhd_wlfc_skip_fc;
8530 dhd->pub.plat_init = dhd_wlfc_plat_init;
8531 dhd->pub.plat_deinit = dhd_wlfc_plat_deinit;
8534 init_waitqueue_head(&dhd->pub.wlfc_wqhead);
8535 dhd->pub.wlfc_thread = kthread_create(dhd_wlfc_transfer_packets, &dhd->pub, "wlfc-thread");
8536 if (IS_ERR(dhd->pub.wlfc_thread)) {
8540 wake_up_process(dhd->pub.wlfc_thread);
8546 init_waitqueue_head(&dhd->ioctl_resp_wait);
8547 init_waitqueue_head(&dhd->d3ack_wait);
8548 init_waitqueue_head(&dhd->ctrl_wait);
8549 init_waitqueue_head(&dhd->dhd_bus_busy_state_wait);
8550 init_waitqueue_head(&dhd->dmaxfer_wait);
8551 init_waitqueue_head(&dhd->pub.tx_completion_wait);
8552 dhd->pub.dhd_bus_busy_state = 0;
8554 spin_lock_init(&dhd->sdlock);
8555 spin_lock_init(&dhd->txqlock);
8556 spin_lock_init(&dhd->dhd_lock);
8557 spin_lock_init(&dhd->rxf_lock);
8559 spin_lock_init(&dhd->pub.tdls_lock);
8562 dhd->rxthread_enabled = TRUE;
8566 spin_lock_init(&dhd->tcpack_lock);
8570 spin_lock_init(&dhd->wakelock_spinlock);
8571 spin_lock_init(&dhd->wakelock_evt_spinlock);
8572 DHD_OS_WAKE_LOCK_INIT(dhd);
8573 dhd->wakelock_counter = 0;
8576 wake_lock_init(&dhd->wl_wdwake, WAKE_LOCK_SUSPEND, "wlan_wd_wake");
8580 mutex_init(&dhd->dhd_net_if_mutex);
8581 mutex_init(&dhd->dhd_suspend_mutex);
8583 mutex_init(&dhd->dhd_apf_mutex);
8589 if (dhd_prot_attach(&dhd->pub) != 0) {
8596 spin_lock_init(&dhd->pub.up_lock);
8598 if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) {
8603 dhd_monitor_init(&dhd->pub);
8610 if (wl_iw_attach(net, (void *)&dhd->pub) != 0) {
8619 ret = dhd_init_logstrs_array(osh, &dhd->event_data);
8621 dhd_init_static_strs_array(osh, &dhd->event_data, st_str_file_path, map_file_path);
8622 dhd_init_static_strs_array(osh, &dhd->event_data, rom_st_str_file_path,
8629 if (dhd_os_dbg_attach(&dhd->pub)) {
8636 dhd_os_start_logging(&dhd->pub, FW_VERBOSE_RING_NAME, 3, 0, 0, 0);
8640 dhd->pub.dbg->pkt_mon_lock = dhd_os_spin_lock_init(dhd->pub.osh);
8642 dhd_os_dbg_attach_pkt_monitor(&dhd->pub);
8648 dhd->pub.statlog = dhd_attach_statlog(&dhd->pub, MAX_STATLOG_ITEM,
8650 if (dhd->pub.statlog == NULL) {
8656 dhd_log_dump_init(&dhd->pub);
8659 dhd_dump_pkt_init(&dhd->pub);
8662 dhd_os_attach_pktlog(&dhd->pub);
8666 dhd->pub.hang_info = MALLOCZ(osh, VENDOR_SEND_HANG_EXT_INFO_LEN);
8667 if (dhd->pub.hang_info == NULL) {
8671 if (dhd_sta_pool_init(&dhd->pub, DHD_MAX_STA) != BCME_OK) {
8677 dhd->tx_wq = alloc_workqueue("bcmdhd-tx-wq", WQ_HIGHPRI | WQ_UNBOUND | WQ_MEM_RECLAIM, 1);
8678 if (!dhd->tx_wq) {
8682 dhd->rx_wq = alloc_workqueue("bcmdhd-rx-wq", WQ_HIGHPRI | WQ_UNBOUND | WQ_MEM_RECLAIM, 1);
8683 if (!dhd->rx_wq) {
8685 destroy_workqueue(dhd->tx_wq);
8686 dhd->tx_wq = NULL;
8692 init_timer_compat(&dhd->timer, dhd_watchdog, dhd);
8693 dhd->default_wd_interval = dhd_watchdog_ms;
8697 PROC_START(dhd_watchdog_thread, dhd, &dhd->thr_wdt_ctl, 0, "dhd_watchdog_thread");
8698 if (dhd->thr_wdt_ctl.thr_pid < 0) {
8703 dhd->thr_wdt_ctl.thr_pid = -1;
8708 init_timer_compat(&dhd->rpm_timer, dhd_runtimepm, dhd);
8709 dhd->rpm_timer_valid = FALSE;
8711 dhd->thr_rpm_ctl.thr_pid = DHD_PID_KT_INVALID;
8712 PROC_START(dhd_rpm_state_thread, dhd, &dhd->thr_rpm_ctl, 0, "dhd_rpm_state_thread");
8713 if (dhd->thr_rpm_ctl.thr_pid < 0) {
8719 skb_queue_head_init(&dhd->evt_trace_queue);
8722 dhd_dbg_ring_proc_create(&dhd->pub);
8728 PROC_START(dhd_dpc_thread, dhd, &dhd->thr_dpc_ctl, 0, "dhd_dpc");
8729 if (dhd->thr_dpc_ctl.thr_pid < 0) {
8734 tasklet_init(&dhd->tasklet, dhd_dpc, (ulong)dhd);
8735 dhd->thr_dpc_ctl.thr_pid = -1;
8738 if (dhd->rxthread_enabled) {
8739 bzero(&dhd->pub.skbbuf[0], sizeof(void *) * MAXSKBPEND);
8741 PROC_START(dhd_rxf_thread, dhd, &dhd->thr_rxf_ctl, 0, "dhd_rxf");
8742 if (dhd->thr_rxf_ctl.thr_pid < 0) {
8752 dhd->pm_notifier.notifier_call = dhd_pm_callback;
8753 dhd->pm_notifier.priority = 10;
8754 register_pm_notifier(&dhd->pm_notifier);
8760 dhd->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
8761 dhd->early_suspend.suspend = dhd_early_suspend;
8762 dhd->early_suspend.resume = dhd_late_resume;
8763 register_early_suspend(&dhd->early_suspend);
8768 dhd->pend_ipaddr = 0;
8781 dhd->dhd_deferred_wq = dhd_deferred_work_init((void *)dhd);
8783 INIT_WORK(&dhd->dhd_hang_process_work, dhd_hang_process);
8786 dhd->new_freq = alloc_percpu(int);
8787 dhd->freq_trans.notifier_call = dhd_cpufreq_notifier;
8788 cpufreq_register_notifier(&dhd->freq_trans, CPUFREQ_TRANSITION_NOTIFIER);
8792 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_DELAYTX);
8794 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_HOLD);
8796 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF);
8804 register_page_corrupt_cb(dhd_page_corrupt_cb, &dhd->pub);
8809 dhd_lb_set_default_cpus(dhd);
8810 DHD_LB_STATS_INIT(&dhd->pub);
8813 if (dhd_cpumasks_init(dhd) == 0) {
8815 dhd_select_cpu_candidacy(dhd);
8818 dhd_register_cpuhp_callback(dhd);
8826 dhd->cpu_notifier.notifier_call = NULL;
8834 atomic_set(&dhd->lb_txp_active, 1);
8837 atomic_set(&dhd->lb_txp_active, 0);
8843 atomic_set(&dhd->lb_rxp_active, 1);
8848 tasklet_init(&dhd->tx_compl_tasklet,
8849 dhd_lb_tx_compl_handler, (ulong)(&dhd->pub));
8850 INIT_WORK(&dhd->tx_compl_dispatcher_work, dhd_tx_compl_dispatcher_fn);
8854 tasklet_init(&dhd->rx_compl_tasklet,
8855 dhd_lb_rx_compl_handler, (ulong)(&dhd->pub));
8856 INIT_WORK(&dhd->rx_compl_dispatcher_work, dhd_rx_compl_dispatcher_fn);
8861 __skb_queue_head_init(&dhd->rx_pend_queue);
8862 skb_queue_head_init(&dhd->rx_napi_queue);
8864 INIT_WORK(&dhd->rx_napi_dispatcher_work, dhd_rx_napi_dispatcher_fn);
8869 INIT_WORK(&dhd->tx_dispatcher_work, dhd_tx_dispatcher_work);
8870 skb_queue_head_init(&dhd->tx_pend_queue);
8872 tasklet_init(&dhd->tx_tasklet,
8873 dhd_lb_tx_handler, (ulong)(dhd));
8881 INIT_WORK(&dhd->axi_error_dispatcher_work, dhd_axi_error_dispatcher_fn);
8885 dhd->pub.extended_trap_data = MALLOCZ(osh, BCMPCIE_EXT_TRAP_DATA_MAXLEN);
8886 if (dhd->pub.extended_trap_data == NULL) {
8890 dhd->pub.axi_err_dump = MALLOCZ(osh, sizeof(dhd_axi_error_dump_t));
8891 if (dhd->pub.axi_err_dump == NULL) {
8898 if (dhd_init_logtrace_process(dhd) != BCME_OK) {
8903 DHD_SSSR_MEMPOOL_INIT(&dhd->pub);
8907 if (DHD_EDL_MEM_INIT(&dhd->pub) != BCME_OK) {
8913 (void)dhd_sysfs_init(dhd);
8917 dhd->pub.nfct = dhd_ct_open(&dhd->pub, NFNL_SUBSYS_CTNETLINK | NFNL_SUBSYS_CTNETLINK_EXP,
8922 dhd->dhd_state = dhd_state;
8927 dhd->pub.dump_file_manage =
8928 (dhd_dump_file_manage_t *)MALLOCZ(dhd->pub.osh, sizeof(dhd_dump_file_manage_t));
8929 if (unlikely(!dhd->pub.dump_file_manage)) {
8937 dhd->pub.memdump_enabled = DUMP_DISABLED;
8939 dhd->pub.memdump_enabled = DUMP_MEMFILE_BUGON;
8941 dhd->pub.memdump_enabled = DUMP_MEMFILE;
8944 dhd_get_memdump_info(&dhd->pub);
8949 pom_handler = &dhd->pub.pom_wlan_handler;
8955 dhd->pub.pom_func_register = NULL;
8956 dhd->pub.pom_func_deregister = NULL;
8957 dhd->pub.pom_toggle_reg_on = NULL;
8959 dhd->pub.pom_func_register = symbol_get(pom_func_register);
8960 dhd->pub.pom_func_deregister = symbol_get(pom_func_deregister);
8961 dhd->pub.pom_toggle_reg_on = symbol_get(pom_toggle_reg_on);
8967 if (!dhd->pub.pom_func_register ||
8968 !dhd->pub.pom_func_deregister ||
8969 !dhd->pub.pom_toggle_reg_on) {
8975 dhd->pub.pom_func_register(pom_handler);
8976 dhd->pub.enable_erpom = TRUE;
8980 return &dhd->pub;
8985 __FUNCTION__, dhd_state, &dhd->pub));
8986 dhd->dhd_state = dhd_state;
8987 dhd_detach(&dhd->pub);
8988 dhd_free(&dhd->pub);
9474 dhd_info_t *dhd = (dhd_info_t*)dhdp->info; local
9477 if (dhd->pub.busstate == DHD_BUS_DATA && dhd_update_btfw_path(dhd, btfw_path)) {
9478 DHD_INFO(("%s: download btfw from: %s\n", __FUNCTION__, dhd->btfw_path));
9479 ret = dhd_bus_download_btfw(dhd->pub.bus, dhd->pub.osh, dhd->btfw_path);
9482 __FUNCTION__, dhd->btfw_path));
9494 dhd_info_t *dhd = (dhd_info_t*)dhdp->info; local
9500 ASSERT(dhd);
9514 dhd->pub.iface_op_failed = 0;
9515 dhd->pub.scan_timeout_occurred = 0;
9516 dhd->pub.scan_busy_occurred = 0;
9518 dhd->pub.dhd_induce_error = DHD_INDUCE_ERROR_CLEAR;
9532 if (dhd->pub.busstate == DHD_BUS_DOWN && dhd_update_fw_nv_path(dhd)) {
9534 dhd->pub.fw_download_status = FW_DOWNLOAD_IN_PROGRESS;
9535 DHD_INFO(("%s download fw %s, nv %s\n", __FUNCTION__, dhd->fw_path, dhd->nv_path));
9539 ret = dhd_bus_download_firmware(dhd->pub.bus, dhd->pub.osh,
9540 dhd->fw_path, dhd->nv_path);
9546 __FUNCTION__, dhd->fw_path));
9551 dhd->pub.fw_download_status = FW_DOWNLOAD_DONE;
9553 if (dhd->pub.busstate != DHD_BUS_LOAD) {
9563 dhd->pub.tickcnt = 0;
9564 dhd_os_wd_timer(&dhd->pub, dhd_watchdog_ms);
9567 if ((ret = dhd_bus_init(&dhd->pub, FALSE)) != 0) {
9577 DHD_ENABLE_RUNTIME_PM(&dhd->pub);
9587 DHD_GENERAL_LOCK(&dhd->pub, flags);
9588 dhd->wd_timer_valid = FALSE;
9589 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
9590 del_timer_sync(&dhd->timer);
9593 DHD_DISABLE_RUNTIME_PM(&dhd->pub);
9596 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
9604 dhd_enable_oob_intr(dhd->pub.bus, TRUE);
9610 uint32 max_h2d_rings = dhd_bus_max_h2d_queues(dhd->pub.bus);
9614 if ((ret = dhd_flow_rings_init(&dhd->pub, max_h2d_rings)) != BCME_OK) {
9625 ret = dhd_prot_init(&dhd->pub);
9628 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
9633 if (dhd->pub.busstate != DHD_BUS_DATA) {
9634 DHD_GENERAL_LOCK(&dhd->pub, flags);
9635 dhd->wd_timer_valid = FALSE;
9636 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
9637 del_timer_sync(&dhd->timer);
9639 DHD_DISABLE_RUNTIME_PM(&dhd->pub);
9644 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
9656 if ((ret = dhd_sync_with_dongle(&dhd->pub)) < 0) {
9657 DHD_GENERAL_LOCK(&dhd->pub, flags);
9658 dhd->wd_timer_valid = FALSE;
9659 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
9660 del_timer_sync(&dhd->timer);
9662 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
9680 if (dhd->pend_ipaddr) {
9682 aoe_update_host_ipv4_table(&dhd->pub, dhd->pend_ipaddr, TRUE, 0);
9684 dhd->pend_ipaddr = 0;
9693 int _dhd_tdls_enable(dhd_pub_t *dhd, bool tdls_on, bool auto_on, struct ether_addr *mac)
9705 if (!FW_SUPPORTED(dhd, tdls))
9708 if (dhd->tdls_enable == tdls_on)
9710 ret = dhd_iovar(dhd, 0, "tdls_enable", (char *)&tdls, sizeof(tdls), NULL, 0, TRUE);
9715 dhd->tdls_enable = tdls_on;
9719 ret = dhd_iovar(dhd, 0, "tdls_auto_op", (char *)&tdls_auto_op, sizeof(tdls_auto_op), NULL,
9727 ret = dhd_iovar(dhd, 0, "tdls_idle_time", (char *)&tdls_idle_time,
9733 ret = dhd_iovar(dhd, 0, "tdls_rssi_high", (char *)&tdls_rssi_high,
9739 ret = dhd_iovar(dhd, 0, "tdls_rssi_low", (char *)&tdls_rssi_low,
9745 ret = dhd_iovar(dhd, 0, "tdls_trigger_pktcnt_high", (char *)&tdls_pktcnt_high,
9751 ret = dhd_iovar(dhd, 0, "tdls_trigger_pktcnt_low", (char *)&tdls_pktcnt_low,
9764 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
9766 if (dhd)
9767 ret = _dhd_tdls_enable(&dhd->pub, tdls_on, auto_on, mac);
9773 dhd_tdls_set_mode(dhd_pub_t *dhd, bool wfd_mode)
9788 ret = _dhd_tdls_enable(dhd, false, auto_on, NULL);
9794 ret = dhd_iovar(dhd, 0, "tdls_wfd_mode", (char *)&mode, sizeof(mode), NULL, 0, TRUE);
9800 ret = _dhd_tdls_enable(dhd, true, auto_on, NULL);
9806 dhd->tdls_mode = mode;
9883 bool dhd_is_concurrent_mode(dhd_pub_t *dhd)
9885 if (!dhd)
9888 if (dhd->op_mode & DHD_FLAG_CONCURR_MULTI_CHAN_MODE)
9890 else if ((dhd->op_mode & DHD_FLAG_CONCURR_SINGLE_CHAN_MODE) ==
9903 dhd_get_concurrent_capabilites(dhd_pub_t *dhd)
9911 if (dhd->op_mode & (DHD_FLAG_HOSTAP_MODE | DHD_FLAG_MFG_MODE))
9913 if (FW_SUPPORTED(dhd, vsdb)) {
9916 if (!FW_SUPPORTED(dhd, p2p)) {
9922 ret = dhd_iovar(dhd, 0, "p2p", NULL, 0, (char *)&buf,
9935 if (FW_SUPPORTED(dhd, rsdb)) {
9939 if (FW_SUPPORTED(dhd, mp2p)) {
9957 dhd_preinit_aibss_ioctls(dhd_pub_t *dhd, char *iov_buf_smlen)
9969 ret = dhd_iovar(dhd, 0, "aibss", (char *)&aibss, sizeof(aibss), NULL, 0, TRUE);
9984 ret = dhd_iovar(dhd, 0, "aibss_ps", (char *)&aibss_ps, sizeof(aibss_ps), NULL, 0, TRUE);
9992 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_ATIM,
10007 ret = dhd_iovar(dhd, 0, "aibss_bcn_force_config", (char *)&bcn_config,
10017 ret = dhd_iovar(dhd, 0, "ibss_coalesce_allowed", (char *)&ibss_coalesce,
10025 dhd->op_mode |= DHD_FLAG_IBSS_MODE;
10033 dhd_check_adps_bad_ap(dhd_pub_t *dhd)
10040 if (!dhd_is_associated(dhd, 0, NULL)) {
10045 ndev = dhd_linux_get_primary_netdev(dhd);
10070 dhd_enable_adps(dhd_pub_t *dhd, uint8 on)
10080 iov_buf = MALLOC(dhd->osh, len);
10098 ret = dhd_iovar(dhd, 0, "adps", (char *)iov_buf, len, NULL, 0, TRUE);
10115 dhd_check_adps_bad_ap(dhd);
10121 MFREE(dhd->osh, iov_buf, len);
10129 dhd_preinit_ioctls(dhd_pub_t *dhd)
10309 dhd->apf_set = FALSE;
10312 dhd->suspend_bcn_li_dtim = CUSTOM_SUSPEND_BCN_LI_DTIM;
10314 dhd->max_dtim_enable = TRUE;
10316 dhd->max_dtim_enable = FALSE;
10318 dhd->disable_dtim_in_suspend = FALSE;
10320 dhd->ocl_off = FALSE;
10323 dhd->tid_mode = SET_TID_OFF;
10324 dhd->target_uid = 0;
10325 dhd->target_tid = 0;
10328 dhd->op_mode = 0;
10332 dhd->dhd_cflags &= ~WLAN_PLAT_AP_FLAG;
10336 if (!dhd_validate_chipid(dhd)) {
10338 __FUNCTION__, dhd_bus_chip_id(dhd)));
10349 ret = dhd_iovar(dhd, 0, "ver", NULL, 0, (char *)&buf, sizeof(buf), FALSE);
10359 dhd_set_version_info(dhd, buf);
10372 if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_MFG_MODE) ||
10374 dhd->op_mode = DHD_FLAG_MFG_MODE;
10377 pm_runtime_disable(dhd_bus_to_dev(dhd->bus));
10381 DHD_DISABLE_RUNTIME_PM(dhd);
10393 ret = dhd_iovar(dhd, 0, "bus:hostwake_oob", NULL, 0, (char *)&hostwake_oob,
10410 ret = dhd_iovar(dhd, 0, "axierror_logbuf_addr", NULL, 0, (char *)&dhd->axierror_logbuf_addr,
10411 sizeof(dhd->axierror_logbuf_addr), FALSE);
10414 dhd->axierror_logbuf_addr = 0;
10417 dhd->axierror_logbuf_addr));
10422 ret = dhd_iovar(dhd, 0, "event_log_rate_hc", (char *)&event_log_rate_hc,
10433 ret = wifi_platform_get_mac_addr(dhd->info->adapter, ea_addr.octet);
10435 ret = dhd_iovar(dhd, 0, "cur_etheraddr", (char *)&ea_addr, ETHER_ADDR_LEN, NULL, 0,
10442 memcpy(dhd->mac.octet, ea_addr.octet, ETHER_ADDR_LEN);
10446 ret = dhd_iovar(dhd, 0, "cur_etheraddr", NULL, 0, (char *)&buf, sizeof(buf), FALSE);
10453 memcpy(dhd->mac.octet, buf, ETHER_ADDR_LEN);
10461 dhd_map_clm_path_by_chip(dhd->info, clm_path, MOD_PARAM_PATHLEN);
10465 if ((ret = dhd_apply_default_clm(dhd, clm_path)) < 0) {
10472 uint32 cap_buf_size = sizeof(dhd->fw_capabilities);
10473 memset(dhd->fw_capabilities, 0, cap_buf_size);
10474 ret = dhd_iovar(dhd, 0, "cap", NULL, 0, dhd->fw_capabilities, (cap_buf_size - 1),
10482 memmove(&dhd->fw_capabilities[1], dhd->fw_capabilities, (cap_buf_size - 1));
10483 dhd->fw_capabilities[0] = ' ';
10484 dhd->fw_capabilities[cap_buf_size - 2] = ' ';
10485 dhd->fw_capabilities[cap_buf_size - 1] = '\0';
10489 if (FW_SUPPORTED(dhd, rsdb)) {
10492 ret = dhd_iovar(dhd, 0, "rsdb_mode", (char *)&rsdb_mode, sizeof(rsdb_mode),
10501 if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_HOSTAP_MODE) ||
10506 dhd->op_mode = DHD_FLAG_HOSTAP_MODE;
10523 ret = dhd_iovar(dhd, 0, "cur_etheraddr", (char *)&iovbuf, ETHER_ADDR_LEN, NULL, 0,
10528 memcpy(dhd->mac.octet, iovbuf, ETHER_ADDR_LEN);
10531 dhdsdio_func_blocksize(dhd, 2, sd_f2_blocksize);
10534 ret = dhd_iovar(dhd, 0, "wme_apsd", (char *)&wme_apsd, sizeof(wme_apsd), NULL, 0,
10543 dhd->dhd_cflags |= WLAN_PLAT_AP_FLAG | WLAN_PLAT_NODFS_FLAG;
10545 } else if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_MFG_MODE) ||
10553 dhd->op_mode = DHD_FLAG_MFG_MODE;
10555 dhdsdio_func_blocksize(dhd, 2, DYNAMIC_F2_BLKSIZE_FOR_NONLEGACY);
10559 if (FW_SUPPORTED(dhd, rsdb)) {
10562 ret = dhd_iovar(dhd, 0, "rsdb_mode", (char *)&rsdb_mode, sizeof(rsdb_mode),
10573 if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_P2P_MODE) ||
10581 dhd->op_mode = DHD_FLAG_P2P_MODE;
10582 } else if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_IBSS_MODE) ||
10584 dhd->op_mode = DHD_FLAG_IBSS_MODE;
10586 dhd->op_mode = DHD_FLAG_STA_MODE;
10588 if (dhd->op_mode != DHD_FLAG_IBSS_MODE &&
10589 (concurrent_mode = dhd_get_concurrent_capabilites(dhd))) {
10593 dhd->op_mode |= concurrent_mode;
10597 if (dhd->op_mode & DHD_FLAG_P2P_MODE) {
10598 ret = dhd_iovar(dhd, 0, "apsta", (char *)&apsta, sizeof(apsta), NULL, 0,
10604 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_AP,
10609 memcpy(&p2p_ea, &dhd->mac, ETHER_ADDR_LEN);
10611 ret = dhd_iovar(dhd, 0, "p2p_da_override", (char *)&p2p_ea, sizeof(p2p_ea),
10624 if (FW_SUPPORTED(dhd, rsdb)) {
10625 ret = dhd_iovar(dhd, 0, "scan_features", (char *)&scan_features,
10633 ret = dhd_iovar(dhd, 0, "scan_features", (char *)&scan_features,
10644 dhd->op_mode, MAC2STRDBG(dhd->mac.octet)));
10647 if (!dhd->is_blob)
10652 get_customized_country_code(dhd->info->adapter, dhd->dhd_cspec.country_abbrev,
10653 &dhd->dhd_cspec, dhd->dhd_cflags);
10655 get_customized_country_code(dhd->info->adapter, dhd->dhd_cspec.country_abbrev,
10656 &dhd->dhd_cspec);
10662 if (dhd->op_mode == DHD_FLAG_HOSTAP_MODE)
10663 dhd->info->rxthread_enabled = FALSE;
10665 dhd->info->rxthread_enabled = TRUE;
10668 if (dhd->dhd_cspec.ccode[0] != 0) {
10669 ret = dhd_iovar(dhd, 0, "country", (char *)&dhd->dhd_cspec, sizeof(wl_country_t),
10676 ret = dhd_iovar(dhd, 0, "assoc_listen", (char *)&listen_interval, sizeof(listen_interval),
10683 if (sec_get_param_wfa_cert(dhd, SET_PARAM_ROAMOFF, &roamvar) == BCME_OK) {
10688 ret = dhd_iovar(dhd, 0, "roam_off", (char *)&roamvar, sizeof(roamvar), NULL, 0, TRUE);
10692 ret = dhd_iovar(dhd, 0, "roam_bcnloss_off", (char *)&roam_bcnloss_off,
10695 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_TRIGGER, roam_trigger,
10698 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_SCAN_PERIOD, roam_scan_period,
10701 if ((dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_DELTA, roam_delta,
10704 ret = dhd_iovar(dhd, 0, "fullroamperiod", (char *)&roam_fullscan_period,
10710 if (dhd_iovar(dhd, 0, "roam_env_detection", (char *)&roam_env_mode,
10712 dhd->roam_env_detection = TRUE;
10714 dhd->roam_env_detection = FALSE;
10720 ret = dhd_iovar(dhd, 0, "const_awake_thresh", (char *)&pm_awake_thresh,
10727 ret = dhd_iovar(dhd, 0, "okc_enable", (char *)&okc, sizeof(okc), NULL, 0, TRUE);
10730 ret = dhd_iovar(dhd, 0, "ccx_enable", (char *)&ccx, sizeof(ccx), NULL, 0, TRUE);
10734 dhd->tdls_enable = FALSE;
10735 dhd_tdls_set_mode(dhd, false);
10740 ret = dhd_iovar(dhd, 0, "lpc", (char *)&lpc, sizeof(lpc), NULL, 0, TRUE);
10746 ret = dhd_wl_ioctl_cmd(dhd, WLC_DOWN,
10750 ret = dhd_iovar(dhd, 0, "lpc", (char *)&lpc, sizeof(lpc), NULL, 0, TRUE);
10757 if (dhd->op_mode & DHD_FLAG_STA_MODE) {
10758 if ((ret = dhd_enable_adps(dhd, ADPS_ENABLE)) != BCME_OK) {
10766 sec_control_pm(dhd, &power_mode);
10770 (void) dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char *)&power_mode, sizeof(power_mode), TRUE, 0);
10776 ret = dhd_iovar(dhd, 0, "bus:txglomalign", (char *)&dongle_align, sizeof(dongle_align),
10781 ret = dhd_iovar(dhd, 0, "bus:credall", (char *)&credall, sizeof(credall), NULL, 0, TRUE);
10785 if (sec_get_param_wfa_cert(dhd, SET_PARAM_BUS_TXGLOM_MODE, &glom) == BCME_OK) {
10791 ret = dhd_iovar(dhd, 0, "bus:txglom", (char *)&glom, sizeof(glom), NULL, 0, TRUE);
10796 ret = dhd_iovar(dhd, 0, "bcn_timeout", (char *)&bcn_timeout, sizeof(bcn_timeout), NULL, 0,
10800 ret = dhd_iovar(dhd, 0, "assoc_retry_max", (char *)&retry_max, sizeof(retry_max), NULL, 0,
10804 ret = dhd_iovar(dhd, 0, "apsta", (char *)&apsta, sizeof(apsta), NULL, 0, TRUE);
10809 dhd_sel_ant_from_file(dhd);
10814 dhd_wl_ioctl_cmd(dhd, WLC_SET_DTIMPRD, (char *)&dtim, sizeof(dtim), TRUE, 0);
10826 if (!(dhd->op_mode &
10828 if ((res = dhd_keep_alive_onoff(dhd)) < 0)
10836 ret = dhd_iovar(dhd, 0, "txbf", (char *)&txbf, sizeof(txbf), NULL, 0, TRUE);
10842 ret = dhd_iovar(dhd, 0, "scancache", (char *)&scancache_enab, sizeof(scancache_enab), NULL,
10852 dhd_map_clm_path_by_chip(dhd->info, clm_path, MOD_PARAM_PATHLEN);
10856 if ((ret = dhd_apply_default_clm(dhd, clm_path)) < 0) {
10862 if (!(dhd->op_mode &
10864 if ((ret = dhd_keep_alive_onoff(dhd)) < 0)
10871 memset(dhd->fw_capabilities, 0, sizeof(dhd->fw_capabilities));
10872 ret = dhd_iovar(dhd, 0, "cap", NULL, 0, dhd->fw_capabilities, sizeof(dhd->fw_capabilities),
10881 ret = dhd_iovar(dhd, 0, "event_log_max_sets", NULL, 0, (char *)&event_log_max_sets,
10884 dhd->event_log_max_sets = event_log_max_sets;
10886 dhd->event_log_max_sets = NUM_EVENT_LOG_SETS;
10892 dhd->event_log_max_sets_queried = TRUE;
10894 __FUNCTION__, dhd->event_log_max_sets, ret));
10896 ret = dhd_iovar(dhd, 0, "enable_memuse", (char *)&enable_memuse,
10908 ret = dhd_iovar(dhd, 0, "txbf_bfr_cap", (char *)&txbf_bfr_cap, sizeof(txbf_bfr_cap), NULL,
10917 if (sec_get_param_wfa_cert(dhd, SET_PARAM_FRAMEBURST, &frameburst) == BCME_OK) {
10925 if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE) {
10930 if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_FAKEFRAG, (char *)&frameburst,
10936 ret = dhd_iovar(dhd, 0, "ack_ratio", (char *)&ack_ratio, sizeof(ack_ratio), NULL, 0, TRUE);
10942 ret = dhd_iovar(dhd, 0, "ack_ratio_depth", (char *)&ack_ratio_depth,
10949 iov_buf = (char*)MALLOC(dhd->osh, WLC_IOCTL_SMLEN);
10958 if ((ret = dhd_preinit_aibss_ioctls(dhd, iov_buf)) != BCME_OK) {
10972 if (dhd->op_mode == DHD_FLAG_IBSS_MODE)
10976 ret = dhd_iovar(dhd, 0, "ampdu_ba_wsize", (char *)&du_ba_wsize,
10988 ret = dhd_iovar(dhd, 0, "ampdu_mpdu", (char *)&du_mpdu, sizeof(ampdu_mpdu),
11000 ret = dhd_iovar(dhd, 0, "ampdu_release", (char *)&du_release,
11012 ret = dhd_iovar(dhd, 0, "amsdu_aggsf", (char *)&amsdu_aggsf, sizeof(amsdu_aggsf),
11024 ret = dhd_iovar(dhd, 0, "sup_wpa", (char *)&sup_wpa, sizeof(sup_wpa),
11030 dhd->fw_4way_handshake = TRUE;
11031 DHD_TRACE(("4-way handshake mode is: %d\n", dhd->fw_4way_handshake));
11035 ret = dhd_iovar(dhd, 0, "vht_features", (char *)&vht_features, sizeof(vht_features),
11049 ret = dhd_iovar(dhd, 0, "vht_features", (char *)&vht_features, sizeof(vht_features),
11056 ret = dhd_wl_ioctl_cmd(dhd, WLC_DOWN,
11062 ret = dhd_iovar(dhd, 0, "vht_features", (char *)&vht_features,
11071 ret = dhd_iovar(dhd, 0, "ht_features", (char *)&ht_features, sizeof(ht_features), NULL, 0,
11081 dhd_control_he_enab(dhd, control_he_enab);
11086 ret = dhd_iovar(dhd, 0, "pspretend_threshold", (char *)&pspretend_thr,
11094 ret = dhd_iovar(dhd, 0, "buf_key_b4_m4", (char *)&buf_key_b4_m4, sizeof(buf_key_b4_m4),
11100 ret = dhd_iovar(dhd, 0, "cac", (char *)&cac, sizeof(cac), NULL, 0, TRUE);
11107 dhd_ulp_preinit(dhd);
11111 ret = dhd_iovar(dhd, 0, "event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf,
11127 if (!(dhd->op_mode & DHD_FLAG_IBSS_MODE))
11182 if (dhd->op_mode & DHD_FLAG_P2P_MODE) {
11191 if (dhd_logtrace_from_file(dhd)) {
11212 dhd_update_flow_prio_map(dhd, DHD_FLOW_PRIO_LLR_MAP);
11216 dhd_update_flow_prio_map(dhd, DHD_FLOW_PRIO_LLR_MAP);
11220 ret = dhd_iovar(dhd, 0, "event_msgs", eventmask, WL_EVENTING_MASK_LEN, NULL, 0, TRUE);
11228 eventmask_msg = (eventmsgs_ext_t*)MALLOC(dhd->osh, msglen);
11239 ret2 = dhd_iovar(dhd, 0, "event_msgs_ext", (char *)eventmask_msg, msglen, iov_buf,
11301 ret = dhd_iovar(dhd, 0, "event_msgs_ext", (char *)eventmask_msg, msglen, NULL, 0,
11319 el_tag = (wl_el_tag_params_t *)MALLOC(dhd->osh, sizeof(wl_el_tag_params_t));
11329 ret = dhd_iovar(dhd, 0, "event_log_tag_control", (char *)el_tag, sizeof(*el_tag), NULL, 0,
11334 dhd_wl_ioctl_cmd(dhd, WLC_SET_SCAN_CHANNEL_TIME, (char *)&scan_assoc_time,
11336 dhd_wl_ioctl_cmd(dhd, WLC_SET_SCAN_UNASSOC_TIME, (char *)&scan_unassoc_time,
11338 dhd_wl_ioctl_cmd(dhd, WLC_SET_SCAN_PASSIVE_TIME, (char *)&scan_passive_time,
11348 dhd_arp_offload_enable(dhd, TRUE);
11349 dhd_arp_offload_set(dhd, dhd_arp_mode);
11351 dhd_arp_offload_enable(dhd, FALSE);
11352 dhd_arp_offload_set(dhd, 0);
11359 dhd->pktfilter_count = 6;
11360 dhd->pktfilter[DHD_BROADCAST_FILTER_NUM] = NULL;
11361 if (!FW_SUPPORTED(dhd, pf6)) {
11362 dhd->pktfilter[DHD_MULTICAST4_FILTER_NUM] = NULL;
11363 dhd->pktfilter[DHD_MULTICAST6_FILTER_NUM] = NULL;
11366 dhd->pktfilter[DHD_MULTICAST4_FILTER_NUM] = DISCARD_IPV4_MCAST;
11367 dhd->pktfilter[DHD_MULTICAST6_FILTER_NUM] = DISCARD_IPV6_MCAST;
11370 dhd->pktfilter[DHD_ARP_FILTER_NUM] = "105 0 0 12 0xFFFF 0x0806";
11374 dhd->pktfilter[DHD_UNICAST_FILTER_NUM] = "100 0 0 0 "
11380 dhd->pktfilter[DHD_UNICAST_FILTER_NUM] = "100 0 0 0 0x01 0x00";
11384 dhd->pktfilter[DHD_MDNS_FILTER_NUM] = "104 0 0 0 0xFFFFFF 0x01005E";
11387 dhd->pktfilter[DHD_MDNS_FILTER_NUM] = NULL;
11389 if (FW_SUPPORTED(dhd, pf6)) {
11391 dhd->pktfilter[DHD_IP4BCAST_DROP_FILTER_NUM] = DISCARD_IPV4_BCAST;
11393 dhd->pktfilter[DHD_LLC_STP_DROP_FILTER_NUM] = DISCARD_LLC_STP;
11395 dhd->pktfilter[DHD_LLC_XID_DROP_FILTER_NUM] = DISCARD_LLC_XID;
11396 dhd->pktfilter_count = 10;
11400 dhd->pktfilter_count = 4;
11403 dhd->pktfilter[DHD_UNICAST_FILTER_NUM] = "100 0 0 0 0xffffff 0xffffff";
11405 dhd->pktfilter[DHD_BROADCAST_FILTER_NUM] = "102 0 0 36 0xffffffff 0x11940009";
11407 dhd->pktfilter[DHD_MULTICAST4_FILTER_NUM] = "104 0 0 38 0xffffffff 0x11940009";
11408 dhd->pktfilter[DHD_MULTICAST6_FILTER_NUM] = NULL;
11413 dhd_enable_packet_filter(0, dhd);
11416 dhd_set_packet_filter(dhd);
11419 ret = dhd_iovar(dhd, 0, "nmode", (char *)&nmode, sizeof(nmode), NULL, 0, TRUE);
11425 ret = dhd_iovar(dhd, 0, "bcn_li_bcn", (char *)&bcn_li_bcn, sizeof(bcn_li_bcn), NULL, 0,
11431 ret = dhd_iovar(dhd, 0, "ampdu_tid", (char *)&tid, sizeof(tid), NULL, 0, TRUE);
11435 ret = dhd_iovar(dhd, 0, "ampdu_tid", (char *)&tid, sizeof(tid), NULL, 0, TRUE);
11439 ret = dhd_iovar(dhd, 0, "clmver", NULL, 0, buf, sizeof(buf), FALSE);
11502 sec_save_wlinfo(fw_version, EPI_VERSION_STR, dhd->info->nv_path, clm_version);
11507 ret = dhd_iovar(dhd, 0, "wlc_ver", NULL, 0, (char *)&wlc_ver,
11512 dhd->wlc_ver_major = wlc_ver.wlc_ver_major;
11513 dhd->wlc_ver_minor = wlc_ver.wlc_ver_minor;
11521 dhd_txglom_enable(dhd, TRUE);
11529 (!FW_SUPPORTED(dhd, ap)) ||
11537 if (sec_get_param_wfa_cert(dhd, SET_PARAM_PROPTX, &proptx) == BCME_OK) {
11545 ret2 = dhd_iovar(dhd, 0, "ampdu_hostreorder", (char *)&hostreorder, sizeof(hostreorder),
11547 chipid = dhd_bus_chip_id(dhd);
11555 ret2 = dhd_wl_ioctl_cmd(dhd, WLC_DOWN, (char *)&wl_down,
11560 ret2 = dhd_iovar(dhd, 0, "ampdu_hostreorder", (char *)&hostreorder,
11572 dhd_wlfc_init(dhd);
11575 dhd_wlfc_hostreorder_init(dhd);
11582 if (FW_SUPPORTED(dhd, ap)) {
11584 ret = dhd_iovar(dhd, 0, "ap_isolate", (char *)&wl_ap_isolate, sizeof(wl_ap_isolate),
11591 if (!dhd->pno_state) {
11592 dhd_pno_init(dhd);
11596 if (!dhd->rtt_state) {
11597 ret = dhd_rtt_init(dhd);
11605 if (!(dhd->op_mode & (DHD_FLAG_HOSTAP_MODE | DHD_FLAG_MFG_MODE)))
11606 dhd_read_from_file(dhd);
11609 dhd_interworking_enable(dhd);
11613 dhd->ndo_enable = FALSE;
11614 dhd->ndo_host_ip_overflow = FALSE;
11615 dhd->ndo_max_host_ip = NDO_MAX_HOST_IP_ENTRIES;
11619 dhd->ndo_version = dhd_ndo_get_version(dhd);
11620 if (dhd->ndo_version > 0) {
11621 DHD_INFO(("%s: ndo version %d\n", __FUNCTION__, dhd->ndo_version));
11625 ret = dhd_ndo_unsolicited_na_filter_enable(dhd, 1);
11633 dhd->wbtext_support = FALSE;
11634 if (dhd_wl_ioctl_get_intiovar(dhd, "wnm_bsstrans_resp", &wnm_bsstrans_resp,
11638 dhd->wbtext_policy = wnm_bsstrans_resp;
11639 if (dhd->wbtext_policy == WL_BSSTRANS_POLICY_PRODUCT_WBTEXT) {
11640 dhd->wbtext_support = TRUE;
11644 if (dhd->wbtext_support) {
11645 if (dhd_wl_ioctl_set_intiovar(dhd, "wnm_bsstrans_resp",
11655 if (dhd->op_mode == DHD_FLAG_MFG_MODE &&
11656 (dhd_bus_dmaxfer_lpbk(dhd, M2M_NON_DMA_LPBK) < 0)) {
11671 if (FW_SUPPORTED(dhd, estm)) {
11675 if (dhd_iovar(dhd, 0, "wnm", (char *)&wnm_cap, sizeof(wnm_cap), NULL, 0, TRUE) < 0) {
11679 if (FW_SUPPORTED(dhd, ecounters) && enable_ecounter) {
11680 dhd_ecounter_configure(dhd, TRUE);
11684 if (dhd_get_preserve_log_numbers(dhd, &dhd->logset_prsrv_mask)
11690 if (dhd_iovar(dhd, 0, "wnm_btmdelta", (char *)&btmdelta, sizeof(btmdelta),
11697 if (FW_SUPPORTED(dhd, monitor)) {
11698 dhd->monitor_enable = TRUE;
11701 dhd->monitor_enable = FALSE;
11707 dhd->sroam_turn_on = TRUE;
11708 dhd->sroamed = FALSE;
11714 MFREE(dhd->osh, eventmask_msg, msglen);
11718 MFREE(dhd->osh, iov_buf, WLC_IOCTL_SMLEN);
11723 MFREE(dhd->osh, el_tag, sizeof(wl_el_tag_params_t));
11859 struct dhd_info *dhd = dhdp->info; local
11862 ASSERT(dhd && dhd->iflist[ifidx]);
11863 dev = dhd->iflist[ifidx]->net;
11946 dhd_info_t *dhd; local
11964 dhd = DHD_DEV_INFO(ifa->ifa_dev->dev);
11965 if (!dhd)
11968 dhd_pub = &dhd->pub;
11974 if (dhd->iflist[idx] && dhd->iflist[idx]->net == ifa->ifa_dev->dev)
11978 DHD_TRACE(("ifidx : %p %s %d\n", dhd->iflist[idx]->net,
11979 dhd->iflist[idx]->name, dhd->iflist[idx]->idx));
11995 if (DHD_BUS_CHECK_DOWN_OR_DOWN_IN_PROGRESS(&dhd->pub) ||
11996 dhd->pub.busstate == DHD_BUS_LOAD) {
11998 __FUNCTION__, dhd->pub.busstate));
11999 if (dhd->pend_ipaddr) {
12001 __FUNCTION__, dhd->pend_ipaddr));
12003 dhd->pend_ipaddr = ifa->ifa_address;
12017 dhd->pend_ipaddr = 0;
12027 dhd_aoe_hostip_clr(&dhd->pub, idx);
12028 dhd_aoe_arp_clr(&dhd->pub, idx);
12047 dhd_info_t *dhd = (dhd_info_t *)dhd_info; local
12051 if (!dhd) {
12055 dhdp = &dhd->pub;
12145 dhd_info_t *dhd; local
12156 dhd = DHD_DEV_INFO(inet6_ifa->idev->dev);
12157 if (!dhd) {
12160 dhdp = &dhd->pub;
12163 idx = dhd_net2idx(dhd, inet6_ifa->idev->dev);
12185 dhd_deferred_schedule_work(dhd->dhd_deferred_wq, (void *)ndo_info, DHD_WQ_WORK_IPV6_NDO,
12217 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
12225 if (dhd == NULL || dhd->iflist[ifidx] == NULL) {
12230 ASSERT(dhd && dhd->iflist[ifidx]);
12231 ifp = dhd->iflist[ifidx];
12244 if (!ETHER_ISNULLADDR(dhd->pub.mac.octet))
12245 memcpy(temp_addr, dhd->pub.mac.octet, ETHER_ADDR_LEN);
12246 memcpy(dhd->iflist[0]->mac_addr, dhd->pub.mac.octet, ETHER_ADDR_LEN);
12258 if (!memcmp(temp_addr, dhd->iflist[0]->mac_addr,
12263 memcpy(dhd->iflist[ifidx]->mac_addr, temp_addr, ETHER_ADDR_LEN);
12268 net->hard_header_len = ETH_HLEN + dhd->pub.hdrlen;
12280 dhd->pub.rxsz = DBUS_RX_BUFFER_SIZE_DHD(net);
12299 MAC2STRDBG(dhd->pub.mac.octet));
12320 __skb_queue_purge(&dhd->rx_pend_queue);
12324 skb_queue_purge(&dhd->tx_pend_queue);
12341 dhd->bus_user_count--;
12359 dhd_info_t *dhd = (dhd_info_t *)dhdp->info; local
12364 ifp = dhd->iflist[0];
12400 dhd_info_t *dhd; local
12405 dhd = (dhd_info_t *)dhdp->info;
12406 if (dhd) {
12412 if (dhd->pub.busstate != DHD_BUS_DOWN) {
12414 dhd_prot_stop(&dhd->pub);
12417 dhd_bus_stop(dhd->pub.bus, TRUE);
12429 dhd_info_t *dhd; local
12439 dhd = (dhd_info_t *)dhdp->info;
12440 if (!dhd)
12443 dev = dhd->iflist[0]->net;
12459 DHD_TRACE(("%s: Enter state 0x%x\n", __FUNCTION__, dhd->dhd_state));
12462 dhd->pub.up = 0;
12463 if (!(dhd->dhd_state & DHD_ATTACH_STATE_DONE)) {
12470 dhd_free_wet_info(&dhd->pub, dhd->pub.wet_info);
12477 if (dhd->pub.wlfc_thread) {
12478 kthread_stop(dhd->pub.wlfc_thread);
12482 dhd->pub.wlfc_thread = NULL;
12491 if (dhd->dhd_state & DHD_ATTACH_STATE_PROT_ATTACH) {
12529 if (dhd->dhd_state & DHD_ATTACH_STATE_EARLYSUSPEND_DONE) {
12530 if (dhd->early_suspend.suspend)
12531 unregister_early_suspend(&dhd->early_suspend);
12536 if (dhd->dhd_state & DHD_ATTACH_STATE_WL_ATTACH) {
12543 dhd_ulp_deinit(dhd->pub.osh, dhdp);
12547 if (dhd->dhd_state & DHD_ATTACH_STATE_ADD_IF) {
12552 dhd_net_if_lock_local(dhd);
12554 if (dhd->iflist[i]) {
12555 dhd_remove_if(&dhd->pub, i, TRUE);
12558 dhd_net_if_unlock_local(dhd);
12561 ifp = dhd->iflist[0];
12603 MFREE(dhd->pub.osh, ifp, sizeof(*ifp));
12604 dhd->iflist[0] = NULL;
12609 DHD_GENERAL_LOCK(&dhd->pub, flags);
12610 timer_valid = dhd->wd_timer_valid;
12611 dhd->wd_timer_valid = FALSE;
12612 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
12614 del_timer_sync(&dhd->timer);
12615 DHD_DISABLE_RUNTIME_PM(&dhd->pub);
12617 if (dhd->dhd_state & DHD_ATTACH_STATE_THREADS_CREATED) {
12619 if (dhd->thr_rpm_ctl.thr_pid >= 0) {
12620 PROC_STOP(&dhd->thr_rpm_ctl);
12623 if (dhd->thr_wdt_ctl.thr_pid >= 0) {
12624 PROC_STOP(&dhd->thr_wdt_ctl);
12627 if (dhd->rxthread_enabled && dhd->thr_rxf_ctl.thr_pid >= 0) {
12628 PROC_STOP(&dhd->thr_rxf_ctl);
12631 if (dhd->thr_dpc_ctl.thr_pid >= 0) {
12632 PROC_STOP(&dhd->thr_dpc_ctl);
12635 tasklet_kill(&dhd->tasklet);
12640 if (dhd->pub.nfct) {
12641 dhd_ct_close(dhd->pub.nfct);
12646 if (dhd->dhd_state & DHD_ATTACH_STATE_LB_ATTACH_DONE) {
12648 dhd->dhd_state &= ~DHD_ATTACH_STATE_LB_ATTACH_DONE;
12652 cancel_work_sync(&dhd->rx_napi_dispatcher_work);
12653 __skb_queue_purge(&dhd->rx_pend_queue);
12656 cancel_work_sync(&dhd->tx_dispatcher_work);
12657 tasklet_kill(&dhd->tx_tasklet);
12658 __skb_queue_purge(&dhd->tx_pend_queue);
12661 cancel_work_sync(&dhd->tx_compl_dispatcher_work);
12662 tasklet_kill(&dhd->tx_compl_tasklet);
12665 tasklet_kill(&dhd->rx_compl_tasklet);
12669 dhd_unregister_cpuhp_callback(dhd);
12671 dhd_cpumasks_deinit(dhd);
12672 DHD_LB_STATS_DEINIT(&dhd->pub);
12677 cancel_work_sync(&dhd->axi_error_dispatcher_work);
12680 DHD_SSSR_MEMPOOL_DEINIT(&dhd->pub);
12683 if (dhd->dhd_state & DHD_ATTACH_STATE_CFG80211) {
12695 destroy_workqueue(dhd->tx_wq);
12696 dhd->tx_wq = NULL;
12697 destroy_workqueue(dhd->rx_wq);
12698 dhd->rx_wq = NULL;
12704 dhd_os_spin_lock_deinit(dhd->pub.osh, dhd->pub.dbg->pkt_mon_lock);
12721 if (dhd->pub.hang_info) {
12722 MFREE(dhd->pub.osh, dhd->pub.hang_info, VENDOR_SEND_HANG_EXT_INFO_LEN);
12730 dhd_cancel_logtrace_process_sync(dhd);
12733 dhd_dbg_ring_proc_destroy(&dhd->pub);
12735 if (dhd->dhd_state & DHD_ATTACH_LOGTRACE_INIT) {
12736 if (dhd->event_data.fmts) {
12737 MFREE(dhd->pub.osh, dhd->event_data.fmts,
12738 dhd->event_data.fmts_size);
12739 dhd->event_data.fmts = NULL;
12741 if (dhd->event_data.raw_fmts) {
12742 MFREE(dhd->pub.osh, dhd->event_data.raw_fmts,
12743 dhd->event_data.raw_fmts_size);
12744 dhd->event_data.raw_fmts = NULL;
12746 if (dhd->event_data.raw_sstr) {
12747 MFREE(dhd->pub.osh, dhd->event_data.raw_sstr,
12748 dhd->event_data.raw_sstr_size);
12749 dhd->event_data.raw_sstr = NULL;
12751 if (dhd->event_data.rom_raw_sstr) {
12752 MFREE(dhd->pub.osh, dhd->event_data.rom_raw_sstr,
12753 dhd->event_data.rom_raw_sstr_size);
12754 dhd->event_data.rom_raw_sstr = NULL;
12756 dhd->dhd_state &= ~DHD_ATTACH_LOGTRACE_INIT;
12770 unregister_pm_notifier(&dhd->pm_notifier);
12776 if (dhd->new_freq)
12777 free_percpu(dhd->new_freq);
12778 dhd->new_freq = NULL;
12779 cpufreq_unregister_notifier(&dhd->freq_trans, CPUFREQ_TRANSITION_NOTIFIER);
12782 dhd->wakelock_wd_counter = 0;
12783 wake_lock_destroy(&dhd->wl_wdwake);
12785 if (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT) {
12786 DHD_TRACE(("wd wakelock count:%d\n", dhd->wakelock_wd_counter));
12787 DHD_OS_WAKE_LOCK_DESTROY(dhd);
12792 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF);
12813 dhd_del_monitor_if(dhd);
12822 cancel_work_sync(&dhd->dhd_hang_process_work);
12827 dhd_deferred_work_deinit(dhd->dhd_deferred_wq);
12828 dhd->dhd_deferred_wq = NULL;
12832 dhd_log_dump_deinit(&dhd->pub);
12850 if (dhd->pub.dump_file_manage) {
12851 MFREE(dhd->pub.osh, dhd->pub.dump_file_manage,
12855 dhd_sysfs_exit(dhd);
12856 dhd->pub.fw_download_status = FW_UNLOADED;
12859 mutex_destroy(&dhd->bus_user_lock);
12867 dhd_info_t *dhd; local
12890 dhd = (dhd_info_t *)dhdp->info;
12899 if (dhd != NULL) {
12902 if (dhd != (dhd_info_t *)dhd_os_prealloc(dhdp,
12904 MFREE(dhd->pub.osh, dhd, sizeof(*dhd));
12905 dhd = NULL;
13077 dhd_info_t * dhd = (dhd_info_t *)(pub->info); local
13079 if (dhd) {
13082 down(&dhd->proto_sem);
13094 dhd_info_t * dhd = (dhd_info_t *)(pub->info); local
13096 if (dhd) {
13097 up(&dhd->proto_sem);
13107 dhd_info_t * dhd = (dhd_info_t *)(pub->info); local
13109 if (dhd) {
13110 mutex_lock(&dhd->dhd_iovar_mutex);
13117 dhd_info_t * dhd = (dhd_info_t *)(pub->info); local
13119 if (dhd) {
13120 mutex_unlock(&dhd->dhd_iovar_mutex);
13127 dhd_info_t *dhd = NULL; local
13132 dhd = (dhd_info_t *)(pub->info);
13134 if (dhd) {
13135 mutex_lock(&dhd->logdump_lock);
13142 dhd_info_t *dhd = NULL; local
13147 dhd = (dhd_info_t *)(pub->info);
13149 if (dhd) {
13150 mutex_unlock(&dhd->logdump_lock);
13191 dhd_info_t * dhd = (dhd_info_t *)(pub->info); local
13199 timeout = wait_event_timeout(dhd->ioctl_resp_wait, (*condition), timeout);
13209 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
13211 wake_up(&dhd->ioctl_resp_wait);
13218 dhd_info_t * dhd = (dhd_info_t *)(pub->info); local
13226 timeout = wait_event_timeout(dhd->d3ack_wait, (*condition), timeout);
13236 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
13238 wake_up(&dhd->d3ack_wait);
13245 dhd_info_t * dhd = (dhd_info_t *)(pub->info); local
13255 timeout = wait_event_timeout(dhd->dhd_bus_busy_state_wait, !(*condition), timeout);
13268 dhd_info_t * dhd = (dhd_info_t *)(pub->info); local
13274 timeout = wait_event_timeout(dhd->dhd_bus_busy_state_wait, (*var == condition), timeout);
13288 dhd_info_t * dhd = (dhd_info_t *)(pub->info); local
13294 timeout = wait_event_timeout(dhd->dhd_bus_busy_state_wait,
13304 dhd_info_t * dhd = (dhd_info_t *)(pub->info); local
13310 ret = wait_event_timeout(dhd->dmaxfer_wait, (*condition), timeout);
13320 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
13322 wake_up(&dhd->dmaxfer_wait);
13327 dhd_os_tx_completion_wake(dhd_pub_t *dhd)
13331 wake_up(&dhd->tx_completion_wait);
13338 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
13341 wake_up(&dhd->dhd_bus_busy_state_wait);
13349 dhd_info_t *dhd = (dhd_info_t *)pub->info; local
13354 dhd_os_wd_timer(bus, dhd->default_wd_interval);
13361 dhd_info_t *dhd = (dhd_info_t *)pub->info; local
13366 if (!dhd) {
13385 if (!wdtick && dhd->wd_timer_valid == TRUE) {
13386 dhd->wd_timer_valid = FALSE;
13388 del_timer_sync(&dhd->timer);
13401 mod_timer(&dhd->timer, jiffies + msecs_to_jiffies(dhd_watchdog_ms));
13402 dhd->wd_timer_valid = TRUE;
13412 dhd_info_t *dhd = (dhd_info_t *)pub->info; local
13417 if (!dhd) {
13433 if (dhd->rpm_timer_valid == FALSE) {
13434 mod_timer(&dhd->rpm_timer, jiffies + msecs_to_jiffies(dhd_runtimepm_ms));
13435 dhd->rpm_timer_valid = TRUE;
13441 if (dhd->rpm_timer_valid == TRUE) {
13442 dhd->rpm_timer_valid = FALSE;
13444 del_timer_sync(&dhd->rpm_timer);
13574 dhd_info_t *dhd; local
13576 dhd = (dhd_info_t *)(pub->info);
13579 down(&dhd->sdsem);
13581 spin_lock_bh(&dhd->sdlock);
13587 dhd_info_t *dhd; local
13589 dhd = (dhd_info_t *)(pub->info);
13592 up(&dhd->sdsem);
13594 spin_unlock_bh(&dhd->sdlock);
13600 dhd_info_t *dhd; local
13602 dhd = (dhd_info_t *)(pub->info);
13603 spin_lock_bh(&dhd->txqlock);
13609 dhd_info_t *dhd; local
13611 dhd = (dhd_info_t *)(pub->info);
13612 spin_unlock_bh(&dhd->txqlock);
13628 dhd_info_t *dhd; local
13630 dhd = (dhd_info_t *)(pub->info);
13631 spin_lock_bh(&dhd->rxf_lock);
13638 dhd_info_t *dhd; local
13640 dhd = (dhd_info_t *)(pub->info);
13641 spin_unlock_bh(&dhd->rxf_lock);
13648 dhd_info_t *dhd; local
13651 dhd = (dhd_info_t *)(pub->info);
13653 if (dhd) {
13655 spin_lock_bh(&dhd->tcpack_lock);
13657 spin_lock_irqsave(&dhd->tcpack_lock, flags);
13667 dhd_info_t *dhd; local
13673 dhd = (dhd_info_t *)(pub->info);
13675 if (dhd) {
13677 spin_unlock_bh(&dhd->tcpack_lock);
13679 spin_unlock_irqrestore(&dhd->tcpack_lock, flags);
13706 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
13708 if (!dhd->pub.up) {
13712 res = wl_iw_get_wireless_stats(dev, &dhd->iw.wstats);
13715 return &dhd->iw.wstats;
13722 dhd_wl_host_event(dhd_info_t *dhd, int ifidx, void *pktdata, uint16 pktlen,
13729 ASSERT(dhd != NULL);
13732 bcmerror = wl_process_host_event(&dhd->pub, &ifidx, pktdata, pktlen, event, data,
13733 &dhd->event_data);
13735 bcmerror = wl_process_host_event(&dhd->pub, &ifidx, pktdata, pktlen, event, data,
13755 ASSERT(dhd->iflist[ifidx] != NULL);
13756 ASSERT(dhd->iflist[ifidx]->net != NULL);
13758 if (dhd->iflist[ifidx]->net) {
13759 wl_iw_event(dhd->iflist[ifidx]->net, event, *data);
13765 if (dhd->iflist[ifidx]->net) {
13766 spin_lock_irqsave(&dhd->pub.up_lock, flags);
13767 if (dhd->pub.up) {
13768 wl_cfg80211_event(dhd->iflist[ifidx]->net, event, *data);
13770 spin_unlock_irqrestore(&dhd->pub.up_lock, flags);
13796 dhd_info_t *dhd; local
13802 dhd = dhdp->info;
13818 ifidx = dhd_ifname2idx(dhd, "wlan0");
13819 ifp = dhd->iflist[ifidx];
13821 ifp = dhd->iflist[0];
13847 void dhd_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
13850 struct dhd_info *dhdinfo = dhd->info;
13854 dhd_os_sdunlock(dhd);
13856 dhd_os_sdlock(dhd);
13861 void dhd_wait_event_wakeup(dhd_pub_t *dhd)
13864 struct dhd_info *dhdinfo = dhd->info;
13877 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
13880 if (pm_runtime_get_sync(dhd_bus_to_dev(dhd->pub.bus)) < 0)
13886 if (dhd_wl_ioctl_cmd(&dhd->pub, WLC_DOWN, NULL, 0, TRUE, 0) < 0) {
13890 if (dhd->pub.wlfc_enabled) {
13891 dhd_wlfc_deinit(&dhd->pub);
13895 if (dhd->pub.pno_state) {
13896 dhd_pno_deinit(&dhd->pub);
13900 if (dhd->pub.rtt_state) {
13901 dhd_rtt_deinit(&dhd->pub);
13906 dhd_os_dbg_detach_pkt_monitor(&dhd->pub);
13912 dhd_update_fw_nv_path(dhd);
13914 dhd_bus_update_fw_nv_path(dhd->pub.bus,
13915 dhd->fw_path, dhd->nv_path);
13919 ret = dhd_bus_devreset(&dhd->pub, flag);
13922 pm_runtime_mark_last_busy(dhd_bus_to_dev(dhd->pub.bus));
13923 pm_runtime_put_autosuspend(dhd_bus_to_dev(dhd->pub.bus));
13928 dhd->pub.dongle_trap_occured = 0;
13929 dhd->pub.iovar_timeout_occured = 0;
13931 dhd->pub.d3ack_timeout_occured = 0;
13932 dhd->pub.livelock_occured = 0;
13933 dhd->pub.pktid_audit_failed = 0;
13935 dhd->pub.iface_op_failed = 0;
13936 dhd->pub.scan_timeout_occurred = 0;
13937 dhd->pub.scan_busy_occurred = 0;
13938 dhd->pub.smmu_fault_occurred = 0;
13952 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
13953 return dhd_bus_suspend(&dhd->pub);
13959 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
13960 return dhd_bus_resume(&dhd->pub, stage);
13968 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
13971 if (dhd) {
13972 ret = dhd->pub.suspend_disable_flag;
13973 dhd->pub.suspend_disable_flag = val;
13981 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
13983 if (dhd) {
13987 ret = dhd_set_suspend(val, &dhd->pub);
13989 ret = dhd_suspend_resume_helper(dhd, val, force);
14000 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14002 if (dhd) {
14005 dhd->pub.suspend_bcn_li_dtim = val;
14013 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14015 if (dhd) {
14019 dhd->pub.max_dtim_enable = TRUE;
14021 dhd->pub.max_dtim_enable = FALSE;
14033 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14035 if (dhd) {
14039 dhd->pub.disable_dtim_in_suspend = TRUE;
14041 dhd->pub.disable_dtim_in_suspend = FALSE;
14057 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14060 if (!dhd || (num == DHD_UNICAST_FILTER_NUM)) {
14071 if (num >= dhd->pub.pktfilter_count) {
14075 ret = dhd_packet_filter_add_remove(&dhd->pub, add_remove, num);
14103 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14106 return dhd_os_enable_packet_filter(&dhd->pub, val);
14113 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14116 if ((ret = dhd_sync_with_dongle(&dhd->pub)) < 0)
14127 dhd_pub_t *dhd = (&ptr->pub); local
14130 if (FW_SUPPORTED(dhd, sta)) {
14137 if (FW_SUPPORTED(dhd, dualband))
14139 if (FW_SUPPORTED(dhd, p2p)) {
14145 if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE)
14147 if (FW_SUPPORTED(dhd, tdls))
14149 if (FW_SUPPORTED(dhd, vsdb))
14151 if (FW_SUPPORTED(dhd, nan)) {
14154 if (FW_SUPPORTED(dhd, rttd2d))
14166 if (dhd_is_pno_supported(dhd)) {
14175 if (FW_SUPPORTED(dhd, rssi_mon)) {
14183 if (FW_SUPPORTED(dhd, ndoe))
14193 if (FW_SUPPORTED(dhd, fie)) {
14261 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14264 if (dhd->pub.dhd_cflags & WLAN_PLAT_NODFS_FLAG) {
14267 dhd->pub.dhd_cflags |= WLAN_PLAT_NODFS_FLAG;
14269 if (!(dhd->pub.dhd_cflags & WLAN_PLAT_NODFS_FLAG)) {
14272 dhd->pub.dhd_cflags &= ~WLAN_PLAT_NODFS_FLAG;
14274 dhd->pub.force_country_change = TRUE;
14282 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14283 dhd_pub_t *dhdp = &dhd->pub;
14350 dhd_info_t *dhd; local
14374 dhd = DHD_DEV_INFO(dev);
14375 if (!dhd) {
14379 dhdp = &dhd->pub;
14381 if (dhd_net2idx(dhd, dev) != 0) {
14522 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14524 return (dhd_pno_stop_for_ssid(&dhd->pub));
14531 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14533 return (dhd_pno_set_for_ssid(&dhd->pub, ssids_local, nssid, scan_fr,
14541 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14543 return (dhd_pno_enable(&dhd->pub, enable));
14551 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14552 return (dhd_pno_set_for_hotlist(&dhd->pub, p_pfn_bssid, hotlist_params));
14558 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14559 return (dhd_pno_stop_for_batch(&dhd->pub));
14565 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14566 return (dhd_pno_set_for_batch(&dhd->pub, batch_params));
14572 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14573 return (dhd_pno_get_for_batch(&dhd->pub, buf, bufsize, PNO_STATUS_NORMAL));
14582 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14584 return (dhd_is_legacy_pno_enabled(&dhd->pub));
14590 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14591 if (!dhd) {
14594 return dhd_pno_set_epno(&dhd->pub);
14599 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
14600 if (!dhd) {
14603 return dhd_pno_flush_fw_epno(&dhd->pub);
14611 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14613 return (dhd_pno_set_cfg_gscan(&dhd->pub, type, buf, flush));
14620 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14622 return (dhd_wait_batch_results_complete(&dhd->pub));
14629 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14631 return (dhd_pno_lock_batch_results(&dhd->pub));
14637 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14639 return (dhd_pno_unlock_batch_results(&dhd->pub));
14646 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14648 return (dhd_pno_initiate_gscan_request(&dhd->pub, run, flush));
14655 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14657 return (dhd_pno_enable_full_scan_result(&dhd->pub, real_time_flag));
14665 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14667 return (dhd_handle_hotlist_scan_evt(&dhd->pub, data, send_evt_bytes, type, buf_len));
14675 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14677 return (dhd_process_full_gscan_result(&dhd->pub, data, len, send_evt_bytes));
14683 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14685 dhd_gscan_hotlist_cache_cleanup(&dhd->pub, type);
14693 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14695 return (dhd_gscan_batch_cache_cleanup(&dhd->pub));
14702 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14704 return (dhd_retreive_batch_scan_results(&dhd->pub));
14710 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14712 return (dhd_pno_process_epno_result(&dhd->pub, data, event, send_evt_bytes));
14719 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14738 if (dhd->pub.lazy_roam_enable) {
14741 err = dhd_iovar(&dhd->pub, 0, "roam_exp_params",
14754 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14763 err = dhd_iovar(&dhd->pub, 0, "roam_exp_params",
14769 dhd->pub.lazy_roam_enable = (enable != 0);
14779 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14788 err = dhd_iovar(&dhd->pub, 0, "roam_exp_bssid_pref",
14802 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14806 err = dhd_wl_ioctl_cmd(&(dhd->pub), WLC_SET_MACLIST, (char *)blacklist,
14815 err = dhd_wl_ioctl_cmd(&(dhd->pub), WLC_SET_MACMODE, (char *)&macmode,
14827 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14841 err = dhd_iovar(&dhd->pub, 0, "roam_exp_ssid_whitelist", (char *)ssid_whitelist, len, NULL,
14856 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14858 return (dhd_pno_get_gscan(&dhd->pub, type, info, len));
14870 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14876 err = dhd_iovar(&dhd->pub, 0, "rssi_monitor", (char *)&rssi_monitor, sizeof(rssi_monitor),
14890 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14892 err = dhd_tcpack_suppress_set(&dhd->pub, enable);
14903 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14904 dhd_pub_t *dhdp = &dhd->pub;
14924 dhd_set_rand_mac_oui(dhd_pub_t *dhd)
14928 uint8 *rand_mac_oui = dhd->rand_mac_oui;
14942 err = dhd_iovar(dhd, 0, "pfn_macaddr", (char *)&wl_cfg, sizeof(wl_cfg), NULL, 0, TRUE);
14954 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14956 return (dhd_rtt_set_cfg(&dhd->pub, buf));
14962 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14964 return (dhd_rtt_stop(&dhd->pub, mac_list, mac_cnt));
14970 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14972 return (dhd_rtt_register_noti_callback(&dhd->pub, ctx, noti_fn));
14978 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14980 return (dhd_rtt_unregister_noti_callback(&dhd->pub, noti_fn));
14986 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14988 return (dhd_rtt_capability(&dhd->pub, capa));
14994 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
14995 return (dhd_rtt_avail_channel(&dhd->pub, channel_info));
15001 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
15002 return (dhd_rtt_enable_responder(&dhd->pub, channel_info));
15007 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
15008 return (dhd_rtt_cancel_responder(&dhd->pub));
15237 static void _dhd_apf_lock_local(dhd_info_t *dhd)
15239 if (dhd) {
15240 mutex_lock(&dhd->dhd_apf_mutex);
15244 static void _dhd_apf_unlock_local(dhd_info_t *dhd)
15246 if (dhd) {
15247 mutex_unlock(&dhd->dhd_apf_mutex);
15255 dhd_info_t *dhd = DHD_DEV_INFO(ndev); local
15256 dhd_pub_t *dhdp = &dhd->pub;
15264 ifidx = dhd_net2idx(dhd, ndev);
15317 dhd_info_t *dhd = DHD_DEV_INFO(ndev); local
15318 dhd_pub_t *dhdp = &dhd->pub;
15325 ifidx = dhd_net2idx(dhd, ndev);
15370 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev); local
15371 dhd_pub_t *dhdp = &dhd->pub;
15374 ifidx = dhd_net2idx(dhd, ndev);
15392 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15393 _dhd_apf_lock_local(dhd);
15398 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15399 _dhd_apf_unlock_local(dhd);
15405 dhd_info_t *dhd = DHD_DEV_INFO(ndev); local
15406 dhd_pub_t *dhdp = &dhd->pub;
15420 ifidx = dhd_net2idx(dhd, ndev);
15439 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev); local
15440 dhd_pub_t *dhdp = &dhd->pub;
15449 ifidx = dhd_net2idx(dhd, ndev);
15469 dhd_info_t *dhd = DHD_DEV_INFO(ndev); local
15470 dhd_pub_t *dhdp = &dhd->pub;
15504 dhd_info_t *dhd = DHD_DEV_INFO(ndev); local
15505 dhd_pub_t *dhdp = &dhd->pub;
15527 dhd_info_t *dhd = DHD_DEV_INFO(ndev); local
15528 dhd_pub_t *dhdp = &dhd->pub;
15546 dhd_info_t *dhd = DHD_DEV_INFO(ndev); local
15547 dhd_pub_t *dhdp = &dhd->pub;
15578 struct dhd_info *dhd = local
15584 dev = dhd->iflist[0]->net;
15605 ndev = dhd->iflist[i] ? dhd->iflist[i]->net : NULL;
15712 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15715 if (dhd) {
15717 if (dhd->pub.hang_report) {
15721 ret = dhd_os_send_hang_message(&dhd->pub);
15737 dhd_info_t *dhd = NULL; local
15741 dhd = DHD_DEV_INFO(dev);
15742 if (dhd) {
15743 dhdp = &dhd->pub;
15746 if (!dhd || !dhdp) {
15765 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15766 return wifi_platform_set_power(dhd->adapter, on, delay_msec);
15771 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15773 if (dhd && dhd->pub.up)
15774 return dhd->pub.force_country_change;
15781 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15783 if (!dhd->pub.is_blob)
15787 get_customized_country_code(dhd->adapter, country_iso_code, cspec,
15788 dhd->pub.dhd_cflags);
15790 get_customized_country_code(dhd->adapter, country_iso_code, cspec);
15805 BCM_REFERENCE(dhd);
15809 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15814 if (dhd && dhd->pub.up) {
15815 dhd->pub.force_country_change = FALSE;
15816 memcpy(&dhd->pub.dhd_cspec, cspec, sizeof(wl_country_t));
15825 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15829 if (dhd && dhd->pub.up) {
15838 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15843 strncpy(dhd->fw_path, fw, sizeof(dhd->fw_path) - 1);
15844 dhd->fw_path[sizeof(dhd->fw_path)-1] = '\0';
15860 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15861 dhd_net_if_lock_local(dhd);
15866 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15867 dhd_net_if_unlock_local(dhd);
15870 static void dhd_net_if_lock_local(dhd_info_t *dhd)
15873 if (dhd)
15874 mutex_lock(&dhd->dhd_net_if_mutex);
15878 static void dhd_net_if_unlock_local(dhd_info_t *dhd)
15881 if (dhd)
15882 mutex_unlock(&dhd->dhd_net_if_mutex);
15889 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
15890 if (dhd)
15891 mutex_lock(&dhd->dhd_suspend_mutex);
15898 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
15899 if (dhd)
15900 mutex_unlock(&dhd->dhd_suspend_mutex);
15906 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
15909 if (dhd)
15910 spin_lock_irqsave(&dhd->dhd_lock, flags);
15917 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
15919 if (dhd)
15920 spin_unlock_irqrestore(&dhd->dhd_lock, flags);
15980 dhd_get_pend_8021x_cnt(dhd_info_t *dhd)
15982 return (atomic_read(&dhd->pend_8021x_cnt));
15990 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
15993 int pend = dhd_get_pend_8021x_cnt(dhd);
15998 DHD_PERIM_UNLOCK(&dhd->pub);
16000 DHD_PERIM_LOCK(&dhd->pub);
16004 pend = dhd_get_pend_8021x_cnt(dhd);
16008 atomic_set(&dhd->pend_8021x_cnt, 0);
16178 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev); local
16179 dhd_pub_t *dhdp = &dhd->pub;
16198 write_dump_to_file(dhd_pub_t *dhd, uint8 *buf, int size, char *fname)
16208 dhd_convert_memdump_type_to_str(dhd->memdump_type, memdump_type, dhd->debug_dump_subcmd);
16209 clear_debug_dump_time(dhd->debug_dump_time_str);
16210 get_debug_dump_time(dhd->debug_dump_time_str);
16213 DHD_COMMON_DUMP_PATH, fname, memdump_type, dhd->debug_dump_time_str);
16217 DHD_COMMON_DUMP_PATH, fname, memdump_type, dhd->debug_dump_time_str);
16221 DHD_COMMON_DUMP_PATH, fname, memdump_type, dhd->debug_dump_time_str);
16226 DHD_COMMON_DUMP_PATH, fname, memdump_type, dhd->debug_dump_time_str);
16230 "/root/", fname, memdump_type, dhd->debug_dump_time_str);
16244 "/tmp/", fname, memdump_type, dhd->debug_dump_time_str);
16252 DHD_COMMON_DUMP_PATH, fname, memdump_type, dhd->debug_dump_time_str);
16260 dhd_print_buf_addr(dhd, "write_dump_to_file", buf, size);
16268 dhd_dump_file_manage_enqueue(dhd, memdump_path, fname);
16278 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16282 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) {
16283 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16284 ret = dhd->wakelock_rx_timeout_enable > dhd->wakelock_ctrl_timeout_enable ?
16285 dhd->wakelock_rx_timeout_enable : dhd->wakelock_ctrl_timeout_enable;
16287 if (dhd->wakelock_rx_timeout_enable)
16288 wake_lock_timeout(&dhd->wl_rxwake,
16289 msecs_to_jiffies(dhd->wakelock_rx_timeout_enable));
16290 if (dhd->wakelock_ctrl_timeout_enable)
16291 wake_lock_timeout(&dhd->wl_ctrlwake,
16292 msecs_to_jiffies(dhd->wakelock_ctrl_timeout_enable));
16294 dhd->wakelock_rx_timeout_enable = 0;
16295 dhd->wakelock_ctrl_timeout_enable = 0;
16296 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16303 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
16306 if (dhd)
16307 ret = dhd_os_wake_lock_timeout(&dhd->pub);
16313 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16316 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) {
16317 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16318 if (val > dhd->wakelock_rx_timeout_enable)
16319 dhd->wakelock_rx_timeout_enable = val;
16320 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16327 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16330 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) {
16331 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16332 if (val > dhd->wakelock_ctrl_timeout_enable)
16333 dhd->wakelock_ctrl_timeout_enable = val;
16334 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16341 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16344 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) {
16345 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16346 dhd->wakelock_ctrl_timeout_enable = 0;
16348 if (wake_lock_active(&dhd->wl_ctrlwake))
16349 wake_unlock(&dhd->wl_ctrlwake);
16351 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16358 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
16361 if (dhd)
16362 ret = dhd_os_wake_lock_rx_timeout_enable(&dhd->pub, val);
16368 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
16371 if (dhd)
16372 ret = dhd_os_wake_lock_ctrl_timeout_enable(&dhd->pub, val);
16444 wklock_info->counter = dhd->wakelock_counter; \
16457 wklock_info->counter = dhd->wakelock_counter; \
16501 static void dhd_wk_lock_trace_init(struct dhd_info *dhd)
16508 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16515 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16519 static void dhd_wk_lock_trace_deinit(struct dhd_info *dhd)
16530 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16546 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16551 dhd_info_t *dhd = (dhd_info_t *)(dhdp->info); local
16555 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16557 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16566 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16570 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) {
16571 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16572 if (dhd->wakelock_counter == 0 && !dhd->waive_wakelock) {
16574 wake_lock(&dhd->wl_wifi);
16584 dhd->wakelock_counter++;
16585 ret = dhd->wakelock_counter;
16586 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16594 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16596 if (dhd) {
16598 wake_lock(&dhd->wl_evtwake);
16609 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16611 if (dhd) {
16612 wake_lock_timeout(&dhd->wl_pmwake, msecs_to_jiffies(val));
16621 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16623 if (dhd) {
16624 wake_lock_timeout(&dhd->wl_txflwake, msecs_to_jiffies(val));
16631 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
16634 if (dhd)
16635 ret = dhd_os_wake_lock(&dhd->pub);
16641 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16646 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) {
16647 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16649 if (dhd->wakelock_counter > 0) {
16650 dhd->wakelock_counter--;
16656 if (dhd->wakelock_counter == 0 && !dhd->waive_wakelock) {
16658 wake_unlock(&dhd->wl_wifi);
16663 ret = dhd->wakelock_counter;
16665 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16672 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16674 if (dhd) {
16676 wake_unlock(&dhd->wl_evtwake);
16686 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16688 if (dhd) {
16690 if (wake_lock_active(&dhd->wl_pmwake)) {
16691 wake_unlock(&dhd->wl_pmwake);
16700 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16702 if (dhd) {
16704 if (wake_lock_active(&dhd->wl_txflwake)) {
16705 wake_unlock(&dhd->wl_txflwake);
16714 dhd_info_t *dhd; local
16718 dhd = (dhd_info_t *)(pub->info);
16723 if (dhd && (wake_lock_active(&dhd->wl_wifi) ||
16724 (wake_lock_active(&dhd->wl_wdwake))))
16727 if (dhd && (dhd->wakelock_counter > 0) && dhd_bus_dev_pm_enabled(pub))
16742 dhd_info_t *dhd; local
16747 dhd = (dhd_info_t *)(pub->info);
16748 if (!dhd) {
16754 c = dhd->wakelock_counter;
16755 l1 = wake_lock_active(&dhd->wl_wifi);
16756 l2 = wake_lock_active(&dhd->wl_wdwake);
16757 l3 = wake_lock_active(&dhd->wl_rxwake);
16758 l4 = wake_lock_active(&dhd->wl_ctrlwake);
16759 l7 = wake_lock_active(&dhd->wl_evtwake);
16761 l5 = wake_lock_active(&dhd->wl_intrwake);
16764 l6 = wake_lock_active(&dhd->wl_scanwake);
16766 l8 = wake_lock_active(&dhd->wl_pmwake);
16767 l9 = wake_lock_active(&dhd->wl_txflwake);
16778 if (dhd && (dhd->wakelock_counter > 0) && dhd_bus_dev_pm_enabled(pub)) {
16787 dhd_info_t *dhd = DHD_DEV_INFO(dev); local
16790 if (dhd)
16791 ret = dhd_os_wake_unlock(&dhd->pub);
16797 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16801 if (dhd) {
16802 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16803 if (dhd->wakelock_wd_counter == 0 && !dhd->waive_wakelock) {
16806 wake_lock(&dhd->wl_wdwake);
16809 dhd->wakelock_wd_counter++;
16810 ret = dhd->wakelock_wd_counter;
16811 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16818 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16822 if (dhd) {
16823 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16824 if (dhd->wakelock_wd_counter > 0) {
16825 dhd->wakelock_wd_counter = 0;
16826 if (!dhd->waive_wakelock) {
16828 wake_unlock(&dhd->wl_wdwake);
16832 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16842 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16844 if (dhd) {
16845 wake_lock_timeout(&dhd->wl_intrwake, msecs_to_jiffies(val));
16854 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16856 if (dhd) {
16858 if (wake_lock_active(&dhd->wl_intrwake)) {
16859 wake_unlock(&dhd->wl_intrwake);
16871 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16873 if (dhd) {
16874 wake_lock_timeout(&dhd->wl_scanwake, msecs_to_jiffies(val));
16883 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16885 if (dhd) {
16887 if (wake_lock_active(&dhd->wl_scanwake)) {
16888 wake_unlock(&dhd->wl_scanwake);
16900 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16904 if (dhd && (dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) {
16905 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16908 if (dhd->waive_wakelock == FALSE) {
16915 dhd->wakelock_before_waive = dhd->wakelock_counter;
16916 dhd->waive_wakelock = TRUE;
16918 ret = dhd->wakelock_wd_counter;
16919 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16926 dhd_info_t *dhd = (dhd_info_t *)(pub->info); local
16930 if (!dhd)
16932 if ((dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT) == 0)
16935 spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
16938 if (!dhd->waive_wakelock)
16941 dhd->waive_wakelock = FALSE;
16952 if (dhd->wakelock_before_waive == 0 && dhd->wakelock_counter > 0) {
16954 wake_lock(&dhd->wl_wifi);
16956 dhd_bus_dev_pm_stay_awake(&dhd->pub);
16958 } else if (dhd->wakelock_before_waive > 0 && dhd->wakelock_counter == 0) {
16960 wake_unlock(&dhd->wl_wifi);
16962 dhd_bus_dev_pm_relax(&dhd->pub);
16965 dhd->wakelock_before_waive = 0;
16967 ret = dhd->wakelock_wd_counter;
16968 spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
16972 void dhd_os_wake_lock_init(struct dhd_info *dhd)
16975 dhd->wakelock_counter = 0;
16976 dhd->wakelock_rx_timeout_enable = 0;
16977 dhd->wakelock_ctrl_timeout_enable = 0;
16980 wake_lock_init(&dhd->wl_wifi, WAKE_LOCK_SUSPEND, "wlan_wake");
16981 wake_lock_init(&dhd->wl_rxwake, WAKE_LOCK_SUSPEND, "wlan_rx_wake");
16982 wake_lock_init(&dhd->wl_ctrlwake, WAKE_LOCK_SUSPEND, "wlan_ctrl_wake");
16983 wake_lock_init(&dhd->wl_evtwake, WAKE_LOCK_SUSPEND, "wlan_evt_wake");
16984 wake_lock_init(&dhd->wl_pmwake, WAKE_LOCK_SUSPEND, "wlan_pm_wake");
16985 wake_lock_init(&dhd->wl_txflwake, WAKE_LOCK_SUSPEND, "wlan_txfl_wake");
16987 wake_lock_init(&dhd->wl_intrwake, WAKE_LOCK_SUSPEND, "wlan_oob_irq_wake");
16990 wake_lock_init(&dhd->wl_scanwake, WAKE_LOCK_SUSPEND, "wlan_scan_wake");
16994 dhd_wk_lock_trace_init(dhd);
16998 void dhd_os_wake_lock_destroy(struct dhd_info *dhd)
17002 dhd->wakelock_counter = 0;
17003 dhd->wakelock_rx_timeout_enable = 0;
17004 dhd->wakelock_ctrl_timeout_enable = 0;
17005 wake_lock_destroy(&dhd->wl_wifi);
17006 wake_lock_destroy(&dhd->wl_rxwake);
17007 wake_lock_destroy(&dhd->wl_ctrlwake);
17008 wake_lock_destroy(&dhd->wl_evtwake);
17009 wake_lock_destroy(&dhd->wl_pmwake);
17010 wake_lock_destroy(&dhd->wl_txflwake);
17012 wake_lock_destroy(&dhd->wl_intrwake);
17015 wake_lock_destroy(&dhd->wl_scanwake);
17018 dhd_wk_lock_trace_deinit(dhd);
17051 dhd_info_t *dhd = NULL; local
17059 dhd = DHD_DEV_INFO(net);
17060 if (!dhd)
17063 ifidx = dhd_net2idx(dhd, net);
17069 DHD_OS_WAKE_LOCK(&dhd->pub);
17070 DHD_PERIM_LOCK(&dhd->pub);
17072 ret = dhd_wl_ioctl(&dhd->pub, ifidx, ioc, ioc->buf, ioc->len);
17073 dhd_check_hang(net, &dhd->pub, ret);
17075 DHD_PERIM_UNLOCK(&dhd->pub);
17076 DHD_OS_WAKE_UNLOCK(&dhd->pub);
17106 dhd_info_t *dhd; local
17111 dhd = DHD_DEV_INFO(dev);
17112 dhdp = &dhd->pub;
17170 void dhd_wlfc_plat_init(void *dhd)
17173 dhdsdio_func_blocksize((dhd_pub_t *)dhd, 2, sd_f2_blocksize);
17178 void dhd_wlfc_plat_deinit(void *dhd)
17181 dhdsdio_func_blocksize((dhd_pub_t *)dhd, 2, sd_f2_blocksize);
17341 void dhd_set_cpucore(dhd_pub_t *dhd, int set)
17345 if (!(dhd->chan_isvht80)) {
17346 DHD_ERROR(("%s: chan_status(%d) cpucore!!!\n", __FUNCTION__, dhd->chan_isvht80));
17353 e_dpc = set_cpus_allowed_ptr(dhd->current_dpc,
17356 e_dpc = set_cpus_allowed_ptr(dhd->current_dpc,
17370 e_rxf = set_cpus_allowed_ptr(dhd->current_rxf,
17373 e_rxf = set_cpus_allowed_ptr(dhd->current_rxf,
17397 dhd_info_t *dhd = dhdp->info; local
17402 ifp = dhd->iflist[idx];
17410 dhd_info_t *dhd = dhdp->info; local
17415 ifp = dhd->iflist[idx];
17430 dhd_info_t *dhd = dhdp->info; local
17435 ifp = dhd->iflist[idx];
17443 dhd_info_t *dhd = dhdp->info; local
17448 ifp = dhd->iflist[idx];
17478 dhd_get_rnd_info(dhd_pub_t *dhd)
17513 ret = vfs_read(fp, (char *)&dhd->rnd_len, sizeof(dhd->rnd_len), &pos);
17519 dhd->rnd_buf = MALLOCZ(dhd->osh, dhd->rnd_len);
17520 if (!dhd->rnd_buf) {
17525 ret = vfs_read(fp, (char *)dhd->rnd_buf, dhd->rnd_len, &pos);
17538 MFREE(dhd->osh, dhd->rnd_buf, dhd->rnd_len);
17539 dhd->rnd_buf = NULL;
17548 dhd_dump_rnd_info(dhd_pub_t *dhd, uint8 *rnd_buf, uint32 rnd_len)
17695 dhd_info_t *dhd = handle; local
17701 DHD_ERROR(("%s: ENTER, memdump type %u\n", __FUNCTION__, dhd->pub.memdump_type));
17703 if (!dhd) {
17708 dhdp = &dhd->pub;
17748 if (write_dump_to_file(&dhd->pub, dump->buf, dump->bufsize, "mem_dump")) {
17751 dhd->pub.memdump_success = FALSE;
17763 if (dhd->scheduled_memdump &&
17770 dhd_log_dump(dhd, flush_type, 0);
17784 if (dhd->scheduled_memdump) {
17804 if (write_dump_to_file(&dhd->pub, dump->hscb_buf,
17808 dhd->pub.memdump_success = FALSE;
17814 DHD_ERROR(("%s: memdump type %u\n", __FUNCTION__, dhd->pub.memdump_type));
17815 if (dhd->pub.memdump_enabled == DUMP_MEMFILE_BUGON &&
17817 dhd->pub.memdump_type != DUMP_TYPE_BY_SYSDUMP &&
17819 dhd->pub.memdump_type != DUMP_TYPE_BY_USER &&
17821 dhd->pub.memdump_success == TRUE &&
17824 dhd->pub.memdump_type != DUMP_TYPE_DONGLE_HOST_EVENT &&
17826 dhd->pub.memdump_type != DUMP_TYPE_CFG_VENDOR_TRIGGERED) {
17830 dhd_flush_logtrace_process(dhd);
17838 DHD_ERROR(("%s: No BUG ON, memdump type %u \n", __FUNCTION__, dhd->pub.memdump_type));
17842 MFREE(dhd->pub.osh, dump, sizeof(dhd_dump_t));
17845 DHD_BUS_BUSY_CLEAR_IN_MEMDUMP(&dhd->pub);
17848 dhd->scheduled_memdump = FALSE;
17940 dhd_info_t *dhd = dhdinfo; local
17950 if (!dhd) {
17955 dhdp = &dhd->pub;
18056 dhd_info_t *dhd = handle; local
18059 if (!dhd || !type) {
18066 wl_flush_fw_log_buffer(dhd_linux_get_primary_netdev(&dhd->pub),
18080 dhd_os_logdump_lock(&dhd->pub);
18081 DHD_OS_WAKE_LOCK(&dhd->pub);
18082 if (do_dhd_log_dump(&dhd->pub, type) != BCME_OK) {
18085 DHD_OS_WAKE_UNLOCK(&dhd->pub);
18086 dhd_os_logdump_unlock(&dhd->pub);
18274 dhdpcie_sssr_dump_get_before_after_len(dhd_pub_t *dhd, uint32 *arr_len)
18282 if (dhd->sssr_d11_before[i] && dhd->sssr_d11_outofreset[i] &&
18283 (dhd->sssr_dump_mode == SSSR_DUMP_MODE_SSSR)) {
18284 arr_len[SSSR_C0_D11_BEFORE] = (dhd->sssr_reg_info.mac_regs[i].sr_size);
18288 dhd_print_buf_addr(dhd, "SSSR_C0_D11_BEFORE",
18289 dhd->sssr_d11_before[i], arr_len[SSSR_C0_D11_BEFORE]);
18292 if (dhd->sssr_d11_after[i] && dhd->sssr_d11_outofreset[i]) {
18293 arr_len[SSSR_C0_D11_AFTER] = (dhd->sssr_reg_info.mac_regs[i].sr_size);
18297 dhd_print_buf_addr(dhd, "SSSR_C0_D11_AFTER",
18298 dhd->sssr_d11_after[i], arr_len[SSSR_C0_D11_AFTER]);
18304 if (dhd->sssr_d11_before[i] && dhd->sssr_d11_outofreset[i] &&
18305 (dhd->sssr_dump_mode == SSSR_DUMP_MODE_SSSR)) {
18306 arr_len[SSSR_C1_D11_BEFORE] = (dhd->sssr_reg_info.mac_regs[i].sr_size);
18310 dhd_print_buf_addr(dhd, "SSSR_C1_D11_BEFORE",
18311 dhd->sssr_d11_before[i], arr_len[SSSR_C1_D11_BEFORE]);
18314 if (dhd->sssr_d11_after[i] && dhd->sssr_d11_outofreset[i]) {
18315 arr_len[SSSR_C1_D11_AFTER] = (dhd->sssr_reg_info.mac_regs[i].sr_size);
18319 dhd_print_buf_addr(dhd, "SSSR_C1_D11_AFTER",
18320 dhd->sssr_d11_after[i], arr_len[SSSR_C1_D11_AFTER]);
18324 if (dhd->sssr_reg_info.vasip_regs.vasip_sr_size) {
18325 arr_len[SSSR_DIG_BEFORE] = (dhd->sssr_reg_info.vasip_regs.vasip_sr_size);
18326 arr_len[SSSR_DIG_AFTER] = (dhd->sssr_reg_info.vasip_regs.vasip_sr_size);
18332 if (dhd->sssr_dig_buf_before) {
18333 dhd_print_buf_addr(dhd, "SSSR_DIG_BEFORE",
18334 dhd->sssr_dig_buf_before, arr_len[SSSR_DIG_BEFORE]);
18336 if (dhd->sssr_dig_buf_after) {
18337 dhd_print_buf_addr(dhd, "SSSR_DIG_AFTER",
18338 dhd->sssr_dig_buf_after, arr_len[SSSR_DIG_AFTER]);
18341 } else if ((dhd->sssr_reg_info.length > OFFSETOF(sssr_reg_info_v1_t, dig_mem_info)) &&
18342 dhd->sssr_reg_info.dig_mem_info.dig_sr_addr) {
18343 arr_len[SSSR_DIG_BEFORE] = (dhd->sssr_reg_info.dig_mem_info.dig_sr_size);
18344 arr_len[SSSR_DIG_AFTER] = (dhd->sssr_reg_info.dig_mem_info.dig_sr_size);
18350 if (dhd->sssr_dig_buf_before) {
18351 dhd_print_buf_addr(dhd, "SSSR_DIG_BEFORE",
18352 dhd->sssr_dig_buf_before, arr_len[SSSR_DIG_BEFORE]);
18354 if (dhd->sssr_dig_buf_after) {
18355 dhd_print_buf_addr(dhd, "SSSR_DIG_AFTER",
18356 dhd->sssr_dig_buf_after, arr_len[SSSR_DIG_AFTER]);
19390 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
19391 dhd_pub_t *dhdp = &dhd->pub;
19421 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
19422 dhd_pub_t *dhdp = &dhd->pub;
19469 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
19470 dhd_pub_t *dhdp = &dhd->pub;
19488 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
19489 dhd_pub_t *dhdp = &dhd->pub;
19501 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
19502 dhd_pub_t *dhdp = &dhd->pub;
19512 dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); local
19513 dhd_pub_t *dhdp = &dhd->pub;
19559 dhd_info_t *dhd = dhdp->info; local
19564 ifp = dhd->iflist[bssidx];
19570 dhd_info_t *dhd = dhdp->info; local
19575 ifp = dhd->iflist[idx];
19586 dhd_info_t *dhd = dhdp->info; local
19589 ifp = dhd->iflist[idx];
19611 dhd_info_t *dhd = dhdp->info; local
19616 ifp = dhd->iflist[idx];
19625 dhd_info_t *dhd = dhdp->info; local
19630 ifp = dhd->iflist[idx];
19639 dhd_info_t *dhd = dhdp->info; local
19644 ifp = dhd->iflist[idx];
19653 dhd_info_t *dhd = dhdp->info; local
19656 ifp = dhd->iflist[idx];
19666 dhd_info_t *dhd = dhdp->info; local
19671 ifp = dhd->iflist[idx];
19680 dhd_info_t *dhd = dhdp->info; local
19683 ifp = dhd->iflist[idx];
19697 dhd_info_t *dhd = dhdp->info; local
19702 ifp = dhd->iflist[idx];
19711 dhd_info_t *dhd = dhdp->info; local
19714 ifp = dhd->iflist[idx];
19725 dhd_info_t *dhd = dhdp->info; local
19730 ifp = dhd->iflist[idx];
19739 dhd_info_t *dhd = dhdp->info; local
19742 ifp = dhd->iflist[idx];
19755 dhd_info_t *dhd = DHD_DEV_INFO(net); local
19760 ifidx = dhd_net2idx(dhd, net);
19767 if (dhd->pub.op_mode == DHD_FLAG_IBSS_MODE) {
19782 ifp = dhd->iflist[ifidx];
19958 dhd_info_t *dhd; local
19969 dhd = DHD_DEV_INFO(argos_rps_ctrl_data.wlan_primary_netdev);
19970 if (dhd == NULL) {
19974 dhdp = &dhd->pub;
20102 dhd_info_t *dhd = dhdp->info; local
20104 if (dhd->iflist[0] && dhd->iflist[0]->net)
20105 return dhd->iflist[0]->net;
20230 dhd_log_dump_init(dhd_pub_t *dhd)
20241 dhd_info_t *dhd_info = dhd->info;
20287 prealloc_buf = DHD_OS_PREALLOC(dhd, prealloc_idx++, LOG_DUMP_TOTAL_BUFSIZE);
20288 dld_buf_special->buffer = DHD_OS_PREALLOC(dhd, prealloc_idx++,
20291 prealloc_buf = MALLOCZ(dhd->osh, LOG_DUMP_TOTAL_BUFSIZE);
20292 dld_buf_special->buffer = MALLOCZ(dhd->osh, dld_buf_size[DLD_BUF_TYPE_SPECIAL]);
20306 dld_buf->dhd_pub = dhd;
20323 dhd->ecntr_dbg_ring = MALLOCZ(dhd->osh, sizeof(dhd_dbg_ring_t));
20324 if (!dhd->ecntr_dbg_ring)
20327 ring = (dhd_dbg_ring_t *)dhd->ecntr_dbg_ring;
20328 ret = dhd_dbg_ring_init(dhd, ring, ECNTR_RING_ID,
20346 dhd->rtt_dbg_ring = MALLOCZ(dhd->osh, sizeof(dhd_dbg_ring_t));
20347 if (!dhd->rtt_dbg_ring)
20350 ring = (dhd_dbg_ring_t *)dhd->rtt_dbg_ring;
20351 ret = dhd_dbg_ring_init(dhd, ring, RTT_RING_ID,
20374 dhd->concise_dbg_buf = MALLOC(dhd->osh, CONCISE_DUMP_BUFLEN);
20375 if (!dhd->concise_dbg_buf) {
20382 ret = dhd_event_log_filter_init(dhd,
20390 cookie_buf = MALLOC(dhd->osh, LOG_DUMP_COOKIE_BUFSIZE);
20396 ret = dhd_logdump_cookie_init(dhd, cookie_buf, LOG_DUMP_COOKIE_BUFSIZE);
20398 MFREE(dhd->osh, cookie_buf, LOG_DUMP_COOKIE_BUFSIZE);
20405 if (dhd->logdump_cookie) {
20406 dhd_logdump_cookie_deinit(dhd);
20407 MFREE(dhd->osh, dhd->logdump_cookie, LOG_DUMP_COOKIE_BUFSIZE);
20408 dhd->logdump_cookie = NULL;
20411 if (dhd->event_log_filter) {
20412 dhd_event_log_filter_deinit(dhd);
20416 if (dhd->concise_dbg_buf) {
20417 MFREE(dhd->osh, dhd->concise_dbg_buf, CONCISE_DUMP_BUFLEN);
20421 if (dhd->ecntr_dbg_ring) {
20422 ring = (dhd_dbg_ring_t *)dhd->ecntr_dbg_ring;
20423 dhd_dbg_ring_deinit(dhd, ring);
20426 MFREE(dhd->osh, ring, sizeof(dhd_dbg_ring_t));
20427 dhd->ecntr_dbg_ring = NULL;
20432 if (dhd->rtt_dbg_ring) {
20433 ring = (dhd_dbg_ring_t *)dhd->rtt_dbg_ring;
20434 dhd_dbg_ring_deinit(dhd, ring);
20437 MFREE(dhd->osh, ring, sizeof(dhd_dbg_ring_t));
20438 dhd->rtt_dbg_ring = NULL;
20444 DHD_OS_PREFREE(dhd, prealloc_buf, LOG_DUMP_TOTAL_BUFSIZE);
20447 DHD_OS_PREFREE(dhd, dld_buf_special->buffer,
20452 MFREE(dhd->osh, prealloc_buf, LOG_DUMP_TOTAL_BUFSIZE);
20455 MFREE(dhd->osh, dld_buf_special->buffer,
20469 dhd_log_dump_deinit(dhd_pub_t *dhd)
20473 dhd_info_t *dhd_info = dhd->info;
20478 if (dhd->concise_dbg_buf) {
20479 MFREE(dhd->osh, dhd->concise_dbg_buf, CONCISE_DUMP_BUFLEN);
20480 dhd->concise_dbg_buf = NULL;
20483 if (dhd->logdump_cookie) {
20484 dhd_logdump_cookie_deinit(dhd);
20485 MFREE(dhd->osh, dhd->logdump_cookie, LOG_DUMP_COOKIE_BUFSIZE);
20486 dhd->logdump_cookie = NULL;
20490 if (dhd->event_log_filter) {
20491 dhd_event_log_filter_deinit(dhd);
20496 if (dhd->ecntr_dbg_ring) {
20497 ring = (dhd_dbg_ring_t *)dhd->ecntr_dbg_ring;
20498 dhd_dbg_ring_deinit(dhd, ring);
20501 MFREE(dhd->osh, ring, sizeof(dhd_dbg_ring_t));
20502 dhd->ecntr_dbg_ring = NULL;
20507 if (dhd->rtt_dbg_ring) {
20508 ring = (dhd_dbg_ring_t *)dhd->rtt_dbg_ring;
20509 dhd_dbg_ring_deinit(dhd, ring);
20512 MFREE(dhd->osh, ring, sizeof(dhd_dbg_ring_t));
20513 dhd->rtt_dbg_ring = NULL;
20522 DHD_OS_PREFREE(dhd, dld_buf->buffer, LOG_DUMP_TOTAL_BUFSIZE);
20525 DHD_OS_PREFREE(dhd, dld_buf_special->buffer,
20530 MFREE(dhd->osh, dld_buf->buffer, LOG_DUMP_TOTAL_BUFSIZE);
20533 MFREE(dhd->osh, dld_buf_special->buffer,
20637 dhd_info_t * dhd;
20640 dhd = dhdp->info;
20641 if (dhd) {
20642 flush_workqueue(dhd->tx_wq);
20643 flush_workqueue(dhd->rx_wq);
20655 dhd_info_t *dhd = DHD_DEV_INFO(dev);
20657 if (dhd->duart_execute) {
20921 dhd_pub_t *dhd = (dhd_pub_t *) pub;
20926 iflist = dhd->info->iflist[idx];
20958 dhd_pub_t *dhd = (dhd_pub_t *) dhd_bandsteer_cntx->dhd_pub;
20960 dhd_deferred_schedule_work(dhd->info->dhd_deferred_wq,
20967 int dhd_read_from_file(dhd_pub_t *dhd)
20972 NULL_CHECK(dhd, "dhd is NULL", ret);
20974 buf = MALLOCZ(dhd->osh, FILE_BLOCK_READ_SIZE);
20981 fd = dhd_os_open_image1(dhd, FILTER_IE_PATH);
20990 if ((ret = dhd_parse_filter_ie(dhd, buf)) < 0) {
20997 dhd_os_close_image1(dhd, fd);
21000 MFREE(dhd->osh, buf, FILE_BLOCK_READ_SIZE);
21030 int dhd_parse_oui(dhd_pub_t *dhd, uint8 *inbuf, uint8 *oui, int len)
21082 int dhd_parse_filter_ie(dhd_pub_t *dhd, uint8 *buf)
21092 element_count = dhd_get_filter_ie_count(dhd, buf);
21096 p_filter_iov = MALLOCZ(dhd->osh, filter_iovsize);
21123 if (dhd_check_valid_ie(dhd, token, strlen(token)) == BCME_ERROR) {
21133 if ((ele_token == NULL) || (dhd_check_valid_ie(dhd, ele_token,
21142 oui_size = dhd_parse_oui(dhd, token, &(data[len]), strlen(token));
21153 dhd_parse_oui(dhd, oui_token,
21161 if (dhd_check_valid_ie(dhd, token,
21171 if ((type == NULL) || (dhd_check_valid_ie(dhd, type,
21180 (dhd_check_valid_ie(dhd, token,
21208 ret = dhd_iovar(dhd, 0, "filter_ie", (void *)p_filter_iov,
21216 MFREE(dhd->osh, p_filter_iov, filter_iovsize);
21251 dhd_info_t *dhd = NULL;
21255 dhd = DHD_DEV_INFO(dev);
21257 if (dhd) {
21258 dhdp = &dhd->pub;
21261 if (!dhd || !dhdp) {
21341 dhd_info_t *dhd = handle;
21345 if (!dhd) {
21350 dhdp = &dhd->pub;
21352 if (!(dhd->dhd_state & DHD_ATTACH_STATE_DONE)) {
21382 dhd_info_t *dhd = handle;
21384 if (!dhd) {
21389 if (dhd_pktlog_dump_write_file(&dhd->pub)) {
21484 dhd_print_tasklet_status(dhd_pub_t *dhd)
21488 if (!dhd) {
21493 dhdinfo = dhd->info;
22562 dhd_dump_file_manage_enqueue(dhd_pub_t *dhd, char *dump_path, char *fname)
22569 if (!dhd || !dhd->dump_file_manage) {
22571 __FUNCTION__, dhd, (dhd ? dhd->dump_file_manage : NULL)));
22575 fm_ptr = dhd->dump_file_manage;
22761 dhd_info_t *dhd = (dhd_info_t *)(dhdp->info);
22773 ifp = dhd->iflist[ifidx];
22817 dhd_info_t *dhd;
22820 dhd = (dhd_info_t *)(pub->info);
22822 if (dhd) {
22823 spin_lock_irqsave(&dhd->hp2p_lock, flags);
22832 dhd_info_t *dhd;
22834 dhd = (dhd_info_t *)(pub->info);
22836 if (dhd) {
22837 spin_unlock_irqrestore(&dhd->hp2p_lock, flags);
22845 dhd_info_t *dhd = (dhd_info_t *)handle;
22848 if (!dhd) {
22853 dhdp = &dhd->pub;
22898 dhd_info_t *dhd = handle;
22901 if (!dhd) {
22907 dhdp = &dhd->pub;