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