/*
* Copyright (c) 2008-2016 Solarflare Communications Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the FreeBSD Project.
*/
#ifndef _SYS_EFSYS_H
#define _SYS_EFSYS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/sysmacros.h>
#include <sys/byteorder.h>
#define EFSYS_USE_UINT64 0
#define EFSYS_HAS_SSE2_M128 0
#ifdef _BIG_ENDIAN
#endif
#ifdef _LITTLE_ENDIAN
#endif
#include "efx_types.h"
/* Modifiers used for Windows builds */
#define __in
#define __in_opt
#define __out
#define __out_opt
#define __deref_out
#define __inout
#define __inout_opt
#define __deref_out_bcount_opt(n)
#define __checkReturn
/* Code inclusion options */
#define EFSYS_OPT_MEDFORD 0
#if DEBUG
#else
#define EFSYS_OPT_CHECK_REG 0
#endif
#define EFSYS_OPT_MCDI_LOGGING 0
#define EFSYS_OPT_MCDI_PROXY_AUTH 0
#define EFSYS_OPT_DIAG 0
#define EFSYS_OPT_EV_PREFETCH 0
#define EFSYS_OPT_LICENSING 0
/* ID */
/* DMA */
typedef struct efsys_mem_s {
} efsys_mem_t;
do { \
\
\
\
addr); \
\
\
} while (B_FALSE)
do { \
\
\
\
addr++); \
addr); \
\
\
} while (B_FALSE)
do { \
\
\
\
addr++); \
addr++); \
addr++); \
addr); \
\
\
} while (B_FALSE)
do { \
\
\
\
\
\
} while (B_FALSE)
do { \
\
\
\
\
\
} while (B_FALSE)
do { \
\
\
\
\
\
} while (B_FALSE)
/* BAR */
typedef struct efsys_bar_s {
} efsys_bar_t;
do { \
\
\
if (_lock) \
\
\
addr); \
\
\
if (_lock) \
} while (B_FALSE)
do { \
\
\
\
\
addr++); \
addr); \
\
\
} while (B_FALSE)
do { \
\
\
if (_lock) \
\
\
addr++); \
addr++); \
addr++); \
addr); \
\
\
if (_lock) \
} while (B_FALSE)
do { \
\
\
if (_lock) \
\
\
\
\
if (_lock) \
} while (B_FALSE)
do { \
\
\
\
\
\
\
} while (B_FALSE)
/*
* Guarantees 64bit aligned 64bit writes to write combined BAR mapping
* (required by PIO hardware)
*/
do { \
\
(void) (_esbp); \
\
/* FIXME: Perform a 64-bit write */ \
EFSYS_ASSERT(0); \
\
} while (B_FALSE)
do { \
\
\
if (_lock) \
\
\
\
\
if (_lock) \
} while (B_FALSE)
/* Use the standard octo-word write for doorbell writes */
do { \
} while (B_FALSE)
/* SPIN */
/* TODO: Perhaps this should use delay(9F)? */
/* BARRIERS */
/* Strict ordering guaranteed by devacc.devacc_attr_dataorder */
/* TODO: Is ddi_put32() properly barriered? */
#define EFSYS_PIO_WRITE_BARRIER()
/* DMA SYNC */
/*
* It could be cheaper to sync entire map than calculate offset and
* size. If so, below macros should be updated to ignore these arguments
* and sync entire map.
*/
/* TIMESTAMP */
/* TODO: Arguably this could use gethrtime */
do { \
} while (B_FALSE)
/* KMEM */
do { \
} while (B_FALSE)
do { \
} while (B_FALSE)
/* LOCK */
do { \
mutex_enter(_lockp); \
(_state) = EFSYS_LOCK_MAGIC; \
} while (B_FALSE)
do { \
if ((_state) != EFSYS_LOCK_MAGIC) \
mutex_exit(_lockp); \
} while (B_FALSE)
/* STAT */
do { \
} while (B_FALSE)
do { \
} while (B_FALSE)
do { \
} while (B_FALSE)
do { \
} while (B_FALSE)
do { \
} while (B_FALSE)
do { \
} while (B_FALSE)
do { \
} while (B_FALSE)
/* ERR */
extern void sfxge_err(efsys_identifier_t *, unsigned int,
#endif
/* PROBE */
/* ASSERT */
/* ROTATE */
#define EFSYS_HAS_ROTL_DWORD 0
#ifdef __cplusplus
}
#endif
#endif /* _SYS_EFSYS_H */