📄 cmtdef.h
字号:
/****************************************************************************** * * (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 _CMTDEF_#define _CMTDEF_/* **************************************************************** *//* * implementation specific constants * MODIIFY THE FOLLWOING THREE DEFINES */#define AMDPLC /* if Amd PLC chip used */#ifdef CONC#define NUMPHYS 12 /* 2 for SAS or DAS, more for Concentrator */#else#ifdef CONC_II#define NUMPHYS 24 /* 2 for SAS or DAS, more for Concentrator */#else#define NUMPHYS 2 /* 2 for SAS or DAS, more for Concentrator */#endif#endif#define NUMMACS 1 /* only 1 supported at the moment */#define NUMPATHS 2 /* primary and secondary path supported *//* * DO NOT MODIFY BEYOND THIS POINT *//* **************************************************************** */#if NUMPHYS > 2#define CONCENTRATOR#endif/* * Definitions for comfortable LINT usage */#ifdef lint#define LINT_USE(x) (x)=(x)#else#define LINT_USE(x)#endif#ifdef DEBUG#define DB_PR(flag,a,b,c) { if (flag) printf(a,b,c) ; }#else#define DB_PR(flag,a,b,c)#endif#ifdef DEBUG_BRD#define DB_ECM(a,b,c) DB_PR((smc->debug.d_smt&1),a,b,c)#define DB_ECMN(n,a,b,c) DB_PR((smc->debug.d_ecm >=(n)),a,b,c)#define DB_RMT(a,b,c) DB_PR((smc->debug.d_smt&2),a,b,c)#define DB_RMTN(n,a,b,c) DB_PR((smc->debug.d_rmt >=(n)),a,b,c)#define DB_CFM(a,b,c) DB_PR((smc->debug.d_smt&4),a,b,c)#define DB_CFMN(n,a,b,c) DB_PR((smc->debug.d_cfm >=(n)),a,b,c)#define DB_PCM(a,b,c) DB_PR((smc->debug.d_smt&8),a,b,c)#define DB_PCMN(n,a,b,c) DB_PR((smc->debug.d_pcm >=(n)),a,b,c)#define DB_SMT(a,b,c) DB_PR((smc->debug.d_smtf),a,b,c)#define DB_SMTN(n,a,b,c) DB_PR((smc->debug.d_smtf >=(n)),a,b,c)#define DB_SBA(a,b,c) DB_PR((smc->debug.d_sba),a,b,c)#define DB_SBAN(n,a,b,c) DB_PR((smc->debug.d_sba >=(n)),a,b,c)#define DB_ESS(a,b,c) DB_PR((smc->debug.d_ess),a,b,c)#define DB_ESSN(n,a,b,c) DB_PR((smc->debug.d_ess >=(n)),a,b,c)#else#define DB_ECM(a,b,c) DB_PR((debug.d_smt&1),a,b,c)#define DB_ECMN(n,a,b,c) DB_PR((debug.d_ecm >=(n)),a,b,c)#define DB_RMT(a,b,c) DB_PR((debug.d_smt&2),a,b,c)#define DB_RMTN(n,a,b,c) DB_PR((debug.d_rmt >=(n)),a,b,c)#define DB_CFM(a,b,c) DB_PR((debug.d_smt&4),a,b,c)#define DB_CFMN(n,a,b,c) DB_PR((debug.d_cfm >=(n)),a,b,c)#define DB_PCM(a,b,c) DB_PR((debug.d_smt&8),a,b,c)#define DB_PCMN(n,a,b,c) DB_PR((debug.d_pcm >=(n)),a,b,c)#define DB_SMT(a,b,c) DB_PR((debug.d_smtf),a,b,c)#define DB_SMTN(n,a,b,c) DB_PR((debug.d_smtf >=(n)),a,b,c)#define DB_SBA(a,b,c) DB_PR((debug.d_sba),a,b,c)#define DB_SBAN(n,a,b,c) DB_PR((debug.d_sba >=(n)),a,b,c)#define DB_ESS(a,b,c) DB_PR((debug.d_ess),a,b,c)#define DB_ESSN(n,a,b,c) DB_PR((debug.d_ess >=(n)),a,b,c)#endif#ifndef SS_NOT_DS#define SK_LOC_DECL(type,var) type var#else#define SK_LOC_DECL(type,var) static type var#endif/* * PHYs and PORTS * Note: Don't touch the definition of PA and PB. Those might be used * by some "for" loops. */#define PA 0#define PB 1#if defined(SUPERNET_3) || defined(CONC_II)/* * The port indices have to be different, * because the MAC output goes through the 2. PLC * Conc II: It has to be the first port in the row. */#define PS 0 /* Internal PLC which is the same as PA */#else#define PS 1#endif#define PM 2 /* PM .. PA+NUM_PHYS-1 *//* * PHY types - as in path descriptor 'fddiPHYType' */#define TA 0 /* A port */#define TB 1 /* B port */#define TS 2 /* S port */#define TM 3 /* M port */#define TNONE 4/* * indexes in MIB */#define INDEX_MAC 1#define INDEX_PATH 1#define INDEX_PORT 1/* * policies */#define POLICY_AA (1<<0) /* reject AA */#define POLICY_AB (1<<1) /* reject AB */#define POLICY_AS (1<<2) /* reject AS */#define POLICY_AM (1<<3) /* reject AM */#define POLICY_BA (1<<4) /* reject BA */#define POLICY_BB (1<<5) /* reject BB */#define POLICY_BS (1<<6) /* reject BS */#define POLICY_BM (1<<7) /* reject BM */#define POLICY_SA (1<<8) /* reject SA */#define POLICY_SB (1<<9) /* reject SB */#define POLICY_SS (1<<10) /* reject SS */#define POLICY_SM (1<<11) /* reject SM */#define POLICY_MA (1<<12) /* reject MA */#define POLICY_MB (1<<13) /* reject MB */#define POLICY_MS (1<<14) /* reject MS */#define POLICY_MM (1<<15) /* reject MM *//* * commands *//* * EVENTS * event classes */#define EVENT_ECM 1 /* event class ECM */#define EVENT_CFM 2 /* event class CFM */#define EVENT_RMT 3 /* event class RMT */#define EVENT_SMT 4 /* event class SMT */#define EVENT_PCM 5 /* event class PCM */#define EVENT_PCMA 5 /* event class PCMA */#define EVENT_PCMB 6 /* event class PCMB *//* WARNING : * EVENT_PCM* must be last in the above list * if more than two ports are used, EVENT_PCM .. EVENT_PCMA+NUM_PHYS-1 * are used ! */#define EV_TOKEN(class,event) (((u_long)(class)<<16L)|((u_long)(event)))#define EV_T_CLASS(token) ((int)((token)>>16)&0xffff)#define EV_T_EVENT(token) ((int)(token)&0xffff)/* * ECM events */#define EC_CONNECT 1 /* connect request */#define EC_DISCONNECT 2 /* disconnect request */#define EC_TRACE_PROP 3 /* trace propagation */#define EC_PATH_TEST 4 /* path test */#define EC_TIMEOUT_TD 5 /* timer TD_min */#define EC_TIMEOUT_TMAX 6 /* timer trace_max */#define EC_TIMEOUT_IMAX 7 /* timer I_max */#define EC_TIMEOUT_INMAX 8 /* timer IN_max */#define EC_TEST_DONE 9 /* path test done *//* * CFM events */#define CF_LOOP 1 /* cf_loop flag from PCM */#define CF_LOOP_A 1 /* cf_loop flag from PCM */#define CF_LOOP_B 2 /* cf_loop flag from PCM */#define CF_JOIN 3 /* cf_join flag from PCM */#define CF_JOIN_A 3 /* cf_join flag from PCM */#define CF_JOIN_B 4 /* cf_join flag from PCM *//* * PCM events */#define PC_START 1#define PC_STOP 2#define PC_LOOP 3#define PC_JOIN 4#define PC_SIGNAL 5#define PC_REJECT 6#define PC_MAINT 7#define PC_TRACE 8#define PC_PDR 9#define PC_ENABLE 10#define PC_DISABLE 11/* * must be ordered as in LineStateType */#define PC_QLS 12#define PC_ILS 13#define PC_MLS 14#define PC_HLS 15#define PC_LS_PDR 16#define PC_LS_NONE 17#define LS2MIB(x) ((x)-PC_QLS)#define MIB2LS(x) ((x)+PC_QLS)#define PC_TIMEOUT_TB_MAX 18 /* timer TB_max */#define PC_TIMEOUT_TB_MIN 19 /* timer TB_min */#define PC_TIMEOUT_C_MIN 20 /* timer C_Min */#define PC_TIMEOUT_T_OUT 21 /* timer T_Out */#define PC_TIMEOUT_TL_MIN 22 /* timer TL_Min */#define PC_TIMEOUT_T_NEXT 23 /* timer t_next[] */#define PC_TIMEOUT_LCT 24#define PC_NSE 25 /* NOISE hardware timer */#define PC_LEM 26 /* LEM done *//* * RMT events meaning from */#define RM_RING_OP 1 /* ring operational MAC */#define RM_RING_NON_OP 2 /* ring not operational MAC */#define RM_MY_BEACON 3 /* recvd my beacon MAC */#define RM_OTHER_BEACON 4 /* recvd other beacon MAC */#define RM_MY_CLAIM 5 /* recvd my claim MAC */#define RM_TRT_EXP 6 /* TRT exp MAC */#define RM_VALID_CLAIM 7 /* claim from dup addr MAC */#define RM_JOIN 8 /* signal rm_join CFM */#define RM_LOOP 9 /* signal rm_loop CFM */#define RM_DUP_ADDR 10 /* dup_addr_test hange SMT-NIF */#define RM_ENABLE_FLAG 11 /* enable flag */#define RM_TIMEOUT_NON_OP 12 /* timeout T_Non_OP */#define RM_TIMEOUT_T_STUCK 13 /* timeout T_Stuck */#define RM_TIMEOUT_ANNOUNCE 14 /* timeout T_Announce */#define RM_TIMEOUT_T_DIRECT 15 /* timeout T_Direct */#define RM_TIMEOUT_D_MAX 16 /* timeout D_Max */#define RM_TIMEOUT_POLL 17 /* claim/beacon poller */#define RM_TX_STATE_CHANGE 18 /* To restart timer for D_Max *//* * SMT events */#define SM_TIMER 1 /* timer */#define SM_FAST 2 /* smt_force_irq *//* PC modes */#define PM_NONE 0#define PM_PEER 1#define PM_TREE 2/* * PCM withhold codes * MIB PC-WithholdType ENUM */#define PC_WH_NONE 0 /* ok */#define PC_WH_M_M 1 /* M to M */#define PC_WH_OTHER 2 /* other incompatible phys */#define PC_WH_PATH 3 /* path not available *//* * LCT duration */#define LC_SHORT 1 /* short LCT */#define LC_MEDIUM 2 /* medium LCT */#define LC_LONG 3 /* long LCT */#define LC_EXTENDED 4 /* extended LCT *//* * path_test values */#define PT_NONE 0#define PT_TESTING 1 /* test is running */#define PT_PASSED 2 /* test passed */#define PT_FAILED 3 /* test failed */#define PT_PENDING 4 /* path test follows */#define PT_EXITING 5 /* disconnected while in trace/leave *//* * duplicate address test * MIB DupAddressTest ENUM */#define DA_NONE 0 /* */#define DA_PASSED 1 /* test passed */#define DA_FAILED 2 /* test failed *//* * optical bypass */#define BP_DEINSERT 0 /* disable bypass */#define BP_INSERT 1 /* enable bypass *//* * ODL enable/disable */#define PM_TRANSMIT_DISABLE 0 /* disable xmit */#define PM_TRANSMIT_ENABLE 1 /* enable xmit *//* * parameter for config_mux * note : number is index in config_endec table ! */#define MUX_THRUA 0 /* through A */#define MUX_THRUB 1 /* through B */#define MUX_WRAPA 2 /* wrap A */#define MUX_WRAPB 3 /* wrap B */#define MUX_ISOLATE 4 /* isolated */#define MUX_WRAPS 5 /* SAS *//* * MAC control */#define MA_RESET 0#define MA_BEACON 1#define MA_CLAIM 2#define MA_DIRECTED 3 /* directed beacon */#define MA_TREQ 4 /* change T_Req */#define MA_OFFLINE 5 /* switch MAC to offline *//* * trace prop * bit map for trace propagation */#define ENTITY_MAC (NUMPHYS)#define ENTITY_PHY(p) (p)#define ENTITY_BIT(m) (1<<(m))/* * Resource Tag Types */#define PATH_ISO 0 /* isolated */#define PATH_PRIM 3 /* primary path */#define PATH_THRU 5 /* through path */#define RES_MAC 2 /* resource type MAC */#define RES_PORT 4 /* resource type PORT *//* * CFM state * oops: MUST MATCH CF-StateType in SMT7.2 ! */#define SC0_ISOLATED 0 /* isolated */#define SC1_WRAP_A 5 /* wrap A (not used) */#define SC2_WRAP_B 6 /* wrap B (not used) */#define SC4_THRU_A 12 /* through A */#define SC5_THRU_B 7 /* through B (used in SMT 6.2) */#define SC7_WRAP_S 8 /* SAS (not used) */#define SC9_C_WRAP_A 9 /* c wrap A */#define SC10_C_WRAP_B 10 /* c wrap B */#define SC11_C_WRAP_S 11 /* c wrap S *//* * convert MIB time in units of 80nS to uS */#define MIB2US(t) ((t)/12)#define SEC2MIB(s) ((s)*12500000L)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -