42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
|
// SPDX-License-Identifier: GPL-2.0
|
||
|
/* Copyright (c) 2018, Intel Corporation. */
|
||
|
|
||
|
#include "ice_common.h"
|
||
|
#include "ice_adminq_cmd.h"
|
||
|
#include "ice_sriov.h"
|
||
|
|
||
|
/**
|
||
|
* ice_aq_send_msg_to_vf
|
||
|
* @hw: pointer to the hardware structure
|
||
|
* @vfid: VF ID to send msg
|
||
|
* @v_opcode: opcodes for VF-PF communication
|
||
|
* @v_retval: return error code
|
||
|
* @msg: pointer to the msg buffer
|
||
|
* @msglen: msg length
|
||
|
* @cd: pointer to command details
|
||
|
*
|
||
|
* Send message to VF driver (0x0802) using mailbox
|
||
|
* queue and asynchronously sending message via
|
||
|
* ice_sq_send_cmd() function
|
||
|
*/
|
||
|
enum ice_status
|
||
|
ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 v_retval,
|
||
|
u8 *msg, u16 msglen, struct ice_sq_cd *cd)
|
||
|
{
|
||
|
struct ice_aqc_pf_vf_msg *cmd;
|
||
|
struct ice_aq_desc desc;
|
||
|
|
||
|
ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_vf);
|
||
|
|
||
|
cmd = &desc.params.virt;
|
||
|
cmd->id = cpu_to_le32(vfid);
|
||
|
|
||
|
desc.cookie_high = cpu_to_le32(v_opcode);
|
||
|
desc.cookie_low = cpu_to_le32(v_retval);
|
||
|
|
||
|
if (msglen)
|
||
|
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||
|
|
||
|
return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd);
|
||
|
}
|