Lines Matching full:pub
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)
728 #define DHD_IF_ROLE(pub, idx) ((pub)->info->iflist[idx]->role) argument
729 #define DHD_IF_ROLE_AP(pub, idx) (DHD_IF_ROLE(pub, idx) == WLC_E_IF_ROLE_AP) argument
730 #define DHD_IF_ROLE_STA(pub, idx) (DHD_IF_ROLE(pub, idx) == WLC_E_IF_ROLE_STA) argument
731 #define DHD_IF_ROLE_P2PGO(pub, idx) (DHD_IF_ROLE(pub, idx) == WLC_E_IF_ROLE_P2P_GO) argument
958 DHD_OS_WAKE_LOCK_WAIVE(&dhdinfo->pub); in dhd_pm_callback()
959 dhd_wlfc_suspend(&dhdinfo->pub); in dhd_pm_callback()
960 DHD_OS_WAKE_LOCK_RESTORE(&dhdinfo->pub); in dhd_pm_callback()
962 dhd_wlfc_resume(&dhdinfo->pub); in dhd_pm_callback()
983 static void dhd_os_rxflock(dhd_pub_t *pub);
984 static void dhd_os_rxfunlock(dhd_pub_t *pub);
1055 .pub = {
1065 #define DHD_PUB_NULL (&dhd_info_null.pub)
1089 static void dhd_sta_free(dhd_pub_t *pub, dhd_sta_t *sta);
1209 dhd_sta_free(&ifp->info->pub, sta); in dhd_if_del_sta_list()
1361 dhd_find_sta(void *pub, int ifidx, void *ea) in dhd_find_sta() argument
1368 ifp = dhd_get_ifp((dhd_pub_t *)pub, ifidx); in dhd_find_sta()
1395 dhd_add_sta(void *pub, int ifidx, void *ea) in dhd_add_sta() argument
1402 ifp = dhd_get_ifp((dhd_pub_t *)pub, ifidx); in dhd_add_sta()
1411 sta = dhd_sta_alloc((dhd_pub_t *)pub); in dhd_add_sta()
1438 dhd_del_all_sta(void *pub, int ifidx) in dhd_del_all_sta() argument
1444 ifp = dhd_get_ifp((dhd_pub_t *)pub, ifidx); in dhd_del_all_sta()
1456 dhd_sta_free(&ifp->info->pub, sta); in dhd_del_all_sta()
1460 bcm_l2_filter_arp_table_update(((dhd_pub_t*)pub)->osh, in dhd_del_all_sta()
1462 sta->ea.octet, FALSE, ((dhd_pub_t*)pub)->tickcnt); in dhd_del_all_sta()
1476 dhd_del_sta(void *pub, int ifidx, void *ea) in dhd_del_sta() argument
1483 ifp = dhd_get_ifp((dhd_pub_t *)pub, ifidx); in dhd_del_sta()
1497 dhd_sta_free(&ifp->info->pub, sta); in dhd_del_sta()
1507 bcm_l2_filter_arp_table_update(((dhd_pub_t*)pub)->osh, ifp->phnd_arp_table, FALSE, in dhd_del_sta()
1508 ea, FALSE, ((dhd_pub_t*)pub)->tickcnt); in dhd_del_sta()
1516 dhd_findadd_sta(void *pub, int ifidx, void *ea) in dhd_findadd_sta() argument
1520 sta = dhd_find_sta(pub, ifidx, ea); in dhd_findadd_sta()
1524 sta = dhd_add_sta(pub, ifidx, ea); in dhd_findadd_sta()
1543 snapshot = (dhd_sta_t *)MALLOC(dhd->pub.osh, sizeof(dhd_sta_t)); in dhd_sta_list_snapshot()
1567 MFREE(dhd->pub.osh, sta, sizeof(dhd_sta_t)); in dhd_sta_list_snapshot_free()
1584 dhd_axi_error(&dhd->pub); in dhd_axi_error_dispatcher_fn()
2375 dhd_pub_t *dhdp = &dhd->pub;
2487 struct net_device * dhd_idx2net(void *pub, int ifidx)
2489 struct dhd_pub *dhd_pub = (struct dhd_pub *)pub;
2606 if (!dhd->pub.early_suspended)
2614 if (!(bufp = buf = MALLOC(dhd->pub.osh, buflen))) {
2616 dhd_ifname(&dhd->pub, ifidx), cnt));
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)));
2724 ret = dhd_wl_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
2727 dhd_ifname(&dhd->pub, ifidx), ltoh32(allmulti)));
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)));
2743 memcpy(dhd->pub.mac.octet, addr, ETHER_ADDR_LEN);
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);
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);
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) {
3044 DHD_PERIM_UNLOCK(&dhd->pub);
3045 DHD_OS_WAKE_UNLOCK(&dhd->pub);
3068 DHD_OS_WAKE_LOCK(&dhd->pub);
3069 DHD_PERIM_LOCK(&dhd->pub);
3073 if (ifp == NULL || !dhd->pub.up) {
3082 DHD_GENERAL_LOCK(&dhd->pub, flags);
3084 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
3105 DHD_PERIM_UNLOCK(&dhd->pub);
3106 DHD_OS_WAKE_UNLOCK(&dhd->pub);
3168 dhd_os_wlfc_block(dhd_pub_t *pub)
3170 dhd_info_t *di = (dhd_info_t *)(pub->info);
3177 dhd_os_wlfc_unblock(dhd_pub_t *pub)
3179 dhd_info_t *di = (dhd_info_t *)(pub->info);
3391 PKTCFREE(dhd->pub.osh, pktbuf, TRUE);
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);
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)) {
3578 DHD_ERROR(("%s: xmit rejected pub.up=%d busstate=%d \n",
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);
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);
3608 DHD_OS_WAKE_UNLOCK(&dhd->pub);
3613 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
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)) {
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);
3749 DHD_OS_WAKE_UNLOCK(&dhd->pub);
3758 struct dhd_pub * pub; local
3762 pub = work->pub;
3766 if (atomic_read(&pub->block_bus) || pub->busstate == DHD_BUS_DOWN) {
3770 DHD_OS_WAKE_LOCK(pub);
3771 if (pm_runtime_get_sync(dhd_bus_to_dev(pub->bus)) >= 0) {
3774 pm_runtime_mark_last_busy(dhd_bus_to_dev(pub->bus));
3775 pm_runtime_put_autosuspend(dhd_bus_to_dev(pub->bus));
3777 DHD_OS_WAKE_UNLOCK(pub);
3792 bus = dhd->pub.bus;
3794 if (atomic_read(&dhd->pub.block_bus)) {
3825 if (dhd->pub.busstate == DHD_BUS_SUSPEND) {
3828 dhd_netif_stop_queue(dhd->pub.bus);
3854 } else if (dhd->pub.busstate == DHD_BUS_DATA) {
3882 rx_work->pub = dhdp;
4048 dhdp = &dhd->pub;
4051 DHD_ERROR(("%s: dhd pub is null \n", __FUNCTION__));
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,
4211 if (dhd->pub.dongle_edl_support) {
4212 ret = dhd_prot_process_edl_complete(&dhd->pub, &dhd->event_data);
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++;
4821 dhd->pub.up))
4963 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF);
5011 uint datalen = PKTLEN(dhd->pub.osh, txp);
5014 dhd->pub.tx_packets++;
5038 ifp = dhd_get_ifp_by_ndev(&dhd->pub, net);
5045 if (dhd->pub.up) {
5047 dhd_prot_dstats(&dhd->pub);
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);
5107 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
5110 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
5125 if (dhd->pub.dongle_reset) {
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);
5150 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
5152 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
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);
5191 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
5205 if (dhd->pub.dongle_reset) {
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);
5343 dhd_pub_t *pub = &dhd->pub; local
5356 dhd->pub.current_rxf = current;
5371 skb = dhd_rxf_dequeue(pub);
5377 void *skbnext = PKTNEXT(pub->osh, skb);
5378 PKTSETNEXT(pub->osh, skb, NULL);
5391 DHD_OS_WAKE_UNLOCK(pub);
5497 if (dhd->pub.busstate != DHD_BUS_DOWN) {
5501 if (dhd_bus_dpc(dhd->pub.bus)) {
5505 dhd_bus_stop(dhd->pub.bus, TRUE);
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));
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));
5636 snprintf(info->version, sizeof(info->version), "%lu", dhd->pub.drv_version);
5681 else if (!dhd->pub.up) {
5687 else if (dhd->pub.iswl)
5692 snprintf(info.version, sizeof(info.version), "%lu", dhd->pub.drv_version);
5959 dhd->pub.hang_was_sent = 0;
5976 dhd_bus_update_fw_nv_path(dhd->pub.bus,
5983 if (dhd_sync_with_dongle(&dhd->pub) < 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);
6059 return dhd_bus_get(&dhd->pub, WLAN_MODULE);
6066 return dhd_bus_put(&dhd->pub, WLAN_MODULE);
6142 dhd_os_send_hang_message(&dhd->pub);
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,
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,
6274 dhd_set_monitor(dhd_pub_t *pub, int ifidx, int val)
6276 dhd_info_t *dhd = pub->info;
6325 dhd = &dhd_info->pub;
6338 int dhd_ioctl_process(dhd_pub_t *pub, int ifidx, dhd_ioctl_t *ioc, void *data_buf)
6344 net = dhd_idx2net(pub, ifidx);
6359 bcmerror = dhd_ioctl((void *)pub, ioc, data_buf, buflen);
6361 pub->bcmerror = bcmerror;
6370 if (pub->busstate == DHD_BUS_DOWN || pub->busstate == DHD_BUS_LOAD) {
6371 if ((!pub->dongle_trap_occured) && allow_delay_fwdl) {
6378 ret = dhd_bus_start(pub);
6390 if (!pub->iswl) {
6416 bcmerror = dhd_wl_ioctl(pub, ifidx, (wl_ioctl_t *)ioc, data_buf, buflen);
6431 dhd_set_monitor(pub, ifidx, val);
6437 dhd_check_hang(net, pub, bcmerror);
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);
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);
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);
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));
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;
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;
6795 DHD_STATLOG_CTRL(&dhd->pub, ST(WLAN_POWER_OFF), ifidx, 0);
6803 dhd_cleanup_m4_state_work(&dhd->pub, ifidx);
6806 dhd_dump_pkt_clear(&dhd->pub);
6811 dhd_remove_if(&dhd->pub, i, FALSE);
6850 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF);
6865 DHD_SSSR_DUMP_DEINIT(&dhd->pub);
6868 dhd_wlfc_cleanup(&dhd->pub, NULL, 0);
6873 dhd_event_logtrace_flush_queue(&dhd->pub);
6876 MFREE(dhd->pub.osh, dhd->event_data.fmts,
6881 MFREE(dhd->pub.osh, dhd->event_data.raw_fmts,
6886 MFREE(dhd->pub.osh, dhd->event_data.raw_sstr,
6891 MFREE(dhd->pub.osh, dhd->event_data.rom_raw_sstr,
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);
6957 mutex_unlock(&dhd->pub.ndev_op_sync);
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);
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,
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;
7109 DHD_STATLOG_CTRL(&dhd->pub, ST(WLAN_POWER_ON), ifidx, 0);
7125 ret = dhd_bus_get(&dhd->pub, WLAN_MODULE);
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);
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);
7413 if (dhd->pub.up == 0) {
7455 if (dhd->pub.busstate == DHD_BUS_DATA) {
7473 if (wl_cfg80211_notify_ifadd(dhd_linux_get_primary_netdev(&dhdinfo->pub),
7484 dhd_if_event_t *if_event = MALLOC(dhdinfo->pub.osh, sizeof(dhd_if_event_t));
7487 MALLOCED(dhdinfo->pub.osh)));
7508 if (wl_cfg80211_notify_ifdel(dhd_linux_get_primary_netdev(&dhdinfo->pub),
7516 if_event = MALLOC(dhdinfo->pub.osh, sizeof(dhd_if_event_t));
7519 MALLOCED(dhdinfo->pub.osh)));
7536 wl_cfg80211_notify_ifchange(dhd_linux_get_primary_netdev(&dhdinfo->pub),
7549 dhd_nfct_info_t *nfct = dhd->pub.nfct;
7619 if (dhd_natoe_prep_send_exception_port_ioctl(&dhd->pub, ct_ioc) < 0) {
7797 ifp = MALLOC(dhdinfo->pub.osh, sizeof(dhd_if_t));
7900 MFREE(dhdinfo->pub.osh, ifp, sizeof(*ifp));
7944 dhd_pub_t *dhdp = &dhdinfo->pub;
8038 MFREE(dhdinfo->pub.osh, ifp, sizeof(*ifp));
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 */
8443 dhd->pub.is_bt_recovery_required = FALSE;
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;
8462 dhd->pub.dhd_cspec.country_abbrev, &dhd->pub.dhd_cspec,
8463 dhd->pub.dhd_cflags);
8468 dhd->pub.wet_info = dhd_get_wet_info(&dhd->pub);
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;
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;
8518 if (!(dhd_ulp_init(osh, &dhd->pub)))
8523 dhd->pub.req_hang_type = 0;
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);
8551 init_waitqueue_head(&dhd->pub.tx_completion_wait);
8552 dhd->pub.dhd_bus_busy_state = 0;
8559 spin_lock_init(&dhd->pub.tdls_lock);
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) {
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) {
8722 dhd_dbg_ring_proc_create(&dhd->pub);
8739 bzero(&dhd->pub.skbbuf[0], sizeof(void *) * MAXSKBPEND);
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);
8810 DHD_LB_STATS_INIT(&dhd->pub);
8849 dhd_lb_tx_compl_handler, (ulong)(&dhd->pub));
8855 dhd_lb_rx_compl_handler, (ulong)(&dhd->pub));
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) {
8903 DHD_SSSR_MEMPOOL_INIT(&dhd->pub);
8907 if (DHD_EDL_MEM_INIT(&dhd->pub) != BCME_OK) {
8917 dhd->pub.nfct = dhd_ct_open(&dhd->pub, NFNL_SUBSYS_CTNETLINK | NFNL_SUBSYS_CTNETLINK_EXP,
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;
8984 DHD_TRACE(("%s: Calling dhd_detach dhd_state 0x%x &dhd->pub %p\n",
8985 __FUNCTION__, dhd_state, &dhd->pub));
8987 dhd_detach(&dhd->pub);
8988 dhd_free(&dhd->pub);
9079 chip_id = dhd_bus_chip_id(&dhdinfo->pub);
9080 chip_rev = dhd_bus_chiprev_id(&dhdinfo->pub);
9081 chip_module = dhd_bus_chipmodule_id(&dhdinfo->pub);
9477 if (dhd->pub.busstate == DHD_BUS_DATA && dhd_update_btfw_path(dhd, btfw_path)) {
9479 ret = dhd_bus_download_btfw(dhd->pub.bus, dhd->pub.osh, dhd->btfw_path);
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;
9539 ret = dhd_bus_download_firmware(dhd->pub.bus, dhd->pub.osh,
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);
9589 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
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);
9636 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
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);
9659 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
9662 DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
9682 aoe_update_host_ipv4_table(&dhd->pub, dhd->pend_ipaddr, TRUE, 0);
9767 ret = _dhd_tdls_enable(&dhd->pub, tdls_on, auto_on, mac);
11731 dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *param_buf, uint param_len, char *res_buf,
11753 buf = MALLOCZ(pub->osh, input_len);
11770 ret = dhd_wl_ioctl(pub, ifidx, &ioc, ioc.buf, ioc.len);
11781 buf = MALLOCZ(pub->osh, input_len);
11798 ret = dhd_wl_ioctl(pub, ifidx, &ioc, ioc.buf, ioc.len);
11816 ret = dhd_wl_ioctl(pub, ifidx, &ioc, ioc.buf, ioc.len);
11821 MFREE(pub->osh, buf, input_len);
11828 dhd_getiovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf,
11852 ret = dhd_wl_ioctl(pub, ifidx, &ioc, ioc.buf, ioc.len);
11968 dhd_pub = &dhd->pub;
11995 if (DHD_BUS_CHECK_DOWN_OR_DOWN_IN_PROGRESS(&dhd->pub) ||
11996 dhd->pub.busstate == DHD_BUS_LOAD) {
11998 __FUNCTION__, dhd->pub.busstate));
12027 dhd_aoe_hostip_clr(&dhd->pub, idx);
12028 dhd_aoe_arp_clr(&dhd->pub, idx);
12055 dhdp = &dhd->pub;
12160 dhdp = &dhd->pub;
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);
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));
12412 if (dhd->pub.busstate != DHD_BUS_DOWN) {
12414 dhd_prot_stop(&dhd->pub);
12417 dhd_bus_stop(dhd->pub.bus, TRUE);
12462 dhd->pub.up = 0;
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;
12543 dhd_ulp_deinit(dhd->pub.osh, dhdp);
12555 dhd_remove_if(&dhd->pub, i, TRUE);
12603 MFREE(dhd->pub.osh, ifp, sizeof(*ifp));
12609 DHD_GENERAL_LOCK(&dhd->pub, flags);
12612 DHD_GENERAL_UNLOCK(&dhd->pub, flags);
12615 DHD_DISABLE_RUNTIME_PM(&dhd->pub);
12640 if (dhd->pub.nfct) {
12641 dhd_ct_close(dhd->pub.nfct);
12672 DHD_LB_STATS_DEINIT(&dhd->pub);
12680 DHD_SSSR_MEMPOOL_DEINIT(&dhd->pub);
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);
12733 dhd_dbg_ring_proc_destroy(&dhd->pub);
12737 MFREE(dhd->pub.osh, dhd->event_data.fmts,
12742 MFREE(dhd->pub.osh, dhd->event_data.raw_fmts,
12747 MFREE(dhd->pub.osh, dhd->event_data.raw_sstr,
12752 MFREE(dhd->pub.osh, dhd->event_data.rom_raw_sstr,
12792 dhd_tcpack_suppress_set(&dhd->pub, TCPACK_SUP_OFF);
12832 dhd_log_dump_deinit(&dhd->pub);
12850 if (dhd->pub.dump_file_manage) {
12851 MFREE(dhd->pub.osh, dhd->pub.dump_file_manage,
12856 dhd->pub.fw_download_status = FW_UNLOADED;
12904 MFREE(dhd->pub.osh, dhd, sizeof(*dhd));
13075 dhd_os_proto_block(dhd_pub_t *pub)
13077 dhd_info_t * dhd = (dhd_info_t *)(pub->info);
13080 DHD_PERIM_UNLOCK(pub);
13084 DHD_PERIM_LOCK(pub);
13092 dhd_os_proto_unblock(dhd_pub_t *pub)
13094 dhd_info_t * dhd = (dhd_info_t *)(pub->info);
13105 dhd_os_dhdiovar_lock(dhd_pub_t *pub)
13107 dhd_info_t * dhd = (dhd_info_t *)(pub->info);
13115 dhd_os_dhdiovar_unlock(dhd_pub_t *pub)
13117 dhd_info_t * dhd = (dhd_info_t *)(pub->info);
13125 dhd_os_logdump_lock(dhd_pub_t *pub)
13129 if (!pub)
13132 dhd = (dhd_info_t *)(pub->info);
13140 dhd_os_logdump_unlock(dhd_pub_t *pub)
13144 if (!pub)
13147 dhd = (dhd_info_t *)(pub->info);
13189 dhd_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition)
13191 dhd_info_t * dhd = (dhd_info_t *)(pub->info);
13197 DHD_PERIM_UNLOCK(pub);
13201 DHD_PERIM_LOCK(pub);
13207 dhd_os_ioctl_resp_wake(dhd_pub_t *pub)
13209 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
13216 dhd_os_d3ack_wait(dhd_pub_t *pub, uint *condition)
13218 dhd_info_t * dhd = (dhd_info_t *)(pub->info);
13224 DHD_PERIM_UNLOCK(pub);
13228 DHD_PERIM_LOCK(pub);
13234 dhd_os_d3ack_wake(dhd_pub_t *pub)
13236 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
13243 dhd_os_busbusy_wait_negation(dhd_pub_t *pub, uint *condition)
13245 dhd_info_t * dhd = (dhd_info_t *)(pub->info);
13266 dhd_os_busbusy_wait_condition(dhd_pub_t *pub, uint *var, uint condition)
13268 dhd_info_t * dhd = (dhd_info_t *)(pub->info);
13285 dhd_os_busbusy_wait_bitmask(dhd_pub_t *pub, uint *var,
13288 dhd_info_t * dhd = (dhd_info_t *)(pub->info);
13301 dhd_os_dmaxfer_wait(dhd_pub_t *pub, uint *condition)
13304 dhd_info_t * dhd = (dhd_info_t *)(pub->info);
13309 DHD_PERIM_UNLOCK(pub);
13311 DHD_PERIM_LOCK(pub);
13318 dhd_os_dmaxfer_wake(dhd_pub_t *pub)
13320 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
13336 dhd_os_busbusy_wake(dhd_pub_t *pub)
13338 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
13348 dhd_pub_t *pub = bus; local
13349 dhd_info_t *dhd = (dhd_info_t *)pub->info;
13360 dhd_pub_t *pub = bus; local
13361 dhd_info_t *dhd = (dhd_info_t *)pub->info;
13371 DHD_GENERAL_LOCK(pub, flags);
13374 if (pub->busstate == DHD_BUS_DOWN) {
13375 DHD_GENERAL_UNLOCK(pub, flags);
13378 DHD_OS_WD_WAKE_UNLOCK(pub);
13387 DHD_GENERAL_UNLOCK(pub, flags);
13390 DHD_OS_WD_WAKE_UNLOCK(pub);
13397 DHD_OS_WD_WAKE_LOCK(pub);
13404 DHD_GENERAL_UNLOCK(pub, flags);
13411 dhd_pub_t *pub = bus; local
13412 dhd_info_t *dhd = (dhd_info_t *)pub->info;
13422 DHD_GENERAL_LOCK(pub, flags);
13425 if (DHD_BUS_CHECK_DOWN_OR_DOWN_IN_PROGRESS(pub)) {
13426 DHD_GENERAL_UNLOCK(pub, flags);
13443 DHD_GENERAL_UNLOCK(pub, flags);
13451 DHD_GENERAL_UNLOCK(pub, flags);
13460 dhd_os_open_image1(dhd_pub_t *pub, char *filename)
13523 dhd_os_gets_image(dhd_pub_t *pub, char *str, int len, void *image)
13564 dhd_os_close_image1(dhd_pub_t *pub, void *image)
13572 dhd_os_sdlock(dhd_pub_t *pub)
13576 dhd = (dhd_info_t *)(pub->info);
13585 dhd_os_sdunlock(dhd_pub_t *pub)
13589 dhd = (dhd_info_t *)(pub->info);
13598 dhd_os_sdlock_txq(dhd_pub_t *pub)
13602 dhd = (dhd_info_t *)(pub->info);
13607 dhd_os_sdunlock_txq(dhd_pub_t *pub)
13611 dhd = (dhd_info_t *)(pub->info);
13616 dhd_os_sdlock_rxq(dhd_pub_t *pub)
13621 dhd_os_sdunlock_rxq(dhd_pub_t *pub)
13626 dhd_os_rxflock(dhd_pub_t *pub)
13630 dhd = (dhd_info_t *)(pub->info);
13636 dhd_os_rxfunlock(dhd_pub_t *pub)
13640 dhd = (dhd_info_t *)(pub->info);
13646 dhd_os_tcpacklock(dhd_pub_t *pub)
13651 dhd = (dhd_info_t *)(pub->info);
13665 dhd_os_tcpackunlock(dhd_pub_t *pub, unsigned long flags)
13673 dhd = (dhd_info_t *)(pub->info);
13708 if (!dhd->pub.up) {
13732 bcmerror = wl_process_host_event(&dhd->pub, &ifidx, pktdata, pktlen, event, data,
13735 bcmerror = wl_process_host_event(&dhd->pub, &ifidx, pktdata, pktlen, event, data,
13766 spin_lock_irqsave(&dhd->pub.up_lock, flags);
13767 if (dhd->pub.up) {
13770 spin_unlock_irqrestore(&dhd->pub.up_lock, flags);
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);
13914 dhd_bus_update_fw_nv_path(dhd->pub.bus,
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;
13953 return dhd_bus_suspend(&dhd->pub);
13960 return dhd_bus_resume(&dhd->pub, stage);
13972 ret = dhd->pub.suspend_disable_flag;
13973 dhd->pub.suspend_disable_flag = val;
13987 ret = dhd_set_suspend(val, &dhd->pub);
14005 dhd->pub.suspend_bcn_li_dtim = val;
14019 dhd->pub.max_dtim_enable = TRUE;
14021 dhd->pub.max_dtim_enable = FALSE;
14039 dhd->pub.disable_dtim_in_suspend = TRUE;
14041 dhd->pub.disable_dtim_in_suspend = FALSE;
14071 if (num >= dhd->pub.pktfilter_count) {
14075 ret = dhd_packet_filter_add_remove(&dhd->pub, add_remove, num);
14106 return dhd_os_enable_packet_filter(&dhd->pub, val);
14116 if ((ret = dhd_sync_with_dongle(&dhd->pub)) < 0)
14127 dhd_pub_t *dhd = (&ptr->pub);
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;
14283 dhd_pub_t *dhdp = &dhd->pub;
14379 dhdp = &dhd->pub;
14524 return (dhd_pno_stop_for_ssid(&dhd->pub));
14533 return (dhd_pno_set_for_ssid(&dhd->pub, ssids_local, nssid, scan_fr,
14543 return (dhd_pno_enable(&dhd->pub, enable));
14552 return (dhd_pno_set_for_hotlist(&dhd->pub, p_pfn_bssid, hotlist_params));
14559 return (dhd_pno_stop_for_batch(&dhd->pub));
14566 return (dhd_pno_set_for_batch(&dhd->pub, batch_params));
14573 return (dhd_pno_get_for_batch(&dhd->pub, buf, bufsize, PNO_STATUS_NORMAL));
14584 return (dhd_is_legacy_pno_enabled(&dhd->pub));
14594 return dhd_pno_set_epno(&dhd->pub);
14603 return dhd_pno_flush_fw_epno(&dhd->pub);
14613 return (dhd_pno_set_cfg_gscan(&dhd->pub, type, buf, flush));
14622 return (dhd_wait_batch_results_complete(&dhd->pub));
14631 return (dhd_pno_lock_batch_results(&dhd->pub));
14639 return (dhd_pno_unlock_batch_results(&dhd->pub));
14648 return (dhd_pno_initiate_gscan_request(&dhd->pub, run, flush));
14657 return (dhd_pno_enable_full_scan_result(&dhd->pub, real_time_flag));
14667 return (dhd_handle_hotlist_scan_evt(&dhd->pub, data, send_evt_bytes, type, buf_len));
14677 return (dhd_process_full_gscan_result(&dhd->pub, data, len, send_evt_bytes));
14685 dhd_gscan_hotlist_cache_cleanup(&dhd->pub, type);
14695 return (dhd_gscan_batch_cache_cleanup(&dhd->pub));
14704 return (dhd_retreive_batch_scan_results(&dhd->pub));
14712 return (dhd_pno_process_epno_result(&dhd->pub, data, event, send_evt_bytes));
14738 if (dhd->pub.lazy_roam_enable) {
14741 err = dhd_iovar(&dhd->pub, 0, "roam_exp_params",
14763 err = dhd_iovar(&dhd->pub, 0, "roam_exp_params",
14769 dhd->pub.lazy_roam_enable = (enable != 0);
14788 err = dhd_iovar(&dhd->pub, 0, "roam_exp_bssid_pref",
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,
14841 err = dhd_iovar(&dhd->pub, 0, "roam_exp_ssid_whitelist", (char *)ssid_whitelist, len, NULL,
14858 return (dhd_pno_get_gscan(&dhd->pub, type, info, len));
14876 err = dhd_iovar(&dhd->pub, 0, "rssi_monitor", (char *)&rssi_monitor, sizeof(rssi_monitor),
14892 err = dhd_tcpack_suppress_set(&dhd->pub, enable);
14904 dhd_pub_t *dhdp = &dhd->pub;
14956 return (dhd_rtt_set_cfg(&dhd->pub, buf));
14964 return (dhd_rtt_stop(&dhd->pub, mac_list, mac_cnt));
14972 return (dhd_rtt_register_noti_callback(&dhd->pub, ctx, noti_fn));
14980 return (dhd_rtt_unregister_noti_callback(&dhd->pub, noti_fn));
14988 return (dhd_rtt_capability(&dhd->pub, capa));
14995 return (dhd_rtt_avail_channel(&dhd->pub, channel_info));
15002 return (dhd_rtt_enable_responder(&dhd->pub, channel_info));
15008 return (dhd_rtt_cancel_responder(&dhd->pub));
15256 dhd_pub_t *dhdp = &dhd->pub;
15318 dhd_pub_t *dhdp = &dhd->pub;
15371 dhd_pub_t *dhdp = &dhd->pub;
15406 dhd_pub_t *dhdp = &dhd->pub;
15440 dhd_pub_t *dhdp = &dhd->pub;
15470 dhd_pub_t *dhdp = &dhd->pub;
15505 dhd_pub_t *dhdp = &dhd->pub;
15528 dhd_pub_t *dhdp = &dhd->pub;
15547 dhd_pub_t *dhdp = &dhd->pub;
15717 if (dhd->pub.hang_report) {
15721 ret = dhd_os_send_hang_message(&dhd->pub);
15743 dhdp = &dhd->pub;
15773 if (dhd && dhd->pub.up)
15774 return dhd->pub.force_country_change;
15783 if (!dhd->pub.is_blob)
15788 dhd->pub.dhd_cflags);
15814 if (dhd && dhd->pub.up) {
15815 dhd->pub.force_country_change = FALSE;
15816 memcpy(&dhd->pub.dhd_cspec, cspec, sizeof(wl_country_t));
15829 if (dhd && dhd->pub.up) {
15886 static void dhd_suspend_lock(dhd_pub_t *pub)
15889 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
15895 static void dhd_suspend_unlock(dhd_pub_t *pub)
15898 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
15904 unsigned long dhd_os_general_spin_lock(dhd_pub_t *pub)
15906 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
15915 void dhd_os_general_spin_unlock(dhd_pub_t *pub, unsigned long flags)
15917 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
15998 DHD_PERIM_UNLOCK(&dhd->pub);
16000 DHD_PERIM_LOCK(&dhd->pub);
16179 dhd_pub_t *dhdp = &dhd->pub;
16276 int dhd_os_wake_lock_timeout(dhd_pub_t *pub)
16278 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16307 ret = dhd_os_wake_lock_timeout(&dhd->pub);
16311 int dhd_os_wake_lock_rx_timeout_enable(dhd_pub_t *pub, int val)
16313 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16325 int dhd_os_wake_lock_ctrl_timeout_enable(dhd_pub_t *pub, int val)
16327 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16339 int dhd_os_wake_lock_ctrl_timeout_cancel(dhd_pub_t *pub)
16341 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16362 ret = dhd_os_wake_lock_rx_timeout_enable(&dhd->pub, val);
16372 ret = dhd_os_wake_lock_ctrl_timeout_enable(&dhd->pub, val);
16564 int dhd_os_wake_lock(dhd_pub_t *pub)
16566 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16576 dhd_bus_dev_pm_stay_awake(pub);
16592 void dhd_event_wake_lock(dhd_pub_t *pub)
16594 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16600 dhd_bus_dev_pm_stay_awake(pub);
16606 dhd_pm_wake_lock_timeout(dhd_pub_t *pub, int val)
16609 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16618 dhd_txfl_wake_lock_timeout(dhd_pub_t *pub, int val)
16621 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16635 ret = dhd_os_wake_lock(&dhd->pub);
16639 int dhd_os_wake_unlock(dhd_pub_t *pub)
16641 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16645 dhd_os_wake_lock_timeout(pub);
16660 dhd_bus_dev_pm_relax(pub);
16670 void dhd_event_wake_unlock(dhd_pub_t *pub)
16672 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16678 dhd_bus_dev_pm_relax(pub);
16683 void dhd_pm_wake_unlock(dhd_pub_t *pub)
16686 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16697 void dhd_txfl_wake_unlock(dhd_pub_t *pub)
16700 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16711 int dhd_os_check_wakelock(dhd_pub_t *pub)
16716 if (!pub)
16718 dhd = (dhd_info_t *)(pub->info);
16727 if (dhd && (dhd->wakelock_counter > 0) && dhd_bus_dev_pm_enabled(pub))
16734 dhd_os_check_wakelock_all(dhd_pub_t *pub)
16744 if (!pub) {
16747 dhd = (dhd_info_t *)(pub->info);
16778 if (dhd && (dhd->wakelock_counter > 0) && dhd_bus_dev_pm_enabled(pub)) {
16791 ret = dhd_os_wake_unlock(&dhd->pub);
16795 int dhd_os_wd_wake_lock(dhd_pub_t *pub)
16797 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16816 int dhd_os_wd_wake_unlock(dhd_pub_t *pub)
16818 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16839 dhd_os_oob_irq_wake_lock_timeout(dhd_pub_t *pub, int val)
16842 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16851 dhd_os_oob_irq_wake_unlock(dhd_pub_t *pub)
16854 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16868 dhd_os_scan_wake_lock_timeout(dhd_pub_t *pub, int val)
16871 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16880 dhd_os_scan_wake_unlock(dhd_pub_t *pub)
16883 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16898 int dhd_os_wake_lock_waive(dhd_pub_t *pub)
16900 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16924 int dhd_os_wake_lock_restore(dhd_pub_t *pub)
16926 dhd_info_t *dhd = (dhd_info_t *)(pub->info);
16956 dhd_bus_dev_pm_stay_awake(&dhd->pub);
16962 dhd_bus_dev_pm_relax(&dhd->pub);
17023 bool dhd_os_check_if_up(dhd_pub_t *pub)
17025 if (!pub)
17027 return pub->up;
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);
17112 dhdp = &dhd->pub;
17701 DHD_ERROR(("%s: ENTER, memdump type %u\n", __FUNCTION__, dhd->pub.memdump_type));
17708 dhdp = &dhd->pub;
17748 if (write_dump_to_file(&dhd->pub, dump->buf, dump->bufsize, "mem_dump")) {
17751 dhd->pub.memdump_success = FALSE;
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) {
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);
17866 dhd_pub_t *dhdp = &dhd_info->pub;
17888 dhd_pub_t *dhdp = &dhd_info->pub;
17910 dhd_pub_t *dhdp = &dhd_info->pub;
17926 dhd_pub_t *dhdp = &dhd_info->pub;
17955 dhdp = &dhd->pub;
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);
18367 dhd_pub_t *dhdp = &dhd_info->pub;
18396 dhdp = &dhd_info->pub;
18420 dhdp = &dhd_info->pub;
18444 dhdp = &dhd_info->pub;
18471 dhdp = &dhd_info->pub;
18496 dhdp = &dhd_info->pub;
18543 dhdp = &dhd_info->pub;
18568 dhdp = &dhd_info->pub;
18595 dhdp = &dhd_info->pub;
18663 if (dhd_info->pub.dongle_edl_support) {
18703 dhdp = &dhd_info->pub;
18803 dhdp = &dhd_info->pub;
18848 dhdp = &dhd_info->pub;
18894 dhdp = &dhd_info->pub;
18935 dhdp = &dhd_info->pub;
18959 dhdp = &dhd_info->pub;
19009 dhdp = &dhd_info->pub;
19039 dhdp = &dhd_info->pub;
19065 dhdp = &dhd_info->pub;
19083 dhdp = &dhd_info->pub;
19391 dhd_pub_t *dhdp = &dhd->pub;
19422 dhd_pub_t *dhdp = &dhd->pub;
19470 dhd_pub_t *dhdp = &dhd->pub;
19489 dhd_pub_t *dhdp = &dhd->pub;
19502 dhd_pub_t *dhdp = &dhd->pub;
19513 dhd_pub_t *dhdp = &dhd->pub;
19767 if (dhd->pub.op_mode == DHD_FLAG_IBSS_MODE) {
19974 dhdp = &dhd->pub;
20752 dmaxfer_free_prev_dmaaddr(&dhd_info->pub, dmmap);
20916 dhd_bandsteer_get_ifaces(void *pub, void *ifaces)
20921 dhd_pub_t *dhd = (dhd_pub_t *) pub;
21258 dhdp = &dhd->pub;
21350 dhdp = &dhd->pub;
21389 if (dhd_pktlog_dump_write_file(&dhd->pub)) {
21417 dhdp = (dhd_pub_t *)cfg->pub;
22701 dhdp = &ifp->info->pub;
22751 (OSL_ATOMIC_READ(ifp->info->pub->osh, &ifp->m4state) == M4_TXFAILED)) {
22815 dhd_os_hp2plock(dhd_pub_t *pub)
22820 dhd = (dhd_info_t *)(pub->info);
22830 dhd_os_hp2punlock(dhd_pub_t *pub, unsigned long flags)
22834 dhd = (dhd_info_t *)(pub->info);
22853 dhdp = &dhd->pub;
22907 dhdp = &dhd->pub;