Lines Matching refs:wrole
21 struct rtw_wifi_role_t *wrole, u8 hw_band) in _phl_alloc_hw_resource() argument
36 ridx = wrole->id; in _phl_alloc_hw_resource()
51 wrole->hw_port = port_num; in _phl_alloc_hw_resource()
62 wrole->hw_wmm = 0; in _phl_alloc_hw_resource()
64 wrole->hw_wmm = wmm_num; in _phl_alloc_hw_resource()
67 if (wrole->hw_wmm == 0) in _phl_alloc_hw_resource()
68 _os_atomic_inc(phl_to_drvpriv(phl), &wrole->hw_wmm0_ref_cnt); in _phl_alloc_hw_resource()
73 wrole->hw_band = hw_band; in _phl_alloc_hw_resource()
80 PHL_DUMP_ROLE_EX(phl, wrole); in _phl_alloc_hw_resource()
87 struct rtw_wifi_role_t *wrole) in _phl_free_hw_resource() argument
94 int ridx = wrole->id; in _phl_free_hw_resource()
95 u8 hw_band = wrole->hw_band; in _phl_free_hw_resource()
98 PHL_DUMP_ROLE_EX(phl, wrole); in _phl_free_hw_resource()
102 band_ctrl->port_map &= ~BIT(wrole->hw_port); in _phl_free_hw_resource()
106 if (wrole->hw_wmm == 0) { in _phl_free_hw_resource()
107 _os_atomic_dec(phl_to_drvpriv(phl), &wrole->hw_wmm0_ref_cnt); in _phl_free_hw_resource()
108 if (_os_atomic_read(phl_to_drvpriv(phl), &wrole->hw_wmm0_ref_cnt) == 0) in _phl_free_hw_resource()
109 band_ctrl->wmm_map &= ~BIT(wrole->hw_wmm); in _phl_free_hw_resource()
113 band_ctrl->wmm_map &= ~BIT(wrole->hw_wmm); in _phl_free_hw_resource()
127 struct rtw_wifi_role_t *wrole, u8 new_band)
131 if (new_band == wrole->hw_band) {
132 PHL_ERR("%s widx:%d at the same band(%d)\n", __func__, wrole->id, new_band);
136 _phl_free_hw_resource(phl, wrole);
137 _phl_alloc_hw_resource(phl, wrole, new_band);
170 struct rtw_wifi_role_t *wrole = NULL; in phl_get_wrole_by_addr() local
175 wrole = &(phl_com->wifi_roles[ridx]); in phl_get_wrole_by_addr()
177 wrole->mac_addr, mac_addr, MAC_ALEN) == 0) { in phl_get_wrole_by_addr()
185 wrole = NULL; in phl_get_wrole_by_addr()
187 return wrole; in phl_get_wrole_by_addr()
223 struct rtw_wifi_role_t *wrole, enum role_state rstate) in _phl_send_role_notify_cmd() argument
236 rcmd->wrole = wrole; in _phl_send_role_notify_cmd()
263 struct rtw_wifi_role_t *wrole, in _phl_role_notify() argument
272 _phl_send_role_notify_cmd(phl_info, wrole, rstate); in _phl_role_notify()
275 rtw_phl_btc_role_notify(phl_info, wrole->id, rstate); in _phl_role_notify()
352 struct rtw_wifi_role_t *wrole, in _phl_wifi_role_start() argument
371 hsts = rtw_hal_role_cfg(phl_info->hal, wrole); in _phl_wifi_role_start()
377 wrole->active = true; in _phl_wifi_role_start()
378 _phl_role_notify(phl_info, wrole, PHL_ROLE_START); in _phl_wifi_role_start()
387 _phl_wifi_role_free_sw(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole) in _phl_wifi_role_free_sw() argument
392 _phl_free_hw_resource(phl_info, wrole); in _phl_wifi_role_free_sw()
393 _os_mem_set(phl_to_drvpriv(phl_info), wrole->mac_addr, 0, MAC_ALEN); in _phl_wifi_role_free_sw()
395 mr_ctl->role_map &= ~BIT(wrole->id); in _phl_wifi_role_free_sw()
397 wrole->active = false; in _phl_wifi_role_free_sw()
403 struct rtw_wifi_role_t *wrole; member
412 return _phl_wifi_role_start(phl_info, cmd_wr->wrole, cmd_wr->sta); in phl_wifi_role_start_hdl()
427 struct rtw_wifi_role_t *wrole, in phl_wifi_role_start() argument
442 wr_start->wrole = wrole; in phl_wifi_role_start()
446 wrole->hw_band, in phl_wifi_role_start()
457 PHL_INFO("%s wr-id:%d failure\n", __func__, wrole->id); in phl_wifi_role_start()
462 PHL_INFO("%s wr-id:%d failure\n", __func__, wrole->id); in phl_wifi_role_start()
464 PHL_INFO("%s wr-id:%d success\n", __func__, wrole->id); in phl_wifi_role_start()
473 struct rtw_wifi_role_t *wrole, in phl_wifi_role_start() argument
476 return _phl_wifi_role_start(phl_info, wrole, sta); in phl_wifi_role_start()
543 phl_role_noa_notify(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole) in phl_role_noa_notify() argument
545 _phl_role_notify(phl_info, wrole, PHL_ROLE_UPDATE_NOA); in phl_role_noa_notify()
552 struct rtw_wifi_role_t *wrole, u8 link_sts) in phl_role_ap_client_notify() argument
563 _phl_role_notify(phl_info, wrole, rstate); in phl_role_ap_client_notify()
565 phl_mcc_client_link_notify_for_ap(phl_info, wrole, rstate); in phl_role_ap_client_notify()
571 phl_role_notify(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole) in phl_role_notify() argument
575 switch (wrole->type) { in phl_role_notify()
579 if (wrole->mstate == MLME_LINKING) in phl_role_notify()
581 else if (wrole->mstate == MLME_LINKED) in phl_role_notify()
593 rstate = (wrole->mstate == MLME_NO_LINK) in phl_role_notify()
608 __func__, wrole->type); in phl_role_notify()
613 __func__, wrole->type); in phl_role_notify()
617 _phl_role_notify(phl_info, wrole, rstate); in phl_role_notify()
632 struct rtw_wifi_role_t *wrole, in phl_wifi_role_change() argument
647 if (wrole->type == type) { in phl_wifi_role_change()
648 PHL_WARN("wrole type(%d) not change\n", wrole->type); in phl_wifi_role_change()
653 wrole->type, type); in phl_wifi_role_change()
655 sta = rtw_phl_get_stainfo_self(phl_info, wrole); in phl_wifi_role_change()
657 if (type == PHL_RTYPE_TDLS || wrole->type == PHL_RTYPE_TDLS) { in phl_wifi_role_change()
658 wrole->type = type; in phl_wifi_role_change()
662 wrole->type = type; in phl_wifi_role_change()
663 wrole->mstate = MLME_NO_LINK; in phl_wifi_role_change()
667 if (wrole->type == PHL_RTYPE_AP) { in phl_wifi_role_change()
668 wrole->bcn_cmn.bcn_interval = 100; in phl_wifi_role_change()
669 wrole->mstate = MLME_LINKED; in phl_wifi_role_change()
670 wrole->hiq_win = 16; /* unit: ms */ in phl_wifi_role_change()
674 phl_init_role_cap(phl_info, wrole); in phl_wifi_role_change()
675 phl_init_protocol_cap(phl_info, wrole); in phl_wifi_role_change()
677 rtw_hal_role_cfg(phl_info->hal, wrole); in phl_wifi_role_change()
680 _os_mem_cpy(drv, sta->mac_addr, wrole->mac_addr, MAC_ALEN); in phl_wifi_role_change()
683 _phl_role_notify(phl_info, wrole, PHL_ROLE_CHG_TYPE); in phl_wifi_role_change()
696 if(_os_mem_cmp(drv, wrole->mac_addr, maddr, MAC_ALEN) == 0) { in phl_wifi_role_change()
703 wrole->mac_addr[0], wrole->mac_addr[1], in phl_wifi_role_change()
704 wrole->mac_addr[2], wrole->mac_addr[3], in phl_wifi_role_change()
705 wrole->mac_addr[4], wrole->mac_addr[5], in phl_wifi_role_change()
709 _os_mem_cpy(drv, wrole->mac_addr, maddr, MAC_ALEN); in phl_wifi_role_change()
710 sta = rtw_phl_get_stainfo_self(phl_info, wrole); in phl_wifi_role_change()
713 _os_mem_cpy(drv, sta->mac_addr, wrole->mac_addr, MAC_ALEN); in phl_wifi_role_change()
723 if (wrole->type != PHL_RTYPE_AP) in phl_wifi_role_change()
729 wrole->proto_role_cap.bsscolor = (u8)bsscolor; in phl_wifi_role_change()
730 rtw_hal_role_cfg_ex(phl_info->hal, wrole, PCFG_BSS_CLR, &bsscolor); in phl_wifi_role_change()
734 PHL_INFO("wrole->type(%d) WR_CHG_AP_PARAM todo.....\n", wrole->type); in phl_wifi_role_change()
744 hstate = rtw_hal_set_edca(phl_info->hal, wrole, param->ac, in phl_wifi_role_change()
753 hstate = rtw_hal_set_mu_edca(phl_info->hal, wrole->hw_band, param->ac, in phl_wifi_role_change()
764 wrole->hw_band, wrole->hw_wmm, val); in phl_wifi_role_change()
772 hstate = rtw_hal_role_cfg_ex(phl_info->hal, wrole, PCFG_BSS_CLR, &val); in phl_wifi_role_change()
783 wrole->hw_band, in phl_wifi_role_change()
829 struct rtw_wifi_role_t *wrole; member
840 return phl_wifi_role_change(phl_info, wr_chg->wrole, wr_chg->id, wr_chg->info); in phl_wifi_role_chg_hdl()
866 struct rtw_wifi_role_t *wrole, in rtw_phl_cmd_wrole_change() argument
881 psts = phl_wifi_role_change(phl_info, wrole, chg_id, chg_info); in rtw_phl_cmd_wrole_change()
893 wr_chg->wrole = wrole; in rtw_phl_cmd_wrole_change()
907 wrole->hw_band, in rtw_phl_cmd_wrole_change()
918 PHL_INFO("%s wr-id:%d failure\n", __func__, wrole->id); in rtw_phl_cmd_wrole_change()
922 PHL_INFO("%s wr-id:%d failure\n", __func__, wrole->id); in rtw_phl_cmd_wrole_change()
925 PHL_INFO("%s wr-id:%d success\n", __func__, wrole->id); in rtw_phl_cmd_wrole_change()
943 struct rtw_wifi_role_t *wrole, in rtw_phl_cmd_wrole_change() argument
947 return phl_wifi_role_change((struct phl_info_t *)phl, wrole, chg_id, chg_info); in rtw_phl_cmd_wrole_change()
952 _phl_wifi_role_stop(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole) in _phl_wifi_role_stop() argument
956 wrole->active = false; in _phl_wifi_role_stop()
957 _phl_role_notify(phl_info, wrole, PHL_ROLE_STOP); in _phl_wifi_role_stop()
958 psts = phl_wifi_role_free_stainfo_hw(phl_info, wrole); in _phl_wifi_role_stop()
971 struct rtw_wifi_role_t *wrole = (struct rtw_wifi_role_t *)param; in phl_wifi_role_stop_hdl() local
973 return _phl_wifi_role_stop(phl_info, wrole); in phl_wifi_role_stop_hdl()
979 struct rtw_wifi_role_t *wrole = NULL; in phl_wifi_role_stop_done() local
981 wrole = (struct rtw_wifi_role_t *)cmd; in phl_wifi_role_stop_done()
984 __func__, wrole->id, status); in phl_wifi_role_stop_done()
987 __func__, wrole->id); in phl_wifi_role_stop_done()
992 phl_wifi_role_stop(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole) in phl_wifi_role_stop() argument
997 wrole->hw_band, in phl_wifi_role_stop()
999 (u8 *)wrole, in phl_wifi_role_stop()
1007 PHL_INFO("%s wr-id:%d failure\n", __func__, wrole->id); in phl_wifi_role_stop()
1011 PHL_INFO("%s wr-id:%d failure\n", __func__, wrole->id); in phl_wifi_role_stop()
1013 PHL_INFO("%s wr-id:%d success\n", __func__, wrole->id); in phl_wifi_role_stop()
1020 phl_wifi_role_stop(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole) in phl_wifi_role_stop() argument
1022 return _phl_wifi_role_stop(phl_info, wrole); in phl_wifi_role_stop()
1029 struct rtw_wifi_role_t *wrole = NULL; in rtw_phl_wifi_role_free() local
1036 wrole = &phl_com->wifi_roles[role_idx]; in rtw_phl_wifi_role_free()
1038 if (phl_wifi_role_stop(phl_info, wrole) != RTW_PHL_STATUS_SUCCESS) { in rtw_phl_wifi_role_free()
1043 if (phl_wifi_role_free_stainfo_sw(phl_info, wrole) != RTW_PHL_STATUS_SUCCESS) { in rtw_phl_wifi_role_free()
1047 _phl_wifi_role_free_sw(phl_info, wrole); in rtw_phl_wifi_role_free()
1090 struct rtw_wifi_role_t *wrole; in phl_role_recover() local
1095 wrole = rtw_phl_get_wrole_by_ridx(phl_info->phl_com, role_idx); in phl_role_recover()
1096 if(wrole == NULL) in phl_role_recover()
1101 sta = rtw_phl_get_stainfo_self(phl_info, wrole); in phl_role_recover()
1105 pstatus = _phl_wifi_role_start(phl_info, wrole, sta); in phl_role_recover()
1111 if (wrole->target_type != PHL_RTYPE_NONE) { in phl_role_recover()
1112 PHL_INFO("%s with role_idx %d change to role type %d\n", __func__, role_idx, wrole->target_type); in phl_role_recover()
1113 phl_wifi_role_change(phl_info, wrole, WR_CHG_TYPE, (u8 *)&wrole->target_type); in phl_role_recover()
1114 wrole->target_type = PHL_RTYPE_NONE; in phl_role_recover()
1145 struct rtw_wifi_role_t *wrole; in phl_role_suspend() local
1149 wrole = rtw_phl_get_wrole_by_ridx(phl_info->phl_com, role_idx); in phl_role_suspend()
1150 if (wrole == NULL) in phl_role_suspend()
1153 if (wrole->active == false) in phl_role_suspend()
1158 pstatus = _phl_wifi_role_stop(phl_info, wrole); in phl_role_suspend()
1187 bool rtw_phl_role_is_client_category(struct rtw_wifi_role_t *wrole) in rtw_phl_role_is_client_category() argument
1191 if (wrole->type == PHL_RTYPE_STATION || wrole->type == PHL_RTYPE_P2P_GC) in rtw_phl_role_is_client_category()
1196 u16 phl_role_get_bcn_intvl(struct phl_info_t *phl, struct rtw_wifi_role_t *wrole) in phl_role_get_bcn_intvl() argument
1198 struct rtw_phl_stainfo_t *sta = rtw_phl_get_stainfo_self(phl, wrole); in phl_role_get_bcn_intvl()
1201 if (phl_role_is_client_category(wrole)) { in phl_role_get_bcn_intvl()
1204 } else if (phl_role_is_ap_category(wrole)) { in phl_role_get_bcn_intvl()
1205 bcn_intvl = (u16)wrole->bcn_cmn.bcn_interval; in phl_role_get_bcn_intvl()
1209 wrole->id, wrole->type); in phl_role_get_bcn_intvl()
1215 phl_wifi_role_macid_all_pause(struct phl_info_t *phl_info, struct rtw_wifi_role_t *wrole, bool paus… in phl_wifi_role_macid_all_pause() argument
1221 switch (wrole->type) { in phl_wifi_role_macid_all_pause()
1240 _os_mem_cpy(drv, macid_pause, &mctrl->wifi_role_usedmap[wrole->id][0], PHL_MACID_MAX_ARRAY_NUM); in phl_wifi_role_macid_all_pause()
1248 struct rtw_phl_stainfo_t * self_sta = rtw_phl_get_stainfo_self((void *)phl_info, wrole); in phl_wifi_role_macid_all_pause()