src/dpdk/drivers/net/txgbe/base/txgbe_mbx.c
s32 txgbe_write_mbx_pf(struct txgbe_hw *hw, u32 *msg, u16 size, u16 vf_number)
{
	s32 ret_val;
	u16 i;

	DEBUGFUNC("txgbe_write_mbx_pf");

	/* lock the mailbox to prevent pf/vf race condition */
	ret_val = txgbe_obtain_mbx_lock_pf(hw, vf_number);
	if (ret_val)
		goto out_no_write;

	/* flush msg and acks as we are overwriting the message buffer */
	txgbe_check_for_msg_pf(hw, vf_number);
	txgbe_check_for_ack_pf(hw, vf_number);

	/* copy the caller specified message to the mailbox memory buffer */
	for (i = 0; i < size; i++)
		wr32a(hw, TXGBE_MBMEM(vf_number), i, msg[i]);

	/* Interrupt VF to tell it a message has been sent and release buffer*/
	wr32(hw, TXGBE_MBCTL(vf_number), TXGBE_MBCTL_STS);

	/* update stats */
	hw->mbx.stats.msgs_tx++;

out_no_write:
	return ret_val;
}
/**
 *  txgbe_write_mbx_pf - Places a message in the mailbox
 *  @hw: pointer to the HW structure
 *  @msg: The message buffer
 *  @size: Length of buffer
 *  @vf_number: the VF index
 *
 *  returns 0 if it successfully copied message into the buffer
 **/
Places a message in the mailbox
@hw: pointer to the HW structure
@msg: The message buffer
@size: Length of buffer
@vf_number: the VF index

returns 0 if it successfully copied message into the buffer
Places a message in the mailbox @hw : pointer to the HW structure @msg : The message buffer @size : Length of buffer @vf_number : the VF index returns 0 if it successfully copied message into the buffer
s32 txgbe_write_mbx_pf(struct txgbe_hw *hw, u32 *msg, u16 size, u16 vf_number)
{
	s32 ret_val;
	u16 i;
	DEBUGFUNC("txgbe_write_mbx_pf");
	ret_val = txgbe_obtain_mbx_lock_pf(hw, vf_number);
	if (ret_val)
		goto out_no_write;
	txgbe_check_for_msg_pf(hw, vf_number);
	txgbe_check_for_ack_pf(hw, vf_number);
	for (i = 0; i < size; i++)
		wr32a(hw, TXGBE_MBMEM(vf_number), i, msg[i]);
	wr32(hw, TXGBE_MBCTL(vf_number), TXGBE_MBCTL_STS);
	hw->mbx.stats.msgs_tx++;
out_no_write:
	return ret_val;
}
s32 txgbe_write_mbx_pf ( struct txgbe_hw * hw , u32 * msg , u16 size , u16 vf_number ) { s32 ret_val ; u16 i ; DEBUGFUNC ( " " ) ; ret_val = txgbe_obtain_mbx_lock_pf ( hw , vf_number ) ; if ( ret_val ) goto out_no_write ; txgbe_check_for_msg_pf ( hw , vf_number ) ; txgbe_check_for_ack_pf ( hw , vf_number ) ; for ( i = 0 ; i < size ; i ++ ) wr32a ( hw , TXGBE_MBMEM ( vf_number ) , i , msg [ i ] ) ; wr32 ( hw , TXGBE_MBCTL ( vf_number ) , TXGBE_MBCTL_STS ) ; hw -> mbx . stats . msgs_tx ++ ; out_no_write : return ret_val ; }
txgbe_write_mbx_pf - Places a message in the mailbox
  @hw: pointer to the HW structure
  @msg: The message buffer
  @size: Length of buffer
  @vf_number: the VF index
txgbe_write_mbx_pf - Places a message in the mailbox @hw : pointer to the HW structure @msg : The message buffer @size : Length of buffer @vf_number : the VF index
/* lock the mailbox to prevent pf/vf race condition */ /* flush msg and acks as we are overwriting the message buffer */ /* copy the caller specified message to the mailbox memory buffer */ /* Interrupt VF to tell it a message has been sent and release buffer*/ /* update stats */