Lines Matching refs:recv_mbox
302 struct hinic_recv_mbox *recv_mbox, in recv_vf_mbox_handler() argument
308 if (recv_mbox->mod >= HINIC_MOD_MAX) { in recv_vf_mbox_handler()
310 recv_mbox->mod); in recv_vf_mbox_handler()
315 &func_to_func->vf_mbox_cb_state[recv_mbox->mod]); in recv_vf_mbox_handler()
317 cb = func_to_func->vf_mbox_cb[recv_mbox->mod]; in recv_vf_mbox_handler()
319 &func_to_func->vf_mbox_cb_state[recv_mbox->mod])) { in recv_vf_mbox_handler()
320 cb(func_to_func->hwdev, recv_mbox->cmd, recv_mbox->mbox, in recv_vf_mbox_handler()
321 recv_mbox->mbox_len, buf_out, out_size); in recv_vf_mbox_handler()
328 &func_to_func->vf_mbox_cb_state[recv_mbox->mod]); in recv_vf_mbox_handler()
335 struct hinic_recv_mbox *recv_mbox, in recv_pf_from_vf_mbox_handler() argument
343 if (recv_mbox->mod >= HINIC_MOD_MAX) { in recv_pf_from_vf_mbox_handler()
345 recv_mbox->mod); in recv_pf_from_vf_mbox_handler()
350 &func_to_func->pf_mbox_cb_state[recv_mbox->mod]); in recv_pf_from_vf_mbox_handler()
352 cb = func_to_func->pf_mbox_cb[recv_mbox->mod]; in recv_pf_from_vf_mbox_handler()
354 &func_to_func->pf_mbox_cb_state[recv_mbox->mod])) { in recv_pf_from_vf_mbox_handler()
357 ret = cb(func_to_func->hwdev, vf_id, recv_mbox->cmd, in recv_pf_from_vf_mbox_handler()
358 recv_mbox->mbox, recv_mbox->mbox_len, in recv_pf_from_vf_mbox_handler()
362 recv_mbox->mod); in recv_pf_from_vf_mbox_handler()
367 &func_to_func->pf_mbox_cb_state[recv_mbox->mod]); in recv_pf_from_vf_mbox_handler()
372 static bool check_mbox_seq_id_and_seg_len(struct hinic_recv_mbox *recv_mbox, in check_mbox_seq_id_and_seg_len() argument
379 recv_mbox->seq_id = seq_id; in check_mbox_seq_id_and_seg_len()
381 if (seq_id != recv_mbox->seq_id + 1) in check_mbox_seq_id_and_seg_len()
384 recv_mbox->seq_id = seq_id; in check_mbox_seq_id_and_seg_len()
391 struct hinic_recv_mbox *recv_mbox) in resp_mbox_handler() argument
394 if (recv_mbox->msg_info.msg_id == func_to_func->send_msg_id && in resp_mbox_handler()
396 complete(&recv_mbox->recv_done); in resp_mbox_handler()
400 func_to_func->send_msg_id, recv_mbox->msg_info.msg_id, in resp_mbox_handler()
401 recv_mbox->msg_info.status); in resp_mbox_handler()
406 struct hinic_recv_mbox *recv_mbox,
413 struct hinic_recv_mbox *recv_mbox; in recv_func_mbox_work_handler() local
415 recv_func_mbox_handler(mbox_work->func_to_func, mbox_work->recv_mbox, in recv_func_mbox_work_handler()
418 recv_mbox = in recv_func_mbox_work_handler()
421 atomic_dec(&recv_mbox->msg_cnt); in recv_func_mbox_work_handler()
427 void *header, struct hinic_recv_mbox *recv_mbox) in recv_mbox_handler() argument
441 if (!check_mbox_seq_id_and_seg_len(recv_mbox, seq_id, seg_len)) { in recv_mbox_handler()
444 src_func_idx, recv_mbox->seq_id, seq_id, seg_len); in recv_mbox_handler()
445 recv_mbox->seq_id = SEQ_ID_MAX_VAL; in recv_mbox_handler()
450 memcpy((u8 *)recv_mbox->mbox + pos, mbox_body, in recv_mbox_handler()
456 recv_mbox->cmd = HINIC_MBOX_HEADER_GET(mbox_header, CMD); in recv_mbox_handler()
457 recv_mbox->mod = HINIC_MBOX_HEADER_GET(mbox_header, MODULE); in recv_mbox_handler()
458 recv_mbox->mbox_len = HINIC_MBOX_HEADER_GET(mbox_header, MSG_LEN); in recv_mbox_handler()
459 recv_mbox->ack_type = HINIC_MBOX_HEADER_GET(mbox_header, NO_ACK); in recv_mbox_handler()
460 recv_mbox->msg_info.msg_id = HINIC_MBOX_HEADER_GET(mbox_header, MSG_ID); in recv_mbox_handler()
461 recv_mbox->msg_info.status = HINIC_MBOX_HEADER_GET(mbox_header, STATUS); in recv_mbox_handler()
462 recv_mbox->seq_id = SEQ_ID_MAX_VAL; in recv_mbox_handler()
466 resp_mbox_handler(func_to_func, recv_mbox); in recv_mbox_handler()
470 if (atomic_read(&recv_mbox->msg_cnt) > HINIC_MAX_MSG_CNT_TO_PROCESS) { in recv_mbox_handler()
473 src_func_idx, atomic_read(&recv_mbox->msg_cnt)); in recv_mbox_handler()
477 rcv_mbox_temp = kmemdup(recv_mbox, sizeof(*rcv_mbox_temp), GFP_KERNEL); in recv_mbox_handler()
481 rcv_mbox_temp->mbox = kmemdup(recv_mbox->mbox, MBOX_MAX_BUF_SZ, in recv_mbox_handler()
495 mbox_work->recv_mbox = rcv_mbox_temp; in recv_mbox_handler()
498 atomic_inc(&recv_mbox->msg_cnt); in recv_mbox_handler()
623 struct hinic_recv_mbox *recv_mbox; in hinic_mbox_func_aeqe_handler() local
640 recv_mbox = (dir == HINIC_HWIF_DIRECT_SEND) ? in hinic_mbox_func_aeqe_handler()
644 recv_mbox_handler(func_to_func, (u64 *)header, recv_mbox); in hinic_mbox_func_aeqe_handler()
904 struct hinic_recv_mbox *recv_mbox, int err, in response_for_recv_func_mbox() argument
909 if (recv_mbox->ack_type == MBOX_ACK) { in response_for_recv_func_mbox()
910 msg_info.msg_id = recv_mbox->msg_info.msg_id; in response_for_recv_func_mbox()
922 send_mbox_to_func(func_to_func, recv_mbox->mod, recv_mbox->cmd, in response_for_recv_func_mbox()
923 recv_mbox->buf_out, out_size, src_func_idx, in response_for_recv_func_mbox()
930 struct hinic_recv_mbox *recv_mbox, in recv_func_mbox_handler() argument
933 void *buf_out = recv_mbox->buf_out; in recv_func_mbox_handler()
938 err = recv_vf_mbox_handler(func_to_func, recv_mbox, buf_out, in recv_func_mbox_handler()
946 recv_mbox, in recv_func_mbox_handler()
951 response_for_recv_func_mbox(func_to_func, recv_mbox, err, out_size, in recv_func_mbox_handler()
953 kfree(recv_mbox->buf_out); in recv_func_mbox_handler()
954 kfree(recv_mbox->mbox); in recv_func_mbox_handler()
955 kfree(recv_mbox); in recv_func_mbox_handler()