Lines Matching refs:hw

39  *  @hw: pointer to the HW structure
41 static s32 e1000_null_mbx_check_for_flag(struct e1000_hw E1000_UNUSEDARG *hw,
51 * @hw: pointer to the HW structure
53 static s32 e1000_null_mbx_transact(struct e1000_hw E1000_UNUSEDARG *hw,
65 * @hw: pointer to the HW structure
72 s32 e1000_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
74 struct e1000_mbx_info *mbx = &hw->mbx;
84 ret_val = mbx->ops.read(hw, msg, size, mbx_id);
91 * @hw: pointer to the HW structure
98 s32 e1000_write_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
100 struct e1000_mbx_info *mbx = &hw->mbx;
109 ret_val = mbx->ops.write(hw, msg, size, mbx_id);
116 * @hw: pointer to the HW structure
121 s32 e1000_check_for_msg(struct e1000_hw *hw, u16 mbx_id)
123 struct e1000_mbx_info *mbx = &hw->mbx;
129 ret_val = mbx->ops.check_for_msg(hw, mbx_id);
136 * @hw: pointer to the HW structure
141 s32 e1000_check_for_ack(struct e1000_hw *hw, u16 mbx_id)
143 struct e1000_mbx_info *mbx = &hw->mbx;
149 ret_val = mbx->ops.check_for_ack(hw, mbx_id);
156 * @hw: pointer to the HW structure
161 s32 e1000_check_for_rst(struct e1000_hw *hw, u16 mbx_id)
163 struct e1000_mbx_info *mbx = &hw->mbx;
169 ret_val = mbx->ops.check_for_rst(hw, mbx_id);
176 * @hw: pointer to the HW structure
181 static s32 e1000_poll_for_msg(struct e1000_hw *hw, u16 mbx_id)
183 struct e1000_mbx_info *mbx = &hw->mbx;
191 while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) {
207 * @hw: pointer to the HW structure
212 static s32 e1000_poll_for_ack(struct e1000_hw *hw, u16 mbx_id)
214 struct e1000_mbx_info *mbx = &hw->mbx;
222 while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) {
238 * @hw: pointer to the HW structure
246 s32 e1000_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
248 struct e1000_mbx_info *mbx = &hw->mbx;
256 ret_val = e1000_poll_for_msg(hw, mbx_id);
260 ret_val = mbx->ops.read(hw, msg, size, mbx_id);
267 * @hw: pointer to the HW structure
275 s32 e1000_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
277 struct e1000_mbx_info *mbx = &hw->mbx;
287 ret_val = mbx->ops.write(hw, msg, size, mbx_id);
291 ret_val = e1000_poll_for_ack(hw, mbx_id);
298 * @hw: pointer to the HW structure
302 void e1000_init_mbx_ops_generic(struct e1000_hw *hw)
304 struct e1000_mbx_info *mbx = &hw->mbx;
317 * @hw: pointer to the HW structure
322 static u32 e1000_read_v2p_mailbox(struct e1000_hw *hw)
324 u32 v2p_mailbox = E1000_READ_REG(hw, E1000_V2PMAILBOX(0));
326 v2p_mailbox |= hw->dev_spec.vf.v2p_mailbox;
327 hw->dev_spec.vf.v2p_mailbox |= v2p_mailbox & E1000_V2PMAILBOX_R2C_BITS;
334 * @hw: pointer to the HW structure
340 static s32 e1000_check_for_bit_vf(struct e1000_hw *hw, u32 mask)
342 u32 v2p_mailbox = e1000_read_v2p_mailbox(hw);
348 hw->dev_spec.vf.v2p_mailbox &= ~mask;
355 * @hw: pointer to the HW structure
360 static s32 e1000_check_for_msg_vf(struct e1000_hw *hw,
367 if (!e1000_check_for_bit_vf(hw, E1000_V2PMAILBOX_PFSTS)) {
369 hw->mbx.stats.reqs++;
377 * @hw: pointer to the HW structure
382 static s32 e1000_check_for_ack_vf(struct e1000_hw *hw,
389 if (!e1000_check_for_bit_vf(hw, E1000_V2PMAILBOX_PFACK)) {
391 hw->mbx.stats.acks++;
399 * @hw: pointer to the HW structure
404 static s32 e1000_check_for_rst_vf(struct e1000_hw *hw,
411 if (!e1000_check_for_bit_vf(hw, (E1000_V2PMAILBOX_RSTD |
414 hw->mbx.stats.rsts++;
422 * @hw: pointer to the HW structure
426 static s32 e1000_obtain_mbx_lock_vf(struct e1000_hw *hw)
435 E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_VFU);
438 if (e1000_read_v2p_mailbox(hw) & E1000_V2PMAILBOX_VFU) {
450 * @hw: pointer to the HW structure
457 static s32 e1000_write_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size,
467 ret_val = e1000_obtain_mbx_lock_vf(hw);
472 e1000_check_for_msg_vf(hw, 0);
473 e1000_check_for_ack_vf(hw, 0);
477 E1000_WRITE_REG_ARRAY(hw, E1000_VMBMEM(0), i, msg[i]);
480 hw->mbx.stats.msgs_tx++;
483 E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_REQ);
491 * @hw: pointer to the HW structure
498 static s32 e1000_read_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size,
507 ret_val = e1000_obtain_mbx_lock_vf(hw);
513 msg[i] = E1000_READ_REG_ARRAY(hw, E1000_VMBMEM(0), i);
516 E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_ACK);
519 hw->mbx.stats.msgs_rx++;
527 * @hw: pointer to the HW structure
529 * Initializes the hw->mbx struct to correct values for vf mailbox
531 s32 e1000_init_mbx_params_vf(struct e1000_hw *hw)
533 struct e1000_mbx_info *mbx = &hw->mbx;
559 static s32 e1000_check_for_bit_pf(struct e1000_hw *hw, u32 mask)
561 u32 mbvficr = E1000_READ_REG(hw, E1000_MBVFICR);
566 E1000_WRITE_REG(hw, E1000_MBVFICR, mask);
574 * @hw: pointer to the HW structure
579 static s32 e1000_check_for_msg_pf(struct e1000_hw *hw, u16 vf_number)
585 if (!e1000_check_for_bit_pf(hw, E1000_MBVFICR_VFREQ_VF1 << vf_number)) {
587 hw->mbx.stats.reqs++;
595 * @hw: pointer to the HW structure
600 static s32 e1000_check_for_ack_pf(struct e1000_hw *hw, u16 vf_number)
606 if (!e1000_check_for_bit_pf(hw, E1000_MBVFICR_VFACK_VF1 << vf_number)) {
608 hw->mbx.stats.acks++;
616 * @hw: pointer to the HW structure
621 static s32 e1000_check_for_rst_pf(struct e1000_hw *hw, u16 vf_number)
623 u32 vflre = E1000_READ_REG(hw, E1000_VFLRE);
630 E1000_WRITE_REG(hw, E1000_VFLRE, (1 << vf_number));
631 hw->mbx.stats.rsts++;
639 * @hw: pointer to the HW structure
644 static s32 e1000_obtain_mbx_lock_pf(struct e1000_hw *hw, u16 vf_number)
654 E1000_WRITE_REG(hw, E1000_P2VMAILBOX(vf_number),
658 p2v_mailbox = E1000_READ_REG(hw, E1000_P2VMAILBOX(vf_number));
672 * @hw: pointer to the HW structure
679 static s32 e1000_write_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size,
688 ret_val = e1000_obtain_mbx_lock_pf(hw, vf_number);
693 e1000_check_for_msg_pf(hw, vf_number);
694 e1000_check_for_ack_pf(hw, vf_number);
698 E1000_WRITE_REG_ARRAY(hw, E1000_VMBMEM(vf_number), i, msg[i]);
701 E1000_WRITE_REG(hw, E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_STS);
704 hw->mbx.stats.msgs_tx++;
713 * @hw: pointer to the HW structure
722 static s32 e1000_read_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size,
731 ret_val = e1000_obtain_mbx_lock_pf(hw, vf_number);
737 msg[i] = E1000_READ_REG_ARRAY(hw, E1000_VMBMEM(vf_number), i);
740 E1000_WRITE_REG(hw, E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_ACK);
743 hw->mbx.stats.msgs_rx++;
751 * @hw: pointer to the HW structure
753 * Initializes the hw->mbx struct to correct values for pf mailbox
755 s32 e1000_init_mbx_params_pf(struct e1000_hw *hw)
757 struct e1000_mbx_info *mbx = &hw->mbx;
759 switch (hw->mac.type) {