Lines Matching refs:cptpf

14 static int forward_to_af(struct otx2_cptpf_dev *cptpf,  in forward_to_af()  argument
21 msg = otx2_mbox_alloc_msg(&cptpf->afpf_mbox, 0, size); in forward_to_af()
32 otx2_mbox_msg_send(&cptpf->afpf_mbox, 0); in forward_to_af()
33 ret = otx2_mbox_wait_for_rsp(&cptpf->afpf_mbox, 0); in forward_to_af()
35 dev_err(&cptpf->pdev->dev, "RVU MBOX timeout.\n"); in forward_to_af()
38 dev_err(&cptpf->pdev->dev, "RVU MBOX error: %d.\n", ret); in forward_to_af()
44 static int handle_msg_get_caps(struct otx2_cptpf_dev *cptpf, in handle_msg_get_caps() argument
51 otx2_mbox_alloc_msg(&cptpf->vfpf_mbox, vf->vf_id, in handle_msg_get_caps()
60 rsp->cpt_revision = cptpf->pdev->revision; in handle_msg_get_caps()
61 memcpy(&rsp->eng_caps, &cptpf->eng_caps, sizeof(rsp->eng_caps)); in handle_msg_get_caps()
66 static int handle_msg_get_eng_grp_num(struct otx2_cptpf_dev *cptpf, in handle_msg_get_eng_grp_num() argument
75 otx2_mbox_alloc_msg(&cptpf->vfpf_mbox, vf->vf_id, sizeof(*rsp)); in handle_msg_get_eng_grp_num()
83 rsp->eng_grp_num = otx2_cpt_get_eng_grp(&cptpf->eng_grps, in handle_msg_get_eng_grp_num()
89 static int handle_msg_kvf_limits(struct otx2_cptpf_dev *cptpf, in handle_msg_kvf_limits() argument
96 otx2_mbox_alloc_msg(&cptpf->vfpf_mbox, vf->vf_id, sizeof(*rsp)); in handle_msg_kvf_limits()
103 rsp->kvf_limits = cptpf->kvf_limits; in handle_msg_kvf_limits()
108 static int cptpf_handle_vf_req(struct otx2_cptpf_dev *cptpf, in cptpf_handle_vf_req() argument
120 err = handle_msg_get_eng_grp_num(cptpf, vf, req); in cptpf_handle_vf_req()
123 err = handle_msg_get_caps(cptpf, vf, req); in cptpf_handle_vf_req()
126 err = handle_msg_kvf_limits(cptpf, vf, req); in cptpf_handle_vf_req()
129 err = forward_to_af(cptpf, vf, req, size); in cptpf_handle_vf_req()
135 otx2_reply_invalid_msg(&cptpf->vfpf_mbox, vf->vf_id, 0, req->id); in cptpf_handle_vf_req()
136 otx2_mbox_msg_send(&cptpf->vfpf_mbox, vf->vf_id); in cptpf_handle_vf_req()
142 struct otx2_cptpf_dev *cptpf = arg; in otx2_cptpf_vfpf_mbox_intr() local
153 intr = otx2_cpt_read64(cptpf->reg_base, BLKADDR_RVUM, 0, in otx2_cptpf_vfpf_mbox_intr()
156 for (vf_idx = i * 64; vf_idx < cptpf->enabled_vfs; vf_idx++) { in otx2_cptpf_vfpf_mbox_intr()
157 vf = &cptpf->vf[vf_idx]; in otx2_cptpf_vfpf_mbox_intr()
159 queue_work(cptpf->vfpf_mbox_wq, in otx2_cptpf_vfpf_mbox_intr()
162 otx2_cpt_write64(cptpf->reg_base, BLKADDR_RVUM, in otx2_cptpf_vfpf_mbox_intr()
173 struct otx2_cptpf_dev *cptpf; in otx2_cptpf_vfpf_mbox_handler() local
182 cptpf = vf->cptpf; in otx2_cptpf_vfpf_mbox_handler()
183 mbox = &cptpf->vfpf_mbox; in otx2_cptpf_vfpf_mbox_handler()
195 msg->pcifunc = ((u16)cptpf->pf_id << RVU_PFVF_PF_SHIFT) | in otx2_cptpf_vfpf_mbox_handler()
198 err = cptpf_handle_vf_req(cptpf, vf, msg, in otx2_cptpf_vfpf_mbox_handler()
215 struct otx2_cptpf_dev *cptpf = arg; in otx2_cptpf_afpf_mbox_intr() local
219 intr = otx2_cpt_read64(cptpf->reg_base, BLKADDR_RVUM, 0, RVU_PF_INT); in otx2_cptpf_afpf_mbox_intr()
223 queue_work(cptpf->afpf_mbox_wq, &cptpf->afpf_mbox_work); in otx2_cptpf_afpf_mbox_intr()
225 otx2_cpt_write64(cptpf->reg_base, BLKADDR_RVUM, 0, RVU_PF_INT, in otx2_cptpf_afpf_mbox_intr()
231 static void process_afpf_mbox_msg(struct otx2_cptpf_dev *cptpf, in process_afpf_mbox_msg() argument
234 struct device *dev = &cptpf->pdev->dev; in process_afpf_mbox_msg()
249 cptpf->pf_id = (msg->pcifunc >> RVU_PFVF_PF_SHIFT) & in process_afpf_mbox_msg()
265 cptpf->lfs.are_lfs_attached = 1; in process_afpf_mbox_msg()
269 cptpf->lfs.are_lfs_attached = 0; in process_afpf_mbox_msg()
279 static void forward_to_vf(struct otx2_cptpf_dev *cptpf, struct mbox_msghdr *msg, in forward_to_vf() argument
286 dev_err(&cptpf->pdev->dev, in forward_to_vf()
291 dev_err(&cptpf->pdev->dev, in forward_to_vf()
296 vfpf_mbox = &cptpf->vfpf_mbox; in forward_to_vf()
298 if (vf_id >= cptpf->enabled_vfs) { in forward_to_vf()
299 dev_err(&cptpf->pdev->dev, in forward_to_vf()
301 vf_id, cptpf->enabled_vfs); in forward_to_vf()
309 dev_err(&cptpf->pdev->dev, in forward_to_vf()
325 struct otx2_cptpf_dev *cptpf; in otx2_cptpf_afpf_mbox_handler() local
332 cptpf = container_of(work, struct otx2_cptpf_dev, afpf_mbox_work); in otx2_cptpf_afpf_mbox_handler()
333 afpf_mbox = &cptpf->afpf_mbox; in otx2_cptpf_afpf_mbox_handler()
347 forward_to_vf(cptpf, msg, vf_id, in otx2_cptpf_afpf_mbox_handler()
350 process_afpf_mbox_msg(cptpf, msg); in otx2_cptpf_afpf_mbox_handler()