Lines Matching refs:hw

36 static s32 ixgbevf_poll_for_msg(struct ixgbe_hw *hw)  in ixgbevf_poll_for_msg()  argument
38 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_poll_for_msg()
41 while (countdown && mbx->ops.check_for_msg(hw)) { in ixgbevf_poll_for_msg()
59 static s32 ixgbevf_poll_for_ack(struct ixgbe_hw *hw) in ixgbevf_poll_for_ack() argument
61 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_poll_for_ack()
64 while (countdown && mbx->ops.check_for_ack(hw)) { in ixgbevf_poll_for_ack()
85 static s32 ixgbevf_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size) in ixgbevf_read_posted_mbx() argument
87 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_read_posted_mbx()
93 ret_val = ixgbevf_poll_for_msg(hw); in ixgbevf_read_posted_mbx()
97 ret_val = mbx->ops.read(hw, msg, size); in ixgbevf_read_posted_mbx()
111 static s32 ixgbevf_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size) in ixgbevf_write_posted_mbx() argument
113 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_write_posted_mbx()
121 ret_val = mbx->ops.write(hw, msg, size); in ixgbevf_write_posted_mbx()
125 ret_val = ixgbevf_poll_for_ack(hw); in ixgbevf_write_posted_mbx()
137 static u32 ixgbevf_read_v2p_mailbox(struct ixgbe_hw *hw) in ixgbevf_read_v2p_mailbox() argument
139 u32 v2p_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); in ixgbevf_read_v2p_mailbox()
141 v2p_mailbox |= hw->mbx.v2p_mailbox; in ixgbevf_read_v2p_mailbox()
142 hw->mbx.v2p_mailbox |= v2p_mailbox & IXGBE_VFMAILBOX_R2C_BITS; in ixgbevf_read_v2p_mailbox()
155 static s32 ixgbevf_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask) in ixgbevf_check_for_bit_vf() argument
157 u32 v2p_mailbox = ixgbevf_read_v2p_mailbox(hw); in ixgbevf_check_for_bit_vf()
163 hw->mbx.v2p_mailbox &= ~mask; in ixgbevf_check_for_bit_vf()
174 static s32 ixgbevf_check_for_msg_vf(struct ixgbe_hw *hw) in ixgbevf_check_for_msg_vf() argument
178 if (!ixgbevf_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) { in ixgbevf_check_for_msg_vf()
180 hw->mbx.stats.reqs++; in ixgbevf_check_for_msg_vf()
192 static s32 ixgbevf_check_for_ack_vf(struct ixgbe_hw *hw) in ixgbevf_check_for_ack_vf() argument
196 if (!ixgbevf_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFACK)) { in ixgbevf_check_for_ack_vf()
198 hw->mbx.stats.acks++; in ixgbevf_check_for_ack_vf()
210 static s32 ixgbevf_check_for_rst_vf(struct ixgbe_hw *hw) in ixgbevf_check_for_rst_vf() argument
214 if (!ixgbevf_check_for_bit_vf(hw, (IXGBE_VFMAILBOX_RSTD | in ixgbevf_check_for_rst_vf()
217 hw->mbx.stats.rsts++; in ixgbevf_check_for_rst_vf()
229 static s32 ixgbevf_obtain_mbx_lock_vf(struct ixgbe_hw *hw) in ixgbevf_obtain_mbx_lock_vf() argument
234 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU); in ixgbevf_obtain_mbx_lock_vf()
237 if (ixgbevf_read_v2p_mailbox(hw) & IXGBE_VFMAILBOX_VFU) in ixgbevf_obtain_mbx_lock_vf()
251 static s32 ixgbevf_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size) in ixgbevf_write_mbx_vf() argument
257 ret_val = ixgbevf_obtain_mbx_lock_vf(hw); in ixgbevf_write_mbx_vf()
262 ixgbevf_check_for_msg_vf(hw); in ixgbevf_write_mbx_vf()
263 ixgbevf_check_for_ack_vf(hw); in ixgbevf_write_mbx_vf()
267 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]); in ixgbevf_write_mbx_vf()
270 hw->mbx.stats.msgs_tx++; in ixgbevf_write_mbx_vf()
273 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ); in ixgbevf_write_mbx_vf()
287 static s32 ixgbevf_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size) in ixgbevf_read_mbx_vf() argument
293 ret_val = ixgbevf_obtain_mbx_lock_vf(hw); in ixgbevf_read_mbx_vf()
299 msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_VFMBMEM, i); in ixgbevf_read_mbx_vf()
302 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_ACK); in ixgbevf_read_mbx_vf()
305 hw->mbx.stats.msgs_rx++; in ixgbevf_read_mbx_vf()
317 static s32 ixgbevf_init_mbx_params_vf(struct ixgbe_hw *hw) in ixgbevf_init_mbx_params_vf() argument
319 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_init_mbx_params_vf()