Lines Matching full:mbox
42 "Mbox msg with unknown ID %d\n", msg->id); in otx2vf_process_vfaf_mbox_msg()
48 "Mbox msg with wrong signature %x, ID %d\n", in otx2vf_process_vfaf_mbox_msg()
83 "Mbox msg response has err %d, ID %d\n", in otx2vf_process_vfaf_mbox_msg()
93 struct otx2_mbox *mbox; in otx2vf_vfaf_mbox_handler() local
94 struct mbox *af_mbox; in otx2vf_vfaf_mbox_handler()
97 af_mbox = container_of(work, struct mbox, mbox_wrk); in otx2vf_vfaf_mbox_handler()
98 mbox = &af_mbox->mbox; in otx2vf_vfaf_mbox_handler()
99 mdev = &mbox->dev[0]; in otx2vf_vfaf_mbox_handler()
100 rsp_hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start); in otx2vf_vfaf_mbox_handler()
103 offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN); in otx2vf_vfaf_mbox_handler()
108 offset = mbox->rx_start + msg->next_msgoff; in otx2vf_vfaf_mbox_handler()
110 __otx2_mbox_reset(mbox, 0); in otx2vf_vfaf_mbox_handler()
123 otx2_reply_invalid_msg(&vf->mbox.mbox_up, 0, 0, req->id); in otx2vf_process_mbox_msg_up()
130 &vf->mbox.mbox_up, 0, in otx2vf_process_mbox_msg_up()
143 otx2_reply_invalid_msg(&vf->mbox.mbox_up, 0, 0, req->id); in otx2vf_process_mbox_msg_up()
154 struct otx2_mbox *mbox; in otx2vf_vfaf_mbox_up_handler() local
155 struct mbox *vf_mbox; in otx2vf_vfaf_mbox_up_handler()
159 vf_mbox = container_of(work, struct mbox, mbox_up_wrk); in otx2vf_vfaf_mbox_up_handler()
161 mbox = &vf_mbox->mbox_up; in otx2vf_vfaf_mbox_up_handler()
162 mdev = &mbox->dev[0]; in otx2vf_vfaf_mbox_up_handler()
164 rsp_hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start); in otx2vf_vfaf_mbox_up_handler()
168 offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN); in otx2vf_vfaf_mbox_up_handler()
173 offset = mbox->rx_start + msg->next_msgoff; in otx2vf_vfaf_mbox_up_handler()
176 otx2_mbox_msg_send(mbox, 0); in otx2vf_vfaf_mbox_up_handler()
183 struct otx2_mbox *mbox; in otx2vf_vfaf_mbox_intr_handler() local
189 /* Read latest mbox data */ in otx2vf_vfaf_mbox_intr_handler()
193 mbox = &vf->mbox.mbox; in otx2vf_vfaf_mbox_intr_handler()
194 mdev = &mbox->dev[0]; in otx2vf_vfaf_mbox_intr_handler()
195 otx2_sync_mbox_bbuf(mbox, 0); in otx2vf_vfaf_mbox_intr_handler()
197 trace_otx2_msg_interrupt(mbox->pdev, "PF to VF", BIT_ULL(0)); in otx2vf_vfaf_mbox_intr_handler()
199 hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start); in otx2vf_vfaf_mbox_intr_handler()
201 vf->mbox.num_msgs = hdr->num_msgs; in otx2vf_vfaf_mbox_intr_handler()
203 memset(mbox->hwbase + mbox->rx_start, 0, in otx2vf_vfaf_mbox_intr_handler()
205 queue_work(vf->mbox_wq, &vf->mbox.mbox_wrk); in otx2vf_vfaf_mbox_intr_handler()
208 mbox = &vf->mbox.mbox_up; in otx2vf_vfaf_mbox_intr_handler()
209 mdev = &mbox->dev[0]; in otx2vf_vfaf_mbox_intr_handler()
210 otx2_sync_mbox_bbuf(mbox, 0); in otx2vf_vfaf_mbox_intr_handler()
212 hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start); in otx2vf_vfaf_mbox_intr_handler()
214 vf->mbox.up_num_msgs = hdr->num_msgs; in otx2vf_vfaf_mbox_intr_handler()
216 memset(mbox->hwbase + mbox->rx_start, 0, in otx2vf_vfaf_mbox_intr_handler()
218 queue_work(vf->mbox_wq, &vf->mbox.mbox_up_wrk); in otx2vf_vfaf_mbox_intr_handler()
242 snprintf(irq_name, NAME_SIZE, "RVUVFAF Mbox"); in otx2vf_register_mbox_intr()
247 "RVUPF: IRQ registration failed for VFAF mbox irq\n"); in otx2vf_register_mbox_intr()
261 req = otx2_mbox_alloc_msg_ready(&vf->mbox); in otx2vf_register_mbox_intr()
267 err = otx2_sync_mbox_msg(&vf->mbox); in otx2vf_register_mbox_intr()
279 struct mbox *mbox = &vf->mbox; in otx2vf_vfaf_mbox_destroy() local
286 if (mbox->mbox.hwbase && !test_bit(CN10K_MBOX, &vf->hw.cap_flag)) in otx2vf_vfaf_mbox_destroy()
287 iounmap((void __iomem *)mbox->mbox.hwbase); in otx2vf_vfaf_mbox_destroy()
289 otx2_mbox_destroy(&mbox->mbox); in otx2vf_vfaf_mbox_destroy()
290 otx2_mbox_destroy(&mbox->mbox_up); in otx2vf_vfaf_mbox_destroy()
295 struct mbox *mbox = &vf->mbox; in otx2vf_vfaf_mbox_init() local
299 mbox->pfvf = vf; in otx2vf_vfaf_mbox_init()
327 err = otx2_mbox_init(&mbox->mbox, hwbase, vf->pdev, vf->reg_base, in otx2vf_vfaf_mbox_init()
332 err = otx2_mbox_init(&mbox->mbox_up, hwbase, vf->pdev, vf->reg_base, in otx2vf_vfaf_mbox_init()
337 err = otx2_mbox_bbuf_init(mbox, vf->pdev); in otx2vf_vfaf_mbox_init()
341 INIT_WORK(&mbox->mbox_wrk, otx2vf_vfaf_mbox_handler); in otx2vf_vfaf_mbox_init()
342 INIT_WORK(&mbox->mbox_up_wrk, otx2vf_vfaf_mbox_up_handler); in otx2vf_vfaf_mbox_init()
343 mutex_init(&mbox->lock); in otx2vf_vfaf_mbox_init()
417 mutex_lock(&vf->mbox.lock); in otx2vf_do_set_rx_mode()
419 req = otx2_mbox_alloc_msg_nix_set_rx_mode(&vf->mbox); in otx2vf_do_set_rx_mode()
421 mutex_unlock(&vf->mbox.lock); in otx2vf_do_set_rx_mode()
434 otx2_sync_mbox_msg(&vf->mbox); in otx2vf_do_set_rx_mode()
436 mutex_unlock(&vf->mbox.lock); in otx2vf_do_set_rx_mode()
714 otx2_detach_resources(&vf->mbox); in otx2vf_probe()
762 otx2_detach_resources(&vf->mbox); in otx2vf_remove()