Lines Matching full:cfg

71 static s32 wl_cfgp2p_cancel_listen(struct bcm_cfg80211 *cfg, struct net_device *ndev,
347 wl_cfgp2p_init_priv(struct bcm_cfg80211 *cfg) in wl_cfgp2p_init_priv() argument
349 cfg->p2p = MALLOCZ(cfg->osh, sizeof(struct p2p_info)); in wl_cfgp2p_init_priv()
350 if (cfg->p2p == NULL) { in wl_cfgp2p_init_priv()
355 wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_PRIMARY) = bcmcfg_to_prmry_ndev(cfg); in wl_cfgp2p_init_priv()
356 wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_PRIMARY) = 0; in wl_cfgp2p_init_priv()
357 wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_DEVICE) = NULL; in wl_cfgp2p_init_priv()
358 wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE) = 0; in wl_cfgp2p_init_priv()
359 wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_CONNECTION1) = NULL; in wl_cfgp2p_init_priv()
360 wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_CONNECTION1) = -1; in wl_cfgp2p_init_priv()
361 wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_CONNECTION2) = NULL; in wl_cfgp2p_init_priv()
362 wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_CONNECTION2) = -1; in wl_cfgp2p_init_priv()
371 wl_cfgp2p_deinit_priv(struct bcm_cfg80211 *cfg) in wl_cfgp2p_deinit_priv() argument
374 if (cfg->p2p) { in wl_cfgp2p_deinit_priv()
375 MFREE(cfg->osh, cfg->p2p, sizeof(struct p2p_info)); in wl_cfgp2p_deinit_priv()
376 cfg->p2p = NULL; in wl_cfgp2p_deinit_priv()
378 cfg->p2p_supported = 0; in wl_cfgp2p_deinit_priv()
384 wl_cfgp2p_set_firm_p2p(struct bcm_cfg80211 *cfg) in wl_cfgp2p_set_firm_p2p() argument
386 struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg); in wl_cfgp2p_set_firm_p2p()
423 sizeof(null_eth_addr), cfg->ioctl_buf, WLC_IOCTL_MAXLEN, 0, &cfg->ioctl_buf_sync); in wl_cfgp2p_set_firm_p2p()
430 int wl_cfg_multip2p_operational(struct bcm_cfg80211 *cfg) in wl_cfg_multip2p_operational() argument
432 if (!cfg->p2p) { in wl_cfg_multip2p_operational()
437 if ((wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_CONNECTION1) != -1) && in wl_cfg_multip2p_operational()
438 (wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_CONNECTION2) != -1)) in wl_cfg_multip2p_operational()
452 wl_cfgp2p_ifadd(struct bcm_cfg80211 *cfg, struct ether_addr *mac, u8 if_type, in wl_cfgp2p_ifadd() argument
457 struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg); in wl_cfgp2p_ifadd()
463 CFGP2P_ERR(("---cfg p2p_ifadd "MACDBG" %s %u\n", in wl_cfgp2p_ifadd()
469 cfg->ioctl_buf, WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync); in wl_cfgp2p_ifadd()
471 printk("'cfg p2p_ifadd' error %d\n", err); in wl_cfgp2p_ifadd()
484 wl_cfgp2p_ifdisable(struct bcm_cfg80211 *cfg, struct ether_addr *mac) in wl_cfgp2p_ifdisable() argument
487 struct net_device *netdev = bcmcfg_to_prmry_ndev(cfg); in wl_cfgp2p_ifdisable()
489 CFGP2P_INFO(("------ cfg p2p_ifdis "MACDBG" dev->ifindex:%d \n", in wl_cfgp2p_ifdisable()
492 cfg->ioctl_buf, WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync); in wl_cfgp2p_ifdisable()
494 printk("'cfg p2p_ifdis' error %d\n", ret); in wl_cfgp2p_ifdisable()
505 wl_cfgp2p_ifdel(struct bcm_cfg80211 *cfg, struct ether_addr *mac) in wl_cfgp2p_ifdel() argument
511 struct net_device *netdev = bcmcfg_to_prmry_ndev(cfg); in wl_cfgp2p_ifdel()
513 CFGP2P_ERR(("------ cfg p2p_ifdel "MACDBG" dev->ifindex:%d\n", in wl_cfgp2p_ifdel()
516 cfg->ioctl_buf, WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync); in wl_cfgp2p_ifdel()
518 printk("'cfg p2p_ifdel' error %d\n", ret); in wl_cfgp2p_ifdel()
521 if ((bssidx = wl_get_bssidx_by_wdev(cfg, netdev->ieee80211_ptr)) < 0) { in wl_cfgp2p_ifdel()
527 wl_cfg80211_set_he_mode(netdev, cfg, bssidx, WL_IF_TYPE_P2P_DISC, TRUE); in wl_cfgp2p_ifdel()
542 wl_cfgp2p_ifchange(struct bcm_cfg80211 *cfg, struct ether_addr *mac, u8 if_type, in wl_cfgp2p_ifchange() argument
548 struct net_device *netdev = wl_to_p2p_bss_ndev(cfg, conn_idx); in wl_cfgp2p_ifchange()
554 CFGP2P_INFO(("---cfg p2p_ifchange "MACDBG" %s %u" in wl_cfgp2p_ifchange()
561 cfg->ioctl_buf, WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync); in wl_cfgp2p_ifchange()
563 printk("'cfg p2p_ifupd' error %d\n", err); in wl_cfgp2p_ifchange()
565 cfg->p2p->p2p_go_count++; in wl_cfgp2p_ifchange()
577 wl_cfgp2p_ifidx(struct bcm_cfg80211 *cfg, struct ether_addr *mac, s32 *index) in wl_cfgp2p_ifidx() argument
581 struct net_device *dev = bcmcfg_to_prmry_ndev(cfg); in wl_cfgp2p_ifidx()
583 CFGP2P_INFO(("---cfg p2p_if "MACDBG"\n", MAC2STRDBG(mac->octet))); in wl_cfgp2p_ifidx()
586 sizeof(getbuf), wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_PRIMARY), NULL); in wl_cfgp2p_ifidx()
590 CFGP2P_DBG(("---cfg p2p_if ==> %d\n", *index)); in wl_cfgp2p_ifidx()
597 wl_cfgp2p_set_discovery(struct bcm_cfg80211 *cfg, s32 on) in wl_cfgp2p_set_discovery() argument
600 struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg); in wl_cfgp2p_set_discovery()
622 wl_cfgp2p_set_p2p_mode(struct bcm_cfg80211 *cfg, u8 mode, u32 channel, u16 listen_ms, int bssidx) in wl_cfgp2p_set_p2p_mode() argument
634 dev = wl_cfgp2p_find_ndev(cfg, bssidx); in wl_cfgp2p_set_p2p_mode()
642 channel, cfg->channel)); in wl_cfgp2p_set_p2p_mode()
643 if ((mode == WL_P2P_DISC_ST_LISTEN) && (cfg->channel == channel)) { in wl_cfgp2p_set_p2p_mode()
644 struct net_device *primary_ndev = bcmcfg_to_prmry_ndev(cfg); in wl_cfgp2p_set_p2p_mode()
646 if (cfg->p2p_resp_apchn_status) { in wl_cfgp2p_set_p2p_mode()
651 if (wl_get_drv_status(cfg, CONNECTED, primary_ndev)) { in wl_cfgp2p_set_p2p_mode()
653 cfg->p2p_resp_apchn_status = true; in wl_cfgp2p_set_p2p_mode()
665 sizeof(discovery_mode), cfg->ioctl_buf, WLC_IOCTL_MAXLEN, in wl_cfgp2p_set_p2p_mode()
666 bssidx, &cfg->ioctl_buf_sync); in wl_cfgp2p_set_p2p_mode()
673 wl_cfgp2p_get_disc_idx(struct bcm_cfg80211 *cfg, s32 *index) in wl_cfgp2p_get_disc_idx() argument
676 struct net_device *dev = wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_PRIMARY); in wl_cfgp2p_get_disc_idx()
688 int wl_cfgp2p_get_conn_idx(struct bcm_cfg80211 *cfg) in wl_cfgp2p_get_conn_idx() argument
692 dhd_pub_t *dhd = (dhd_pub_t *)(cfg->pub); in wl_cfgp2p_get_conn_idx()
696 if (wl_to_p2p_bss_bssidx(cfg, i) == -1) { in wl_cfgp2p_get_conn_idx()
702 if ((connected_cnt = wl_get_drv_status_all(cfg, CONNECTED)) > 2) { in wl_cfgp2p_get_conn_idx()
715 wl_cfgp2p_init_discovery(struct bcm_cfg80211 *cfg) in wl_cfgp2p_init_discovery() argument
720 struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg); in wl_cfgp2p_init_discovery()
725 if (wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE) > 0) { in wl_cfgp2p_init_discovery()
730 ret = wl_cfgp2p_set_discovery(cfg, 1); in wl_cfgp2p_init_discovery()
736 ret = wl_cfgp2p_get_disc_idx(cfg, &bssidx); in wl_cfgp2p_init_discovery()
742 if (!cfg->p2p_wdev) { in wl_cfgp2p_init_discovery()
752 ret = wl_alloc_netinfo(cfg, NULL, cfg->p2p_wdev, WL_IF_TYPE_STA, 0, bssidx, 0); in wl_cfgp2p_init_discovery()
756 wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_DEVICE) = in wl_cfgp2p_init_discovery()
757 wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_PRIMARY); in wl_cfgp2p_init_discovery()
758 wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE) = bssidx; in wl_cfgp2p_init_discovery()
761 ret = wl_cfgp2p_set_p2p_mode(cfg, WL_P2P_DISC_ST_SCAN, 0, 0, in wl_cfgp2p_init_discovery()
762 wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE)); in wl_cfgp2p_init_discovery()
766 wl_cfgp2p_set_discovery(cfg, 0); in wl_cfgp2p_init_discovery()
767 wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE) = 0; in wl_cfgp2p_init_discovery()
768 wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_DEVICE) = NULL; in wl_cfgp2p_init_discovery()
774 wl_cfg80211_clear_p2p_disc_ies(cfg); in wl_cfgp2p_init_discovery()
784 * @cfg : wl_private data
788 wl_cfgp2p_deinit_discovery(struct bcm_cfg80211 *cfg) in wl_cfgp2p_deinit_discovery() argument
794 bssidx = wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE); in wl_cfgp2p_deinit_discovery()
801 wl_cfg80211_clear_p2p_disc_ies(cfg); in wl_cfgp2p_deinit_discovery()
804 wl_cfgp2p_set_p2p_mode(cfg, WL_P2P_DISC_ST_SCAN, 0, 0, in wl_cfgp2p_deinit_discovery()
807 ret = wl_cfgp2p_set_discovery(cfg, 0); in wl_cfgp2p_deinit_discovery()
810 wl_dealloc_netinfo_by_wdev(cfg, cfg->p2p_wdev); in wl_cfgp2p_deinit_discovery()
812 wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE) = WL_INVALID; in wl_cfgp2p_deinit_discovery()
813 wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_DEVICE) = NULL; in wl_cfgp2p_deinit_discovery()
820 * @cfg : wl_private data
826 wl_cfgp2p_enable_discovery(struct bcm_cfg80211 *cfg, struct net_device *dev, in wl_cfgp2p_enable_discovery() argument
834 mutex_lock(&cfg->if_sync); in wl_cfgp2p_enable_discovery()
836 if ((ret = wl_cfg80211_handle_if_role_conflict(cfg, WL_IF_TYPE_P2P_DISC)) != BCME_OK) { in wl_cfgp2p_enable_discovery()
842 if (wl_get_p2p_status(cfg, DISCOVERY_ON)) { in wl_cfgp2p_enable_discovery()
847 ret = wl_cfgp2p_init_discovery(cfg); in wl_cfgp2p_enable_discovery()
853 wl_set_p2p_status(cfg, DISCOVERY_ON); in wl_cfgp2p_enable_discovery()
858 ret = wldev_iovar_setint_bsscfg(wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_DEVICE), in wl_cfgp2p_enable_discovery()
859 "wsec", AES_ENABLED, wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE)); in wl_cfgp2p_enable_discovery()
866 if (bcmcfg_to_prmry_ndev(cfg) == dev) { in wl_cfgp2p_enable_discovery()
867 bssidx = wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE); in wl_cfgp2p_enable_discovery()
868 } else if ((bssidx = wl_get_bssidx_by_wdev(cfg, cfg->p2p_wdev)) < 0) { in wl_cfgp2p_enable_discovery()
869 WL_ERR(("Find p2p index from wdev(%p) failed\n", cfg->p2p_wdev)); in wl_cfgp2p_enable_discovery()
876 cfgdev = cfg->p2p_wdev; in wl_cfgp2p_enable_discovery()
881 ret = wl_cfg80211_set_mgmt_vndr_ies(cfg, cfgdev, in wl_cfgp2p_enable_discovery()
892 mutex_unlock(&cfg->if_sync); in wl_cfgp2p_enable_discovery()
898 * @cfg : wl_private_data
902 wl_cfgp2p_disable_discovery(struct bcm_cfg80211 *cfg) in wl_cfgp2p_disable_discovery() argument
908 wl_clr_p2p_status(cfg, DISCOVERY_ON); in wl_cfgp2p_disable_discovery()
911 __FUNCTION__, (cfg)->p2p->bss[P2PAPI_BSSCFG_DEVICE].bssidx)); in wl_cfgp2p_disable_discovery()
913 bssidx = wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE); in wl_cfgp2p_disable_discovery()
919 ret = wl_cfgp2p_set_p2p_mode(cfg, WL_P2P_DISC_ST_SCAN, 0, 0, bssidx); in wl_cfgp2p_disable_discovery()
926 wl_clr_p2p_status(cfg, DISCOVERY_ON); in wl_cfgp2p_disable_discovery()
927 ret = wl_cfgp2p_deinit_discovery(cfg); in wl_cfgp2p_disable_discovery()
939 wl_cfgp2p_escan(struct bcm_cfg80211 *cfg, struct net_device *dev, u16 active_scan, in wl_cfgp2p_escan() argument
960 pri_dev = wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_PRIMARY); in wl_cfgp2p_escan()
962 if (cfg->scan_params_v2) { in wl_cfgp2p_escan()
980 bzero(cfg->ioctl_buf, WLC_IOCTL_MAXLEN); in wl_cfgp2p_escan()
986 wl_cfgp2p_set_p2p_mode(cfg, WL_P2P_DISC_ST_SEARCH, 0, 0, bssidx); in wl_cfgp2p_escan()
997 wl_cfgp2p_set_p2p_mode(cfg, WL_P2P_DISC_ST_SCAN, 0, 0, bssidx); in wl_cfgp2p_escan()
1033 active_time = wl_get_drv_status_all(cfg, CONNECTED) ? in wl_cfgp2p_escan()
1050 wl_escan_set_sync_id(sync_id, cfg); in wl_cfgp2p_escan()
1052 if (cfg->scan_params_v2) { in wl_cfgp2p_escan()
1100 wl_escan_set_type(cfg, WL_SCANTYPE_P2P); in wl_cfgp2p_escan()
1111 memblk, memsize, cfg->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &cfg->ioctl_buf_sync); in wl_cfgp2p_escan()
1114 wl_set_p2p_status(cfg, SCANNING); in wl_cfgp2p_escan()
1121 * @cfg : wl_private data
1127 wl_cfgp2p_act_frm_search(struct bcm_cfg80211 *cfg, struct net_device *ndev, in wl_cfgp2p_act_frm_search() argument
1134 if (!p2p_is_on(cfg) || ndev == NULL || bssidx == WL_INVALID) in wl_cfgp2p_act_frm_search()
1137 if (bssidx == wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_PRIMARY)) in wl_cfgp2p_act_frm_search()
1138 bssidx = wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE); in wl_cfgp2p_act_frm_search()
1144 if (cfg->afx_hdl->pending_tx_act_frm && cfg->afx_hdl->is_active) { in wl_cfgp2p_act_frm_search()
1146 action_frame = &(cfg->afx_hdl->pending_tx_act_frm->action_frame); in wl_cfgp2p_act_frm_search()
1153 default_chan_list = (u16 *)MALLOCZ(cfg->osh, chan_cnt * sizeof(*default_chan_list)); in wl_cfgp2p_act_frm_search()
1170 ret = wl_cfgp2p_escan(cfg, ndev, true, chan_cnt, in wl_cfgp2p_act_frm_search()
1173 MFREE(cfg->osh, default_chan_list, chan_cnt * sizeof(*default_chan_list)); in wl_cfgp2p_act_frm_search()
1269 wl_cfgp2p_vndr_ie(struct bcm_cfg80211 *cfg, u8 *iebuf, s32 pktflag, in wl_cfgp2p_vndr_ie() argument
1327 wl_cfgp2p_find_ndev(struct bcm_cfg80211 *cfg, s32 bssidx) in wl_cfgp2p_find_ndev() argument
1337 if (bssidx == wl_to_p2p_bss_bssidx(cfg, i)) { in wl_cfgp2p_find_ndev()
1338 ndev = wl_to_p2p_bss_ndev(cfg, i); in wl_cfgp2p_find_ndev()
1351 * @cfg : wl_private data
1358 wl_cfgp2p_find_type(struct bcm_cfg80211 *cfg, s32 bssidx, s32 *type) in wl_cfgp2p_find_type() argument
1365 if (!cfg->p2p) { in wl_cfgp2p_find_type()
1370 if (bssidx == wl_to_p2p_bss_bssidx(cfg, i)) { in wl_cfgp2p_find_type()
1384 wl_cfgp2p_listen_complete(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, argument
1390 if (!cfg || !cfg->p2p || !cfgdev)
1398 ndev = cfgdev_to_wlc_ndev(cfgdev, cfg);
1401 if (wl_get_p2p_status(cfg, DISC_IN_PROGRESS)) {
1402 wl_clr_p2p_status(cfg, DISC_IN_PROGRESS);
1407 cfg80211_remain_on_channel_expired(cfgdev, cfg->last_roc_id,
1408 &cfg->remain_on_chan, GFP_KERNEL);
1414 cfg80211_remain_on_channel_expired(cfgdev, cfg->last_roc_id,
1415 &cfg->remain_on_chan, cfg->remain_on_chan_type, GFP_KERNEL);
1421 if (wl_get_p2p_status(cfg, LISTEN_EXPIRED) == 0) {
1422 wl_set_p2p_status(cfg, LISTEN_EXPIRED);
1423 if (timer_pending(&cfg->p2p->listen_timer)) {
1424 del_timer_sync(&cfg->p2p->listen_timer);
1427 if (cfg->afx_hdl->is_listen == TRUE &&
1428 wl_get_drv_status_all(cfg, FINDING_COMMON_CHANNEL)) {
1430 complete(&cfg->act_frm_scan);
1433 else if (wl_get_drv_status_all(cfg, WAITING_NEXT_ACT_FRM_LISTEN)) {
1434 wl_clr_drv_status(cfg, WAITING_NEXT_ACT_FRM_LISTEN, ndev);
1436 jiffies_to_msecs(jiffies - cfg->af_tx_sent_jiffies)));
1438 if (wl_get_drv_status_all(cfg, WAITING_NEXT_ACT_FRM))
1439 wl_clr_drv_status(cfg, WAITING_NEXT_ACT_FRM, ndev);
1441 complete(&cfg->wait_next_af);
1446 if (wl_get_drv_status_all(cfg, REMAINING_ON_CHANNEL)) {
1448 if (wl_get_drv_status_all(cfg, REMAINING_ON_CHANNEL) ||
1449 wl_get_drv_status_all(cfg, FAKE_REMAINING_ON_CHANNEL)) {
1452 wl_clr_drv_status(cfg, REMAINING_ON_CHANNEL, ndev);
1454 wl_clr_drv_status(cfg, FAKE_REMAINING_ON_CHANNEL, ndev);
1459 bcmcfg_to_p2p_wdev(cfg)) {
1465 wdev_dpp_listen = wl_get_wdev_by_dpp_listen(cfg);
1472 wl_set_dpp_listen_by_netdev(cfg, wdev_dpp_listen->netdev, 0);
1474 cfg->last_roc_id, &cfg->remain_on_chan, GFP_KERNEL);
1476 cfg80211_remain_on_channel_expired(bcmcfg_to_p2p_wdev(cfg),
1477 cfg->last_roc_id, &cfg->remain_on_chan, GFP_KERNEL);
1486 cfg->last_roc_id, &cfg->remain_on_chan,
1487 cfg->remain_on_chan_type, GFP_KERNEL);
1491 if (wl_add_remove_eventmsg(bcmcfg_to_prmry_ndev(cfg),
1496 wl_clr_p2p_status(cfg, LISTEN_EXPIRED);
1511 struct bcm_cfg80211 *cfg = (struct bcm_cfg80211 *) data; local
1515 if (!cfg) {
1516 CFGP2P_ERR((" No cfg\n"));
1521 msg.bsscfgidx = wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE);
1523 ndev = cfg->p2p_net ? cfg->p2p_net :
1524 wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_DEVICE);
1526 ndev = wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_DEVICE);
1538 wl_cfgp2p_cancel_listen(struct bcm_cfg80211 *cfg, struct net_device *ndev, argument
1545 if (timer_pending(&cfg->p2p->listen_timer)) {
1546 del_timer_sync(&cfg->p2p->listen_timer);
1549 if (bcmcfg_to_p2p_wdev(cfg))
1550 cfg80211_remain_on_channel_expired(wdev, cfg->last_roc_id,
1551 &cfg->remain_on_chan, GFP_KERNEL);
1554 cfg80211_remain_on_channel_expired(ndev, cfg->last_roc_id,
1555 &cfg->remain_on_chan, cfg->remain_on_chan_type, GFP_KERNEL);
1568 * @cfg : wl_private data
1573 wl_cfgp2p_discover_listen(struct bcm_cfg80211 *cfg, s32 channel, u32 duration_ms) argument
1579 struct net_device *netdev = bcmcfg_to_prmry_ndev(cfg);
1582 if (unlikely(wl_get_p2p_status(cfg, DISCOVERY_ON) == 0)) {
1589 if (timer_pending(&cfg->p2p->listen_timer)) {
1596 wl_clr_p2p_status(cfg, LISTEN_EXPIRED);
1602 ret = wl_cfgp2p_set_p2p_mode(cfg, WL_P2P_DISC_ST_LISTEN, channel, (u16) duration_ms,
1603 wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE));
1604 _timer = &cfg->p2p->listen_timer;
1619 wl_clr_p2p_status(cfg, LISTEN_EXPIRED);
1628 wl_cfgp2p_discover_enable_search(struct bcm_cfg80211 *cfg, u8 enable) argument
1632 if (!wl_get_p2p_status(cfg, DISCOVERY_ON)) {
1637 if (wl_get_p2p_status(cfg, SEARCH_ENABLED) == enable) {
1642 wl_chg_p2p_status(cfg, SEARCH_ENABLED);
1647 wl_clr_p2p_status(cfg, SCANNING);
1648 ret = wl_cfgp2p_set_p2p_mode(cfg, WL_P2P_DISC_ST_SCAN, 0, 0,
1649 wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE));
1659 wl_cfgp2p_action_tx_complete(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, argument
1670 ndev = cfgdev_to_wlc_ndev(cfgdev, cfg);
1672 if (wl_get_drv_status_all(cfg, SENDING_ACT_FRM)) {
1677 wl_set_p2p_status(cfg, ACTION_TX_COMPLETED);
1679 if (!cfg->need_wait_afrx && cfg->af_sent_channel) {
1681 wl_stop_wait_next_action_frame(cfg, ndev, bsscfgidx);
1684 else if (!wl_get_p2p_status(cfg, ACTION_TX_COMPLETED)) {
1685 wl_set_p2p_status(cfg, ACTION_TX_NOACK);
1691 wl_stop_wait_next_action_frame(cfg, ndev, bsscfgidx);
1697 if (wl_get_drv_status_all(cfg, SENDING_ACT_FRM))
1698 complete(&cfg->send_af_done);
1712 wl_cfgp2p_tx_action_frame(struct bcm_cfg80211 *cfg, struct net_device *dev, argument
1724 wl_clr_p2p_status(cfg, ACTION_TX_COMPLETED);
1725 wl_clr_p2p_status(cfg, ACTION_TX_NOACK);
1730 if ((evt_ret = wl_cfg80211_apply_eventbuffer(bcmcfg_to_prmry_ndev(cfg), cfg, &buf)) < 0)
1733 cfg->af_sent_channel = af_params->channel;
1735 cfg->af_tx_sent_jiffies = jiffies;
1739 cfg->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &cfg->ioctl_buf_sync);
1746 timeout = wait_for_completion_timeout(&cfg->send_af_done,
1749 if (timeout >= 0 && wl_get_p2p_status(cfg, ACTION_TX_COMPLETED)) {
1752 } else if (ETHER_ISBCAST(&cfg->afx_hdl->tx_dst_addr)) {
1760 wl_clr_p2p_status(cfg, ACTION_TX_COMPLETED);
1761 wl_clr_p2p_status(cfg, ACTION_TX_NOACK);
1769 if ((evt_ret = wl_cfg80211_apply_eventbuffer(bcmcfg_to_prmry_ndev(cfg), cfg, &buf)) < 0) {
1781 wl_cfgp2p_generate_bss_mac(struct bcm_cfg80211 *cfg, struct ether_addr *primary_addr) argument
1783 struct ether_addr *mac_addr = wl_to_p2p_bss_macaddr(cfg, P2PAPI_BSSCFG_DEVICE);
1790 int_addr = wl_to_p2p_bss_macaddr(cfg, P2PAPI_BSSCFG_CONNECTION1);
1795 int_addr = wl_to_p2p_bss_macaddr(cfg, P2PAPI_BSSCFG_CONNECTION2);
1852 wl_cfgp2p_supported(struct bcm_cfg80211 *cfg, struct net_device *ndev) argument
1863 CFGP2P_ERR(("cfg p2p error %d\n", ret));
1877 wl_cfgp2p_down(struct bcm_cfg80211 *cfg) argument
1883 ndev = bcmcfg_to_prmry_ndev(cfg);
1884 wdev = bcmcfg_to_p2p_wdev(cfg);
1886 ndev = cfg->p2p_net ? cfg->p2p_net : bcmcfg_to_prmry_ndev(cfg);
1890 wl_cfgp2p_cancel_listen(cfg, ndev, wdev, TRUE);
1891 wl_cfgp2p_disable_discovery(cfg);
1900 if (cfg->p2p_wdev) {
1903 wl_cfgp2p_del_p2p_disc_if(cfg->p2p_wdev, cfg);
1907 wl_cfgp2p_deinit_priv(cfg);
1911 int wl_cfgp2p_vif_created(struct bcm_cfg80211 *cfg) argument
1913 if (cfg->p2p && ((wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_CONNECTION1) != -1) ||
1914 (wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_CONNECTION2) != -1)))
1922 wl_cfgp2p_set_p2p_noa(struct bcm_cfg80211 *cfg, struct net_device *ndev, char* buf, int len) argument
1933 if (wl_cfgp2p_vif_created(cfg)) {
1934 cfg->p2p->noa.desc[0].start = 0;
1940 cfg->p2p->noa.desc[0].count = count;
1944 cfg->p2p->noa.desc[0].interval = start;
1947 cfg->p2p->noa.desc[0].duration = duration;
1949 if (cfg->p2p->noa.desc[0].count != 255 && cfg->p2p->noa.desc[0].count != 0) {
1950 cfg->p2p->noa.desc[0].start = 200;
1955 else if (cfg->p2p->noa.desc[0].count == 0) {
1956 cfg->p2p->noa.desc[0].start = 0;
1965 if ((cfg->p2p->noa.desc[0].interval == 102) ||
1966 (cfg->p2p->noa.desc[0].interval == 100)) {
1967 cfg->p2p->noa.desc[0].start = 100 -
1968 cfg->p2p->noa.desc[0].duration;
1976 dongle_noa.desc[0].count = htod32(cfg->p2p->noa.desc[0].count);
1978 dongle_noa.desc[0].start = htod32(cfg->p2p->noa.desc[0].start);
1979 dongle_noa.desc[0].duration = htod32(cfg->p2p->noa.desc[0].duration);
1982 dongle_noa.desc[0].start = htod32(cfg->p2p->noa.desc[0].start*1000);
1983 dongle_noa.desc[0].duration = htod32(cfg->p2p->noa.desc[0].duration*1000);
1985 dongle_noa.desc[0].interval = htod32(cfg->p2p->noa.desc[0].interval*1000);
1986 bssidx = wl_get_bssidx_by_wdev(cfg, ndev->ieee80211_ptr);
1987 if (wl_cfgp2p_find_type(cfg, bssidx, &type) != BCME_OK)
1994 ret = wldev_iovar_setbuf(wl_to_p2p_bss_ndev(cfg, type),
1995 "p2p_noa", &dongle_noa, iovar_len, cfg->ioctl_buf,
1996 WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync);
2008 wl_cfgp2p_get_p2p_noa(struct bcm_cfg80211 *cfg, struct net_device *ndev, char* buf, int buf_len) argument
2017 if (wl_cfgp2p_vif_created(cfg)) {
2018 if (cfg->p2p->noa.desc[0].count || cfg->p2p->ops.ops) {
2020 _buf[1] = (cfg->p2p->ops.ops ? 0x80: 0) |
2021 (cfg->p2p->ops.ctw & 0x7f); /* ops + ctw */
2023 if (cfg->p2p->noa.desc[0].count) {
2025 noa_desc->cnt_type = cfg->p2p->noa.desc[0].count;
2026 noa_desc->duration = cfg->p2p->noa.desc[0].duration;
2027 noa_desc->interval = cfg->p2p->noa.desc[0].interval;
2028 noa_desc->start = cfg->p2p->noa.desc[0].start;
2051 wl_cfgp2p_set_p2p_ps(struct bcm_cfg80211 *cfg, struct net_device *ndev, char* buf, int len) argument
2061 if (wl_cfgp2p_vif_created(cfg)) {
2065 bssidx = wl_get_bssidx_by_wdev(cfg, ndev->ieee80211_ptr);
2066 if (wl_cfgp2p_find_type(cfg, bssidx, &conn_idx) != BCME_OK)
2068 dev = wl_to_p2p_bss_ndev(cfg, conn_idx);
2070 cfg->p2p->ops.ctw = ctw;
2074 cfg->p2p->ops.ops = ps;
2076 "p2p_ops", &cfg->p2p->ops, sizeof(cfg->p2p->ops),
2077 cfg->ioctl_buf, WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync);
2101 wl_cfgp2p_set_p2p_ecsa(struct bcm_cfg80211 *cfg, struct net_device *ndev, char* buf, int len) argument
2113 if (wl_cfgp2p_vif_created(cfg)) {
2117 bssidx = wl_get_bssidx_by_wdev(cfg, ndev->ieee80211_ptr);
2118 if (wl_cfgp2p_find_type(cfg, bssidx, &conn_idx) != BCME_OK) {
2121 dev = wl_to_p2p_bss_ndev(cfg, conn_idx);
2155 wl_cfgp2p_increase_p2p_bw(struct bcm_cfg80211 *cfg, struct net_device *ndev, char* buf, int len) argument
2164 ret = wldev_iovar_setbuf(ndev, "mchan_algo", &algo, sizeof(algo), cfg->ioctl_buf,
2165 WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync);
2172 ret = wldev_iovar_setbuf(ndev, "mchan_algo", &algo, sizeof(algo), cfg->ioctl_buf,
2173 WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync);
2178 ret = wldev_iovar_setbuf(ndev, "mchan_bw", &bw, sizeof(algo), cfg->ioctl_buf,
2179 WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync);
2329 wl_cfgp2p_register_ndev(struct bcm_cfg80211 *cfg) argument
2338 if (cfg->p2p_net) {
2350 wdev = (struct wireless_dev *)MALLOCZ(cfg->osh, sizeof(*wdev));
2361 memcpy((void *)netdev_priv(net), &cfg, sizeof(struct bcm_cfg80211 *));
2378 wdev->wiphy = cfg->wdev->wiphy;
2403 MFREE(cfg->osh, wdev, sizeof(*wdev));
2412 cfg->p2p_wdev = wdev;
2414 cfg->p2p_wdev = NULL;
2416 cfg->p2p_net = net;
2424 wl_cfgp2p_unregister_ndev(struct bcm_cfg80211 *cfg) argument
2427 if (!cfg || !cfg->p2p_net) {
2432 unregister_netdev(cfg->p2p_net);
2433 free_netdev(cfg->p2p_net);
2453 struct bcm_cfg80211 *cfg = *(struct bcm_cfg80211 **)netdev_priv(net); local
2454 struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg);
2503 struct bcm_cfg80211 *cfg = wl_get_cfg(net); local
2508 wl_cfg80211_scan_stop(cfg, net);
2526 wl_cfgp2p_add_p2p_disc_if(struct bcm_cfg80211 *cfg) argument
2531 if (!cfg || !cfg->p2p_supported)
2536 if (cfg->p2p_wdev) {
2538 dhd_pub_t *dhd = (dhd_pub_t *)(cfg->pub);
2548 wl_probe_wdev_all(cfg);
2559 wl_cfgp2p_del_p2p_disc_if(cfg->p2p_wdev, cfg);
2572 net_os_send_hang_message(bcmcfg_to_prmry_ndev(cfg));
2578 wdev = (struct wireless_dev *)MALLOCZ(cfg->osh, sizeof(*wdev));
2585 get_primary_mac(cfg, &primary_mac);
2586 wl_cfgp2p_generate_bss_mac(cfg, &primary_mac);
2588 wdev->wiphy = cfg->wdev->wiphy;
2590 memcpy(wdev->address, wl_to_p2p_bss_macaddr(cfg, P2PAPI_BSSCFG_DEVICE), ETHER_ADDR_LEN);
2593 if (cfg->p2p_net)
2594 memcpy(cfg->p2p_net->dev_addr, wl_to_p2p_bss_macaddr(cfg, P2PAPI_BSSCFG_DEVICE),
2599 cfg->p2p_wdev = wdev;
2609 struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); local
2611 if (!cfg)
2616 ret = wl_cfgp2p_set_firm_p2p(cfg);
2622 ret = wl_cfgp2p_enable_discovery(cfg, bcmcfg_to_prmry_ndev(cfg), NULL, 0);
2628 p2p_on(cfg) = true;
2630 cfg->p2p_prb_noti = false;
2644 struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); local
2646 if (!cfg)
2652 ndev = bcmcfg_to_prmry_ndev(cfg);
2653 if (!wl_get_drv_status(cfg, READY, ndev)) {
2658 ret = wl_cfg80211_scan_stop(cfg, wdev);
2663 if (!p2p_is_on(cfg)) {
2668 wl_cfg80211_p2plo_deinit(cfg);
2672 wl_cfgp2p_cancel_listen(cfg, bcmcfg_to_prmry_ndev(cfg), wdev, TRUE);
2674 ret = wl_cfgp2p_disable_discovery(cfg);
2679 p2p_on(cfg) = false;
2687 wl_cfgp2p_del_p2p_disc_if(struct wireless_dev *wdev, struct bcm_cfg80211 *cfg) argument
2691 if (!wdev || !cfg) {
2692 WL_ERR(("null ptr. wdev:%p cfg:%p\n", wdev, cfg));
2710 MFREE(cfg->osh, wdev, sizeof(*wdev));
2712 cfg->p2p_wdev = NULL;
2721 wl_cfgp2p_need_wait_actfrmae(struct bcm_cfg80211 *cfg, void *frame, u32 frame_len, bool tx) argument
2736 cfg->need_wait_afrx = false;
2742 cfg->need_wait_afrx = true;