// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 1999 - 2018 Intel Corporation. */ #include "mbx.h" #include "ixgbevf.h" /** * ixgbevf_poll_for_msg - Wait for message notification * @hw: pointer to the HW structure * * returns 0 if it successfully received a message notification **/ static s32 ixgbevf_poll_for_msg(struct ixgbe_hw *hw) { … } /** * ixgbevf_poll_for_ack - Wait for message acknowledgment * @hw: pointer to the HW structure * * returns 0 if it successfully received a message acknowledgment **/ static s32 ixgbevf_poll_for_ack(struct ixgbe_hw *hw) { … } /** * ixgbevf_read_mailbox_vf - read VF's mailbox register * @hw: pointer to the HW structure * * This function is used to read the mailbox register dedicated for VF without * losing the read to clear status bits. **/ static u32 ixgbevf_read_mailbox_vf(struct ixgbe_hw *hw) { … } /** * ixgbevf_clear_msg_vf - clear PF status bit * @hw: pointer to the HW structure * * This function is used to clear PFSTS bit in the VFMAILBOX register **/ static void ixgbevf_clear_msg_vf(struct ixgbe_hw *hw) { … } /** * ixgbevf_clear_ack_vf - clear PF ACK bit * @hw: pointer to the HW structure * * This function is used to clear PFACK bit in the VFMAILBOX register **/ static void ixgbevf_clear_ack_vf(struct ixgbe_hw *hw) { … } /** * ixgbevf_clear_rst_vf - clear PF reset bit * @hw: pointer to the HW structure * * This function is used to clear reset indication and reset done bit in * VFMAILBOX register after reset the shared resources and the reset sequence. **/ static void ixgbevf_clear_rst_vf(struct ixgbe_hw *hw) { … } /** * ixgbevf_check_for_bit_vf - Determine if a status bit was set * @hw: pointer to the HW structure * @mask: bitmask for bits to be tested and cleared * * This function is used to check for the read to clear bits within * the V2P mailbox. **/ static s32 ixgbevf_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask) { … } /** * ixgbevf_check_for_msg_vf - checks to see if the PF has sent mail * @hw: pointer to the HW structure * * returns 0 if the PF has set the Status bit or else ERR_MBX **/ static s32 ixgbevf_check_for_msg_vf(struct ixgbe_hw *hw) { … } /** * ixgbevf_check_for_ack_vf - checks to see if the PF has ACK'd * @hw: pointer to the HW structure * * returns 0 if the PF has set the ACK bit or else ERR_MBX **/ static s32 ixgbevf_check_for_ack_vf(struct ixgbe_hw *hw) { … } /** * ixgbevf_check_for_rst_vf - checks to see if the PF has reset * @hw: pointer to the HW structure * * returns true if the PF has set the reset done bit or else false **/ static s32 ixgbevf_check_for_rst_vf(struct ixgbe_hw *hw) { … } /** * ixgbevf_obtain_mbx_lock_vf - obtain mailbox lock * @hw: pointer to the HW structure * * return 0 if we obtained the mailbox lock **/ static s32 ixgbevf_obtain_mbx_lock_vf(struct ixgbe_hw *hw) { … } /** * ixgbevf_release_mbx_lock_vf - release mailbox lock * @hw: pointer to the HW structure **/ static void ixgbevf_release_mbx_lock_vf(struct ixgbe_hw *hw) { … } /** * ixgbevf_release_mbx_lock_vf_legacy - release mailbox lock * @hw: pointer to the HW structure **/ static void ixgbevf_release_mbx_lock_vf_legacy(struct ixgbe_hw *__always_unused hw) { … } /** * ixgbevf_write_mbx_vf - Write a message to the mailbox * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * * returns 0 if it successfully copied message into the buffer **/ static s32 ixgbevf_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size) { … } /** * ixgbevf_write_mbx_vf_legacy - Write a message to the mailbox * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * * returns 0 if it successfully copied message into the buffer **/ static s32 ixgbevf_write_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size) { … } /** * ixgbevf_read_mbx_vf - Reads a message from the inbox intended for VF * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * * returns 0 if it successfully read message from buffer **/ static s32 ixgbevf_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size) { … } /** * ixgbevf_read_mbx_vf_legacy - Reads a message from the inbox intended for VF * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * * returns 0 if it successfully read message from buffer **/ static s32 ixgbevf_read_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size) { … } /** * ixgbevf_init_mbx_params_vf - set initial values for VF mailbox * @hw: pointer to the HW structure * * Initializes the hw->mbx struct to correct values for VF mailbox */ static s32 ixgbevf_init_mbx_params_vf(struct ixgbe_hw *hw) { … } /** * ixgbevf_poll_mbx - Wait for message and read it from the mailbox * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * * returns 0 if it successfully read message from buffer **/ s32 ixgbevf_poll_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size) { … } /** * ixgbevf_write_mbx - Write a message to the mailbox and wait for ACK * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * * returns 0 if it successfully copied message into the buffer and * received an ACK to that message within specified period **/ s32 ixgbevf_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size) { … } const struct ixgbe_mbx_operations ixgbevf_mbx_ops = …; const struct ixgbe_mbx_operations ixgbevf_mbx_ops_legacy = …; /* Mailbox operations when running on Hyper-V. * On Hyper-V, PF/VF communication is not through the * hardware mailbox; this communication is through * a software mediated path. * Most mail box operations are noop while running on * Hyper-V. */ const struct ixgbe_mbx_operations ixgbevf_hv_mbx_ops = …;