FreeBSD kernel E1000 device code
|
#include "e1000_api.h"
Go to the source code of this file.
Macros | |
#define | E1000_V2PMAILBOX_REQ 0x00000001 /* Request for PF Ready bit */ |
#define | E1000_V2PMAILBOX_ACK 0x00000002 /* Ack PF message received */ |
#define | E1000_V2PMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */ |
#define | E1000_V2PMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */ |
#define | E1000_V2PMAILBOX_PFSTS 0x00000010 /* PF wrote a message in the MB */ |
#define | E1000_V2PMAILBOX_PFACK 0x00000020 /* PF ack the previous VF msg */ |
#define | E1000_V2PMAILBOX_RSTI 0x00000040 /* PF has reset indication */ |
#define | E1000_V2PMAILBOX_RSTD 0x00000080 /* PF has indicated reset done */ |
#define | E1000_V2PMAILBOX_R2C_BITS 0x000000B0 /* All read to clear bits */ |
#define | E1000_P2VMAILBOX_STS 0x00000001 /* Initiate message send to VF */ |
#define | E1000_P2VMAILBOX_ACK 0x00000002 /* Ack message recv'd from VF */ |
#define | E1000_P2VMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */ |
#define | E1000_P2VMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */ |
#define | E1000_P2VMAILBOX_RVFU 0x00000010 /* Reset VFU - used when VF stuck */ |
#define | E1000_MBVFICR_VFREQ_MASK 0x000000FF /* bits for VF messages */ |
#define | E1000_MBVFICR_VFREQ_VF1 0x00000001 /* bit for VF 1 message */ |
#define | E1000_MBVFICR_VFACK_MASK 0x00FF0000 /* bits for VF acks */ |
#define | E1000_MBVFICR_VFACK_VF1 0x00010000 /* bit for VF 1 ack */ |
#define | E1000_VFMAILBOX_SIZE 16 /* 16 32 bit words - 64 bytes */ |
#define | E1000_VT_MSGTYPE_ACK 0x80000000 |
#define | E1000_VT_MSGTYPE_NACK 0x40000000 |
#define | E1000_VT_MSGTYPE_CTS 0x20000000 |
#define | E1000_VT_MSGINFO_SHIFT 16 |
#define | E1000_VT_MSGINFO_MASK (0xFF << E1000_VT_MSGINFO_SHIFT) |
#define | E1000_VF_RESET 0x01 /* VF requests reset */ |
#define | E1000_VF_SET_MAC_ADDR 0x02 /* VF requests to set MAC addr */ |
#define | E1000_VF_SET_MULTICAST 0x03 /* VF requests to set MC addr */ |
#define | E1000_VF_SET_MULTICAST_COUNT_MASK (0x1F << E1000_VT_MSGINFO_SHIFT) |
#define | E1000_VF_SET_MULTICAST_OVERFLOW (0x80 << E1000_VT_MSGINFO_SHIFT) |
#define | E1000_VF_SET_VLAN 0x04 /* VF requests to set VLAN */ |
#define | E1000_VF_SET_VLAN_ADD (0x01 << E1000_VT_MSGINFO_SHIFT) |
#define | E1000_VF_SET_LPE 0x05 /* reqs to set VMOLR.LPE */ |
#define | E1000_VF_SET_PROMISC 0x06 /* reqs to clear VMOLR.ROPE/MPME*/ |
#define | E1000_VF_SET_PROMISC_UNICAST (0x01 << E1000_VT_MSGINFO_SHIFT) |
#define | E1000_VF_SET_PROMISC_MULTICAST (0x02 << E1000_VT_MSGINFO_SHIFT) |
#define | E1000_PF_CONTROL_MSG 0x0100 /* PF control message */ |
#define | E1000_VF_MBX_INIT_TIMEOUT 2000 /* number of retries on mailbox */ |
#define | E1000_VF_MBX_INIT_DELAY 500 /* microseconds between retries */ |
Functions | |
s32 | e1000_read_mbx (struct e1000_hw *, u32 *, u16, u16) |
s32 | e1000_write_mbx (struct e1000_hw *, u32 *, u16, u16) |
s32 | e1000_read_posted_mbx (struct e1000_hw *, u32 *, u16, u16) |
s32 | e1000_write_posted_mbx (struct e1000_hw *, u32 *, u16, u16) |
s32 | e1000_check_for_msg (struct e1000_hw *, u16) |
s32 | e1000_check_for_ack (struct e1000_hw *, u16) |
s32 | e1000_check_for_rst (struct e1000_hw *, u16) |
void | e1000_init_mbx_ops_generic (struct e1000_hw *hw) |
s32 | e1000_init_mbx_params_vf (struct e1000_hw *) |
s32 | e1000_init_mbx_params_pf (struct e1000_hw *) |
#define E1000_MBVFICR_VFACK_MASK 0x00FF0000 /* bits for VF acks */ |
Definition at line 60 of file e1000_mbx.h.
#define E1000_MBVFICR_VFACK_VF1 0x00010000 /* bit for VF 1 ack */ |
Definition at line 61 of file e1000_mbx.h.
#define E1000_MBVFICR_VFREQ_MASK 0x000000FF /* bits for VF messages */ |
Definition at line 58 of file e1000_mbx.h.
#define E1000_MBVFICR_VFREQ_VF1 0x00000001 /* bit for VF 1 message */ |
Definition at line 59 of file e1000_mbx.h.
#define E1000_P2VMAILBOX_ACK 0x00000002 /* Ack message recv'd from VF */ |
Definition at line 53 of file e1000_mbx.h.
#define E1000_P2VMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */ |
Definition at line 55 of file e1000_mbx.h.
#define E1000_P2VMAILBOX_RVFU 0x00000010 /* Reset VFU - used when VF stuck */ |
Definition at line 56 of file e1000_mbx.h.
#define E1000_P2VMAILBOX_STS 0x00000001 /* Initiate message send to VF */ |
Definition at line 52 of file e1000_mbx.h.
#define E1000_P2VMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */ |
Definition at line 54 of file e1000_mbx.h.
#define E1000_PF_CONTROL_MSG 0x0100 /* PF control message */ |
Definition at line 91 of file e1000_mbx.h.
#define E1000_V2PMAILBOX_ACK 0x00000002 /* Ack PF message received */ |
Definition at line 43 of file e1000_mbx.h.
#define E1000_V2PMAILBOX_PFACK 0x00000020 /* PF ack the previous VF msg */ |
Definition at line 47 of file e1000_mbx.h.
#define E1000_V2PMAILBOX_PFSTS 0x00000010 /* PF wrote a message in the MB */ |
Definition at line 46 of file e1000_mbx.h.
#define E1000_V2PMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */ |
Definition at line 45 of file e1000_mbx.h.
#define E1000_V2PMAILBOX_R2C_BITS 0x000000B0 /* All read to clear bits */ |
Definition at line 50 of file e1000_mbx.h.
#define E1000_V2PMAILBOX_REQ 0x00000001 /* Request for PF Ready bit */ |
Definition at line 42 of file e1000_mbx.h.
#define E1000_V2PMAILBOX_RSTD 0x00000080 /* PF has indicated reset done */ |
Definition at line 49 of file e1000_mbx.h.
#define E1000_V2PMAILBOX_RSTI 0x00000040 /* PF has reset indication */ |
Definition at line 48 of file e1000_mbx.h.
#define E1000_V2PMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */ |
Definition at line 44 of file e1000_mbx.h.
#define E1000_VF_MBX_INIT_DELAY 500 /* microseconds between retries */ |
Definition at line 94 of file e1000_mbx.h.
#define E1000_VF_MBX_INIT_TIMEOUT 2000 /* number of retries on mailbox */ |
Definition at line 93 of file e1000_mbx.h.
#define E1000_VF_RESET 0x01 /* VF requests reset */ |
Definition at line 79 of file e1000_mbx.h.
#define E1000_VF_SET_LPE 0x05 /* reqs to set VMOLR.LPE */ |
Definition at line 86 of file e1000_mbx.h.
#define E1000_VF_SET_MAC_ADDR 0x02 /* VF requests to set MAC addr */ |
Definition at line 80 of file e1000_mbx.h.
#define E1000_VF_SET_MULTICAST 0x03 /* VF requests to set MC addr */ |
Definition at line 81 of file e1000_mbx.h.
#define E1000_VF_SET_MULTICAST_COUNT_MASK (0x1F << E1000_VT_MSGINFO_SHIFT) |
Definition at line 82 of file e1000_mbx.h.
#define E1000_VF_SET_MULTICAST_OVERFLOW (0x80 << E1000_VT_MSGINFO_SHIFT) |
Definition at line 83 of file e1000_mbx.h.
#define E1000_VF_SET_PROMISC 0x06 /* reqs to clear VMOLR.ROPE/MPME*/ |
Definition at line 87 of file e1000_mbx.h.
#define E1000_VF_SET_PROMISC_MULTICAST (0x02 << E1000_VT_MSGINFO_SHIFT) |
Definition at line 89 of file e1000_mbx.h.
#define E1000_VF_SET_PROMISC_UNICAST (0x01 << E1000_VT_MSGINFO_SHIFT) |
Definition at line 88 of file e1000_mbx.h.
#define E1000_VF_SET_VLAN 0x04 /* VF requests to set VLAN */ |
Definition at line 84 of file e1000_mbx.h.
#define E1000_VF_SET_VLAN_ADD (0x01 << E1000_VT_MSGINFO_SHIFT) |
Definition at line 85 of file e1000_mbx.h.
#define E1000_VFMAILBOX_SIZE 16 /* 16 32 bit words - 64 bytes */ |
Definition at line 63 of file e1000_mbx.h.
#define E1000_VT_MSGINFO_MASK (0xFF << E1000_VT_MSGINFO_SHIFT) |
Definition at line 77 of file e1000_mbx.h.
#define E1000_VT_MSGINFO_SHIFT 16 |
Definition at line 75 of file e1000_mbx.h.
#define E1000_VT_MSGTYPE_ACK 0x80000000 |
Definition at line 70 of file e1000_mbx.h.
#define E1000_VT_MSGTYPE_CTS 0x20000000 |
Definition at line 74 of file e1000_mbx.h.
#define E1000_VT_MSGTYPE_NACK 0x40000000 |
Definition at line 72 of file e1000_mbx.h.
e1000_check_for_ack - checks to see if someone sent us ACK @hw: pointer to the HW structure @mbx_id: id of mailbox to check
returns SUCCESS if the Status bit was found or else ERR_MBX
Definition at line 146 of file e1000_mbx.c.
References e1000_mbx_operations::check_for_ack, DEBUGFUNC, E1000_ERR_MBX, e1000_hw::mbx, and e1000_mbx_info::ops.
e1000_check_for_msg - checks to see if someone sent us mail @hw: pointer to the HW structure @mbx_id: id of mailbox to check
returns SUCCESS if the Status bit was found or else ERR_MBX
Definition at line 126 of file e1000_mbx.c.
References e1000_mbx_operations::check_for_msg, DEBUGFUNC, E1000_ERR_MBX, e1000_hw::mbx, and e1000_mbx_info::ops.
e1000_check_for_rst - checks to see if other side has reset @hw: pointer to the HW structure @mbx_id: id of mailbox to check
returns SUCCESS if the Status bit was found or else ERR_MBX
Definition at line 166 of file e1000_mbx.c.
References e1000_mbx_operations::check_for_rst, DEBUGFUNC, E1000_ERR_MBX, e1000_hw::mbx, and e1000_mbx_info::ops.
void e1000_init_mbx_ops_generic | ( | struct e1000_hw * | hw | ) |
e1000_init_mbx_ops_generic - Initialize mbx function pointers @hw: pointer to the HW structure
Sets the function pointers to no-op functions
Definition at line 307 of file e1000_mbx.c.
References e1000_mbx_operations::check_for_ack, e1000_mbx_operations::check_for_msg, e1000_mbx_operations::check_for_rst, e1000_null_mbx_check_for_flag(), e1000_null_mbx_transact(), e1000_null_ops_generic(), e1000_read_posted_mbx(), e1000_write_posted_mbx(), e1000_mbx_operations::init_params, e1000_hw::mbx, e1000_mbx_info::ops, e1000_mbx_operations::read, e1000_mbx_operations::read_posted, e1000_mbx_operations::write, and e1000_mbx_operations::write_posted.
Referenced by e1000_setup_init_funcs().
e1000_init_mbx_params_pf - set initial values for pf mailbox @hw: pointer to the HW structure
Initializes the hw->mbx struct to correct values for pf mailbox
Definition at line 760 of file e1000_mbx.c.
References e1000_mbx_stats::acks, e1000_mbx_operations::check_for_ack, e1000_mbx_operations::check_for_msg, e1000_mbx_operations::check_for_rst, e1000_82576, e1000_check_for_ack_pf(), e1000_check_for_msg_pf(), e1000_check_for_rst_pf(), e1000_i350, e1000_i354, e1000_read_mbx_pf(), e1000_read_posted_mbx(), E1000_SUCCESS, E1000_VFMAILBOX_SIZE, e1000_write_mbx_pf(), e1000_write_posted_mbx(), e1000_hw::mac, e1000_hw::mbx, e1000_mbx_stats::msgs_rx, e1000_mbx_stats::msgs_tx, e1000_mbx_info::ops, e1000_mbx_operations::read, e1000_mbx_operations::read_posted, e1000_mbx_stats::reqs, e1000_mbx_stats::rsts, e1000_mbx_info::size, e1000_mbx_info::stats, e1000_mbx_info::timeout, e1000_mac_info::type, e1000_mbx_info::usec_delay, e1000_mbx_operations::write, and e1000_mbx_operations::write_posted.
Referenced by e1000_init_function_pointers_82575().
e1000_init_mbx_params_vf - set initial values for vf mailbox @hw: pointer to the HW structure
Initializes the hw->mbx struct to correct values for vf mailbox
Definition at line 536 of file e1000_mbx.c.
References e1000_mbx_stats::acks, e1000_mbx_operations::check_for_ack, e1000_mbx_operations::check_for_msg, e1000_mbx_operations::check_for_rst, e1000_check_for_ack_vf(), e1000_check_for_msg_vf(), e1000_check_for_rst_vf(), e1000_read_mbx_vf(), e1000_read_posted_mbx(), E1000_SUCCESS, E1000_VF_MBX_INIT_DELAY, E1000_VFMAILBOX_SIZE, e1000_write_mbx_vf(), e1000_write_posted_mbx(), e1000_hw::mbx, e1000_mbx_stats::msgs_rx, e1000_mbx_stats::msgs_tx, e1000_mbx_info::ops, e1000_mbx_operations::read, e1000_mbx_operations::read_posted, e1000_mbx_stats::reqs, e1000_mbx_stats::rsts, e1000_mbx_info::size, e1000_mbx_info::stats, e1000_mbx_info::timeout, e1000_mbx_info::usec_delay, e1000_mbx_operations::write, and e1000_mbx_operations::write_posted.
Referenced by e1000_init_function_pointers_vf().
e1000_read_mbx - Reads a message from the mailbox @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @mbx_id: id of mailbox to read
returns SUCCESS if it successfully read message from buffer
Definition at line 77 of file e1000_mbx.c.
References DEBUGFUNC, E1000_ERR_MBX, e1000_hw::mbx, e1000_mbx_info::ops, e1000_mbx_operations::read, and e1000_mbx_info::size.
e1000_read_posted_mbx - Wait for message notification and receive message @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @mbx_id: id of mailbox to write
returns SUCCESS if it successfully received a message notification and copied it into the receive buffer.
Definition at line 251 of file e1000_mbx.c.
References DEBUGFUNC, E1000_ERR_MBX, e1000_poll_for_msg(), e1000_hw::mbx, e1000_mbx_info::ops, e1000_mbx_operations::read, and e1000_mbx_info::size.
Referenced by e1000_init_mbx_ops_generic(), e1000_init_mbx_params_pf(), and e1000_init_mbx_params_vf().
e1000_write_mbx - Write a message to the mailbox @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @mbx_id: id of mailbox to write
returns SUCCESS if it successfully copied message into the buffer
Definition at line 103 of file e1000_mbx.c.
References DEBUGFUNC, E1000_ERR_MBX, E1000_SUCCESS, e1000_hw::mbx, e1000_mbx_info::ops, e1000_mbx_info::size, and e1000_mbx_operations::write.
e1000_write_posted_mbx - Write a message to the mailbox, wait for ack @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @mbx_id: id of mailbox to write
returns SUCCESS if it successfully copied message into the buffer and received an ack to that message within delay * timeout period
Definition at line 280 of file e1000_mbx.c.
References DEBUGFUNC, E1000_ERR_MBX, e1000_poll_for_ack(), e1000_hw::mbx, e1000_mbx_info::ops, e1000_mbx_info::size, e1000_mbx_info::timeout, and e1000_mbx_operations::write.
Referenced by e1000_init_mbx_ops_generic(), e1000_init_mbx_params_pf(), and e1000_init_mbx_params_vf().