1*dee1ad47SJeff Kirsher /******************************************************************************* 2*dee1ad47SJeff Kirsher 3*dee1ad47SJeff Kirsher Intel(R) Gigabit Ethernet Linux driver 4*dee1ad47SJeff Kirsher Copyright(c) 2007-2011 Intel Corporation. 5*dee1ad47SJeff Kirsher 6*dee1ad47SJeff Kirsher This program is free software; you can redistribute it and/or modify it 7*dee1ad47SJeff Kirsher under the terms and conditions of the GNU General Public License, 8*dee1ad47SJeff Kirsher version 2, as published by the Free Software Foundation. 9*dee1ad47SJeff Kirsher 10*dee1ad47SJeff Kirsher This program is distributed in the hope it will be useful, but WITHOUT 11*dee1ad47SJeff Kirsher ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12*dee1ad47SJeff Kirsher FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13*dee1ad47SJeff Kirsher more details. 14*dee1ad47SJeff Kirsher 15*dee1ad47SJeff Kirsher You should have received a copy of the GNU General Public License along with 16*dee1ad47SJeff Kirsher this program; if not, write to the Free Software Foundation, Inc., 17*dee1ad47SJeff Kirsher 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18*dee1ad47SJeff Kirsher 19*dee1ad47SJeff Kirsher The full GNU General Public License is included in this distribution in 20*dee1ad47SJeff Kirsher the file called "COPYING". 21*dee1ad47SJeff Kirsher 22*dee1ad47SJeff Kirsher Contact Information: 23*dee1ad47SJeff Kirsher e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 24*dee1ad47SJeff Kirsher Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 25*dee1ad47SJeff Kirsher 26*dee1ad47SJeff Kirsher *******************************************************************************/ 27*dee1ad47SJeff Kirsher 28*dee1ad47SJeff Kirsher #ifndef _E1000_MBX_H_ 29*dee1ad47SJeff Kirsher #define _E1000_MBX_H_ 30*dee1ad47SJeff Kirsher 31*dee1ad47SJeff Kirsher #include "e1000_hw.h" 32*dee1ad47SJeff Kirsher 33*dee1ad47SJeff Kirsher #define E1000_P2VMAILBOX_STS 0x00000001 /* Initiate message send to VF */ 34*dee1ad47SJeff Kirsher #define E1000_P2VMAILBOX_ACK 0x00000002 /* Ack message recv'd from VF */ 35*dee1ad47SJeff Kirsher #define E1000_P2VMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */ 36*dee1ad47SJeff Kirsher #define E1000_P2VMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */ 37*dee1ad47SJeff Kirsher #define E1000_P2VMAILBOX_RVFU 0x00000010 /* Reset VFU - used when VF stuck */ 38*dee1ad47SJeff Kirsher 39*dee1ad47SJeff Kirsher #define E1000_MBVFICR_VFREQ_MASK 0x000000FF /* bits for VF messages */ 40*dee1ad47SJeff Kirsher #define E1000_MBVFICR_VFREQ_VF1 0x00000001 /* bit for VF 1 message */ 41*dee1ad47SJeff Kirsher #define E1000_MBVFICR_VFACK_MASK 0x00FF0000 /* bits for VF acks */ 42*dee1ad47SJeff Kirsher #define E1000_MBVFICR_VFACK_VF1 0x00010000 /* bit for VF 1 ack */ 43*dee1ad47SJeff Kirsher 44*dee1ad47SJeff Kirsher #define E1000_VFMAILBOX_SIZE 16 /* 16 32 bit words - 64 bytes */ 45*dee1ad47SJeff Kirsher 46*dee1ad47SJeff Kirsher /* If it's a E1000_VF_* msg then it originates in the VF and is sent to the 47*dee1ad47SJeff Kirsher * PF. The reverse is true if it is E1000_PF_*. 48*dee1ad47SJeff Kirsher * Message ACK's are the value or'd with 0xF0000000 49*dee1ad47SJeff Kirsher */ 50*dee1ad47SJeff Kirsher #define E1000_VT_MSGTYPE_ACK 0x80000000 /* Messages below or'd with 51*dee1ad47SJeff Kirsher * this are the ACK */ 52*dee1ad47SJeff Kirsher #define E1000_VT_MSGTYPE_NACK 0x40000000 /* Messages below or'd with 53*dee1ad47SJeff Kirsher * this are the NACK */ 54*dee1ad47SJeff Kirsher #define E1000_VT_MSGTYPE_CTS 0x20000000 /* Indicates that VF is still 55*dee1ad47SJeff Kirsher clear to send requests */ 56*dee1ad47SJeff Kirsher #define E1000_VT_MSGINFO_SHIFT 16 57*dee1ad47SJeff Kirsher /* bits 23:16 are used for exra info for certain messages */ 58*dee1ad47SJeff Kirsher #define E1000_VT_MSGINFO_MASK (0xFF << E1000_VT_MSGINFO_SHIFT) 59*dee1ad47SJeff Kirsher 60*dee1ad47SJeff Kirsher #define E1000_VF_RESET 0x01 /* VF requests reset */ 61*dee1ad47SJeff Kirsher #define E1000_VF_SET_MAC_ADDR 0x02 /* VF requests to set MAC addr */ 62*dee1ad47SJeff Kirsher #define E1000_VF_SET_MULTICAST 0x03 /* VF requests to set MC addr */ 63*dee1ad47SJeff Kirsher #define E1000_VF_SET_VLAN 0x04 /* VF requests to set VLAN */ 64*dee1ad47SJeff Kirsher #define E1000_VF_SET_LPE 0x05 /* VF requests to set VMOLR.LPE */ 65*dee1ad47SJeff Kirsher #define E1000_VF_SET_PROMISC 0x06 /*VF requests to clear VMOLR.ROPE/MPME*/ 66*dee1ad47SJeff Kirsher #define E1000_VF_SET_PROMISC_MULTICAST (0x02 << E1000_VT_MSGINFO_SHIFT) 67*dee1ad47SJeff Kirsher 68*dee1ad47SJeff Kirsher #define E1000_PF_CONTROL_MSG 0x0100 /* PF control message */ 69*dee1ad47SJeff Kirsher 70*dee1ad47SJeff Kirsher s32 igb_read_mbx(struct e1000_hw *, u32 *, u16, u16); 71*dee1ad47SJeff Kirsher s32 igb_write_mbx(struct e1000_hw *, u32 *, u16, u16); 72*dee1ad47SJeff Kirsher s32 igb_check_for_msg(struct e1000_hw *, u16); 73*dee1ad47SJeff Kirsher s32 igb_check_for_ack(struct e1000_hw *, u16); 74*dee1ad47SJeff Kirsher s32 igb_check_for_rst(struct e1000_hw *, u16); 75*dee1ad47SJeff Kirsher s32 igb_init_mbx_params_pf(struct e1000_hw *); 76*dee1ad47SJeff Kirsher 77*dee1ad47SJeff Kirsher #endif /* _E1000_MBX_H_ */ 78