xref: /freebsd/sys/dev/ixl/ixl_iw.h (revision cb6b8299fdda0ccd5c9c9b0d29cd9c005f6d780b)
1*cb6b8299SEric Joyner /******************************************************************************
2*cb6b8299SEric Joyner 
3*cb6b8299SEric Joyner   Copyright (c) 2013-2015, Intel Corporation
4*cb6b8299SEric Joyner   All rights reserved.
5*cb6b8299SEric Joyner 
6*cb6b8299SEric Joyner   Redistribution and use in source and binary forms, with or without
7*cb6b8299SEric Joyner   modification, are permitted provided that the following conditions are met:
8*cb6b8299SEric Joyner 
9*cb6b8299SEric Joyner    1. Redistributions of source code must retain the above copyright notice,
10*cb6b8299SEric Joyner       this list of conditions and the following disclaimer.
11*cb6b8299SEric Joyner 
12*cb6b8299SEric Joyner    2. Redistributions in binary form must reproduce the above copyright
13*cb6b8299SEric Joyner       notice, this list of conditions and the following disclaimer in the
14*cb6b8299SEric Joyner       documentation and/or other materials provided with the distribution.
15*cb6b8299SEric Joyner 
16*cb6b8299SEric Joyner    3. Neither the name of the Intel Corporation nor the names of its
17*cb6b8299SEric Joyner       contributors may be used to endorse or promote products derived from
18*cb6b8299SEric Joyner       this software without specific prior written permission.
19*cb6b8299SEric Joyner 
20*cb6b8299SEric Joyner   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21*cb6b8299SEric Joyner   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22*cb6b8299SEric Joyner   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23*cb6b8299SEric Joyner   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24*cb6b8299SEric Joyner   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25*cb6b8299SEric Joyner   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26*cb6b8299SEric Joyner   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27*cb6b8299SEric Joyner   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28*cb6b8299SEric Joyner   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29*cb6b8299SEric Joyner   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30*cb6b8299SEric Joyner   POSSIBILITY OF SUCH DAMAGE.
31*cb6b8299SEric Joyner 
32*cb6b8299SEric Joyner ******************************************************************************/
33*cb6b8299SEric Joyner /*$FreeBSD$*/
34*cb6b8299SEric Joyner 
35*cb6b8299SEric Joyner #ifndef _IXL_IW_H_
36*cb6b8299SEric Joyner #define _IXL_IW_H_
37*cb6b8299SEric Joyner 
38*cb6b8299SEric Joyner #define IXL_IW_MAX_USER_PRIORITY 8
39*cb6b8299SEric Joyner 
40*cb6b8299SEric Joyner 
41*cb6b8299SEric Joyner struct ixl_iw_msix_mapping {
42*cb6b8299SEric Joyner 	u8	itr_indx;
43*cb6b8299SEric Joyner 	int	aeq_vector;
44*cb6b8299SEric Joyner 	int	ceq_cnt;
45*cb6b8299SEric Joyner 	int	*ceq_vector;
46*cb6b8299SEric Joyner };
47*cb6b8299SEric Joyner 
48*cb6b8299SEric Joyner struct ixl_iw_msix {
49*cb6b8299SEric Joyner 	int	base;
50*cb6b8299SEric Joyner 	int	count;
51*cb6b8299SEric Joyner };
52*cb6b8299SEric Joyner 
53*cb6b8299SEric Joyner struct ixl_iw_pf {
54*cb6b8299SEric Joyner 	void		*handle;
55*cb6b8299SEric Joyner 	struct ifnet	*ifp;
56*cb6b8299SEric Joyner 	device_t	dev;
57*cb6b8299SEric Joyner 	struct resource	*pci_mem;
58*cb6b8299SEric Joyner 	u8		pf_id;
59*cb6b8299SEric Joyner 	u16		mtu;
60*cb6b8299SEric Joyner 	struct ixl_iw_msix	iw_msix;
61*cb6b8299SEric Joyner 	u16	qs_handle[IXL_IW_MAX_USER_PRIORITY];
62*cb6b8299SEric Joyner };
63*cb6b8299SEric Joyner 
64*cb6b8299SEric Joyner struct ixl_iw_ops {
65*cb6b8299SEric Joyner 	int (*init)(struct ixl_iw_pf *pf_info);
66*cb6b8299SEric Joyner 	int (*stop)(struct ixl_iw_pf *pf_info);
67*cb6b8299SEric Joyner };
68*cb6b8299SEric Joyner 
69*cb6b8299SEric Joyner int	ixl_iw_pf_reset(void *pf_handle);
70*cb6b8299SEric Joyner int	ixl_iw_pf_msix_init(void *pf_handle,
71*cb6b8299SEric Joyner 	    struct ixl_iw_msix_mapping *msix_info);
72*cb6b8299SEric Joyner int	ixl_iw_register(struct ixl_iw_ops *iw_ops);
73*cb6b8299SEric Joyner int	ixl_iw_unregister(void);
74*cb6b8299SEric Joyner 
75*cb6b8299SEric Joyner #endif /* _IXL_IW_H_ */
76