linux/drivers/net/fddi/skfp/h/smc.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	_SCMECM_
#define _SCMECM_

#if	defined(PCI) && !defined(OSDEF)
/*
 * In the case of the PCI bus the file osdef1st.h must be present
 */
#define OSDEF
#endif

#ifdef	PCI
#ifndef	SUPERNET_3
#define SUPERNET_3
#endif
#ifndef	TAG_MODE
#define TAG_MODE
#endif
#endif

/*
 * include all other files in required order
 * the following files must have been included before:
 *	types.h
 *	fddi.h
 */
#ifdef	OSDEF
#include "osdef1st.h"
#endif	/* OSDEF */
#ifdef	OEM_CONCEPT
#include "oemdef.h"
#endif	/* OEM_CONCEPT */
#include "smt.h"
#include "cmtdef.h"
#include "fddimib.h"
#include "targethw.h"		/* all target hw dependencies */
#include "targetos.h"		/* all target os dependencies */
#ifdef	ESS
#include "sba.h"
#endif

/*
 * Event Queue
 *	queue.c
 * events are class/value pairs
 *	class	is addressee, e.g. RMT, PCM etc.
 *	value	is command, e.g. line state change, ring op change etc.
 */
struct event_queue {} ;

/*
 * define event queue as circular buffer
 */
#ifdef	CONCENTRATOR
#define MAX_EVENT
#else	/* nCONCENTRATOR */
#define MAX_EVENT
#endif	/* nCONCENTRATOR */

struct s_queue {} ;

/*
 * ECM - Entity Coordination Management
 * ecm.c
 */
struct s_ecm {} ;


/*
 * RMT - Ring Management
 * rmt.c
 */
struct s_rmt {} ;

/*
 * CFM - Configuration Management
 * cfm.c
 * used for SAS and DAS
 */
struct s_cfm {} ;

/*
 * CEM - Configuration Element Management
 * cem.c
 * used for Concentrator
 */
#ifdef	CONCENTRATOR
struct s_cem {
	int	ce_state ;	/* CEM state */
	int	ce_port ;	/* PA PB PM PM+1 .. */
	int	ce_type ;	/* TA TB TS TM */
} ;

/*
 * linked list of CCEs in current token path
 */
struct s_c_ring {
	struct s_c_ring	*c_next ;
	char		c_entity ;
} ;

struct mib_path_config {
	u_long	fddimibPATHConfigSMTIndex;
	u_long	fddimibPATHConfigPATHIndex;
	u_long	fddimibPATHConfigTokenOrder;
	u_long	fddimibPATHConfigResourceType;
#define SNMP_RES_TYPE_MAC
#define SNMP_RES_TYPE_PORT
	u_long	fddimibPATHConfigResourceIndex;
	u_long	fddimibPATHConfigCurrentPath;
#define SNMP_PATH_ISOLATED
#define SNMP_PATH_LOCAL
#define SNMP_PATH_SECONDARY
#define SNMP_PATH_PRIMARY
#define SNMP_PATH_CONCATENATED
#define SNMP_PATH_THRU
};


#endif

/*
 * PCM connect states
 */
#define PCM_DISABLED
#define PCM_CONNECTING
#define PCM_STANDBY
#define PCM_ACTIVE

struct s_pcm {} ;

/*
 * PHY struct
 * one per physical port
 */
struct s_phy {} ;

/*
 * timer package
 * smttimer.c
 */
struct s_timer {} ;

/*
 * SRF types and data
 */
#define SMT_EVENT_BASE
#define SMT_EVENT_MAC_PATH_CHANGE
#define SMT_EVENT_MAC_NEIGHBOR_CHANGE
#define SMT_EVENT_PORT_PATH_CHANGE
#define SMT_EVENT_PORT_CONNECTION

#define SMT_IS_CONDITION(x)

#define SMT_COND_BASE
#define SMT_COND_SMT_PEER_WRAP
#define SMT_COND_SMT_HOLD
#define SMT_COND_MAC_FRAME_ERROR
#define SMT_COND_MAC_DUP_ADDR
#define SMT_COND_MAC_NOT_COPIED
#define SMT_COND_PORT_EB_ERROR
#define SMT_COND_PORT_LER

#define SR0_WAIT
#define SR1_HOLDOFF
#define SR2_DISABLED

struct s_srf {} ;

/*
 * IBM token ring status
 */
#define RS_RES15
#define RS_HARDERROR
#define RS_SOFTERROR
#define RS_BEACON
#define RS_PATHTEST
#define RS_SELFTEST
#define RS_RES9
#define RS_DISCONNECT
#define RS_RES7
#define RS_DUPADDR
#define RS_NORINGOP
#define RS_VERSION
#define RS_STUCKBYPASSS
#define RS_EVENT
#define RS_RINGOPCHANGE
#define RS_RES0

#define RS_SET(smc,bit)
#define RS_CLEAR(smc,bit)

#define RS_CLEAR_EVENT

/* Define the AIX-event-Notification as null function if it isn't defined */
/* in the targetos.h file */
#ifndef AIX_EVENT
#define AIX_EVENT(smc,opt0,opt1,opt2,opt3)
#endif

struct s_srf_evc {} ;

/*
 * Values used by frame based services
 * smt.c
 */
#define SMT_MAX_TEST
#define SMT_TID_NIF
#define SMT_TID_NIF_TEST
#define SMT_TID_ECF_UNA
#define SMT_TID_ECF_DNA
#define SMT_TID_ECF

struct smt_values {} ;

/*
 * SMT/CMT configurable parameters
 */
#define SMT_DAS
#define SMT_SAS
#define SMT_NAC

struct smt_config {} ;

#ifdef	DEBUG
/*
 * Debugging struct sometimes used in smc
 */
struct	smt_debug {
	int	d_smtf ;
	int	d_smt ;
	int	d_ecm ;
	int	d_rmt ;
	int	d_cfm ;
	int	d_pcm ;
	int	d_plc ;
#ifdef	ESS
	int	d_ess ;
#endif
#ifdef	SBA
	int	d_sba ;
#endif
	struct	os_debug	d_os;	/* Include specific OS DEBUG struct */
} ;

#ifndef	DEBUG_BRD
/* all boards shall be debugged with one debug struct */
extern	struct	smt_debug	debug;	/* Declaration of debug struct */
#endif	/* DEBUG_BRD */

#endif	/* DEBUG */

/*
 * the SMT Context Struct SMC
 * this struct contains ALL global variables of SMT
 */
struct s_smc {} ;

extern const struct fddi_addr fddi_broadcast;

void all_selection_criteria(struct s_smc *smc);
void card_stop(struct s_smc *smc);
void init_board(struct s_smc *smc, u_char *mac_addr);
int init_fplus(struct s_smc *smc);
void init_plc(struct s_smc *smc);
int init_smt(struct s_smc *smc, const u_char *mac_addr);
void mac1_irq(struct s_smc *smc, u_short stu, u_short stl);
void mac2_irq(struct s_smc *smc, u_short code_s2u, u_short code_s2l);
void mac3_irq(struct s_smc *smc, u_short code_s3u, u_short code_s3l);
int pcm_status_twisted(struct s_smc *smc);
void plc1_irq(struct s_smc *smc);
void plc2_irq(struct s_smc *smc);
void read_address(struct s_smc *smc, u_char *mac_addr);
void timer_irq(struct s_smc *smc);

#endif	/* _SCMECM_ */