Lines Matching defs:cptvf

6 #include "cptvf.h"
8 static void cptvf_send_msg_to_pf(struct cpt_vf *cptvf, struct cpt_mbox *mbx)
11 cpt_write_csr64(cptvf->reg_base, CPTX_VFX_PF_MBOXX(0, 0, 0),
13 cpt_write_csr64(cptvf->reg_base, CPTX_VFX_PF_MBOXX(0, 0, 1),
18 void cptvf_handle_mbox_intr(struct cpt_vf *cptvf)
26 mbx.msg = cpt_read_csr64(cptvf->reg_base, CPTX_VFX_PF_MBOXX(0, 0, 0));
27 mbx.data = cpt_read_csr64(cptvf->reg_base, CPTX_VFX_PF_MBOXX(0, 0, 1));
28 dev_dbg(&cptvf->pdev->dev, "%s: Mailbox msg 0x%llx from PF\n",
33 cptvf->pf_acked = true;
34 cptvf->vfid = mbx.data;
35 dev_dbg(&cptvf->pdev->dev, "Received VFID %d\n", cptvf->vfid);
39 cptvf->pf_acked = true;
40 cptvf->vftype = mbx.data;
41 dev_dbg(&cptvf->pdev->dev, "VF %d type %s group %d\n",
42 cptvf->vfid, ((mbx.data == SE_TYPES) ? "SE" : "AE"),
43 cptvf->vfgrp);
46 cptvf->pf_acked = true;
49 cptvf->pf_nacked = true;
52 dev_err(&cptvf->pdev->dev, "Invalid msg from PF, msg 0x%llx\n",
58 static int cptvf_send_msg_to_pf_timeout(struct cpt_vf *cptvf,
64 cptvf->pf_acked = false;
65 cptvf->pf_nacked = false;
66 cptvf_send_msg_to_pf(cptvf, mbx);
68 while (!cptvf->pf_acked) {
69 if (cptvf->pf_nacked)
72 if (cptvf->pf_acked)
76 dev_err(&cptvf->pdev->dev, "PF didn't ack to mbox msg %llx from VF%u\n",
77 (mbx->msg & 0xFF), cptvf->vfid);
89 int cptvf_check_pf_ready(struct cpt_vf *cptvf)
91 struct pci_dev *pdev = cptvf->pdev;
95 if (cptvf_send_msg_to_pf_timeout(cptvf, &mbx)) {
107 int cptvf_send_vq_size_msg(struct cpt_vf *cptvf)
109 struct pci_dev *pdev = cptvf->pdev;
113 mbx.data = cptvf->qsize;
114 if (cptvf_send_msg_to_pf_timeout(cptvf, &mbx)) {
125 int cptvf_send_vf_to_grp_msg(struct cpt_vf *cptvf)
127 struct pci_dev *pdev = cptvf->pdev;
132 mbx.data = cptvf->vfgrp;
133 if (cptvf_send_msg_to_pf_timeout(cptvf, &mbx)) {
144 int cptvf_send_vf_priority_msg(struct cpt_vf *cptvf)
146 struct pci_dev *pdev = cptvf->pdev;
151 mbx.data = cptvf->priority;
152 if (cptvf_send_msg_to_pf_timeout(cptvf, &mbx)) {
162 int cptvf_send_vf_up(struct cpt_vf *cptvf)
164 struct pci_dev *pdev = cptvf->pdev;
168 if (cptvf_send_msg_to_pf_timeout(cptvf, &mbx)) {
179 int cptvf_send_vf_down(struct cpt_vf *cptvf)
181 struct pci_dev *pdev = cptvf->pdev;
185 if (cptvf_send_msg_to_pf_timeout(cptvf, &mbx)) {