1 /******************************************************************************
3 Copyright (c) 2013-2015, Intel Corporation
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 3. Neither the name of the Intel Corporation nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
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.
32 ******************************************************************************/
39 #define VF_FLAG_ENABLED 0x01
40 #define VF_FLAG_SET_MAC_CAP 0x02
41 #define VF_FLAG_VLAN_CAP 0x04
42 #define VF_FLAG_PROMISC_CAP 0x08
43 #define VF_FLAG_MAC_ANTI_SPOOF 0x10
49 uint8_t mac[ETHER_ADDR_LEN];
52 struct sysctl_ctx_list ctx;
55 /* Physical controller structure */
58 struct i40e_osdep osdep;
61 struct resource *pci_mem;
62 struct resource *msix_mem;
65 * Interrupt resources: this set is
66 * either used for legacy, or for Link
86 int fc; /* local flow ctrl setting */
90 ** These are the traffic class holders, and
91 ** will have a stack interface and queues
92 ** associated with them.
93 ** NOTE: The PF has only a single interface,
94 ** so it is embedded in the PF struct.
98 /* Misc stats maintained by the driver */
102 /* Statistics from hw */
103 struct i40e_hw_port_stats stats;
104 struct i40e_hw_port_stats stats_offsets;
105 bool stat_offsets_loaded;
110 struct task vflr_task;
114 #define IXL_SET_ADVERTISE_HELP \
115 "Control link advertise speed:\n" \
117 "\t\t0x1 - advertise 100 Mb\n" \
118 "\t\t0x2 - advertise 1G\n" \
119 "\t\t0x4 - advertise 10G\n" \
120 "\t\t0x8 - advertise 20G\n\n" \
121 "\tDoes not work on 40G devices."
123 #define I40E_VC_DEBUG(pf, level, ...) \
125 if ((pf)->vc_debug_lvl >= (level)) \
126 device_printf((pf)->dev, __VA_ARGS__); \
129 #define i40e_send_vf_nack(pf, vf, op, st) \
130 ixl_send_vf_nack_msg((pf), (vf), (op), (st), __FILE__, __LINE__)
132 #define IXL_PF_LOCK_INIT(_sc, _name) \
133 mtx_init(&(_sc)->pf_mtx, _name, "IXL PF Lock", MTX_DEF)
134 #define IXL_PF_LOCK(_sc) mtx_lock(&(_sc)->pf_mtx)
135 #define IXL_PF_UNLOCK(_sc) mtx_unlock(&(_sc)->pf_mtx)
136 #define IXL_PF_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->pf_mtx)
137 #define IXL_PF_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->pf_mtx, MA_OWNED)
139 #endif /* _IXL_PF_H_ */