Deleted Added
sdiff udiff text old ( 286833 ) new ( 295323 )
full compact
1/******************************************************************************
2
3 Copyright (c) 2001-2015, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
33/*$FreeBSD: head/sys/dev/e1000/e1000_mbx.c 286833 2015-08-16 20:13:58Z sbruno $*/
34
35#include "e1000_mbx.h"
36
37/**
38 * e1000_null_mbx_check_for_flag - No-op function, return 0
39 * @hw: pointer to the HW structure
40 **/
41static s32 e1000_null_mbx_check_for_flag(struct e1000_hw E1000_UNUSEDARG *hw,

--- 379 unchanged lines hidden (view full) ---

421 * e1000_obtain_mbx_lock_vf - obtain mailbox lock
422 * @hw: pointer to the HW structure
423 *
424 * return SUCCESS if we obtained the mailbox lock
425 **/
426static s32 e1000_obtain_mbx_lock_vf(struct e1000_hw *hw)
427{
428 s32 ret_val = -E1000_ERR_MBX;
429
430 DEBUGFUNC("e1000_obtain_mbx_lock_vf");
431
432 /* Take ownership of the buffer */
433 E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_VFU);
434
435 /* reserve mailbox for vf use */
436 if (e1000_read_v2p_mailbox(hw) & E1000_V2PMAILBOX_VFU)
437 ret_val = E1000_SUCCESS;
438
439 return ret_val;
440}
441
442/**
443 * e1000_write_mbx_vf - Write a message to the mailbox
444 * @hw: pointer to the HW structure
445 * @msg: The message buffer

--- 188 unchanged lines hidden (view full) ---

634 * @vf_number: the VF index
635 *
636 * return SUCCESS if we obtained the mailbox lock
637 **/
638static s32 e1000_obtain_mbx_lock_pf(struct e1000_hw *hw, u16 vf_number)
639{
640 s32 ret_val = -E1000_ERR_MBX;
641 u32 p2v_mailbox;
642
643 DEBUGFUNC("e1000_obtain_mbx_lock_pf");
644
645 /* Take ownership of the buffer */
646 E1000_WRITE_REG(hw, E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_PFU);
647
648 /* reserve mailbox for vf use */
649 p2v_mailbox = E1000_READ_REG(hw, E1000_P2VMAILBOX(vf_number));
650 if (p2v_mailbox & E1000_P2VMAILBOX_PFU)
651 ret_val = E1000_SUCCESS;
652
653 return ret_val;
654}
655
656/**
657 * e1000_write_mbx_pf - Places a message in the mailbox
658 * @hw: pointer to the HW structure
659 * @msg: The message buffer
660 * @size: Length of buffer
661 * @vf_number: the VF index

--- 110 unchanged lines hidden ---