Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
This commit is contained in:
Linus Torvalds
2005-04-16 15:20:36 -07:00
commit 1da177e4c3
17291 changed files with 6718755 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#
# Makefile for the SysKonnect FDDI PCI adapter driver
#
obj-$(CONFIG_SKFP) += skfp.o
skfp-objs := skfddi.o hwmtm.o fplustm.o smt.o cfm.o \
ecm.o pcmplc.o pmf.o queue.o rmt.o \
smtdef.o smtinit.o smttimer.o srf.o lnkstat.o \
smtparse.o hwt.o drvfbi.o ess.o
# NOTE:
# Compiling this driver produces some warnings (and some more are
# switched off below), but I did not fix this, because the Hardware
# Module source (see skfddi.c for details) is used for different
# drivers, and fixing it for Linux might bring problems on other
# projects. To keep the source common for all those drivers (and
# thus simplify fixes to it), please do not clean it up!
EXTRA_CFLAGS += -Idrivers/net/skfp -DPCI -DMEM_MAPPED_IO -Wno-strict-prototypes
+83
View File
@@ -0,0 +1,83 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* See the file "skfddi.c" for further information.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
#ifndef lint
static const char xID_sccs[] = "@(#)can.c 1.5 97/04/07 (C) SK " ;
#endif
/*
* canonical bit order
*/
const u_char canonical[256] = {
0x00,0x80,0x40,0xc0,0x20,0xa0,0x60,0xe0,
0x10,0x90,0x50,0xd0,0x30,0xb0,0x70,0xf0,
0x08,0x88,0x48,0xc8,0x28,0xa8,0x68,0xe8,
0x18,0x98,0x58,0xd8,0x38,0xb8,0x78,0xf8,
0x04,0x84,0x44,0xc4,0x24,0xa4,0x64,0xe4,
0x14,0x94,0x54,0xd4,0x34,0xb4,0x74,0xf4,
0x0c,0x8c,0x4c,0xcc,0x2c,0xac,0x6c,0xec,
0x1c,0x9c,0x5c,0xdc,0x3c,0xbc,0x7c,0xfc,
0x02,0x82,0x42,0xc2,0x22,0xa2,0x62,0xe2,
0x12,0x92,0x52,0xd2,0x32,0xb2,0x72,0xf2,
0x0a,0x8a,0x4a,0xca,0x2a,0xaa,0x6a,0xea,
0x1a,0x9a,0x5a,0xda,0x3a,0xba,0x7a,0xfa,
0x06,0x86,0x46,0xc6,0x26,0xa6,0x66,0xe6,
0x16,0x96,0x56,0xd6,0x36,0xb6,0x76,0xf6,
0x0e,0x8e,0x4e,0xce,0x2e,0xae,0x6e,0xee,
0x1e,0x9e,0x5e,0xde,0x3e,0xbe,0x7e,0xfe,
0x01,0x81,0x41,0xc1,0x21,0xa1,0x61,0xe1,
0x11,0x91,0x51,0xd1,0x31,0xb1,0x71,0xf1,
0x09,0x89,0x49,0xc9,0x29,0xa9,0x69,0xe9,
0x19,0x99,0x59,0xd9,0x39,0xb9,0x79,0xf9,
0x05,0x85,0x45,0xc5,0x25,0xa5,0x65,0xe5,
0x15,0x95,0x55,0xd5,0x35,0xb5,0x75,0xf5,
0x0d,0x8d,0x4d,0xcd,0x2d,0xad,0x6d,0xed,
0x1d,0x9d,0x5d,0xdd,0x3d,0xbd,0x7d,0xfd,
0x03,0x83,0x43,0xc3,0x23,0xa3,0x63,0xe3,
0x13,0x93,0x53,0xd3,0x33,0xb3,0x73,0xf3,
0x0b,0x8b,0x4b,0xcb,0x2b,0xab,0x6b,0xeb,
0x1b,0x9b,0x5b,0xdb,0x3b,0xbb,0x7b,0xfb,
0x07,0x87,0x47,0xc7,0x27,0xa7,0x67,0xe7,
0x17,0x97,0x57,0xd7,0x37,0xb7,0x77,0xf7,
0x0f,0x8f,0x4f,0xcf,0x2f,0xaf,0x6f,0xef,
0x1f,0x9f,0x5f,0xdf,0x3f,0xbf,0x7f,0xff
} ;
#ifdef MAKE_TABLE
int byte_reverse(x)
int x ;
{
int y = 0 ;
if (x & 0x01)
y |= 0x80 ;
if (x & 0x02)
y |= 0x40 ;
if (x & 0x04)
y |= 0x20 ;
if (x & 0x08)
y |= 0x10 ;
if (x & 0x10)
y |= 0x08 ;
if (x & 0x20)
y |= 0x04 ;
if (x & 0x40)
y |= 0x02 ;
if (x & 0x80)
y |= 0x01 ;
return(y) ;
}
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+69
View File
@@ -0,0 +1,69 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
#ifndef _FDDI_
#define _FDDI_
struct fddi_addr {
u_char a[6] ;
} ;
#define GROUP_ADDR 0x80 /* MSB in a[0] */
struct fddi_mac {
struct fddi_addr mac_dest ;
struct fddi_addr mac_source ;
u_char mac_info[4478] ;
} ;
#define FDDI_MAC_SIZE (12)
#define FDDI_RAW_MTU (4500-5) /* exl. Pr,SD, ED/FS */
#define FDDI_RAW (4500)
/*
* FC values
*/
#define FC_VOID 0x40 /* void frame */
#define FC_TOKEN 0x80 /* token */
#define FC_RES_TOKEN 0xc0 /* restricted token */
#define FC_SMT_INFO 0x41 /* SMT Info frame */
/*
* FC_SMT_LAN_LOC && FC_SMT_LOC are SK specific !
*/
#define FC_SMT_LAN_LOC 0x42 /* local SMT Info frame */
#define FC_SMT_LOC 0x43 /* local SMT Info frame */
#define FC_SMT_NSA 0x4f /* SMT NSA frame */
#define FC_MAC 0xc0 /* MAC frame */
#define FC_BEACON 0xc2 /* MAC beacon frame */
#define FC_CLAIM 0xc3 /* MAC claim frame */
#define FC_SYNC_LLC 0xd0 /* sync. LLC frame */
#define FC_ASYNC_LLC 0x50 /* async. LLC frame */
#define FC_SYNC_BIT 0x80 /* sync. bit in FC */
#define FC_LLC_PRIOR 0x07 /* priority bits */
#define BEACON_INFO 0 /* beacon type */
#define DBEACON_INFO 1 /* beacon type DIRECTED */
/*
* indicator bits
*/
#define C_INDICATOR (1<<0)
#define A_INDICATOR (1<<1)
#define E_INDICATOR (1<<2)
#define I_INDICATOR (1<<6) /* SK specific */
#define L_INDICATOR (1<<7) /* SK specific */
#endif /* _FDDI_ */
+349
View File
@@ -0,0 +1,349 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
/*
* FDDI MIB
*/
/*
* typedefs
*/
typedef u_long Counter ;
typedef u_char TimeStamp[8] ;
typedef struct fddi_addr LongAddr ;
typedef u_long Timer_2 ;
typedef u_long Timer ;
typedef u_short ResId ;
typedef u_short SMTEnum ;
typedef u_char SMTFlag ;
typedef struct {
Counter count ;
TimeStamp timestamp ;
} SetCountType ;
/*
* bits for bit string "available_path"
*/
#define MIB_PATH_P (1<<0)
#define MIB_PATH_S (1<<1)
#define MIB_PATH_L (1<<2)
/*
* bits for bit string PermittedPaths & RequestedPaths (SIZE(8))
*/
#define MIB_P_PATH_LOCAL (1<<0)
#define MIB_P_PATH_SEC_ALTER (1<<1)
#define MIB_P_PATH_PRIM_ALTER (1<<2)
#define MIB_P_PATH_CON_ALTER (1<<3)
#define MIB_P_PATH_SEC_PREFER (1<<4)
#define MIB_P_PATH_PRIM_PREFER (1<<5)
#define MIB_P_PATH_CON_PREFER (1<<6)
#define MIB_P_PATH_THRU (1<<7)
/*
* enum current path
*/
#define MIB_PATH_ISOLATED 0
#define MIB_PATH_LOCAL 1
#define MIB_PATH_SECONDARY 2
#define MIB_PATH_PRIMARY 3
#define MIB_PATH_CONCATENATED 4
#define MIB_PATH_THRU 5
/*
* enum PMDClass
*/
#define MIB_PMDCLASS_MULTI 0
#define MIB_PMDCLASS_SINGLE1 1
#define MIB_PMDCLASS_SINGLE2 2
#define MIB_PMDCLASS_SONET 3
#define MIB_PMDCLASS_LCF 4
#define MIB_PMDCLASS_TP 5
#define MIB_PMDCLASS_UNKNOWN 6
#define MIB_PMDCLASS_UNSPEC 7
/*
* enum SMTStationStatus
*/
#define MIB_SMT_STASTA_CON 0
#define MIB_SMT_STASTA_SEPA 1
#define MIB_SMT_STASTA_THRU 2
struct fddi_mib {
/*
* private
*/
u_char fddiPRPMFPasswd[8] ;
struct smt_sid fddiPRPMFStation ;
#ifdef ESS
/*
* private variables for static allocation of the
* End Station Support
*/
u_long fddiESSPayload ; /* payload for static alloc */
u_long fddiESSOverhead ; /* frame ov for static alloc */
u_long fddiESSMaxTNeg ; /* maximum of T-NEG */
u_long fddiESSMinSegmentSize ; /* min size of the sync frames */
u_long fddiESSCategory ; /* category for the Alloc req */
short fddiESSSynchTxMode ; /* send all LLC frames as sync */
#endif /* ESS */
#ifdef SBA
/*
* private variables for the Synchronous Bandwidth Allocator
*/
char fddiSBACommand ; /* holds the parsed SBA cmd */
u_char fddiSBAAvailable ; /* SBA allocatable value */
#endif /* SBA */
/*
* SMT standard mib
*/
struct smt_sid fddiSMTStationId ;
u_short fddiSMTOpVersionId ;
u_short fddiSMTHiVersionId ;
u_short fddiSMTLoVersionId ;
u_char fddiSMTManufacturerData[32] ;
u_char fddiSMTUserData[32] ;
u_short fddiSMTMIBVersionId ;
/*
* ConfigGrp
*/
u_char fddiSMTMac_Ct ;
u_char fddiSMTNonMaster_Ct ;
u_char fddiSMTMaster_Ct ;
u_char fddiSMTAvailablePaths ;
u_short fddiSMTConfigCapabilities ;
u_short fddiSMTConfigPolicy ;
u_short fddiSMTConnectionPolicy ;
u_short fddiSMTTT_Notify ;
u_char fddiSMTStatRptPolicy ;
u_long fddiSMTTrace_MaxExpiration ;
u_short fddiSMTPORTIndexes[NUMPHYS] ;
u_short fddiSMTMACIndexes ;
u_char fddiSMTBypassPresent ;
/*
* StatusGrp
*/
SMTEnum fddiSMTECMState ;
SMTEnum fddiSMTCF_State ;
SMTEnum fddiSMTStationStatus ;
u_char fddiSMTRemoteDisconnectFlag ;
u_char fddiSMTPeerWrapFlag ;
/*
* MIBOperationGrp
*/
TimeStamp fddiSMTTimeStamp ;
TimeStamp fddiSMTTransitionTimeStamp ;
SetCountType fddiSMTSetCount ;
struct smt_sid fddiSMTLastSetStationId ;
struct fddi_mib_m {
u_short fddiMACFrameStatusFunctions ;
Timer_2 fddiMACT_MaxCapabilitiy ;
Timer_2 fddiMACTVXCapabilitiy ;
/* ConfigGrp */
u_char fddiMACMultiple_N ; /* private */
u_char fddiMACMultiple_P ; /* private */
u_char fddiMACDuplicateAddressCond ;/* private */
u_char fddiMACAvailablePaths ;
u_short fddiMACCurrentPath ;
LongAddr fddiMACUpstreamNbr ;
LongAddr fddiMACDownstreamNbr ;
LongAddr fddiMACOldUpstreamNbr ;
LongAddr fddiMACOldDownstreamNbr ;
SMTEnum fddiMACDupAddressTest ;
u_short fddiMACRequestedPaths ;
SMTEnum fddiMACDownstreamPORTType ;
ResId fddiMACIndex ;
/* AddressGrp */
LongAddr fddiMACSMTAddress ;
/* OperationGrp */
Timer_2 fddiMACT_Min ; /* private */
Timer_2 fddiMACT_ReqMIB ;
Timer_2 fddiMACT_Req ; /* private */
Timer_2 fddiMACT_Neg ;
Timer_2 fddiMACT_MaxMIB ;
Timer_2 fddiMACT_Max ; /* private */
Timer_2 fddiMACTvxValueMIB ;
Timer_2 fddiMACTvxValue ; /* private */
Timer_2 fddiMACT_Pri0 ;
Timer_2 fddiMACT_Pri1 ;
Timer_2 fddiMACT_Pri2 ;
Timer_2 fddiMACT_Pri3 ;
Timer_2 fddiMACT_Pri4 ;
Timer_2 fddiMACT_Pri5 ;
Timer_2 fddiMACT_Pri6 ;
/* CountersGrp */
Counter fddiMACFrame_Ct ;
Counter fddiMACCopied_Ct ;
Counter fddiMACTransmit_Ct ;
Counter fddiMACToken_Ct ;
Counter fddiMACError_Ct ;
Counter fddiMACLost_Ct ;
Counter fddiMACTvxExpired_Ct ;
Counter fddiMACNotCopied_Ct ;
Counter fddiMACRingOp_Ct ;
Counter fddiMACSMTCopied_Ct ; /* private */
Counter fddiMACSMTTransmit_Ct ; /* private */
/* private for delta ratio */
Counter fddiMACOld_Frame_Ct ;
Counter fddiMACOld_Copied_Ct ;
Counter fddiMACOld_Error_Ct ;
Counter fddiMACOld_Lost_Ct ;
Counter fddiMACOld_NotCopied_Ct ;
/* FrameErrorConditionGrp */
u_short fddiMACFrameErrorThreshold ;
u_short fddiMACFrameErrorRatio ;
/* NotCopiedConditionGrp */
u_short fddiMACNotCopiedThreshold ;
u_short fddiMACNotCopiedRatio ;
/* StatusGrp */
SMTEnum fddiMACRMTState ;
SMTFlag fddiMACDA_Flag ;
SMTFlag fddiMACUNDA_Flag ;
SMTFlag fddiMACFrameErrorFlag ;
SMTFlag fddiMACNotCopiedFlag ;
SMTFlag fddiMACMA_UnitdataAvailable ;
SMTFlag fddiMACHardwarePresent ;
SMTFlag fddiMACMA_UnitdataEnable ;
} m[NUMMACS] ;
#define MAC0 0
struct fddi_mib_a {
ResId fddiPATHIndex ;
u_long fddiPATHSbaPayload ;
u_long fddiPATHSbaOverhead ;
/* fddiPATHConfiguration is built on demand */
/* u_long fddiPATHConfiguration ; */
Timer fddiPATHT_Rmode ;
u_long fddiPATHSbaAvailable ;
Timer_2 fddiPATHTVXLowerBound ;
Timer_2 fddiPATHT_MaxLowerBound ;
Timer_2 fddiPATHMaxT_Req ;
} a[NUMPATHS] ;
#define PATH0 0
struct fddi_mib_p {
/* ConfigGrp */
SMTEnum fddiPORTMy_Type ;
SMTEnum fddiPORTNeighborType ;
u_char fddiPORTConnectionPolicies ;
struct {
u_char T_val ;
u_char R_val ;
} fddiPORTMacIndicated ;
SMTEnum fddiPORTCurrentPath ;
/* must be 4: is 32 bit in SMT format
* indices :
* 1 none
* 2 tree
* 3 peer
*/
u_char fddiPORTRequestedPaths[4] ;
u_short fddiPORTMACPlacement ;
u_char fddiPORTAvailablePaths ;
u_char fddiPORTConnectionCapabilities ;
SMTEnum fddiPORTPMDClass ;
ResId fddiPORTIndex ;
/* OperationGrp */
SMTEnum fddiPORTMaint_LS ;
SMTEnum fddiPORTPC_LS ;
u_char fddiPORTBS_Flag ;
/* ErrorCtrsGrp */
Counter fddiPORTLCTFail_Ct ;
Counter fddiPORTEBError_Ct ;
Counter fddiPORTOldEBError_Ct ;
/* LerGrp */
Counter fddiPORTLem_Reject_Ct ;
Counter fddiPORTLem_Ct ;
u_char fddiPORTLer_Estimate ;
u_char fddiPORTLer_Cutoff ;
u_char fddiPORTLer_Alarm ;
/* StatusGrp */
SMTEnum fddiPORTConnectState ;
SMTEnum fddiPORTPCMState ; /* real value */
SMTEnum fddiPORTPCMStateX ; /* value for MIB */
SMTEnum fddiPORTPC_Withhold ;
SMTFlag fddiPORTHardwarePresent ;
u_char fddiPORTLerFlag ;
u_char fddiPORTMultiple_U ; /* private */
u_char fddiPORTMultiple_P ; /* private */
u_char fddiPORTEB_Condition ; /* private */
} p[NUMPHYS] ;
struct {
Counter fddiPRIVECF_Req_Rx ; /* ECF req received */
Counter fddiPRIVECF_Reply_Rx ; /* ECF repl received */
Counter fddiPRIVECF_Req_Tx ; /* ECF req transm */
Counter fddiPRIVECF_Reply_Tx ; /* ECF repl transm */
Counter fddiPRIVPMF_Get_Rx ; /* PMF Get rec */
Counter fddiPRIVPMF_Set_Rx ; /* PMF Set rec */
Counter fddiPRIVRDF_Rx ; /* RDF received */
Counter fddiPRIVRDF_Tx ; /* RDF transmitted */
} priv ;
} ;
/*
* OIDs for statistics
*/
#define SMT_OID_CF_STATE 1 /* fddiSMTCF_State */
#define SMT_OID_PCM_STATE_A 2 /* fddiPORTPCMState port A */
#define SMT_OID_PCM_STATE_B 17 /* fddiPORTPCMState port B */
#define SMT_OID_RMT_STATE 3 /* fddiMACRMTState */
#define SMT_OID_UNA 4 /* fddiMACUpstreamNbr */
#define SMT_OID_DNA 5 /* fddiMACOldDownstreamNbr */
#define SMT_OID_ERROR_CT 6 /* fddiMACError_Ct */
#define SMT_OID_LOST_CT 7 /* fddiMACLost_Ct */
#define SMT_OID_LEM_CT 8 /* fddiPORTLem_Ct */
#define SMT_OID_LEM_CT_A 11 /* fddiPORTLem_Ct port A */
#define SMT_OID_LEM_CT_B 12 /* fddiPORTLem_Ct port B */
#define SMT_OID_LCT_FAIL_CT 9 /* fddiPORTLCTFail_Ct */
#define SMT_OID_LCT_FAIL_CT_A 13 /* fddiPORTLCTFail_Ct port A */
#define SMT_OID_LCT_FAIL_CT_B 14 /* fddiPORTLCTFail_Ct port B */
#define SMT_OID_LEM_REJECT_CT 10 /* fddiPORTLem_Reject_Ct */
#define SMT_OID_LEM_REJECT_CT_A 15 /* fddiPORTLem_Reject_Ct port A */
#define SMT_OID_LEM_REJECT_CT_B 16 /* fddiPORTLem_Reject_Ct port B */
/*
* SK MIB
*/
#define SMT_OID_ECF_REQ_RX 20 /* ECF requests received */
#define SMT_OID_ECF_REPLY_RX 21 /* ECF replies received */
#define SMT_OID_ECF_REQ_TX 22 /* ECF requests transmitted */
#define SMT_OID_ECF_REPLY_TX 23 /* ECF replies transmitted */
#define SMT_OID_PMF_GET_RX 24 /* PMF get requests received */
#define SMT_OID_PMF_SET_RX 25 /* PMF set requests received */
#define SMT_OID_RDF_RX 26 /* RDF received */
#define SMT_OID_RDF_TX 27 /* RDF transmitted */
+274
View File
@@ -0,0 +1,274 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
/*
* AMD Fplus in tag mode data structs
* defs for fplustm.c
*/
#ifndef _FPLUS_
#define _FPLUS_
#ifndef HW_PTR
#define HW_PTR void __iomem *
#endif
/*
* fplus error statistic structure
*/
struct err_st {
u_long err_valid ; /* memory status valid */
u_long err_abort ; /* memory status receive abort */
u_long err_e_indicator ; /* error indicator */
u_long err_crc ; /* error detected (CRC or length) */
u_long err_llc_frame ; /* LLC frame */
u_long err_mac_frame ; /* MAC frame */
u_long err_smt_frame ; /* SMT frame */
u_long err_imp_frame ; /* implementer frame */
u_long err_no_buf ; /* no buffer available */
u_long err_too_long ; /* longer than max. buffer */
u_long err_bec_stat ; /* beacon state entered */
u_long err_clm_stat ; /* claim state entered */
u_long err_sifg_det ; /* short interframe gap detect */
u_long err_phinv ; /* PHY invalid */
u_long err_tkiss ; /* token issued */
u_long err_tkerr ; /* token error */
} ;
/*
* Transmit Descriptor struct
*/
struct s_smt_fp_txd {
u_int txd_tbctrl ; /* transmit buffer control */
u_int txd_txdscr ; /* transmit frame status word */
u_int txd_tbadr ; /* physical tx buffer address */
u_int txd_ntdadr ; /* physical pointer to the next TxD */
#ifdef ENA_64BIT_SUP
u_int txd_tbadr_hi ; /* physical tx buffer addr (high dword)*/
#endif
char far *txd_virt ; /* virtual pointer to the data frag */
/* virt pointer to the next TxD */
struct s_smt_fp_txd volatile far *txd_next ;
struct s_txd_os txd_os ; /* OS - specific struct */
} ;
/*
* Receive Descriptor struct
*/
struct s_smt_fp_rxd {
u_int rxd_rbctrl ; /* receive buffer control */
u_int rxd_rfsw ; /* receive frame status word */
u_int rxd_rbadr ; /* physical rx buffer address */
u_int rxd_nrdadr ; /* physical pointer to the next RxD */
#ifdef ENA_64BIT_SUP
u_int rxd_rbadr_hi ; /* physical tx buffer addr (high dword)*/
#endif
char far *rxd_virt ; /* virtual pointer to the data frag */
/* virt pointer to the next RxD */
struct s_smt_fp_rxd volatile far *rxd_next ;
struct s_rxd_os rxd_os ; /* OS - specific struct */
} ;
/*
* Descriptor Union Definition
*/
union s_fp_descr {
struct s_smt_fp_txd t ; /* pointer to the TxD */
struct s_smt_fp_rxd r ; /* pointer to the RxD */
} ;
/*
* TxD Ring Control struct
*/
struct s_smt_tx_queue {
struct s_smt_fp_txd volatile *tx_curr_put ; /* next free TxD */
struct s_smt_fp_txd volatile *tx_prev_put ; /* shadow put pointer */
struct s_smt_fp_txd volatile *tx_curr_get ; /* next TxD to release*/
u_short tx_free ; /* count of free TxD's */
u_short tx_used ; /* count of used TxD's */
HW_PTR tx_bmu_ctl ; /* BMU addr for tx start */
HW_PTR tx_bmu_dsc ; /* BMU addr for curr dsc. */
} ;
/*
* RxD Ring Control struct
*/
struct s_smt_rx_queue {
struct s_smt_fp_rxd volatile *rx_curr_put ; /* next RxD to queue into */
struct s_smt_fp_rxd volatile *rx_prev_put ; /* shadow put pointer */
struct s_smt_fp_rxd volatile *rx_curr_get ; /* next RxD to fill */
u_short rx_free ; /* count of free RxD's */
u_short rx_used ; /* count of used RxD's */
HW_PTR rx_bmu_ctl ; /* BMU addr for rx start */
HW_PTR rx_bmu_dsc ; /* BMU addr for curr dsc. */
} ;
#define VOID_FRAME_OFF 0x00
#define CLAIM_FRAME_OFF 0x08
#define BEACON_FRAME_OFF 0x10
#define DBEACON_FRAME_OFF 0x18
#define RX_FIFO_OFF 0x21 /* to get a prime number for */
/* the RX_FIFO_SPACE */
#define RBC_MEM_SIZE 0x8000
#define SEND_ASYNC_AS_SYNC 0x1
#define SYNC_TRAFFIC_ON 0x2
/* big FIFO memory */
#define RX_FIFO_SPACE 0x4000 - RX_FIFO_OFF
#define TX_FIFO_SPACE 0x4000
#define TX_SMALL_FIFO 0x0900
#define TX_MEDIUM_FIFO TX_FIFO_SPACE / 2
#define TX_LARGE_FIFO TX_FIFO_SPACE - TX_SMALL_FIFO
#define RX_SMALL_FIFO 0x0900
#define RX_LARGE_FIFO RX_FIFO_SPACE - RX_SMALL_FIFO
struct s_smt_fifo_conf {
u_short rbc_ram_start ; /* FIFO start address */
u_short rbc_ram_end ; /* FIFO size */
u_short rx1_fifo_start ; /* rx queue start address */
u_short rx1_fifo_size ; /* rx queue size */
u_short rx2_fifo_start ; /* rx queue start address */
u_short rx2_fifo_size ; /* rx queue size */
u_short tx_s_start ; /* sync queue start address */
u_short tx_s_size ; /* sync queue size */
u_short tx_a0_start ; /* async queue A0 start address */
u_short tx_a0_size ; /* async queue A0 size */
u_short fifo_config_mode ; /* FIFO configuration mode */
} ;
#define FM_ADDRX (FM_ADDET|FM_EXGPA0|FM_EXGPA1)
struct s_smt_fp {
u_short mdr2init ; /* mode register 2 init value */
u_short mdr3init ; /* mode register 3 init value */
u_short frselreg_init ; /* frame selection register init val */
u_short rx_mode ; /* address mode broad/multi/promisc */
u_short nsa_mode ;
u_short rx_prom ;
u_short exgpa ;
struct err_st err_stats ; /* error statistics */
/*
* MAC buffers
*/
struct fddi_mac_sf { /* special frame build buffer */
u_char mac_fc ;
struct fddi_addr mac_dest ;
struct fddi_addr mac_source ;
u_char mac_info[0x20] ;
} mac_sfb ;
/*
* queues
*/
#define QUEUE_S 0
#define QUEUE_A0 1
#define QUEUE_R1 0
#define QUEUE_R2 1
#define USED_QUEUES 2
/*
* queue pointers; points to the queue dependent variables
*/
struct s_smt_tx_queue *tx[USED_QUEUES] ;
struct s_smt_rx_queue *rx[USED_QUEUES] ;
/*
* queue dependent variables
*/
struct s_smt_tx_queue tx_q[USED_QUEUES] ;
struct s_smt_rx_queue rx_q[USED_QUEUES] ;
/*
* FIFO configuration struct
*/
struct s_smt_fifo_conf fifo ;
/* last formac status */
u_short s2u ;
u_short s2l ;
/* calculated FORMAC+ reg.addr. */
HW_PTR fm_st1u ;
HW_PTR fm_st1l ;
HW_PTR fm_st2u ;
HW_PTR fm_st2l ;
HW_PTR fm_st3u ;
HW_PTR fm_st3l ;
/*
* multicast table
*/
#define FPMAX_MULTICAST 32
#define SMT_MAX_MULTI 4
struct {
struct s_fpmc {
struct fddi_addr a ; /* mc address */
u_char n ; /* usage counter */
u_char perm ; /* flag: permanent */
} table[FPMAX_MULTICAST] ;
} mc ;
struct fddi_addr group_addr ;
u_long func_addr ; /* functional address */
int smt_slots_used ; /* count of table entries for the SMT */
int os_slots_used ; /* count of table entries */
/* used by the os-specific module */
} ;
/*
* modes for mac_set_rx_mode()
*/
#define RX_ENABLE_ALLMULTI 1 /* enable all multicasts */
#define RX_DISABLE_ALLMULTI 2 /* disable "enable all multicasts" */
#define RX_ENABLE_PROMISC 3 /* enable promiscous */
#define RX_DISABLE_PROMISC 4 /* disable promiscous */
#define RX_ENABLE_NSA 5 /* enable reception of NSA frames */
#define RX_DISABLE_NSA 6 /* disable reception of NSA frames */
/*
* support for byte reversal in AIX
* (descriptors and pointers must be byte reversed in memory
* CPU is big endian; M-Channel is little endian)
*/
#ifdef AIX
#define MDR_REV
#define AIX_REVERSE(x) ((((x)<<24L)&0xff000000L) + \
(((x)<< 8L)&0x00ff0000L) + \
(((x)>> 8L)&0x0000ff00L) + \
(((x)>>24L)&0x000000ffL))
#else
#ifndef AIX_REVERSE
#define AIX_REVERSE(x) (x)
#endif
#endif
#ifdef MDR_REV
#define MDR_REVERSE(x) ((((x)<<24L)&0xff000000L) + \
(((x)<< 8L)&0x00ff0000L) + \
(((x)>> 8L)&0x0000ff00L) + \
(((x)>>24L)&0x000000ffL))
#else
#ifndef MDR_REVERSE
#define MDR_REVERSE(x) (x)
#endif
#endif
#endif
+424
View File
@@ -0,0 +1,424 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
#ifndef _HWM_
#define _HWM_
#include "h/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 21
#define RX_DISABLE_PASS_SMT 22
#define RX_ENABLE_PASS_NSA 23
#define RX_DISABLE_PASS_NSA 24
#define RX_ENABLE_PASS_DB 25
#define RX_DISABLE_PASS_DB 26
#define RX_DISABLE_PASS_ALL 27
#define RX_DISABLE_LLC_PROMISC 28
#define RX_ENABLE_LLC_PROMISC 29
#ifndef DMA_RD
#define DMA_RD 1 /* memory -> hw */
#endif
#ifndef DMA_WR
#define DMA_WR 2 /* hw -> memory */
#endif
#define SMT_BUF 0x80
/*
* bits of the frame status byte
*/
#define EN_IRQ_EOF 0x02 /* get IRQ after end of frame transmission */
#define LOC_TX 0x04 /* send frame to the local SMT */
#define LAST_FRAG 0x08 /* last TxD of the frame */
#define FIRST_FRAG 0x10 /* first TxD of the frame */
#define LAN_TX 0x20 /* send frame to network if set */
#define RING_DOWN 0x40 /* error: unable to send, ring down */
#define OUT_OF_TXD 0x80 /* error: not enough TxDs available */
#ifndef NULL
#define NULL 0
#endif
#ifdef LITTLE_ENDIAN
#define HWM_REVERSE(x) (x)
#else
#define HWM_REVERSE(x) ((((x)<<24L)&0xff000000L) + \
(((x)<< 8L)&0x00ff0000L) + \
(((x)>> 8L)&0x0000ff00L) + \
(((x)>>24L)&0x000000ffL))
#endif
#define C_INDIC (1L<<25)
#define A_INDIC (1L<<26)
#define RD_FS_LOCAL 0x80
/*
* DEBUG FLAGS
*/
#define DEBUG_SMTF 1
#define DEBUG_SMT 2
#define DEBUG_ECM 3
#define DEBUG_RMT 4
#define DEBUG_CFM 5
#define DEBUG_PCM 6
#define DEBUG_SBA 7
#define DEBUG_ESS 8
#define DB_HWM_RX 10
#define DB_HWM_TX 11
#define DB_HWM_GEN 12
struct s_mbuf_pool {
#ifndef MB_OUTSIDE_SMC
SMbuf mb[MAX_MBUF] ; /* mbuf pool */
#endif
SMbuf *mb_start ; /* points to the first mb */
SMbuf *mb_free ; /* free queue */
} ;
struct hwm_r {
/*
* hardware modul specific receive variables
*/
u_int len ; /* length of the whole frame */
char *mb_pos ; /* SMbuf receive position */
} ;
struct hw_modul {
/*
* All hardware modul specific variables
*/
struct s_mbuf_pool mbuf_pool ;
struct hwm_r r ;
union s_fp_descr volatile *descr_p ; /* points to the desriptor area */
u_short pass_SMT ; /* pass SMT frames */
u_short pass_NSA ; /* pass all NSA frames */
u_short pass_DB ; /* pass Direct Beacon Frames */
u_short pass_llc_promisc ; /* pass all llc frames (default ON) */
SMbuf *llc_rx_pipe ; /* points to the first queued llc fr */
SMbuf *llc_rx_tail ; /* points to the last queued llc fr */
int queued_rx_frames ; /* number of queued frames */
SMbuf *txd_tx_pipe ; /* points to first mb in the txd ring */
SMbuf *txd_tx_tail ; /* points to last mb in the txd ring */
int queued_txd_mb ; /* number of SMT MBufs in txd ring */
int rx_break ; /* rev. was breaked because ind. off */
int leave_isr ; /* leave fddi_isr immedeately if set */
int isr_flag ; /* set, when HWM is entered from isr */
/*
* varaibles for the current transmit frame
*/
struct s_smt_tx_queue *tx_p ; /* pointer to the transmit queue */
u_long tx_descr ; /* tx descriptor for FORMAC+ */
int tx_len ; /* tx frame length */
SMbuf *tx_mb ; /* SMT tx MBuf pointer */
char *tx_data ; /* data pointer to the SMT tx Mbuf */
int detec_count ; /* counter for out of RxD condition */
u_long rx_len_error ; /* rx len FORMAC != sum of fragments */
} ;
/*
* 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 smc->debug
#else
#define DB_P debug
#endif
#define DB_RX(a,b,c,lev) if (DB_P.d_os.hwm_rx >= (lev)) printf(a,b,c)
#define DB_TX(a,b,c,lev) if (DB_P.d_os.hwm_tx >= (lev)) printf(a,b,c)
#define DB_GEN(a,b,c,lev) if (DB_P.d_os.hwm_gen >= (lev)) printf(a,b,c)
#else /* DEBUG */
#define DB_RX(a,b,c,lev)
#define DB_TX(a,b,c,lev)
#define DB_GEN(a,b,c,lev)
#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) (u_long)AIX_REVERSE((txd)->txd_tbadr)
/*
* 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) ((int)AIX_REVERSE((txd)->txd_tbctrl)& RD_LENGTH)
/*
* 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) (int) (smc)->hw.fp.tx_q[queue].tx_used
/*
* 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) (struct s_smt_fp_txd volatile *)\
(smc)->hw.fp.tx_q[queue].tx_curr_put
/*
* BEGIN_MANUAL_ENTRY(HWM_TX_CHECK)
* void HWM_TX_CHECK(smc,frame_status,low_water)
*
* function MACRO (hardware module, hwmtm.h)
* This macro is invoked by the OS-specific before it left it's
* driver_send function. This macro calls mac_drv_clear_txd
* if the free TxDs of the current transmit queue is equal or
* lower than the given low water mark.
*
* para frame_status status of the frame, see design description
* low_water low water mark of free TxD's
*
* END_MANUAL_ENTRY
*/
#ifndef HWM_NO_FLOW_CTL
#define HWM_TX_CHECK(smc,frame_status,low_water) {\
if ((low_water)>=(smc)->hw.fp.tx_q[(frame_status)&QUEUE_A0].tx_free) {\
mac_drv_clear_txd(smc) ;\
}\
}
#else
#define HWM_TX_CHECK(smc,frame_status,low_water) mac_drv_clear_txd(smc)
#endif
/*
* 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) ((int)AIX_REVERSE((rxd)->rxd_rbctrl)& \
RD_LENGTH)
/*
* 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) (u_long)AIX_REVERSE((rxd)->rxd_rbadr)
/*
* 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) ((int)(smc)->hw.fp.rx_q[QUEUE_R1].rx_used)
/*
* 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) ((int)(smc)->hw.fp.rx_q[QUEUE_R1].rx_free-1)
/*
* 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) (struct s_smt_fp_rxd volatile *)\
(smc)->hw.fp.rx_q[QUEUE_R1].rx_curr_put
/*
* 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
* 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) {\
if ((low_water) >= (smc)->hw.fp.rx_q[QUEUE_R1].rx_used) {\
mac_drv_fill_rxd(smc) ;\
}\
}
#else
#define HWM_RX_CHECK(smc,low_water) mac_drv_fill_rxd(smc)
#endif
#ifndef HWM_EBASE
#define HWM_EBASE 500
#endif
#define HWM_E0001 HWM_EBASE + 1
#define HWM_E0001_MSG "HWM: Wrong size of s_rxd_os struct"
#define HWM_E0002 HWM_EBASE + 2
#define HWM_E0002_MSG "HWM: Wrong size of s_txd_os struct"
#define HWM_E0003 HWM_EBASE + 3
#define HWM_E0003_MSG "HWM: smt_free_mbuf() called with NULL pointer"
#define HWM_E0004 HWM_EBASE + 4
#define HWM_E0004_MSG "HWM: Parity error rx queue 1"
#define HWM_E0005 HWM_EBASE + 5
#define HWM_E0005_MSG "HWM: Encoding error rx queue 1"
#define HWM_E0006 HWM_EBASE + 6
#define HWM_E0006_MSG "HWM: Encoding error async tx queue"
#define HWM_E0007 HWM_EBASE + 7
#define HWM_E0007_MSG "HWM: Encoding error sync tx queue"
#define HWM_E0008 HWM_EBASE + 8
#define HWM_E0008_MSG ""
#define HWM_E0009 HWM_EBASE + 9
#define HWM_E0009_MSG "HWM: Out of RxD condition detected"
#define HWM_E0010 HWM_EBASE + 10
#define HWM_E0010_MSG "HWM: A protocol layer has tried to send a frame with an invalid frame control"
#define HWM_E0011 HWM_EBASE + 11
#define HWM_E0011_MSG "HWM: mac_drv_clear_tx_queue was called although the hardware wasn't stopped"
#define HWM_E0012 HWM_EBASE + 12
#define HWM_E0012_MSG "HWM: mac_drv_clear_rx_queue was called although the hardware wasn't stopped"
#define HWM_E0013 HWM_EBASE + 13
#define HWM_E0013_MSG "HWM: mac_drv_repair_descr was called although the hardware wasn't stopped"
#endif
+84
View File
@@ -0,0 +1,84 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
/*
* Definition of the Error Log Structure
* This structure will be copied into the Error Log buffer
* during the NDIS General Request ReadErrorLog by the MAC Driver
*/
struct s_error_log {
/*
* place holder for token ring adapter error log (zeros)
*/
u_char reserved_0 ; /* byte 0 inside Error Log */
u_char reserved_1 ; /* byte 1 */
u_char reserved_2 ; /* byte 2 */
u_char reserved_3 ; /* byte 3 */
u_char reserved_4 ; /* byte 4 */
u_char reserved_5 ; /* byte 5 */
u_char reserved_6 ; /* byte 6 */
u_char reserved_7 ; /* byte 7 */
u_char reserved_8 ; /* byte 8 */
u_char reserved_9 ; /* byte 9 */
u_char reserved_10 ; /* byte 10 */
u_char reserved_11 ; /* byte 11 */
u_char reserved_12 ; /* byte 12 */
u_char reserved_13 ; /* byte 13 */
/*
* FDDI link statistics
*/
/*
* smt error low
*/
#define SMT_ERL_AEB (1<<15) /* A elast. buffer */
#define SMT_ERL_BLC (1<<14) /* B link error condition */
#define SMT_ERL_ALC (1<<13) /* A link error condition */
#define SMT_ERL_NCC (1<<12) /* not copied condition */
#define SMT_ERL_FEC (1<<11) /* frame error condition */
/*
* smt event low
*/
#define SMT_EVL_NCE (1<<5)
u_short smt_error_low ; /* byte 14/15 */
u_short smt_error_high ; /* byte 16/17 */
u_short smt_event_low ; /* byte 18/19 */
u_short smt_event_high ; /* byte 20/21 */
u_short connection_policy_violation ; /* byte 22/23 */
u_short port_event ; /* byte 24/25 */
u_short set_count_low ; /* byte 26/27 */
u_short set_count_high ; /* byte 28/29 */
u_short aci_id_code ; /* byte 30/31 */
u_short purge_frame_counter ; /* byte 32/33 */
/*
* CMT and RMT state machines
*/
u_short ecm_state ; /* byte 34/35 */
u_short pcm_a_state ; /* byte 36/37 */
u_short pcm_b_state ; /* byte 38/39 */
u_short cfm_state ; /* byte 40/41 */
u_short rmt_state ; /* byte 42/43 */
u_short not_used[30] ; /* byte 44-103 */
u_short ucode_version_level ; /* byte 104/105 */
u_short not_used_1 ; /* byte 106/107 */
u_short not_used_2 ; /* byte 108/109 */
} ;
+54
View File
@@ -0,0 +1,54 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
#ifndef _MBUF_
#define _MBUF_
#ifndef PCI
#define M_SIZE 4550
#else
#define M_SIZE 4504
#endif
#ifndef MAX_MBUF
#define MAX_MBUF 4
#endif
#ifndef NO_STD_MBUF
#define sm_next m_next
#define sm_off m_off
#define sm_len m_len
#define sm_data m_data
#define SMbuf Mbuf
#define mtod smtod
#define mtodoff smtodoff
#endif
struct s_mbuf {
struct s_mbuf *sm_next ; /* low level linked list */
short sm_off ; /* offset in m_data */
u_int sm_len ; /* len of data */
#ifdef PCI
int sm_use_count ;
#endif
char sm_data[M_SIZE] ;
} ;
typedef struct s_mbuf SMbuf ;
/* mbuf head, to typed data */
#define smtod(x,t) ((t)((x)->sm_data + (x)->sm_off))
#define smtodoff(x,t,o) ((t)((x)->sm_data + (o)))
#endif /* _MBUF_ */
+123
View File
@@ -0,0 +1,123 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
/*
* Operating system-dependent definitions that have to be defined
* before any other header files are included.
*/
// HWM (HardWare Module) Definitions
// -----------------------
#ifdef __LITTLE_ENDIAN
#define LITTLE_ENDIAN
#else
#define BIG_ENDIAN
#endif
// this is set in the makefile
// #define PCI /* only PCI adapters supported by this driver */
// #define MEM_MAPPED_IO /* use memory mapped I/O */
#define USE_CAN_ADDR /* DA and SA in MAC header are canonical. */
#define MB_OUTSIDE_SMC /* SMT Mbufs outside of smc struct. */
// -----------------------
// SMT Definitions
// -----------------------
#define SYNC /* allow synchronous frames */
// #define SBA /* Synchronous Bandwidth Allocator support */
/* not available as free source */
#define ESS /* SBA End Station Support */
#define SMT_PANIC(smc, nr, msg) printk(KERN_INFO "SMT PANIC: code: %d, msg: %s\n",nr,msg)
#ifdef DEBUG
#define printf(s,args...) printk(KERN_INFO s, ## args)
#endif
// #define HW_PTR u_long
// -----------------------
// HWM and OS-specific buffer definitions
// -----------------------
// default number of receive buffers.
#define NUM_RECEIVE_BUFFERS 10
// default number of transmit buffers.
#define NUM_TRANSMIT_BUFFERS 10
// Number of SMT buffers (Mbufs).
#define NUM_SMT_BUF 4
// Number of TXDs for asynchronous transmit queue.
#define HWM_ASYNC_TXD_COUNT (NUM_TRANSMIT_BUFFERS + NUM_SMT_BUF)
// Number of TXDs for synchronous transmit queue.
#define HWM_SYNC_TXD_COUNT HWM_ASYNC_TXD_COUNT
// Number of RXDs for receive queue #1.
// Note: Workaround for ASIC Errata #7: One extra RXD is required.
#if (NUM_RECEIVE_BUFFERS > 100)
#define SMT_R1_RXD_COUNT (1 + 100)
#else
#define SMT_R1_RXD_COUNT (1 + NUM_RECEIVE_BUFFERS)
#endif
// Number of RXDs for receive queue #2.
#define SMT_R2_RXD_COUNT 0 // Not used.
// -----------------------
/*
* OS-specific part of the transmit/receive descriptor structure (TXD/RXD).
*
* Note: The size of these structures must follow this rule:
*
* sizeof(struct) + 2*sizeof(void*) == n * 16, n >= 1
*
* We use the dma_addr fields under Linux to keep track of the
* DMA address of the packet data, for later pci_unmap_single. -DaveM
*/
struct s_txd_os { // os-specific part of transmit descriptor
struct sk_buff *skb;
dma_addr_t dma_addr;
} ;
struct s_rxd_os { // os-specific part of receive descriptor
struct sk_buff *skb;
dma_addr_t dma_addr;
} ;
/*
* So we do not need to make too many modifications to the generic driver
* parts, we take advantage of the AIX byte swapping macro interface.
*/
#define AIX_REVERSE(x) ((u32)le32_to_cpu((u32)(x)))
#define MDR_REVERSE(x) ((u32)le32_to_cpu((u32)(x)))
+142
View File
@@ -0,0 +1,142 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
/*
* Synchronous Bandwith Allocation (SBA) structs
*/
#ifndef _SBA_
#define _SBA_
#include "h/mbuf.h"
#include "h/sba_def.h"
#ifdef SBA
/* Timer Cell Template */
struct timer_cell {
struct timer_cell *next_ptr ;
struct timer_cell *prev_ptr ;
u_long start_time ;
struct s_sba_node_vars *node_var ;
} ;
/*
* Node variables
*/
struct s_sba_node_vars {
u_char change_resp_flag ;
u_char report_resp_flag ;
u_char change_req_flag ;
u_char report_req_flag ;
long change_amount ;
long node_overhead ;
long node_payload ;
u_long node_status ;
u_char deallocate_status ;
u_char timer_state ;
u_short report_cnt ;
long lastrep_req_tranid ;
struct fddi_addr mac_address ;
struct s_sba_sessions *node_sessions ;
struct timer_cell timer ;
} ;
/*
* Session variables
*/
struct s_sba_sessions {
u_long deallocate_status ;
long session_overhead ;
u_long min_segment_size ;
long session_payload ;
u_long session_status ;
u_long sba_category ;
long lastchg_req_tranid ;
u_short session_id ;
u_char class ;
u_char fddi2 ;
u_long max_t_neg ;
struct s_sba_sessions *next_session ;
} ;
struct s_sba {
struct s_sba_node_vars node[MAX_NODES] ;
struct s_sba_sessions session[MAX_SESSIONS] ;
struct s_sba_sessions *free_session ; /* points to the first */
/* free session */
struct timer_cell *tail_timer ; /* points to the last timer cell */
/*
* variables for allocation actions
*/
long total_payload ; /* Total Payload */
long total_overhead ; /* Total Overhead */
long sba_allocatable ; /* allocatable sync bandwidth */
/*
* RAF message receive parameters
*/
long msg_path_index ; /* Path Type */
long msg_sba_pl_req ; /* Payload Request */
long msg_sba_ov_req ; /* Overhead Request */
long msg_mib_pl ; /* Current Payload for this Path */
long msg_mib_ov ; /* Current Overhead for this Path*/
long msg_category ; /* Category of the Allocation */
u_long msg_max_t_neg ; /* longest T_Neg acceptable */
u_long msg_min_seg_siz ; /* minimum segement size */
struct smt_header *sm ; /* points to the rec message */
struct fddi_addr *msg_alloc_addr ; /* Allocation Address */
/*
* SBA variables
*/
u_long sba_t_neg ; /* holds the last T_NEG */
long sba_max_alloc ; /* the parsed value of SBAAvailable */
/*
* SBA state machine variables
*/
short sba_next_state ; /* the next state of the SBA */
char sba_command ; /* holds the execuded SBA cmd */
u_char sba_available ; /* parsed value after possible check */
} ;
#endif /* SBA */
/*
* variables for the End Station Support
*/
struct s_ess {
/*
* flags and counters
*/
u_char sync_bw_available ; /* is set if sync bw is allocated */
u_char local_sba_active ; /* set when a local sba is available */
char raf_act_timer_poll ; /* activate the timer to send allc req */
char timer_count ; /* counts every timer function call */
SMbuf *sba_reply_pend ; /* local reply for the sba is pending */
/*
* variables for the ess bandwidth control
*/
long sync_bw ; /* holds the allocaed sync bw */
u_long alloc_trans_id ; /* trans id of the last alloc req */
} ;
#endif
+76
View File
@@ -0,0 +1,76 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
#define PHYS 0 /* physical addr */
#define PERM_ADDR 0x80 /* permanet address */
#define SB_STATIC 0x00000001
#define MAX_PAYLOAD 1562
#define PRIMARY_RING 0x00000001
#ifndef NULL
#define NULL 0x00
#endif
/*********************** SB_Input Variable Values ***********************/
/* may be needed when ever the SBA state machine is called */
#define UNKNOWN_SYNC_SOURCE 0x0001
#define REQ_ALLOCATION 0x0002
#define REPORT_RESP 0x0003
#define CHANGE_RESP 0x0004
#define TNEG 0x0005
#define NIF 0x0006
#define SB_STOP 0x0007
#define SB_START 0x0008
#define REPORT_TIMER 0x0009
#define CHANGE_REQUIRED 0x000A
#define DEFAULT_OV 50
#ifdef SBA
/**************************** SBA STATES *****************************/
#define SBA_STANDBY 0x00000000
#define SBA_ACTIVE 0x00000001
#define SBA_RECOVERY 0x00000002
#define SBA_REPORT 0x00000003
#define SBA_CHANGE 0x00000004
/**************************** OTHERS *********************************/
#define FIFTY_PERCENT 50 /* bytes per second */
#define MAX_SESSIONS 150
#define TWO_MINUTES 13079 /* 9.175 ms/tick */
#define FIFTY_BYTES 50
#define SBA_DENIED 0x0000000D
#define I_NEED_ONE 0x00000000
#define MAX_NODES 50
/*#define T_REPORT 0x59682F00L*/ /* 120s/80ns in Hex */
#define TWO_MIN 120 /* seconds */
#define SBA_ST_UNKNOWN 0x00000002
#define SBA_ST_ACTIVE 0x00000001
#define S_CLEAR 0x00000000L
#define ZERO 0x00000000
#define FULL 0x00000000 /* old: 0xFFFFFFFFF */
#define S_SET 0x00000001L
#define LOW_PRIO 0x02 /* ??????? */
#define OK 0x01 /* ??????? */
#define NOT_OK 0x00 /* ??????? */
/****************************************/
/* deallocate_status[ni][si] values */
/****************************************/
#define TX_CHANGE 0X00000001L
#define PENDING 0x00000002L
#define NONE 0X00000000L
#endif
File diff suppressed because it is too large Load Diff
+123
View File
@@ -0,0 +1,123 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
#ifndef _SKFBIINC_
#define _SKFBIINC_
#include "h/supern_2.h"
/*
* special defines for use into .asm files
*/
#define ERR_FLAGS (FS_MSRABT | FS_SEAC2 | FS_SFRMERR | FS_SFRMTY1)
#ifdef ISA
#define DMA_BUSY_CHECK CSRA
#define IMASK_FAST (IS_PLINT1 | IS_PLINT2 | IS_TIMINT)
#define HRQR (RQAA+(RQ_RRQ<<1))
#define HRQW (RQAA+(RQ_WA2<<1))
#define HRQA0 (RQAA+(RQ_WA0<<1))
#define HRQSQ (RQAA+(RQ_WSQ<<1))
#endif
#ifdef EISA
#define DMA_BUSY_CHECK CSRA
#define DMA_HIGH_WORD 0x0400
#define DMA_MASK_M 0x0a
#define DMA_MODE_M 0x0b
#define DMA_BYTE_PTR_M 0x0c
#define DMA_MASK_S 0x0d4
#define DMA_MODE_S 0x0d6
#define DMA_BYTE_PTR_S 0x0d8
#define IMASK_FAST (IS_PLINT1 | IS_PLINT2 | IS_TIMINT | IS_TC)
#endif /* EISA */
#ifdef MCA
#define IMASK_FAST (IS_PLINT1 | IS_PLINT2 | IS_TIMINT | IS_TOKEN | \
IS_CHCK_L | IS_BUSERR)
#endif
#ifdef PCI
#define IMASK_FAST (IS_PLINT1 | IS_PLINT2 | IS_TIMINT | IS_TOKEN | \
IS_MINTR2 | IS_MINTR3 | IS_R1_P | \
IS_R1_C | IS_XA_C | IS_XS_C)
#endif
#ifdef PCI
#define ISR_MASK (IS_MINTR1 | IS_R1_F | IS_XS_F| IS_XA_F | IMASK_FAST)
#else
#define ISR_MASK (IS_MINTR1 | IS_MINTR2 | IMASK_FAST)
#endif
#define FMA_FM_CMDREG1 FMA(FM_CMDREG1)
#define FMA_FM_CMDREG2 FMA(FM_CMDREG2)
#define FMA_FM_STMCHN FMA(FM_STMCHN)
#define FMA_FM_RPR FMA(FM_RPR)
#define FMA_FM_WPXA0 FMA(FM_WPXA0)
#define FMA_FM_WPXA2 FMA(FM_WPXA2)
#define FMA_FM_MARR FMA(FM_MARR)
#define FMA_FM_MARW FMA(FM_MARW)
#define FMA_FM_MDRU FMA(FM_MDRU)
#define FMA_FM_MDRL FMA(FM_MDRL)
#define FMA_ST1L FMA(FM_ST1L)
#define FMA_ST1U FMA(FM_ST1U)
#define FMA_ST2L FMA(FM_ST2L)
#define FMA_ST2U FMA(FM_ST2U)
#ifdef SUPERNET_3
#define FMA_ST3L FMA(FM_ST3L)
#define FMA_ST3U FMA(FM_ST3U)
#endif
#define TMODE_RRQ RQ_RRQ
#define TMODE_WAQ2 RQ_WA2
#define HSRA HSR(0)
#define FMA_FM_ST1L FMA_ST1L
#define FMA_FM_ST1U FMA_ST1U
#define FMA_FM_ST2L FMA_ST2L
#define FMA_FM_ST2U FMA_ST2U
#ifdef SUPERNET_3
#define FMA_FM_ST3L FMA_ST3L
#define FMA_FM_ST3U FMA_ST3U
#endif
#define FMA_FM_SWPR FMA(FM_SWPR)
#define FMA_FM_RPXA0 FMA(FM_RPXA0)
#define FMA_FM_RPXS FMA(FM_RPXS)
#define FMA_FM_WPXS FMA(FM_WPXS)
#define FMA_FM_IMSK1U FMA(FM_IMSK1U)
#define FMA_FM_IMSK1L FMA(FM_IMSK1L)
#define FMA_FM_EAS FMA(FM_EAS)
#define FMA_FM_EAA0 FMA(FM_EAA0)
#define TMODE_WAQ0 RQ_WA0
#define TMODE_WSQ RQ_WSQ
/* Define default for DRV_PCM_STATE_CHANGE */
#ifndef DRV_PCM_STATE_CHANGE
#define DRV_PCM_STATE_CHANGE(smc,plc,p_state) /* nothing */
#endif
/* Define default for DRV_RMT_INDICATION */
#ifndef DRV_RMT_INDICATION
#define DRV_RMT_INDICATION(smc,i) /* nothing */
#endif
#endif /* n_SKFBIINC_ */
+471
View File
@@ -0,0 +1,471 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 "h/osdef1st.h"
#endif /* OSDEF */
#ifdef OEM_CONCEPT
#include "oemdef.h"
#endif /* OEM_CONCEPT */
#include "h/smt.h"
#include "h/cmtdef.h"
#include "h/fddimib.h"
#include "h/targethw.h" /* all target hw dependencies */
#include "h/targetos.h" /* all target os dependencies */
#ifdef ESS
#include "h/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 {
u_short class ; /* event class */
u_short event ; /* event value */
} ;
/*
* define event queue as circular buffer
*/
#ifdef CONCENTRATOR
#define MAX_EVENT 128
#else /* nCONCENTRATOR */
#define MAX_EVENT 64
#endif /* nCONCENTRATOR */
struct s_queue {
struct event_queue ev_queue[MAX_EVENT];
struct event_queue *ev_put ;
struct event_queue *ev_get ;
} ;
/*
* ECM - Entity Coordination Management
* ecm.c
*/
struct s_ecm {
u_char path_test ; /* ECM path test variable */
u_char sb_flag ; /* ECM stuck bypass */
u_char DisconnectFlag ; /* jd 05-Aug-1999 Bug #10419
* ECM disconnected */
u_char ecm_line_state ; /* flag to dispatcher : line states */
u_long trace_prop ; /* ECM Trace_Prop flag >= 16 bits !! */
/* NUMPHYS note:
* this variable must have enough bits to hold all entiies in
* the station. So NUMPHYS may not be greater than 31.
*/
char ec_pad[2] ;
struct smt_timer ecm_timer ; /* timer */
} ;
/*
* RMT - Ring Management
* rmt.c
*/
struct s_rmt {
u_char dup_addr_test ; /* state of dupl. addr. test */
u_char da_flag ; /* flag : duplicate address det. */
u_char loop_avail ; /* flag : MAC available for loopback */
u_char sm_ma_avail ; /* flag : MAC available for SMT */
u_char no_flag ; /* flag : ring not operational */
u_char bn_flag ; /* flag : MAC reached beacon state */
u_char jm_flag ; /* flag : jamming in NON_OP_DUP */
u_char rm_join ; /* CFM flag RM_Join */
u_char rm_loop ; /* CFM flag RM_Loop */
long fast_rm_join ; /* bit mask of active ports */
/*
* timer and flags
*/
struct smt_timer rmt_timer0 ; /* timer 0 */
struct smt_timer rmt_timer1 ; /* timer 1 */
struct smt_timer rmt_timer2 ; /* timer 2 */
u_char timer0_exp ; /* flag : timer 0 expired */
u_char timer1_exp ; /* flag : timer 1 expired */
u_char timer2_exp ; /* flag : timer 2 expired */
u_char rm_pad1[1] ;
} ;
/*
* CFM - Configuration Management
* cfm.c
* used for SAS and DAS
*/
struct s_cfm {
u_char cf_state; /* CFM state machine current state */
u_char cf_pad[3] ;
} ;
/*
* 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 2 /* Resource is a MAC */
#define SNMP_RES_TYPE_PORT 4 /* Resource is a PORT */
u_long fddimibPATHConfigResourceIndex;
u_long fddimibPATHConfigCurrentPath;
#define SNMP_PATH_ISOLATED 1 /* Current path is isolated */
#define SNMP_PATH_LOCAL 2 /* Current path is local */
#define SNMP_PATH_SECONDARY 3 /* Current path is secondary */
#define SNMP_PATH_PRIMARY 4 /* Current path is primary */
#define SNMP_PATH_CONCATENATED 5 /* Current path is concatenated */
#define SNMP_PATH_THRU 6 /* Current path is thru */
};
#endif
/*
* PCM connect states
*/
#define PCM_DISABLED 0
#define PCM_CONNECTING 1
#define PCM_STANDBY 2
#define PCM_ACTIVE 3
struct s_pcm {
u_char pcm_pad[3] ;
} ;
/*
* PHY struct
* one per physical port
*/
struct s_phy {
/* Inter Module Globals */
struct fddi_mib_p *mib ;
u_char np ; /* index 0 .. NUMPHYS */
u_char cf_join ;
u_char cf_loop ;
u_char wc_flag ; /* withhold connection flag */
u_char pc_mode ; /* Holds the negotiated mode of the PCM */
u_char pc_lem_fail ; /* flag : LCT failed */
u_char lc_test ;
u_char scrub ; /* CFM flag Scrub -> PCM */
char phy_name ;
u_char pmd_type[2] ; /* SK connector/transceiver type codes */
#define PMD_SK_CONN 0 /* pmd_type[PMD_SK_CONN] = Connector */
#define PMD_SK_PMD 1 /* pmd_type[PMD_SK_PMD] = Xver */
u_char pmd_scramble ; /* scrambler on/off */
/* inner Module Globals */
u_char curr_ls ; /* current line state */
u_char ls_flag ;
u_char rc_flag ;
u_char tc_flag ;
u_char td_flag ;
u_char bitn ;
u_char tr_flag ; /* trace recvd while in active */
u_char twisted ; /* flag to indicate an A-A or B-B connection */
u_char t_val[NUMBITS] ; /* transmit bits for signaling */
u_char r_val[NUMBITS] ; /* receive bits for signaling */
u_long t_next[NUMBITS] ;
struct smt_timer pcm_timer0 ;
struct smt_timer pcm_timer1 ;
struct smt_timer pcm_timer2 ;
u_char timer0_exp ;
u_char timer1_exp ;
u_char timer2_exp ;
u_char pcm_pad1[1] ;
int cem_pst ; /* CEM privae state; used for dual homing */
struct lem_counter lem ;
#ifdef AMDPLC
struct s_plc plc ;
#endif
} ;
/*
* timer package
* smttimer.c
*/
struct s_timer {
struct smt_timer *st_queue ;
struct smt_timer st_fast ;
} ;
/*
* SRF types and data
*/
#define SMT_EVENT_BASE 1
#define SMT_EVENT_MAC_PATH_CHANGE (SMT_EVENT_BASE+0)
#define SMT_EVENT_MAC_NEIGHBOR_CHANGE (SMT_EVENT_BASE+1)
#define SMT_EVENT_PORT_PATH_CHANGE (SMT_EVENT_BASE+2)
#define SMT_EVENT_PORT_CONNECTION (SMT_EVENT_BASE+3)
#define SMT_IS_CONDITION(x) ((x)>=SMT_COND_BASE)
#define SMT_COND_BASE (SMT_EVENT_PORT_CONNECTION+1)
#define SMT_COND_SMT_PEER_WRAP (SMT_COND_BASE+0)
#define SMT_COND_SMT_HOLD (SMT_COND_BASE+1)
#define SMT_COND_MAC_FRAME_ERROR (SMT_COND_BASE+2)
#define SMT_COND_MAC_DUP_ADDR (SMT_COND_BASE+3)
#define SMT_COND_MAC_NOT_COPIED (SMT_COND_BASE+4)
#define SMT_COND_PORT_EB_ERROR (SMT_COND_BASE+5)
#define SMT_COND_PORT_LER (SMT_COND_BASE+6)
#define SR0_WAIT 0
#define SR1_HOLDOFF 1
#define SR2_DISABLED 2
struct s_srf {
u_long SRThreshold ; /* threshold value */
u_char RT_Flag ; /* report transmitted flag */
u_char sr_state ; /* state-machine */
u_char any_report ; /* any report required */
u_long TSR ; /* timer */
u_short ring_status ; /* IBM ring status */
} ;
/*
* IBM token ring status
*/
#define RS_RES15 (1<<15) /* reserved */
#define RS_HARDERROR (1<<14) /* ring down */
#define RS_SOFTERROR (1<<13) /* sent SRF */
#define RS_BEACON (1<<12) /* transmitted beacon */
#define RS_PATHTEST (1<<11) /* path test failed */
#define RS_SELFTEST (1<<10) /* selftest required */
#define RS_RES9 (1<< 9) /* reserved */
#define RS_DISCONNECT (1<< 8) /* remote disconnect */
#define RS_RES7 (1<< 7) /* reserved */
#define RS_DUPADDR (1<< 6) /* duplicate address */
#define RS_NORINGOP (1<< 5) /* no ring op */
#define RS_VERSION (1<< 4) /* SMT version mismatch */
#define RS_STUCKBYPASSS (1<< 3) /* stuck bypass */
#define RS_EVENT (1<< 2) /* FDDI event occurred */
#define RS_RINGOPCHANGE (1<< 1) /* ring op changed */
#define RS_RES0 (1<< 0) /* reserved */
#define RS_SET(smc,bit) \
ring_status_indication(smc,smc->srf.ring_status |= bit)
#define RS_CLEAR(smc,bit) \
ring_status_indication(smc,smc->srf.ring_status &= ~bit)
#define RS_CLEAR_EVENT (0xffff & ~(RS_NORINGOP))
/* 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) /* nothing */
#endif
struct s_srf_evc {
u_char evc_code ; /* event code type */
u_char evc_index ; /* index for mult. instances */
u_char evc_rep_required ; /* report required */
u_short evc_para ; /* SMT Para Number */
u_char *evc_cond_state ; /* condition state */
u_char *evc_multiple ; /* multiple occurrence */
} ;
/*
* Values used by frame based services
* smt.c
*/
#define SMT_MAX_TEST 5
#define SMT_TID_NIF 0 /* pending NIF request */
#define SMT_TID_NIF_TEST 1 /* pending NIF test */
#define SMT_TID_ECF_UNA 2 /* pending ECF UNA test */
#define SMT_TID_ECF_DNA 3 /* pending ECF DNA test */
#define SMT_TID_ECF 4 /* pending ECF test */
struct smt_values {
u_long smt_tvu ; /* timer valid una */
u_long smt_tvd ; /* timer valid dna */
u_long smt_tid ; /* transaction id */
u_long pend[SMT_MAX_TEST] ; /* TID of requests */
u_long uniq_time ; /* unique time stamp */
u_short uniq_ticks ; /* unique time stamp */
u_short please_reconnect ; /* flag : reconnect */
u_long smt_last_lem ;
u_long smt_last_notify ;
struct smt_timer smt_timer ; /* SMT NIF timer */
u_long last_tok_time[NUMMACS]; /* token cnt emulation */
} ;
/*
* SMT/CMT configurable parameters
*/
#define SMT_DAS 0 /* dual attach */
#define SMT_SAS 1 /* single attach */
#define SMT_NAC 2 /* null attach concentrator */
struct smt_config {
u_char attach_s ; /* CFM attach to secondary path */
u_char sas ; /* SMT_DAS/SAS/NAC */
u_char build_ring_map ; /* build ringmap if TRUE */
u_char numphys ; /* number of active phys */
u_char sc_pad[1] ;
u_long pcm_tb_min ; /* PCM : TB_Min timer value */
u_long pcm_tb_max ; /* PCM : TB_Max timer value */
u_long pcm_c_min ; /* PCM : C_Min timer value */
u_long pcm_t_out ; /* PCM : T_Out timer value */
u_long pcm_tl_min ; /* PCM : TL_min timer value */
u_long pcm_lc_short ; /* PCM : LC_Short timer value */
u_long pcm_lc_medium ; /* PCM : LC_Medium timer value */
u_long pcm_lc_long ; /* PCM : LC_Long timer value */
u_long pcm_lc_extended ; /* PCM : LC_Extended timer value */
u_long pcm_t_next_9 ; /* PCM : T_Next[9] timer value */
u_long pcm_ns_max ; /* PCM : NS_Max timer value */
u_long ecm_i_max ; /* ECM : I_Max timer value */
u_long ecm_in_max ; /* ECM : IN_Max timer value */
u_long ecm_td_min ; /* ECM : TD_Min timer */
u_long ecm_test_done ; /* ECM : path test done timer */
u_long ecm_check_poll ; /* ECM : check bypass poller */
u_long rmt_t_non_op ; /* RMT : T_Non_OP timer value */
u_long rmt_t_stuck ; /* RMT : T_Stuck timer value */
u_long rmt_t_direct ; /* RMT : T_Direct timer value */
u_long rmt_t_jam ; /* RMT : T_Jam timer value */
u_long rmt_t_announce ; /* RMT : T_Announce timer value */
u_long rmt_t_poll ; /* RMT : claim/beacon poller */
u_long rmt_dup_mac_behavior ; /* Flag for the beavior of SMT if
* a Duplicate MAC Address was detected.
* FALSE: SMT will leave finaly the ring
* TRUE: SMT will reinstert into the ring
*/
u_long mac_d_max ; /* MAC : D_Max timer value */
u_long lct_short ; /* LCT : error threshhold */
u_long lct_medium ; /* LCT : error threshhold */
u_long lct_long ; /* LCT : error threshhold */
u_long lct_extended ; /* LCT : error threshhold */
} ;
#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 {
struct s_smt_os os ; /* os specific */
struct s_smt_hw hw ; /* hardware */
/*
* NOTE: os and hw MUST BE the first two structs
* anything beyond hw WILL BE SET TO ZERO in smt_set_defaults()
*/
struct smt_config s ; /* smt constants */
struct smt_values sm ; /* smt variables */
struct s_ecm e ; /* ecm */
struct s_rmt r ; /* rmt */
struct s_cfm cf ; /* cfm/cem */
#ifdef CONCENTRATOR
struct s_cem ce[NUMPHYS] ; /* cem */
struct s_c_ring cr[NUMPHYS+NUMMACS] ;
#endif
struct s_pcm p ; /* pcm */
struct s_phy y[NUMPHYS] ; /* phy */
struct s_queue q ; /* queue */
struct s_timer t ; /* timer */
struct s_srf srf ; /* SRF */
struct s_srf_evc evcs[6+NUMPHYS*4] ;
struct fddi_mib mib ; /* __THE_MIB__ */
#ifdef SBA
struct s_sba sba ; /* SBA variables */
#endif
#ifdef ESS
struct s_ess ess ; /* Ess variables */
#endif
#if defined(DEBUG) && defined(DEBUG_BRD)
/* If you want all single board to be debugged separately */
struct smt_debug debug; /* Declaration of debug struct */
#endif /* DEBUG_BRD && DEBUG */
} ;
#endif /* _SCMECM_ */

Some files were not shown because too many files have changed in this diff Show More