linux/drivers/net/fddi/skfp/h/hwmtm.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/******************************************************************************
 *
 *	(C)Copyright 1998,1999 SysKonnect,
 *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
 *
 *	The information in this file is provided "AS IS" without warranty.
 *
 ******************************************************************************/

#ifndef	_HWM_
#define _HWM_

#include "mbuf.h"

/*
 * MACRO for DMA synchronization:
 *	The descriptor 'desc' is flushed for the device 'flag'.
 *	Devices are the CPU (DDI_DMA_SYNC_FORCPU) and the
 *	adapter (DDI_DMA_SYNC_FORDEV).
 *
 *	'desc'	Pointer to a Rx or Tx descriptor.
 *	'flag'	Flag for direction (view for CPU or DEVICE) that
 *		should be synchronized.
 *
 *	Empty macros and defines are specified here. The real macro
 *	is os-specific and should be defined in osdef1st.h.
 */
#ifndef DRV_BUF_FLUSH
#define DRV_BUF_FLUSH(desc,flag)
#define DDI_DMA_SYNC_FORCPU
#define DDI_DMA_SYNC_FORDEV
#endif

	/*
	 * hardware modul dependent receive modes
	 */
#define RX_ENABLE_PASS_SMT
#define RX_DISABLE_PASS_SMT
#define RX_ENABLE_PASS_NSA
#define RX_DISABLE_PASS_NSA
#define RX_ENABLE_PASS_DB
#define RX_DISABLE_PASS_DB
#define RX_DISABLE_PASS_ALL
#define RX_DISABLE_LLC_PROMISC
#define RX_ENABLE_LLC_PROMISC


#ifndef	DMA_RD
#define DMA_RD
#endif
#ifndef DMA_WR
#define DMA_WR
#endif
#define SMT_BUF

	/*
	 * bits of the frame status byte
	 */
#define EN_IRQ_EOF
#define LOC_TX
#define LAST_FRAG
#define FIRST_FRAG
#define LAN_TX
#define RING_DOWN
#define OUT_OF_TXD


#ifndef NULL
#define NULL
#endif

#define C_INDIC
#define A_INDIC
#define RD_FS_LOCAL

	/*
	 * DEBUG FLAGS
	 */
#define DEBUG_SMTF
#define DEBUG_SMT
#define DEBUG_ECM
#define DEBUG_RMT
#define DEBUG_CFM
#define DEBUG_PCM
#define DEBUG_SBA
#define DEBUG_ESS

#define DB_HWM_RX
#define DB_HWM_TX
#define DB_HWM_GEN

struct s_mbuf_pool {} ;

struct hwm_r {} ;

struct hw_modul {} ;


/*
 * DEBUG structs and macros
 */

#ifdef	DEBUG
struct os_debug {
	int	hwm_rx ;
	int	hwm_tx ;
	int	hwm_gen ;
} ;
#endif

#ifdef	DEBUG
#ifdef	DEBUG_BRD
#define DB_P
#else
#define DB_P
#endif

#define DB_RX
#define DB_TX
#define DB_GEN
#else	/* DEBUG */
#define DB_RX(lev, fmt, ...)
#define DB_TX(lev, fmt, ...)
#define DB_GEN(lev, fmt, ...)
#endif	/* DEBUG */

#ifndef	SK_BREAK
#define SK_BREAK()
#endif


/*
 * HWM Macros
 */

/*
 *	BEGIN_MANUAL_ENTRY(HWM_GET_TX_PHYS)
 *	u_long HWM_GET_TX_PHYS(txd)
 *
 * function	MACRO		(hardware module, hwmtm.h)
 *		This macro may be invoked by the OS-specific module to read
 *		the physical address of the specified TxD.
 *
 * para	txd	pointer to the TxD
 *
 *	END_MANUAL_ENTRY
 */
#define HWM_GET_TX_PHYS(txd)

/*
 *	BEGIN_MANUAL_ENTRY(HWM_GET_TX_LEN)
 *	int HWM_GET_TX_LEN(txd)
 *
 * function	MACRO		(hardware module, hwmtm.h)
 *		This macro may be invoked by the OS-specific module to read
 *		the fragment length of the specified TxD
 *
 * para	rxd	pointer to the TxD
 *
 * return	the length of the fragment in bytes
 *
 *	END_MANUAL_ENTRY
 */
#define HWM_GET_TX_LEN(txd)

/*
 *	BEGIN_MANUAL_ENTRY(HWM_GET_TX_USED)
 *	txd *HWM_GET_TX_USED(smc,queue)
 *
 * function	MACRO		(hardware module, hwmtm.h)
 *		This macro may be invoked by the OS-specific module to get the
 *		number of used TxDs for the queue, specified by the index.
 *
 * para	queue	the number of the send queue: Can be specified by
 *		QUEUE_A0, QUEUE_S or (frame_status & QUEUE_A0)
 *
 * return	number of used TxDs for this send queue
 *
 *	END_MANUAL_ENTRY
 */
