xref: /freebsd/sys/dev/sfxge/common/hunt_impl.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
13c838a9fSAndrew Rybchenko /*-
2*929c7febSAndrew Rybchenko  * Copyright (c) 2012-2016 Solarflare Communications Inc.
33c838a9fSAndrew Rybchenko  * All rights reserved.
43c838a9fSAndrew Rybchenko  *
53c838a9fSAndrew Rybchenko  * Redistribution and use in source and binary forms, with or without
63c838a9fSAndrew Rybchenko  * modification, are permitted provided that the following conditions are met:
73c838a9fSAndrew Rybchenko  *
83c838a9fSAndrew Rybchenko  * 1. Redistributions of source code must retain the above copyright notice,
93c838a9fSAndrew Rybchenko  *    this list of conditions and the following disclaimer.
103c838a9fSAndrew Rybchenko  * 2. Redistributions in binary form must reproduce the above copyright notice,
113c838a9fSAndrew Rybchenko  *    this list of conditions and the following disclaimer in the documentation
123c838a9fSAndrew Rybchenko  *    and/or other materials provided with the distribution.
133c838a9fSAndrew Rybchenko  *
143c838a9fSAndrew Rybchenko  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
153c838a9fSAndrew Rybchenko  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
163c838a9fSAndrew Rybchenko  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
173c838a9fSAndrew Rybchenko  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
183c838a9fSAndrew Rybchenko  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
193c838a9fSAndrew Rybchenko  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
203c838a9fSAndrew Rybchenko  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
213c838a9fSAndrew Rybchenko  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
223c838a9fSAndrew Rybchenko  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
233c838a9fSAndrew Rybchenko  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
243c838a9fSAndrew Rybchenko  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
253c838a9fSAndrew Rybchenko  *
263c838a9fSAndrew Rybchenko  * The views and conclusions contained in the software and documentation are
273c838a9fSAndrew Rybchenko  * those of the authors and should not be interpreted as representing official
283c838a9fSAndrew Rybchenko  * policies, either expressed or implied, of the FreeBSD Project.
293c838a9fSAndrew Rybchenko  */
303c838a9fSAndrew Rybchenko 
313c838a9fSAndrew Rybchenko #ifndef _SYS_HUNT_IMPL_H
323c838a9fSAndrew Rybchenko #define	_SYS_HUNT_IMPL_H
333c838a9fSAndrew Rybchenko 
343c838a9fSAndrew Rybchenko #include "efx.h"
353c838a9fSAndrew Rybchenko #include "efx_regs.h"
363c838a9fSAndrew Rybchenko #include "efx_regs_ef10.h"
373c838a9fSAndrew Rybchenko #include "efx_mcdi.h"
383c838a9fSAndrew Rybchenko 
393c838a9fSAndrew Rybchenko #ifdef	__cplusplus
403c838a9fSAndrew Rybchenko extern "C" {
413c838a9fSAndrew Rybchenko #endif
423c838a9fSAndrew Rybchenko 
43d5bd0d6bSAndrew Rybchenko /* Missing register definitions */
44d5bd0d6bSAndrew Rybchenko #ifndef	ER_DZ_TX_PIOBUF_OFST
45d5bd0d6bSAndrew Rybchenko #define	ER_DZ_TX_PIOBUF_OFST 0x00001000
46d5bd0d6bSAndrew Rybchenko #endif
47d5bd0d6bSAndrew Rybchenko #ifndef	ER_DZ_TX_PIOBUF_STEP
48d5bd0d6bSAndrew Rybchenko #define	ER_DZ_TX_PIOBUF_STEP 8192
49d5bd0d6bSAndrew Rybchenko #endif
50d5bd0d6bSAndrew Rybchenko #ifndef	ER_DZ_TX_PIOBUF_ROWS
51d5bd0d6bSAndrew Rybchenko #define	ER_DZ_TX_PIOBUF_ROWS 2048
52d5bd0d6bSAndrew Rybchenko #endif
53d5bd0d6bSAndrew Rybchenko 
54d5bd0d6bSAndrew Rybchenko #ifndef	ER_DZ_TX_PIOBUF_SIZE
55d5bd0d6bSAndrew Rybchenko #define	ER_DZ_TX_PIOBUF_SIZE 2048
56d5bd0d6bSAndrew Rybchenko #endif
57d5bd0d6bSAndrew Rybchenko 
58d5bd0d6bSAndrew Rybchenko #define	HUNT_PIOBUF_NBUFS	(16)
59d5bd0d6bSAndrew Rybchenko #define	HUNT_PIOBUF_SIZE	(ER_DZ_TX_PIOBUF_SIZE)
60d5bd0d6bSAndrew Rybchenko 
61d5bd0d6bSAndrew Rybchenko #define	HUNT_MIN_PIO_ALLOC_SIZE	(HUNT_PIOBUF_SIZE / 32)
62d5bd0d6bSAndrew Rybchenko 
63d5bd0d6bSAndrew Rybchenko /* NIC */
64d5bd0d6bSAndrew Rybchenko 
65d5bd0d6bSAndrew Rybchenko extern	__checkReturn	efx_rc_t
66d5bd0d6bSAndrew Rybchenko hunt_board_cfg(
67d5bd0d6bSAndrew Rybchenko 	__in		efx_nic_t *enp);
68d5bd0d6bSAndrew Rybchenko 
693c838a9fSAndrew Rybchenko #ifdef	__cplusplus
703c838a9fSAndrew Rybchenko }
713c838a9fSAndrew Rybchenko #endif
723c838a9fSAndrew Rybchenko 
733c838a9fSAndrew Rybchenko #endif	/* _SYS_HUNT_IMPL_H */
74