Lines Matching defs:hw

40  *  @hw: pointer to the HW structure
47 s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
49 struct ixgbe_mbx_info *mbx = &hw->mbx;
59 ret_val = mbx->ops.read(hw, msg, size, mbx_id);
66 * @hw: pointer to the HW structure
73 s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
75 struct ixgbe_mbx_info *mbx = &hw->mbx;
85 ret_val = mbx->ops.write(hw, msg, size, mbx_id);
92 * @hw: pointer to the HW structure
97 s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
99 struct ixgbe_mbx_info *mbx = &hw->mbx;
105 ret_val = mbx->ops.check_for_msg(hw, mbx_id);
112 * @hw: pointer to the HW structure
117 s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
119 struct ixgbe_mbx_info *mbx = &hw->mbx;
125 ret_val = mbx->ops.check_for_ack(hw, mbx_id);
132 * @hw: pointer to the HW structure
137 s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id)
139 struct ixgbe_mbx_info *mbx = &hw->mbx;
145 ret_val = mbx->ops.check_for_rst(hw, mbx_id);
152 * @hw: pointer to the HW structure
157 static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
159 struct ixgbe_mbx_info *mbx = &hw->mbx;
167 while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) {
184 * @hw: pointer to the HW structure
189 static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
191 struct ixgbe_mbx_info *mbx = &hw->mbx;
199 while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) {
216 * @hw: pointer to the HW structure
224 s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
226 struct ixgbe_mbx_info *mbx = &hw->mbx;
234 ret_val = ixgbe_poll_for_msg(hw, mbx_id);
238 ret_val = mbx->ops.read(hw, msg, size, mbx_id);
245 * @hw: pointer to the HW structure
253 s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
256 struct ixgbe_mbx_info *mbx = &hw->mbx;
266 ret_val = mbx->ops.write(hw, msg, size, mbx_id);
270 ret_val = ixgbe_poll_for_ack(hw, mbx_id);
277 * @hw: pointer to the HW structure
281 void ixgbe_init_mbx_ops_generic(struct ixgbe_hw *hw)
283 struct ixgbe_mbx_info *mbx = &hw->mbx;
291 * @hw: pointer to the HW structure
296 static u32 ixgbe_read_v2p_mailbox(struct ixgbe_hw *hw)
298 u32 v2p_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX);
300 v2p_mailbox |= hw->mbx.v2p_mailbox;
301 hw->mbx.v2p_mailbox |= v2p_mailbox & IXGBE_VFMAILBOX_R2C_BITS;
308 * @hw: pointer to the HW structure
314 static s32 ixgbe_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask)
316 u32 v2p_mailbox = ixgbe_read_v2p_mailbox(hw);
322 hw->mbx.v2p_mailbox &= ~mask;
329 * @hw: pointer to the HW structure
334 static s32 ixgbe_check_for_msg_vf(struct ixgbe_hw *hw, u16 mbx_id)
341 if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) {
343 hw->mbx.stats.reqs++;
351 * @hw: pointer to the HW structure
356 static s32 ixgbe_check_for_ack_vf(struct ixgbe_hw *hw, u16 mbx_id)
363 if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFACK)) {
365 hw->mbx.stats.acks++;
373 * @hw: pointer to the HW structure
378 static s32 ixgbe_check_for_rst_vf(struct ixgbe_hw *hw, u16 mbx_id)
385 if (!ixgbe_check_for_bit_vf(hw, (IXGBE_VFMAILBOX_RSTD |
388 hw->mbx.stats.rsts++;
396 * @hw: pointer to the HW structure
400 static s32 ixgbe_obtain_mbx_lock_vf(struct ixgbe_hw *hw)
407 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU);
410 if (ixgbe_read_v2p_mailbox(hw) & IXGBE_VFMAILBOX_VFU)
418 * @hw: pointer to the HW structure
425 static s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size,
436 ret_val = ixgbe_obtain_mbx_lock_vf(hw);
441 ixgbe_check_for_msg_vf(hw, 0);
442 ixgbe_check_for_ack_vf(hw, 0);
446 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]);
449 hw->mbx.stats.msgs_tx++;
452 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ);
460 * @hw: pointer to the HW structure
467 static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size,
477 ret_val = ixgbe_obtain_mbx_lock_vf(hw);
483 msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_VFMBMEM, i);
486 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_ACK);
489 hw->mbx.stats.msgs_rx++;
497 * @hw: pointer to the HW structure
499 * Initializes the hw->mbx struct to correct values for vf mailbox
501 void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw)
503 struct ixgbe_mbx_info *mbx = &hw->mbx;
527 static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index)
529 u32 mbvficr = IXGBE_READ_REG(hw, IXGBE_MBVFICR(index));
534 IXGBE_WRITE_REG(hw, IXGBE_MBVFICR(index), mask);
542 * @hw: pointer to the HW structure
547 static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number)
555 if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFREQ_VF1 << vf_bit,
558 hw->mbx.stats.reqs++;
566 * @hw: pointer to the HW structure
571 static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number)
579 if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFACK_VF1 << vf_bit,
582 hw->mbx.stats.acks++;
590 * @hw: pointer to the HW structure
595 static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number)
604 switch (hw->mac.type) {
606 vflre = IXGBE_READ_REG(hw, IXGBE_VFLRE(reg_offset));
611 vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset));
619 IXGBE_WRITE_REG(hw, IXGBE_VFLREC(reg_offset), (1 << vf_shift));
620 hw->mbx.stats.rsts++;
628 * @hw: pointer to the HW structure
633 static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number)
641 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_PFU);
644 p2v_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_number));
657 * @hw: pointer to the HW structure
664 static s32 ixgbe_write_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size,
673 ret_val = ixgbe_obtain_mbx_lock_pf(hw, vf_number);
678 ixgbe_check_for_msg_pf(hw, vf_number);
679 ixgbe_check_for_ack_pf(hw, vf_number);
683 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i, msg[i]);
686 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_STS);
689 hw->mbx.stats.msgs_tx++;
698 * @hw: pointer to the HW structure
707 static s32 ixgbe_read_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size,
716 ret_val = ixgbe_obtain_mbx_lock_pf(hw, vf_number);
722 msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i);
725 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_ACK);
728 hw->mbx.stats.msgs_rx++;
736 * @hw: pointer to the HW structure
738 * Initializes the hw->mbx struct to correct values for pf mailbox
740 void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw)
742 struct ixgbe_mbx_info *mbx = &hw->mbx;
744 if (hw->mac.type != ixgbe_mac_82599EB &&
745 hw->mac.type != ixgbe_mac_X550 &&
746 hw->mac.type != ixgbe_mac_X550EM_x &&
747 hw->mac.type != ixgbe_mac_X540)