#define HWM_GET_TX_USED(smc,queue)

/*
 *	BEGIN_MANUAL_ENTRY(HWM_GET_CURR_TXD)
 *	txd *HWM_GET_CURR_TXD(smc,queue)
 *
 * function	MACRO		(hardware module, hwmtm.h)
 *		This macro may be invoked by the OS-specific module to get the
 *		pointer to the TxD which points to the current queue put
 *		position.
 *
 * para	queue	the number of the send queue: Can be specified by
 *		QUEUE_A0, QUEUE_S or (frame_status & QUEUE_A0)
 *
 * return	pointer to the current TxD
 *
 *	END_MANUAL_ENTRY
 */
#define HWM_GET_CURR_TXD(smc,queue)

/*
 *	BEGIN_MANUAL_ENTRY(HWM_GET_RX_FRAG_LEN)
 *	int HWM_GET_RX_FRAG_LEN(rxd)
 *
 * function	MACRO		(hardware module, hwmtm.h)
 *		This macro may be invoked by the OS-specific module to read
 *		the fragment length of the specified RxD
 *
 * para	rxd	pointer to the RxD
 *
 * return	the length of the fragment in bytes
 *
 *	END_MANUAL_ENTRY
 */
#define HWM_GET_RX_FRAG_LEN(rxd)

/*
 *	BEGIN_MANUAL_ENTRY(HWM_GET_RX_PHYS)
 *	u_long HWM_GET_RX_PHYS(rxd)
 *
 * function	MACRO		(hardware module, hwmtm.h)
 *		This macro may be invoked by the OS-specific module to read
 *		the physical address of the specified RxD.
 *
 * para	rxd	pointer to the RxD
 *
 * return	the RxD's physical pointer to the data fragment
 *
 *	END_MANUAL_ENTRY
 */
#define HWM_GET_RX_PHYS(rxd)

/*
 *	BEGIN_MANUAL_ENTRY(HWM_GET_RX_USED)
 *	int HWM_GET_RX_USED(smc)
 *
 * function	MACRO		(hardware module, hwmtm.h)
 *		This macro may be invoked by the OS-specific module to get
 *		the count of used RXDs in receive queue 1.
 *
 * return	the used RXD count of receive queue 1
 *
 * NOTE: Remember, because of an ASIC bug at least one RXD should be unused
 *	 in the descriptor ring !
 *
 *	END_MANUAL_ENTRY
 */
#define HWM_GET_RX_USED(smc)

/*
 *	BEGIN_MANUAL_ENTRY(HWM_GET_RX_FREE)
 *	int HWM_GET_RX_FREE(smc)
 *
 * function	MACRO		(hardware module, hwmtm.h)
 *		This macro may be invoked by the OS-specific module to get
 *		the rxd_free count of receive queue 1.
 *
 * return	the rxd_free count of receive queue 1
 *
 *	END_MANUAL_ENTRY
 */
#define HWM_GET_RX_FREE(smc)

/*
 *	BEGIN_MANUAL_ENTRY(HWM_GET_CURR_RXD)
 *	rxd *HWM_GET_CURR_RXD(smc)
 *
 * function	MACRO		(hardware module, hwmtm.h)
 *		This macro may be invoked by the OS-specific module to get the
 *		pointer to the RxD which points to the current queue put
 *		position.
 *
 * return	pointer to the current RxD
 *
 *	END_MANUAL_ENTRY
 */
#define HWM_GET_CURR_RXD(smc)

/*
 *	BEGIN_MANUAL_ENTRY(HWM_RX_CHECK)
 *	void HWM_RX_CHECK(smc,low_water)
 *
 * function	MACRO		(hardware module, hwmtm.h)
 *		This macro is invoked by the OS-specific before it left the
 *		function mac_drv_rx_complete. This macro calls mac_drv_fill_rxd
 *		if the number of used RxDs is equal or lower than the
 *		given low water mark.
 *
 * para	low_water	low water mark of used RxD's
 *
 *	END_MANUAL_ENTRY
 */
#ifndef HWM_NO_FLOW_CTL
#define HWM_RX_CHECK(smc,low_water)
#else
#define HWM_RX_CHECK
#endif

#ifndef	HWM_EBASE
#define HWM_EBASE
#endif

#define HWM_E0001
#define HWM_E0001_MSG
#define HWM_E0002
#define HWM_E0002_MSG
#define HWM_E0003
#define HWM_E0003_MSG
#define HWM_E0004
#define HWM_E0004_MSG
#define HWM_E0005
#define HWM_E0005_MSG
#define HWM_E0006
#define HWM_E0006_MSG
#define HWM_E0007
#define HWM_E0007_MSG
#define HWM_E0008
#define HWM_E0008_MSG
#define HWM_E0009
#define HWM_E0009_MSG
#define HWM_E0010
#define HWM_E0010_MSG
#define HWM_E0011
#define HWM_E0011_MSG
#define HWM_E0012
#define HWM_E0012_MSG
#define HWM_E0013
#define HWM_E0013_MSG

#endif