1*49ef7e06SGarrett D'Amore /*
2*49ef7e06SGarrett D'Amore  * Copyright (c) 2015 Solarflare Communications Inc.
3*49ef7e06SGarrett D'Amore  * All rights reserved.
4*49ef7e06SGarrett D'Amore  *
5*49ef7e06SGarrett D'Amore  * Redistribution and use in source and binary forms, with or without
6*49ef7e06SGarrett D'Amore  * modification, are permitted provided that the following conditions are met:
7*49ef7e06SGarrett D'Amore  *
8*49ef7e06SGarrett D'Amore  * 1. Redistributions of source code must retain the above copyright notice,
9*49ef7e06SGarrett D'Amore  *    this list of conditions and the following disclaimer.
10*49ef7e06SGarrett D'Amore  * 2. Redistributions in binary form must reproduce the above copyright notice,
11*49ef7e06SGarrett D'Amore  *    this list of conditions and the following disclaimer in the documentation
12*49ef7e06SGarrett D'Amore  *    and/or other materials provided with the distribution.
13*49ef7e06SGarrett D'Amore  *
14*49ef7e06SGarrett D'Amore  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15*49ef7e06SGarrett D'Amore  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16*49ef7e06SGarrett D'Amore  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17*49ef7e06SGarrett D'Amore  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18*49ef7e06SGarrett D'Amore  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19*49ef7e06SGarrett D'Amore  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20*49ef7e06SGarrett D'Amore  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21*49ef7e06SGarrett D'Amore  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22*49ef7e06SGarrett D'Amore  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23*49ef7e06SGarrett D'Amore  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24*49ef7e06SGarrett D'Amore  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*49ef7e06SGarrett D'Amore  *
26*49ef7e06SGarrett D'Amore  * The views and conclusions contained in the software and documentation are
27*49ef7e06SGarrett D'Amore  * those of the authors and should not be interpreted as representing official
28*49ef7e06SGarrett D'Amore  * policies, either expressed or implied, of the FreeBSD Project.
29*49ef7e06SGarrett D'Amore  */
30*49ef7e06SGarrett D'Amore 
31*49ef7e06SGarrett D'Amore #ifndef	_SYS_MEDFORD_IMPL_H
32*49ef7e06SGarrett D'Amore #define	_SYS_MEDFORD_IMPL_H
33*49ef7e06SGarrett D'Amore 
34*49ef7e06SGarrett D'Amore #ifdef	__cplusplus
35*49ef7e06SGarrett D'Amore extern "C" {
36*49ef7e06SGarrett D'Amore #endif
37*49ef7e06SGarrett D'Amore 
38*49ef7e06SGarrett D'Amore /* Alignment requirement for value written to RX WPTR:
39*49ef7e06SGarrett D'Amore  *  the WPTR must be aligned to an 8 descriptor boundary
40*49ef7e06SGarrett D'Amore  *
41*49ef7e06SGarrett D'Amore  * FIXME: Is this the same on Medford as Huntington?
42*49ef7e06SGarrett D'Amore  */
43*49ef7e06SGarrett D'Amore #define	MEDFORD_RX_WPTR_ALIGN	8
44*49ef7e06SGarrett D'Amore 
45*49ef7e06SGarrett D'Amore 
46*49ef7e06SGarrett D'Amore 
47*49ef7e06SGarrett D'Amore #ifndef	ER_EZ_TX_PIOBUF_SIZE
48*49ef7e06SGarrett D'Amore #define	ER_EZ_TX_PIOBUF_SIZE	4096
49*49ef7e06SGarrett D'Amore #endif
50*49ef7e06SGarrett D'Amore 
51*49ef7e06SGarrett D'Amore 
52*49ef7e06SGarrett D'Amore #define	MEDFORD_PIOBUF_NBUFS	(16)
53*49ef7e06SGarrett D'Amore #define	MEDFORD_PIOBUF_SIZE	(ER_EZ_TX_PIOBUF_SIZE)
54*49ef7e06SGarrett D'Amore 
55*49ef7e06SGarrett D'Amore #define	MEDFORD_MIN_PIO_ALLOC_SIZE	(MEDFORD_PIOBUF_SIZE / 32)
56*49ef7e06SGarrett D'Amore 
57*49ef7e06SGarrett D'Amore 
58*49ef7e06SGarrett D'Amore extern	__checkReturn	efx_rc_t
59*49ef7e06SGarrett D'Amore medford_board_cfg(
60*49ef7e06SGarrett D'Amore 	__in		efx_nic_t *enp);
61*49ef7e06SGarrett D'Amore 
62*49ef7e06SGarrett D'Amore 
63*49ef7e06SGarrett D'Amore #ifdef	__cplusplus
64*49ef7e06SGarrett D'Amore }
65*49ef7e06SGarrett D'Amore #endif
66*49ef7e06SGarrett D'Amore 
67*49ef7e06SGarrett D'Amore #endif	/* _SYS_MEDFORD_IMPL_H */
68