Lines Matching full:hw

9  *  @hw: pointer to the HW structure
13 static s32 ixgbevf_poll_for_msg(struct ixgbe_hw *hw) in ixgbevf_poll_for_msg() argument
15 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_poll_for_msg()
21 while (countdown && mbx->ops.check_for_msg(hw)) { in ixgbevf_poll_for_msg()
31 * @hw: pointer to the HW structure
35 static s32 ixgbevf_poll_for_ack(struct ixgbe_hw *hw) in ixgbevf_poll_for_ack() argument
37 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_poll_for_ack()
43 while (countdown && mbx->ops.check_for_ack(hw)) { in ixgbevf_poll_for_ack()
53 * @hw: pointer to the HW structure
58 static u32 ixgbevf_read_mailbox_vf(struct ixgbe_hw *hw) in ixgbevf_read_mailbox_vf() argument
60 u32 vf_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); in ixgbevf_read_mailbox_vf()
62 vf_mailbox |= hw->mbx.vf_mailbox; in ixgbevf_read_mailbox_vf()
63 hw->mbx.vf_mailbox |= vf_mailbox & IXGBE_VFMAILBOX_R2C_BITS; in ixgbevf_read_mailbox_vf()
70 * @hw: pointer to the HW structure
74 static void ixgbevf_clear_msg_vf(struct ixgbe_hw *hw) in ixgbevf_clear_msg_vf() argument
76 u32 vf_mailbox = ixgbevf_read_mailbox_vf(hw); in ixgbevf_clear_msg_vf()
79 hw->mbx.stats.reqs++; in ixgbevf_clear_msg_vf()
80 hw->mbx.vf_mailbox &= ~IXGBE_VFMAILBOX_PFSTS; in ixgbevf_clear_msg_vf()
86 * @hw: pointer to the HW structure
90 static void ixgbevf_clear_ack_vf(struct ixgbe_hw *hw) in ixgbevf_clear_ack_vf() argument
92 u32 vf_mailbox = ixgbevf_read_mailbox_vf(hw); in ixgbevf_clear_ack_vf()
95 hw->mbx.stats.acks++; in ixgbevf_clear_ack_vf()
96 hw->mbx.vf_mailbox &= ~IXGBE_VFMAILBOX_PFACK; in ixgbevf_clear_ack_vf()
102 * @hw: pointer to the HW structure
107 static void ixgbevf_clear_rst_vf(struct ixgbe_hw *hw) in ixgbevf_clear_rst_vf() argument
109 u32 vf_mailbox = ixgbevf_read_mailbox_vf(hw); in ixgbevf_clear_rst_vf()
112 hw->mbx.stats.rsts++; in ixgbevf_clear_rst_vf()
113 hw->mbx.vf_mailbox &= ~(IXGBE_VFMAILBOX_RSTI | in ixgbevf_clear_rst_vf()
120 * @hw: pointer to the HW structure
126 static s32 ixgbevf_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask) in ixgbevf_check_for_bit_vf() argument
128 u32 vf_mailbox = ixgbevf_read_mailbox_vf(hw); in ixgbevf_check_for_bit_vf()
139 * @hw: pointer to the HW structure
143 static s32 ixgbevf_check_for_msg_vf(struct ixgbe_hw *hw) in ixgbevf_check_for_msg_vf() argument
147 if (!ixgbevf_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) { in ixgbevf_check_for_msg_vf()
149 hw->mbx.stats.reqs++; in ixgbevf_check_for_msg_vf()
157 * @hw: pointer to the HW structure
161 static s32 ixgbevf_check_for_ack_vf(struct ixgbe_hw *hw) in ixgbevf_check_for_ack_vf() argument
165 if (!ixgbevf_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFACK)) { in ixgbevf_check_for_ack_vf()
167 ixgbevf_clear_ack_vf(hw); in ixgbevf_check_for_ack_vf()
168 hw->mbx.stats.acks++; in ixgbevf_check_for_ack_vf()
176 * @hw: pointer to the HW structure
180 static s32 ixgbevf_check_for_rst_vf(struct ixgbe_hw *hw) in ixgbevf_check_for_rst_vf() argument
184 if (!ixgbevf_check_for_bit_vf(hw, (IXGBE_VFMAILBOX_RSTD | in ixgbevf_check_for_rst_vf()
187 ixgbevf_clear_rst_vf(hw); in ixgbevf_check_for_rst_vf()
188 hw->mbx.stats.rsts++; in ixgbevf_check_for_rst_vf()
196 * @hw: pointer to the HW structure
200 static s32 ixgbevf_obtain_mbx_lock_vf(struct ixgbe_hw *hw) in ixgbevf_obtain_mbx_lock_vf() argument
202 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_obtain_mbx_lock_vf()
212 vf_mailbox = ixgbevf_read_mailbox_vf(hw); in ixgbevf_obtain_mbx_lock_vf()
214 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); in ixgbevf_obtain_mbx_lock_vf()
217 if (ixgbevf_read_mailbox_vf(hw) & IXGBE_VFMAILBOX_VFU) { in ixgbevf_obtain_mbx_lock_vf()
234 * @hw: pointer to the HW structure
236 static void ixgbevf_release_mbx_lock_vf(struct ixgbe_hw *hw) in ixgbevf_release_mbx_lock_vf() argument
241 vf_mailbox = ixgbevf_read_mailbox_vf(hw); in ixgbevf_release_mbx_lock_vf()
243 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); in ixgbevf_release_mbx_lock_vf()
248 * @hw: pointer to the HW structure
250 static void ixgbevf_release_mbx_lock_vf_legacy(struct ixgbe_hw *__always_unused hw) in ixgbevf_release_mbx_lock_vf_legacy() argument
256 * @hw: pointer to the HW structure
262 static s32 ixgbevf_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size) in ixgbevf_write_mbx_vf() argument
269 ret_val = ixgbevf_obtain_mbx_lock_vf(hw); in ixgbevf_write_mbx_vf()
274 ixgbevf_clear_msg_vf(hw); in ixgbevf_write_mbx_vf()
275 ixgbevf_clear_ack_vf(hw); in ixgbevf_write_mbx_vf()
279 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]); in ixgbevf_write_mbx_vf()
282 hw->mbx.stats.msgs_tx++; in ixgbevf_write_mbx_vf()
285 vf_mailbox = ixgbevf_read_mailbox_vf(hw); in ixgbevf_write_mbx_vf()
287 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); in ixgbevf_write_mbx_vf()
290 ret_val = ixgbevf_poll_for_ack(hw); in ixgbevf_write_mbx_vf()
293 hw->mbx.ops.release(hw); in ixgbevf_write_mbx_vf()
300 * @hw: pointer to the HW structure
306 static s32 ixgbevf_write_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size) in ixgbevf_write_mbx_vf_legacy() argument
312 ret_val = ixgbevf_obtain_mbx_lock_vf(hw); in ixgbevf_write_mbx_vf_legacy()
317 ixgbevf_check_for_msg_vf(hw); in ixgbevf_write_mbx_vf_legacy()
318 ixgbevf_clear_msg_vf(hw); in ixgbevf_write_mbx_vf_legacy()
319 ixgbevf_check_for_ack_vf(hw); in ixgbevf_write_mbx_vf_legacy()
320 ixgbevf_clear_ack_vf(hw); in ixgbevf_write_mbx_vf_legacy()
324 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]); in ixgbevf_write_mbx_vf_legacy()
327 hw->mbx.stats.msgs_tx++; in ixgbevf_write_mbx_vf_legacy()
330 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ); in ixgbevf_write_mbx_vf_legacy()
338 * @hw: pointer to the HW structure
344 static s32 ixgbevf_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size) in ixgbevf_read_mbx_vf() argument
351 ret_val = ixgbevf_check_for_msg_vf(hw); in ixgbevf_read_mbx_vf()
355 ixgbevf_clear_msg_vf(hw); in ixgbevf_read_mbx_vf()
359 msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_VFMBMEM, i); in ixgbevf_read_mbx_vf()
362 vf_mailbox = ixgbevf_read_mailbox_vf(hw); in ixgbevf_read_mbx_vf()
364 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); in ixgbevf_read_mbx_vf()
367 hw->mbx.stats.msgs_rx++; in ixgbevf_read_mbx_vf()
374 * @hw: pointer to the HW structure
380 static s32 ixgbevf_read_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size) in ixgbevf_read_mbx_vf_legacy() argument
386 ret_val = ixgbevf_obtain_mbx_lock_vf(hw); in ixgbevf_read_mbx_vf_legacy()
392 msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_VFMBMEM, i); in ixgbevf_read_mbx_vf_legacy()
395 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_ACK); in ixgbevf_read_mbx_vf_legacy()
398 hw->mbx.stats.msgs_rx++; in ixgbevf_read_mbx_vf_legacy()
406 * @hw: pointer to the HW structure
408 * Initializes the hw->mbx struct to correct values for VF mailbox
410 static s32 ixgbevf_init_mbx_params_vf(struct ixgbe_hw *hw) in ixgbevf_init_mbx_params_vf() argument
412 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_init_mbx_params_vf()
433 * @hw: pointer to the HW structure
439 s32 ixgbevf_poll_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size) in ixgbevf_poll_mbx() argument
441 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_poll_mbx()
451 ret_val = ixgbevf_poll_for_msg(hw); in ixgbevf_poll_mbx()
454 ret_val = mbx->ops.read(hw, msg, size); in ixgbevf_poll_mbx()
461 * @hw: pointer to the HW structure
468 s32 ixgbevf_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size) in ixgbevf_write_mbx() argument
470 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_write_mbx()
484 ret_val = mbx->ops.write(hw, msg, size); in ixgbevf_write_mbx()