* txgbe_write_mbx_pf - Places a message in the mailbox * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * @vf_number: the VF index * * returns 0 if it successfully copied message into the buffer **/
| 564 | * returns 0 if it successfully copied message into the buffer |
| 565 | **/ |
| 566 | s32 txgbe_write_mbx_pf(struct txgbe_hw *hw, u32 *msg, u16 size, u16 vf_number) |
| 567 | { |
| 568 | s32 ret_val; |
| 569 | u16 i; |
| 570 | |
| 571 | /* lock the mailbox to prevent pf/vf race condition */ |
| 572 | ret_val = txgbe_obtain_mbx_lock_pf(hw, vf_number); |
| 573 | if (ret_val) |
| 574 | goto out_no_write; |
| 575 | |
| 576 | /* flush msg and acks as we are overwriting the message buffer */ |
| 577 | txgbe_check_for_msg_pf(hw, vf_number); |
| 578 | txgbe_check_for_ack_pf(hw, vf_number); |
| 579 | |
| 580 | /* copy the caller specified message to the mailbox memory buffer */ |
| 581 | for (i = 0; i < size; i++) |
| 582 | wr32a(hw, TXGBE_MBMEM(vf_number), i, msg[i]); |
| 583 | |
| 584 | /* Interrupt VF to tell it a message has been sent and release buffer*/ |
| 585 | wr32(hw, TXGBE_MBCTL(vf_number), TXGBE_MBCTL_STS); |
| 586 | |
| 587 | /* update stats */ |
| 588 | hw->mbx.stats.msgs_tx++; |
| 589 | |
| 590 | out_no_write: |
| 591 | return ret_val; |
| 592 | } |
| 593 | |
| 594 | /** |
| 595 | * txgbe_read_mbx_pf - Read a message from the mailbox |
nothing calls this directly
no test coverage detected