xref: /openbmc/linux/drivers/net/fddi/skfp/h/fddimib.h (revision 9b9c2cd4)
1 /******************************************************************************
2  *
3  *	(C)Copyright 1998,1999 SysKonnect,
4  *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
5  *
6  *	This program is free software; you can redistribute it and/or modify
7  *	it under the terms of the GNU General Public License as published by
8  *	the Free Software Foundation; either version 2 of the License, or
9  *	(at your option) any later version.
10  *
11  *	The information in this file is provided "AS IS" without warranty.
12  *
13  ******************************************************************************/
14 
15 /*
16  * FDDI MIB
17  */
18 
19 /*
20  * typedefs
21  */
22 
23 typedef	u_long	Counter ;
24 typedef u_char	TimeStamp[8] ;
25 typedef struct fddi_addr LongAddr ;
26 typedef	u_long	Timer_2 ;
27 typedef	u_long	Timer ;
28 typedef	u_short	ResId ;
29 typedef u_short	SMTEnum ;
30 typedef	u_char	SMTFlag ;
31 
32 typedef struct {
33 	Counter		count ;
34 	TimeStamp	timestamp ;
35 } SetCountType ;
36 
37 /*
38  * bits for bit string "available_path"
39  */
40 #define MIB_PATH_P	(1<<0)
41 #define MIB_PATH_S	(1<<1)
42 #define MIB_PATH_L	(1<<2)
43 
44 /*
45  * bits for bit string PermittedPaths & RequestedPaths (SIZE(8))
46  */
47 #define MIB_P_PATH_LOCAL	(1<<0)
48 #define MIB_P_PATH_SEC_ALTER	(1<<1)
49 #define MIB_P_PATH_PRIM_ALTER	(1<<2)
50 #define MIB_P_PATH_CON_ALTER	(1<<3)
51 #define MIB_P_PATH_SEC_PREFER	(1<<4)
52 #define MIB_P_PATH_PRIM_PREFER	(1<<5)
53 #define MIB_P_PATH_CON_PREFER	(1<<6)
54 #define MIB_P_PATH_THRU		(1<<7)
55 
56 /*
57  * enum current path
58  */
59 #define MIB_PATH_ISOLATED	0
60 #define MIB_PATH_LOCAL		1
61 #define MIB_PATH_SECONDARY	2
62 #define MIB_PATH_PRIMARY	3
63 #define MIB_PATH_CONCATENATED	4
64 #define MIB_PATH_THRU		5
65 
66 /*
67  * enum PMDClass
68  */
69 #define MIB_PMDCLASS_MULTI	0
70 #define MIB_PMDCLASS_SINGLE1	1
71 #define MIB_PMDCLASS_SINGLE2	2
72 #define MIB_PMDCLASS_SONET	3
73 #define MIB_PMDCLASS_LCF	4
74 #define MIB_PMDCLASS_TP		5
75 #define MIB_PMDCLASS_UNKNOWN	6
76 #define MIB_PMDCLASS_UNSPEC	7
77 
78 /*
79  * enum SMTStationStatus
80  */
81 #define MIB_SMT_STASTA_CON	0
82 #define MIB_SMT_STASTA_SEPA	1
83 #define MIB_SMT_STASTA_THRU	2
84 
85 
86 struct fddi_mib {
87 	/*
88 	 * private
89 	 */
90 	u_char			fddiPRPMFPasswd[8] ;
91 	struct smt_sid		fddiPRPMFStation ;
92 
93 #ifdef	ESS
94 	/*
95 	 * private variables for static allocation of the
96 	 * End Station Support
97 	 */
98 	u_long	fddiESSPayload ;	/* payload for static alloc */
99 	u_long	fddiESSOverhead ;	/* frame ov for static alloc */
100 	u_long	fddiESSMaxTNeg ;	/* maximum of T-NEG */
101 	u_long	fddiESSMinSegmentSize ;	/* min size of the sync frames */
102 	u_long	fddiESSCategory ;	/* category for the Alloc req */
103 	short	fddiESSSynchTxMode ;	/* send all LLC frames as sync */
104 #endif	/* ESS */
105 #ifdef	SBA
106 	/*
107 	 * private variables for the Synchronous Bandwidth Allocator
108 	 */
109 	char	fddiSBACommand ;	/* holds the parsed SBA cmd */
110 	u_char	fddiSBAAvailable ;	/* SBA allocatable value */
111 #endif	/* SBA */
112 
113 	/*
114 	 * SMT standard mib
115 	 */
116 	struct smt_sid		fddiSMTStationId ;
117 	u_short			fddiSMTOpVersionId ;
118 	u_short			fddiSMTHiVersionId ;
119 	u_short			fddiSMTLoVersionId ;
120 	u_char			fddiSMTManufacturerData[32] ;
121 	u_char			fddiSMTUserData[32] ;
122 	u_short			fddiSMTMIBVersionId ;
123 
124 	/*
125 	 * ConfigGrp
126 	 */
127 	u_char			fddiSMTMac_Ct ;
128 	u_char			fddiSMTNonMaster_Ct ;
129 	u_char			fddiSMTMaster_Ct ;
130 	u_char			fddiSMTAvailablePaths ;
131 	u_short			fddiSMTConfigCapabilities ;
132 	u_short			fddiSMTConfigPolicy ;
133 	u_short			fddiSMTConnectionPolicy ;
134 	u_short			fddiSMTTT_Notify ;
135 	u_char			fddiSMTStatRptPolicy ;
136 	u_long			fddiSMTTrace_MaxExpiration ;
137 	u_short			fddiSMTPORTIndexes[NUMPHYS] ;
138 	u_short			fddiSMTMACIndexes ;
139 	u_char			fddiSMTBypassPresent ;
140 
141 	/*
142 	 * StatusGrp
143 	 */
144 	SMTEnum			fddiSMTECMState ;
145 	SMTEnum			fddiSMTCF_State ;
146 	SMTEnum			fddiSMTStationStatus ;
147 	u_char			fddiSMTRemoteDisconnectFlag ;
148 	u_char			fddiSMTPeerWrapFlag ;
149 
150 	/*
151 	 * MIBOperationGrp
152 	 */
153 	TimeStamp		fddiSMTTimeStamp ;
154 	TimeStamp		fddiSMTTransitionTimeStamp ;
155 	SetCountType		fddiSMTSetCount ;
156 	struct smt_sid		fddiSMTLastSetStationId ;
157 
158 	struct fddi_mib_m {
159 		u_short		fddiMACFrameStatusFunctions ;
160 		Timer_2		fddiMACT_MaxCapabilitiy ;
161 		Timer_2		fddiMACTVXCapabilitiy ;
162 
163 		/* ConfigGrp */
164 		u_char		fddiMACMultiple_N ;	/* private */
165 		u_char		fddiMACMultiple_P ;	/* private */
166 		u_char		fddiMACDuplicateAddressCond ;/* private */
167 		u_char		fddiMACAvailablePaths ;
168 		u_short		fddiMACCurrentPath ;
169 		LongAddr	fddiMACUpstreamNbr ;
170 		LongAddr	fddiMACDownstreamNbr ;
171 		LongAddr	fddiMACOldUpstreamNbr ;
172 		LongAddr	fddiMACOldDownstreamNbr ;
173 		SMTEnum		fddiMACDupAddressTest ;
174 		u_short		fddiMACRequestedPaths ;
175 		SMTEnum		fddiMACDownstreamPORTType ;
176 		ResId		fddiMACIndex ;
177 
178 		/* AddressGrp */
179 		LongAddr	fddiMACSMTAddress ;
180 
181 		/* OperationGrp */
182 		Timer_2		fddiMACT_Min ;	/* private */
183 		Timer_2		fddiMACT_ReqMIB ;
184 		Timer_2		fddiMACT_Req ;	/* private */
185 		Timer_2		fddiMACT_Neg ;
186 		Timer_2		fddiMACT_MaxMIB ;
187 		Timer_2		fddiMACT_Max ;	/* private */
188 		Timer_2		fddiMACTvxValueMIB ;
189 		Timer_2		fddiMACTvxValue ; /* private */
190 		Timer_2		fddiMACT_Pri0 ;
191 		Timer_2		fddiMACT_Pri1 ;
192 		Timer_2		fddiMACT_Pri2 ;
193 		Timer_2		fddiMACT_Pri3 ;
194 		Timer_2		fddiMACT_Pri4 ;
195 		Timer_2		fddiMACT_Pri5 ;
196 		Timer_2		fddiMACT_Pri6 ;
197 
198 		/* CountersGrp */
199 		Counter		fddiMACFrame_Ct ;
200 		Counter		fddiMACCopied_Ct ;
201 		Counter		fddiMACTransmit_Ct ;
202 		Counter		fddiMACToken_Ct ;
203 		Counter		fddiMACError_Ct ;
204 		Counter		fddiMACLost_Ct ;
205 		Counter		fddiMACTvxExpired_Ct ;
206 		Counter		fddiMACNotCopied_Ct ;
207 		Counter		fddiMACRingOp_Ct ;
208 
209 		Counter		fddiMACSMTCopied_Ct ;		/* private */
210 		Counter		fddiMACSMTTransmit_Ct ;		/* private */
211 
212 		/* private for delta ratio */
213 		Counter		fddiMACOld_Frame_Ct ;
214 		Counter		fddiMACOld_Copied_Ct ;
215 		Counter		fddiMACOld_Error_Ct ;
216 		Counter		fddiMACOld_Lost_Ct ;
217 		Counter		fddiMACOld_NotCopied_Ct ;
218 
219 		/* FrameErrorConditionGrp */
220 		u_short		fddiMACFrameErrorThreshold ;
221 		u_short		fddiMACFrameErrorRatio ;
222 
223 		/* NotCopiedConditionGrp */
224 		u_short		fddiMACNotCopiedThreshold ;
225 		u_short		fddiMACNotCopiedRatio ;
226 
227 		/* StatusGrp */
228 		SMTEnum		fddiMACRMTState ;
229 		SMTFlag		fddiMACDA_Flag ;
230 		SMTFlag		fddiMACUNDA_Flag ;
231 		SMTFlag		fddiMACFrameErrorFlag ;
232 		SMTFlag		fddiMACNotCopiedFlag ;
233 		SMTFlag		fddiMACMA_UnitdataAvailable ;
234 		SMTFlag		fddiMACHardwarePresent ;
235 		SMTFlag		fddiMACMA_UnitdataEnable ;
236 
237 	} m[NUMMACS] ;
238 #define MAC0	0
239 
240 	struct fddi_mib_a {
241 		ResId		fddiPATHIndex ;
242 		u_long		fddiPATHSbaPayload ;
243 		u_long		fddiPATHSbaOverhead ;
244 		/* fddiPATHConfiguration is built on demand */
245 		/* u_long		fddiPATHConfiguration ; */
246 		Timer		fddiPATHT_Rmode ;
247 		u_long		fddiPATHSbaAvailable ;
248 		Timer_2		fddiPATHTVXLowerBound ;
249 		Timer_2		fddiPATHT_MaxLowerBound ;
250 		Timer_2		fddiPATHMaxT_Req ;
251 	} a[NUMPATHS] ;
252 #define PATH0	0
253 
254 	struct fddi_mib_p {
255 		/* ConfigGrp */
256 		SMTEnum		fddiPORTMy_Type ;
257 		SMTEnum		fddiPORTNeighborType ;
258 		u_char		fddiPORTConnectionPolicies ;
259 		struct {
260 			u_char	T_val ;
261 			u_char	R_val ;
262 		} fddiPORTMacIndicated ;
263 		SMTEnum		fddiPORTCurrentPath ;
264 		/* must be 4: is 32 bit in SMT format
265 		 * indices :
266 		 *	1	none
267 		 *	2	tree
268 		 *	3	peer
269 		 */
270 		u_char		fddiPORTRequestedPaths[4] ;
271 		u_short		fddiPORTMACPlacement ;
272 		u_char		fddiPORTAvailablePaths ;
273 		u_char		fddiPORTConnectionCapabilities ;
274 		SMTEnum		fddiPORTPMDClass ;
275 		ResId		fddiPORTIndex ;
276 
277 		/* OperationGrp */
278 		SMTEnum		fddiPORTMaint_LS ;
279 		SMTEnum		fddiPORTPC_LS ;
280 		u_char		fddiPORTBS_Flag ;
281 
282 		/* ErrorCtrsGrp */
283 		Counter		fddiPORTLCTFail_Ct ;
284 		Counter		fddiPORTEBError_Ct ;
285 		Counter		fddiPORTOldEBError_Ct ;
286 
287 		/* LerGrp */
288 		Counter		fddiPORTLem_Reject_Ct ;
289 		Counter		fddiPORTLem_Ct ;
290 		u_char		fddiPORTLer_Estimate ;
291 		u_char		fddiPORTLer_Cutoff ;
292 		u_char		fddiPORTLer_Alarm ;
293 
294 		/* StatusGrp */
295 		SMTEnum		fddiPORTConnectState ;
296 		SMTEnum		fddiPORTPCMState ;	/* real value */
297 		SMTEnum		fddiPORTPCMStateX ;	/* value for MIB */
298 		SMTEnum		fddiPORTPC_Withhold ;
299 		SMTFlag		fddiPORTHardwarePresent ;
300 		u_char		fddiPORTLerFlag ;
301 
302 		u_char		fddiPORTMultiple_U ;	/* private */
303 		u_char		fddiPORTMultiple_P ;	/* private */
304 		u_char		fddiPORTEB_Condition ;	/* private */
305 	} p[NUMPHYS] ;
306 	struct {
307 		Counter		fddiPRIVECF_Req_Rx ;	/* ECF req received */
308 		Counter		fddiPRIVECF_Reply_Rx ;	/* ECF repl received */
309 		Counter		fddiPRIVECF_Req_Tx ;	/* ECF req transm */
310 		Counter		fddiPRIVECF_Reply_Tx ;	/* ECF repl transm */
311 		Counter		fddiPRIVPMF_Get_Rx ;	/* PMF Get rec */
312 		Counter		fddiPRIVPMF_Set_Rx ;	/* PMF Set rec */
313 		Counter		fddiPRIVRDF_Rx ;	/* RDF received */
314 		Counter		fddiPRIVRDF_Tx ;	/* RDF transmitted */
315 	} priv ;
316 } ;
317 
318 /*
319  * OIDs for statistics
320  */
321 #define	SMT_OID_CF_STATE	1	/* fddiSMTCF_State */
322 #define	SMT_OID_PCM_STATE_A	2	/* fddiPORTPCMState port A */
323 #define	SMT_OID_PCM_STATE_B	17	/* fddiPORTPCMState port B */
324 #define	SMT_OID_RMT_STATE	3	/* fddiMACRMTState */
325 #define	SMT_OID_UNA		4	/* fddiMACUpstreamNbr */
326 #define	SMT_OID_DNA		5	/* fddiMACOldDownstreamNbr */
327 #define	SMT_OID_ERROR_CT	6	/* fddiMACError_Ct */
328 #define	SMT_OID_LOST_CT		7	/* fddiMACLost_Ct */
329 #define	SMT_OID_LEM_CT		8	/* fddiPORTLem_Ct */
330 #define	SMT_OID_LEM_CT_A	11	/* fddiPORTLem_Ct port A */
331 #define	SMT_OID_LEM_CT_B	12	/* fddiPORTLem_Ct port B */
332 #define	SMT_OID_LCT_FAIL_CT	9	/* fddiPORTLCTFail_Ct */
333 #define	SMT_OID_LCT_FAIL_CT_A	13	/* fddiPORTLCTFail_Ct port A */
334 #define	SMT_OID_LCT_FAIL_CT_B	14	/* fddiPORTLCTFail_Ct port B */
335 #define	SMT_OID_LEM_REJECT_CT	10	/* fddiPORTLem_Reject_Ct */
336 #define	SMT_OID_LEM_REJECT_CT_A	15	/* fddiPORTLem_Reject_Ct port A */
337 #define	SMT_OID_LEM_REJECT_CT_B	16	/* fddiPORTLem_Reject_Ct port B */
338 
339 /*
340  * SK MIB
341  */
342 #define SMT_OID_ECF_REQ_RX	20	/* ECF requests received */
343 #define SMT_OID_ECF_REPLY_RX	21	/* ECF replies received */
344 #define SMT_OID_ECF_REQ_TX	22	/* ECF requests transmitted */
345 #define SMT_OID_ECF_REPLY_TX	23	/* ECF replies transmitted */
346 #define SMT_OID_PMF_GET_RX	24	/* PMF get requests received */
347 #define SMT_OID_PMF_SET_RX	25	/* PMF set requests received */
348 #define SMT_OID_RDF_RX		26	/* RDF received */
349 #define SMT_OID_RDF_TX		27	/* RDF transmitted */
350