Lines Matching refs:hw

35  *  @hw: pointer to the HW structure
40 static s32 igbvf_poll_for_msg(struct e1000_hw *hw, u16 mbx_id)
42 struct e1000_mbx_info *mbx = &hw->mbx;
50 while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) {
66 * @hw: pointer to the HW structure
71 static s32 igbvf_poll_for_ack(struct e1000_hw *hw, u16 mbx_id)
73 struct e1000_mbx_info *mbx = &hw->mbx;
81 while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) {
97 * @hw: pointer to the HW structure
105 static s32 igbvf_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size,
108 struct e1000_mbx_info *mbx = &hw->mbx;
116 ret_val = igbvf_poll_for_msg(hw, mbx_id);
120 ret_val = mbx->ops.read(hw, msg, size, mbx_id);
127 * @hw: pointer to the HW structure
135 static s32 igbvf_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size,
138 struct e1000_mbx_info *mbx = &hw->mbx;
148 ret_val = mbx->ops.write(hw, msg, size, mbx_id);
152 ret_val = igbvf_poll_for_ack(hw, mbx_id);
159 * @hw: pointer to the HW structure
163 void igbvf_init_mbx_ops_generic(struct e1000_hw *hw)
165 struct e1000_mbx_info *mbx = &hw->mbx;
172 * @hw: pointer to the HW structure
177 static u32 igbvf_read_v2p_mailbox(struct e1000_hw *hw)
179 u32 v2p_mailbox = E1000_READ_REG(hw, E1000_V2PMAILBOX(0));
181 v2p_mailbox |= hw->dev_spec.vf.v2p_mailbox;
182 hw->dev_spec.vf.v2p_mailbox |= v2p_mailbox & E1000_V2PMAILBOX_R2C_BITS;
189 * @hw: pointer to the HW structure
195 static s32 igbvf_check_for_bit_vf(struct e1000_hw *hw, u32 mask)
197 u32 v2p_mailbox = igbvf_read_v2p_mailbox(hw);
203 hw->dev_spec.vf.v2p_mailbox &= ~mask;
210 * @hw: pointer to the HW structure
215 static s32 igbvf_check_for_msg_vf(struct e1000_hw *hw, u16 mbx_id __unused)
221 if (!igbvf_check_for_bit_vf(hw, E1000_V2PMAILBOX_PFSTS)) {
223 hw->mbx.stats.reqs++;
231 * @hw: pointer to the HW structure
236 static s32 igbvf_check_for_ack_vf(struct e1000_hw *hw, u16 mbx_id __unused)
242 if (!igbvf_check_for_bit_vf(hw, E1000_V2PMAILBOX_PFACK)) {
244 hw->mbx.stats.acks++;
252 * @hw: pointer to the HW structure
257 static s32 igbvf_check_for_rst_vf(struct e1000_hw *hw, u16 mbx_id __unused)
263 if (!igbvf_check_for_bit_vf(hw, (E1000_V2PMAILBOX_RSTD |
266 hw->mbx.stats.rsts++;
274 * @hw: pointer to the HW structure
278 static s32 igbvf_obtain_mbx_lock_vf(struct e1000_hw *hw)
285 E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_VFU);
288 if (igbvf_read_v2p_mailbox(hw) & E1000_V2PMAILBOX_VFU)
296 * @hw: pointer to the HW structure
303 static s32 igbvf_write_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size,
313 ret_val = igbvf_obtain_mbx_lock_vf(hw);
318 igbvf_check_for_msg_vf(hw, 0);
319 igbvf_check_for_ack_vf(hw, 0);
323 E1000_WRITE_REG_ARRAY(hw, E1000_VMBMEM(0), i, msg[i]);
326 hw->mbx.stats.msgs_tx++;
329 E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_REQ);
337 * @hw: pointer to the HW structure
344 static s32 igbvf_read_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size,
353 ret_val = igbvf_obtain_mbx_lock_vf(hw);
359 msg[i] = E1000_READ_REG_ARRAY(hw, E1000_VMBMEM(0), i);
362 E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_ACK);
365 hw->mbx.stats.msgs_rx++;
373 * @hw: pointer to the HW structure
375 * Initializes the hw->mbx struct to correct values for vf mailbox
377 s32 igbvf_init_mbx_params_vf(struct e1000_hw *hw)
379 struct e1000_mbx_info *mbx = &hw->mbx;