Lines Matching refs:hw
43 s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) in ixgbe_read_mbx() argument
45 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_read_mbx()
54 return mbx->ops.read(hw, msg, size, mbx_id); in ixgbe_read_mbx()
66 s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) in ixgbe_write_mbx() argument
68 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_write_mbx()
76 return mbx->ops.write(hw, msg, size, mbx_id); in ixgbe_write_mbx()
86 s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id) in ixgbe_check_for_msg() argument
88 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_check_for_msg()
93 return mbx->ops.check_for_msg(hw, mbx_id); in ixgbe_check_for_msg()
103 s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id) in ixgbe_check_for_ack() argument
105 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_check_for_ack()
110 return mbx->ops.check_for_ack(hw, mbx_id); in ixgbe_check_for_ack()
120 s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id) in ixgbe_check_for_rst() argument
122 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_check_for_rst()
127 return mbx->ops.check_for_rst(hw, mbx_id); in ixgbe_check_for_rst()
137 static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id) in ixgbe_poll_for_msg() argument
139 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_poll_for_msg()
145 while (mbx->ops.check_for_msg(hw, mbx_id)) { in ixgbe_poll_for_msg()
162 static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id) in ixgbe_poll_for_ack() argument
164 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_poll_for_ack()
170 while (mbx->ops.check_for_ack(hw, mbx_id)) { in ixgbe_poll_for_ack()
190 static s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, in ixgbe_read_posted_mbx() argument
193 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_read_posted_mbx()
199 ret_val = ixgbe_poll_for_msg(hw, mbx_id); in ixgbe_read_posted_mbx()
204 return mbx->ops.read(hw, msg, size, mbx_id); in ixgbe_read_posted_mbx()
217 static s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, in ixgbe_write_posted_mbx() argument
220 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_write_posted_mbx()
228 ret_val = mbx->ops.write(hw, msg, size, mbx_id); in ixgbe_write_posted_mbx()
233 return ixgbe_poll_for_ack(hw, mbx_id); in ixgbe_write_posted_mbx()
236 static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index) in ixgbe_check_for_bit_pf() argument
238 u32 mbvficr = IXGBE_READ_REG(hw, IXGBE_MBVFICR(index)); in ixgbe_check_for_bit_pf()
241 IXGBE_WRITE_REG(hw, IXGBE_MBVFICR(index), mask); in ixgbe_check_for_bit_pf()
255 static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number) in ixgbe_check_for_msg_pf() argument
260 if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFREQ_VF1 << vf_bit, in ixgbe_check_for_msg_pf()
262 hw->mbx.stats.reqs++; in ixgbe_check_for_msg_pf()
276 static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) in ixgbe_check_for_ack_pf() argument
281 if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFACK_VF1 << vf_bit, in ixgbe_check_for_ack_pf()
283 hw->mbx.stats.acks++; in ixgbe_check_for_ack_pf()
297 static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number) in ixgbe_check_for_rst_pf() argument
303 switch (hw->mac.type) { in ixgbe_check_for_rst_pf()
305 vflre = IXGBE_READ_REG(hw, IXGBE_VFLRE(reg_offset)); in ixgbe_check_for_rst_pf()
310 vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset)); in ixgbe_check_for_rst_pf()
317 IXGBE_WRITE_REG(hw, IXGBE_VFLREC(reg_offset), (1 << vf_shift)); in ixgbe_check_for_rst_pf()
318 hw->mbx.stats.rsts++; in ixgbe_check_for_rst_pf()
332 static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number) in ixgbe_obtain_mbx_lock_pf() argument
337 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_PFU); in ixgbe_obtain_mbx_lock_pf()
340 p2v_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_number)); in ixgbe_obtain_mbx_lock_pf()
356 static s32 ixgbe_write_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size, in ixgbe_write_mbx_pf() argument
363 ret_val = ixgbe_obtain_mbx_lock_pf(hw, vf_number); in ixgbe_write_mbx_pf()
368 ixgbe_check_for_msg_pf(hw, vf_number); in ixgbe_write_mbx_pf()
369 ixgbe_check_for_ack_pf(hw, vf_number); in ixgbe_write_mbx_pf()
373 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i, msg[i]); in ixgbe_write_mbx_pf()
376 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_STS); in ixgbe_write_mbx_pf()
379 hw->mbx.stats.msgs_tx++; in ixgbe_write_mbx_pf()
395 static s32 ixgbe_read_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size, in ixgbe_read_mbx_pf() argument
402 ret_val = ixgbe_obtain_mbx_lock_pf(hw, vf_number); in ixgbe_read_mbx_pf()
408 msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i); in ixgbe_read_mbx_pf()
411 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_ACK); in ixgbe_read_mbx_pf()
414 hw->mbx.stats.msgs_rx++; in ixgbe_read_mbx_pf()
426 void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw) in ixgbe_init_mbx_params_pf() argument
428 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_init_mbx_params_pf()
430 if (hw->mac.type != ixgbe_mac_82599EB && in ixgbe_init_mbx_params_pf()
431 hw->mac.type != ixgbe_mac_X550 && in ixgbe_init_mbx_params_pf()
432 hw->mac.type != ixgbe_mac_X550EM_x && in ixgbe_init_mbx_params_pf()
433 hw->mac.type != ixgbe_mac_X540) in ixgbe_init_mbx_params_pf()