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 *	SMT 7.2 frame definitions
17 */
18
19#ifndef	_SMT_
20#define _SMT_
21
22/* #define SMT5_10 */
23#define SMT6_10
24#define SMT7_20
25
26#define	OPT_PMF		/* if parameter management is supported */
27#define	OPT_SRF		/* if status report is supported */
28
29/*
30 * SMT frame version 5.1
31 */
32
33#define SMT_VID	0x0001			/* V 5.1 .. 6.1 */
34#define SMT_VID_2 0x0002		/* V 7.2 */
35
36struct smt_sid {
37	u_char	sid_oem[2] ;			/* implementation spec. */
38	struct fddi_addr sid_node ;		/* node address */
39} ;
40
41typedef u_char	t_station_id[8] ;
42
43/*
44 * note on alignment :
45 * sizeof(struct smt_header) = 32
46 * all parameters are long aligned
47 * if struct smt_header starts at offset 0, all longs are aligned correctly
48 * (FC starts at offset 3)
49 */
50_packed struct smt_header {
51	struct fddi_addr    	smt_dest ;	/* destination address */
52	struct fddi_addr	smt_source ;	/* source address */
53	u_char			smt_class ;	/* NIF, SIF ... */
54	u_char			smt_type ;	/* req., response .. */
55	u_short			smt_version ;	/* version id */
56	u_int			smt_tid ;	/* transaction ID */
57	struct smt_sid		smt_sid ;	/* station ID */
58	u_short			smt_pad ;	/* pad with 0 */
59	u_short			smt_len ;	/* length of info field */
60} ;
61#define SWAP_SMTHEADER	"662sl8ss"
62
63
64
65/*
66 * type codes
67 */
68#define SMT_ANNOUNCE	0x01		/* announcement */
69#define SMT_REQUEST	0x02		/* request */
70#define SMT_REPLY	0x03		/* reply */
71
72/*
73 * class codes
74 */
75#define SMT_NIF		0x01		/* neighbor information frames */
76#define SMT_SIF_CONFIG	0x02		/* station information configuration */
77#define SMT_SIF_OPER	0x03		/* station information operation */
78#define SMT_ECF		0x04		/* echo frames */
79#define SMT_RAF		0x05		/* resource allocation */
80#define SMT_RDF		0x06		/* request denied */
81#define SMT_SRF		0x07		/* status report */
82#define SMT_PMF_GET	0x08		/* parameter management get */
83#define SMT_PMF_SET	0x09		/* parameter management set */
84#define SMT_ESF		0xff		/* extended service */
85
86#define SMT_MAX_ECHO_LEN	4458	/* max length of SMT Echo */
87#if	defined(CONC) || defined(CONC_II)
88#define SMT_TEST_ECHO_LEN	50	/* test length of SMT Echo */
89#else
90#define SMT_TEST_ECHO_LEN	SMT_MAX_ECHO_LEN	/* test length */
91#endif
92
93#define SMT_MAX_INFO_LEN	(4352-20)	/* max length for SMT info */
94
95
96/*
97 * parameter types
98 */
99
100struct smt_para {
101	u_short	p_type ;		/* type */
102	u_short	p_len ;			/* length of parameter */
103} ;
104
105#define PARA_LEN	(sizeof(struct smt_para))
106
107#define SMTSETPARA(p,t)		(p)->para.p_type = (t),\
108				(p)->para.p_len = sizeof(*(p)) - PARA_LEN
109
110/*
111 * P01 : Upstream Neighbor Address, UNA
112 */
113#define SMT_P_UNA	0x0001		/* upstream neighbor address */
114#define SWAP_SMT_P_UNA	"s6"
115
116struct smt_p_una {
117	struct smt_para	para ;		/* generic parameter header */
118	u_short	una_pad ;
119	struct fddi_addr una_node ;	/* node address, zero if unknown */
120} ;
121
122/*
123 * P02 : Station Descriptor
124 */
125#define SMT_P_SDE	0x0002		/* station descriptor */
126#define SWAP_SMT_P_SDE	"1111"
127
128#define SMT_SDE_STATION		0	/* end node */
129#define SMT_SDE_CONCENTRATOR	1	/* concentrator */
130
131struct smt_p_sde {
132	struct smt_para	para ;		/* generic parameter header */
133	u_char	sde_type ;		/* station type */
134	u_char	sde_mac_count ;		/* number of MACs */
135	u_char	sde_non_master ;	/* number of A,B or S ports */
136	u_char	sde_master ;		/* number of S ports on conc. */
137} ;
138
139/*
140 * P03 : Station State
141 */
142#define SMT_P_STATE	0x0003		/* station state */
143#define SWAP_SMT_P_STATE	"scc"
144
145struct smt_p_state {
146	struct smt_para	para ;		/* generic parameter header */
147	u_short	st_pad ;
148	u_char	st_topology ;		/* topology */
149	u_char	st_dupl_addr ;		/* duplicate address detected */
150} ;
151#define SMT_ST_WRAPPED		(1<<0)	/* station wrapped */
152#define SMT_ST_UNATTACHED	(1<<1)	/* unattached concentrator */
153#define SMT_ST_TWISTED_A	(1<<2)	/* A-A connection, twisted ring */
154#define SMT_ST_TWISTED_B	(1<<3)	/* B-B connection, twisted ring */
155#define SMT_ST_ROOTED_S		(1<<4)	/* rooted station */
156#define SMT_ST_SRF		(1<<5)	/* SRF protocol supported */
157#define SMT_ST_SYNC_SERVICE	(1<<6)	/* use synchronous bandwidth */
158
159#define SMT_ST_MY_DUPA		(1<<0)	/* my station detected dupl. */
160#define SMT_ST_UNA_DUPA		(1<<1)	/* my UNA detected duplicate */
161
162/*
163 * P04 : timestamp
164 */
165#define SMT_P_TIMESTAMP	0x0004		/* time stamp */
166#define SWAP_SMT_P_TIMESTAMP	"8"
167struct smt_p_timestamp {
168	struct smt_para	para ;		/* generic parameter header */
169	u_char	ts_time[8] ;		/* time, resolution 80nS, unique */
170} ;
171
172/*
173 * P05 : station policies
174 */
175#define SMT_P_POLICY	0x0005		/* station policies */
176#define SWAP_SMT_P_POLICY	"ss"
177
178struct smt_p_policy {
179	struct smt_para	para ;		/* generic parameter header */
180	u_short	pl_config ;
181	u_short pl_connect ;		/* bit string POLICY_AA ... */
182} ;
183#define SMT_PL_HOLD		1	/* hold policy supported (Dual MAC) */
184
185/*
186 * P06 : latency equivalent
187 */
188#define SMT_P_LATENCY	0x0006		/* latency */
189#define SWAP_SMT_P_LATENCY	"ssss"
190
191/*
192 * note: latency has two phy entries by definition
193 * for a SAS, the 2nd one is null
194 */
195struct smt_p_latency {
196	struct smt_para	para ;		/* generic parameter header */
197	u_short	lt_phyout_idx1 ;	/* index */
198	u_short	lt_latency1 ;		/* latency , unit : byte clock */
199	u_short	lt_phyout_idx2 ;	/* 0 if SAS */
200	u_short	lt_latency2 ;		/* 0 if SAS */
201} ;
202
203/*
204 * P07 : MAC neighbors
205 */
206#define SMT_P_NEIGHBORS	0x0007		/* MAC neighbor description */
207#define SWAP_SMT_P_NEIGHBORS	"ss66"
208
209struct smt_p_neighbor {
210	struct smt_para	para ;		/* generic parameter header */
211	u_short	nb_mib_index ;		/* MIB index */
212	u_short	nb_mac_index ;		/* n+1 .. n+m, m = #MACs, n = #PHYs */
213	struct fddi_addr nb_una ;	/* UNA , 0 for unknown */
214	struct fddi_addr nb_dna ;	/* DNA , 0 for unknown */
215} ;
216
217/*
218 * PHY record
219 */
220#define SMT_PHY_A	0		/* A port */
221#define SMT_PHY_B	1		/* B port */
222#define SMT_PHY_S	2		/* slave port */
223#define SMT_PHY_M	3		/* master port */
224
225#define SMT_CS_DISABLED	0		/* connect state : disabled */
226#define SMT_CS_CONNECTING	1	/* connect state : connecting */
227#define SMT_CS_STANDBY	2		/* connect state : stand by */
228#define SMT_CS_ACTIVE	3		/* connect state : active */
229
230#define SMT_RM_NONE	0
231#define SMT_RM_MAC	1
232
233struct smt_phy_rec {
234	u_short	phy_mib_index ;		/* MIB index */
235	u_char	phy_type ;		/* A/B/S/M */
236	u_char	phy_connect_state ;	/* disabled/connecting/active */
237	u_char	phy_remote_type ;	/* A/B/S/M */
238	u_char	phy_remote_mac ;	/* none/remote */
239	u_short	phy_resource_idx ;	/* 1 .. n */
240} ;
241
242/*
243 * MAC record
244 */
245struct smt_mac_rec {
246	struct fddi_addr mac_addr ;		/* MAC address */
247	u_short		mac_resource_idx ;	/* n+1 .. n+m */
248} ;
249
250/*
251 * P08 : path descriptors
252 * should be really an array ; however our environment has a fixed number of
253 * PHYs and MACs
254 */
255#define SMT_P_PATH	0x0008			/* path descriptor */
256#define SWAP_SMT_P_PATH	"[6s]"
257
258struct smt_p_path {
259	struct smt_para	para ;		/* generic parameter header */
260	struct smt_phy_rec	pd_phy[2] ;	/* PHY A */
261	struct smt_mac_rec	pd_mac ;	/* MAC record */
262} ;
263
264/*
265 * P09 : MAC status
266 */
267#define SMT_P_MAC_STATUS	0x0009		/* MAC status */
268#define SWAP_SMT_P_MAC_STATUS	"sslllllllll"
269
270struct smt_p_mac_status {
271	struct smt_para	para ;		/* generic parameter header */
272	u_short st_mib_index ;		/* MIB index */
273	u_short	st_mac_index ;		/* n+1 .. n+m */
274	u_int	st_t_req ;		/* T_Req */
275	u_int	st_t_neg ;		/* T_Neg */
276	u_int	st_t_max ;		/* T_Max */
277	u_int	st_tvx_value ;		/* TVX_Value */
278	u_int	st_t_min ;		/* T_Min */
279	u_int	st_sba ;		/* synchr. bandwidth alloc */
280	u_int	st_frame_ct ;		/* frame counter */
281	u_int	st_error_ct ;		/* error counter */
282	u_int	st_lost_ct ;		/* lost frames counter */
283} ;
284
285/*
286 * P0A : PHY link error rate monitoring
287 */
288#define SMT_P_LEM	0x000a		/* link error monitor */
289#define SWAP_SMT_P_LEM	"ssccccll"
290/*
291 * units of lem_cutoff,lem_alarm,lem_estimate : 10**-x
292 */
293struct smt_p_lem {
294	struct smt_para	para ;		/* generic parameter header */
295	u_short	lem_mib_index ;		/* MIB index */
296	u_short	lem_phy_index ;		/* 1 .. n */
297	u_char	lem_pad2 ;		/* be nice and make it even . */
298	u_char	lem_cutoff ;		/* 0x4 .. 0xf, default 0x7 */
299	u_char	lem_alarm ;		/* 0x4 .. 0xf, default 0x8 */
300	u_char	lem_estimate ;		/* 0x0 .. 0xff */
301	u_int	lem_reject_ct ;		/* 0x00000000 .. 0xffffffff */
302	u_int	lem_ct ;		/* 0x00000000 .. 0xffffffff */
303} ;
304
305/*
306 * P0B : MAC frame counters
307 */
308#define SMT_P_MAC_COUNTER 0x000b	/* MAC frame counters */
309#define SWAP_SMT_P_MAC_COUNTER	"ssll"
310
311struct smt_p_mac_counter {
312	struct smt_para	para ;		/* generic parameter header */
313	u_short	mc_mib_index ;		/* MIB index */
314	u_short	mc_index ;		/* mac index */
315	u_int	mc_receive_ct ;		/* receive counter */
316	u_int	mc_transmit_ct ;	/* transmit counter */
317} ;
318
319/*
320 * P0C : MAC frame not copied counter
321 */
322#define SMT_P_MAC_FNC	0x000c		/* MAC frame not copied counter */
323#define SWAP_SMT_P_MAC_FNC	"ssl"
324
325struct smt_p_mac_fnc {
326	struct smt_para	para ;		/* generic parameter header */
327	u_short	nc_mib_index ;		/* MIB index */
328	u_short	nc_index ;		/* mac index */
329	u_int	nc_counter ;		/* not copied counter */
330} ;
331
332
333/*
334 * P0D : MAC priority values
335 */
336#define SMT_P_PRIORITY	0x000d		/* MAC priority values */
337#define SWAP_SMT_P_PRIORITY	"ssl"
338
339struct smt_p_priority {
340	struct smt_para	para ;		/* generic parameter header */
341	u_short	pr_mib_index ;		/* MIB index */
342	u_short	pr_index ;		/* mac index */
343	u_int	pr_priority[7] ;	/* priority values */
344} ;
345
346/*
347 * P0E : PHY elasticity buffer status
348 */
349#define SMT_P_EB	0x000e		/* PHY EB status */
350#define SWAP_SMT_P_EB	"ssl"
351
352struct smt_p_eb {
353	struct smt_para	para ;		/* generic parameter header */
354	u_short	eb_mib_index ;		/* MIB index */
355	u_short	eb_index ;		/* phy index */
356	u_int	eb_error_ct ;		/* # of eb overflows */
357} ;
358
359/*
360 * P0F : manufacturer field
361 */
362#define SMT_P_MANUFACTURER	0x000f	/* manufacturer field */
363#define SWAP_SMT_P_MANUFACTURER	""
364
365struct smp_p_manufacturer {
366	struct smt_para	para ;		/* generic parameter header */
367	u_char mf_data[32] ;		/* OUI + arbitrary data */
368} ;
369
370/*
371 * P10 : user field
372 */
373#define SMT_P_USER		0x0010	/* manufacturer field */
374#define SWAP_SMT_P_USER	""
375
376struct smp_p_user {
377	struct smt_para	para ;		/* generic parameter header */
378	u_char us_data[32] ;		/* arbitrary data */
379} ;
380
381
382
383/*
384 * P11 : echo data
385 */
386#define SMT_P_ECHODATA	0x0011		/* echo data */
387#define SWAP_SMT_P_ECHODATA	""
388
389struct smt_p_echo {
390	struct smt_para	para ;		/* generic parameter header */
391	u_char	ec_data[SMT_MAX_ECHO_LEN-4] ;	/* echo data */
392} ;
393
394/*
395 * P12 : reason code
396 */
397#define SMT_P_REASON	0x0012		/* reason code */
398#define SWAP_SMT_P_REASON	"l"
399
400struct smt_p_reason {
401	struct smt_para	para ;		/* generic parameter header */
402	u_int	rdf_reason ;		/* CLASS/VERSION */
403} ;
404#define SMT_RDF_CLASS	0x00000001	/* class not supported */
405#define SMT_RDF_VERSION	0x00000002	/* version not supported */
406#define SMT_RDF_SUCCESS	0x00000003	/* success (PMF) */
407#define SMT_RDF_BADSET	0x00000004	/* bad set count (PMF) */
408#define SMT_RDF_ILLEGAL 0x00000005	/* read only (PMF) */
409#define SMT_RDF_NOPARAM	0x6		/* paramter not supported (PMF) */
410#define SMT_RDF_RANGE	0x8		/* out of range */
411#define SMT_RDF_AUTHOR	0x9		/* not autohorized */
412#define SMT_RDF_LENGTH	0x0a		/* length error */
413#define SMT_RDF_TOOLONG	0x0b		/* length error */
414#define SMT_RDF_SBA	0x0d		/* SBA denied */
415
416/*
417 * P13 : refused frame beginning
418 */
419#define SMT_P_REFUSED	0x0013		/* refused frame beginning */
420#define SWAP_SMT_P_REFUSED	"l"
421
422struct smt_p_refused {
423	struct smt_para	para ;		/* generic parameter header */
424	u_int	ref_fc ;		/* 3 bytes 0 + FC */
425	struct smt_header	ref_header ;	/* refused header */
426} ;
427
428/*
429 * P14 : supported SMT versions
430 */
431#define SMT_P_VERSION	0x0014		/* SMT supported versions */
432#define SWAP_SMT_P_VERSION	"sccss"
433
434struct smt_p_version {
435	struct smt_para	para ;		/* generic parameter header */
436	u_short	v_pad ;
437	u_char	v_n ;			/* 1 .. 0xff, #versions */
438	u_char	v_index ;		/* 1 .. 0xff, index of op. v. */
439	u_short	v_version[1] ;		/* list of min. 1 version */
440	u_short	v_pad2 ;		/* pad if necessary */
441} ;
442
443/*
444 * P15 : Resource Type
445 */
446#define	SWAP_SMT_P0015		"l"
447
448struct smt_p_0015 {
449	struct smt_para	para ;		/* generic parameter header */
450	u_int		res_type ;	/* recsource type */
451} ;
452
453#define	SYNC_BW		0x00000001L	/* Synchronous Bandwidth */
454
455/*
456 * P16 : SBA Command
457 */
458#define	SWAP_SMT_P0016		"l"
459
460struct smt_p_0016 {
461	struct smt_para	para ;		/* generic parameter header */
462	u_int		sba_cmd ;	/* command for the SBA */
463} ;
464
465#define	REQUEST_ALLOCATION	0x1	/* req allocation of sync bandwidth */
466#define	REPORT_ALLOCATION	0x2	/* rep of sync bandwidth allocation */
467#define	CHANGE_ALLOCATION	0x3	/* forces a station using sync band-*/
468					/* width to change its current allo-*/
469					/* cation */
470
471/*
472 * P17 : SBA Payload Request
473 */
474#define	SWAP_SMT_P0017		"l"
475
476struct smt_p_0017 {
477	struct smt_para	para ;		/* generic parameter header */
478	int		sba_pl_req ;	/* total sync bandwidth measured in */
479} ;					/* bytes per 125 us */
480
481/*
482 * P18 : SBA Overhead Request
483 */
484#define	SWAP_SMT_P0018		"l"
485
486struct smt_p_0018 {
487	struct smt_para	para ;		/* generic parameter header */
488	int		sba_ov_req ;	/* total sync bandwidth req for overhead*/
489} ;					/* measuered in bytes per T_Neg */
490
491/*
492 * P19 : SBA Allocation Address
493 */
494#define	SWAP_SMT_P0019		"s6"
495
496struct smt_p_0019 {
497	struct smt_para	para ;		/* generic parameter header */
498	u_short		sba_pad ;
499	struct fddi_addr alloc_addr ;	/* Allocation Address */
500} ;
501
502/*
503 * P1A : SBA Category
504 */
505#define	SWAP_SMT_P001A		"l"
506
507struct smt_p_001a {
508	struct smt_para	para ;		/* generic parameter header */
509	u_int		category ;	/* Allocator defined classification */
510} ;
511
512/*
513 * P1B : Maximum T_Neg
514 */
515#define	SWAP_SMT_P001B		"l"
516
517struct smt_p_001b {
518	struct smt_para	para ;		/* generic parameter header */
519	u_int		max_t_neg ;	/* longest T_NEG for the sync service*/
520} ;
521
522/*
523 * P1C : Minimum SBA Segment Size
524 */
525#define	SWAP_SMT_P001C		"l"
526
527struct smt_p_001c {
528	struct smt_para	para ;		/* generic parameter header */
529	u_int		min_seg_siz ;	/* smallest number of bytes per frame*/
530} ;
531
532/*
533 * P1D : SBA Allocatable
534 */
535#define	SWAP_SMT_P001D		"l"
536
537struct smt_p_001d {
538	struct smt_para	para ;		/* generic parameter header */
539	u_int		allocatable ;	/* total sync bw available for alloc */
540} ;
541
542/*
543 * P20 0B : frame status capabilities
544 * NOTE: not in swap table, is used by smt.c AND PMF table
545 */
546#define SMT_P_FSC	0x200b
547/* #define SWAP_SMT_P_FSC	"ssss" */
548
549struct smt_p_fsc {
550	struct smt_para	para ;		/* generic parameter header */
551	u_short	fsc_pad0 ;
552	u_short	fsc_mac_index ;		/* mac index 1 .. ff */
553	u_short	fsc_pad1 ;
554	u_short	fsc_value ;		/* FSC_TYPE[0-2] */
555} ;
556
557#define FSC_TYPE0	0		/* "normal" node (A/C handling) */
558#define FSC_TYPE1	1		/* Special A/C indicator forwarding */
559#define FSC_TYPE2	2		/* Special A/C indicator forwarding */
560
561/*
562 * P00 21 : user defined authoriziation (see pmf.c)
563 */
564#define SMT_P_AUTHOR	0x0021
565
566/*
567 * notification parameters
568 */
569#define SWAP_SMT_P1048	"ll"
570struct smt_p_1048 {
571	u_int p1048_flag ;
572	u_int p1048_cf_state ;
573} ;
574
575/*
576 * NOTE: all 2xxx 3xxx and 4xxx must include the INDEX in the swap string,
577 *	even so the INDEX is NOT part of the struct.
578 *	INDEX is already swapped in pmf.c, format in string is '4'
579 */
580#define SWAP_SMT_P208C	"4lss66"
581struct smt_p_208c {
582	u_int			p208c_flag ;
583	u_short			p208c_pad ;
584	u_short			p208c_dupcondition ;
585	struct	fddi_addr	p208c_fddilong ;
586	struct	fddi_addr	p208c_fddiunalong ;
587} ;
588
589#define SWAP_SMT_P208D	"4lllll"
590struct smt_p_208d {
591	u_int			p208d_flag ;
592	u_int			p208d_frame_ct ;
593	u_int			p208d_error_ct ;
594	u_int			p208d_lost_ct ;
595	u_int			p208d_ratio ;
596} ;
597
598#define SWAP_SMT_P208E	"4llll"
599struct smt_p_208e {
600	u_int			p208e_flag ;
601	u_int			p208e_not_copied ;
602	u_int			p208e_copied ;
603	u_int			p208e_not_copied_ratio ;
604} ;
605
606#define SWAP_SMT_P208F	"4ll6666s6"
607
608struct smt_p_208f {
609	u_int			p208f_multiple ;
610	u_int			p208f_nacondition ;
611	struct fddi_addr	p208f_old_una ;
612	struct fddi_addr	p208f_new_una ;
613	struct fddi_addr	p208f_old_dna ;
614	struct fddi_addr	p208f_new_dna ;
615	u_short			p208f_curren_path ;
616	struct fddi_addr	p208f_smt_address ;
617} ;
618
619#define SWAP_SMT_P2090	"4lssl"
620
621struct smt_p_2090 {
622	u_int			p2090_multiple ;
623	u_short			p2090_availablepaths ;
624	u_short			p2090_currentpath ;
625	u_int			p2090_requestedpaths ;
626} ;
627
628/*
629 * NOTE:
630 * special kludge for parameters 320b,320f,3210
631 * these parameters are part of RAF frames
632 * RAF frames are parsed in SBA.C and must be swapped
633 * PMF.C has special code to avoid double swapping
634 */
635#ifdef	LITTLE_ENDIAN
636#define SBAPATHINDEX	(0x01000000L)
637#else
638#define SBAPATHINDEX	(0x01L)
639#endif
640
641#define	SWAP_SMT_P320B	"42s"
642
643struct	smt_p_320b {
644	struct smt_para para ;	/* generic parameter header */
645	u_int	mib_index ;
646	u_short path_pad ;
647	u_short	path_index ;
648} ;
649
650#define	SWAP_SMT_P320F	"4l"
651
652struct	smt_p_320f {
653	struct smt_para para ;	/* generic parameter header */
654	u_int	mib_index ;
655	u_int	mib_payload ;
656} ;
657
658#define	SWAP_SMT_P3210	"4l"
659
660struct	smt_p_3210 {
661	struct smt_para para ;	/* generic parameter header */
662	u_int	mib_index ;
663	u_int	mib_overhead ;
664} ;
665
666#define SWAP_SMT_P4050	"4l1111ll"
667
668struct smt_p_4050 {
669	u_int			p4050_flag ;
670	u_char			p4050_pad ;
671	u_char			p4050_cutoff ;
672	u_char			p4050_alarm ;
673	u_char			p4050_estimate ;
674	u_int			p4050_reject_ct ;
675	u_int			p4050_ct ;
676} ;
677
678#define SWAP_SMT_P4051	"4lssss"
679struct smt_p_4051 {
680	u_int			p4051_multiple ;
681	u_short			p4051_porttype ;
682	u_short			p4051_connectstate ;
683	u_short			p4051_pc_neighbor ;
684	u_short			p4051_pc_withhold ;
685} ;
686
687#define SWAP_SMT_P4052	"4ll"
688struct smt_p_4052 {
689	u_int			p4052_flag ;
690	u_int			p4052_eberrorcount ;
691} ;
692
693#define SWAP_SMT_P4053	"4lsslss"
694
695struct smt_p_4053 {
696	u_int			p4053_multiple ;
697	u_short			p4053_availablepaths ;
698	u_short			p4053_currentpath ;
699	u_int			p4053_requestedpaths ;
700	u_short			p4053_mytype ;
701	u_short			p4053_neighbortype ;
702} ;
703
704
705#define SMT_P_SETCOUNT	0x1035
706#define SWAP_SMT_P_SETCOUNT	"l8"
707
708struct smt_p_setcount {
709	struct smt_para	para ;		/* generic parameter header */
710	u_int		count ;
711	u_char		timestamp[8] ;
712} ;
713
714/*
715 * SMT FRAMES
716 */
717
718/*
719 * NIF : neighbor information frames
720 */
721struct smt_nif {
722	struct smt_header	smt ;		/* generic header */
723	struct smt_p_una	una ;		/* UNA */
724	struct smt_p_sde	sde ;		/* station descriptor */
725	struct smt_p_state	state ;		/* station state */
726#ifdef	SMT6_10
727	struct smt_p_fsc	fsc ;		/* frame status cap. */
728#endif
729} ;
730
731/*
732 * SIF : station information frames
733 */
734struct smt_sif_config {
735	struct smt_header	smt ;		/* generic header */
736	struct smt_p_timestamp	ts ;		/* time stamp */
737	struct smt_p_sde	sde ;		/* station descriptor */
738	struct smt_p_version	version ;	/* supported versions */
739	struct smt_p_state	state ;		/* station state */
740	struct smt_p_policy	policy ;	/* station policy */
741	struct smt_p_latency	latency ;	/* path latency */
742	struct smt_p_neighbor	neighbor ;	/* neighbors, we have only one*/
743#ifdef	OPT_PMF
744	struct smt_p_setcount	setcount ;	 /* Set Count mandatory */
745#endif
746	/* WARNING : path MUST BE LAST FIELD !!! (see smt.c:smt_fill_path) */
747	struct smt_p_path	path ;		/* path descriptor */
748} ;
749#define SIZEOF_SMT_SIF_CONFIG	(sizeof(struct smt_sif_config)- \
750				 sizeof(struct smt_p_path))
751
752struct smt_sif_operation {
753	struct smt_header	smt ;		/* generic header */
754	struct smt_p_timestamp	ts ;		/* time stamp */
755	struct smt_p_mac_status	status ;	/* mac status */
756	struct smt_p_mac_counter mc ;		/* MAC counter */
757	struct smt_p_mac_fnc 	fnc ;		/* MAC frame not copied */
758	struct smp_p_manufacturer man ;		/* manufacturer field */
759	struct smp_p_user	user ;		/* user field */
760#ifdef	OPT_PMF
761	struct smt_p_setcount	setcount ;	 /* Set Count mandatory */
762#endif
763	/* must be last */
764	struct smt_p_lem	lem[1] ;	/* phy lem status */
765} ;
766#define SIZEOF_SMT_SIF_OPERATION	(sizeof(struct smt_sif_operation)- \
767					 sizeof(struct smt_p_lem))
768
769/*
770 * ECF : echo frame
771 */
772struct smt_ecf {
773	struct smt_header	smt ;		/* generic header */
774	struct smt_p_echo	ec_echo ;	/* echo parameter */
775} ;
776#define SMT_ECF_LEN	(sizeof(struct smt_header)+sizeof(struct smt_para))
777
778/*
779 * RDF : request denied frame
780 */
781struct smt_rdf {
782	struct smt_header	smt ;		/* generic header */
783	struct smt_p_reason	reason ;	/* reason code */
784	struct smt_p_version	version ;	/* supported versions */
785	struct smt_p_refused	refused ;	/* refused frame fragment */
786} ;
787
788/*
789 * SBA Request Allocation Responce Frame
790 */
791struct smt_sba_alc_res {
792	struct smt_header	smt ;		/* generic header */
793	struct smt_p_0015	s_type ;	/* resource type */
794	struct smt_p_0016	cmd ;		/* SBA command */
795	struct smt_p_reason	reason ;	/* reason code */
796	struct smt_p_320b	path ;		/* path type */
797	struct smt_p_320f	payload ;	/* current SBA payload */
798	struct smt_p_3210	overhead ;	/* current SBA overhead */
799	struct smt_p_0019	a_addr ;	/* Allocation Address */
800	struct smt_p_001a	cat ;		/* Category - from the request */
801	struct smt_p_001d	alloc ;		/* SBA Allocatable */
802} ;
803
804/*
805 * SBA Request Allocation Request Frame
806 */
807struct smt_sba_alc_req {
808	struct smt_header	smt ;		/* generic header */
809	struct smt_p_0015	s_type ;	/* resource type */
810	struct smt_p_0016	cmd ;		/* SBA command */
811	struct smt_p_320b	path ;		/* path type */
812	struct smt_p_0017	pl_req ;	/* requested payload */
813	struct smt_p_0018	ov_req ;	/* requested SBA overhead */
814	struct smt_p_320f	payload ;	/* current SBA payload */
815	struct smt_p_3210	overhead ;	/* current SBA overhead */
816	struct smt_p_0019	a_addr ;	/* Allocation Address */
817	struct smt_p_001a	cat ;		/* Category - from the request */
818	struct smt_p_001b	tneg ;		/* max T-NEG */
819	struct smt_p_001c	segm ;		/* minimum segment size */
820} ;
821
822/*
823 * SBA Change Allocation Request Frame
824 */
825struct smt_sba_chg {
826	struct smt_header	smt ;		/* generic header */
827	struct smt_p_0015	s_type ;	/* resource type */
828	struct smt_p_0016	cmd ;		/* SBA command */
829	struct smt_p_320b	path ;		/* path type */
830	struct smt_p_320f	payload ;	/* current SBA payload */
831	struct smt_p_3210	overhead ;	/* current SBA overhead */
832	struct smt_p_001a	cat ;		/* Category - from the request */
833} ;
834
835/*
836 * SBA Report Allocation Request Frame
837 */
838struct smt_sba_rep_req {
839	struct smt_header	smt ;		/* generic header */
840	struct smt_p_0015	s_type ;	/* resource type */
841	struct smt_p_0016	cmd ;		/* SBA command */
842} ;
843
844/*
845 * SBA Report Allocation Response Frame
846 */
847struct smt_sba_rep_res {
848	struct smt_header	smt ;		/* generic header */
849	struct smt_p_0015	s_type ;	/* resource type */
850	struct smt_p_0016	cmd ;		/* SBA command */
851	struct smt_p_320b	path ;		/* path type */
852	struct smt_p_320f	payload ;	/* current SBA payload */
853	struct smt_p_3210	overhead ;	/* current SBA overhead */
854} ;
855
856/*
857 * actions
858 */
859#define SMT_STATION_ACTION	1
860#define SMT_STATION_ACTION_CONNECT	0
861#define SMT_STATION_ACTION_DISCONNECT	1
862#define SMT_STATION_ACTION_PATHTEST	2
863#define SMT_STATION_ACTION_SELFTEST	3
864#define SMT_STATION_ACTION_DISABLE_A	4
865#define SMT_STATION_ACTION_DISABLE_B	5
866#define SMT_STATION_ACTION_DISABLE_M	6
867
868#define SMT_PORT_ACTION		2
869#define SMT_PORT_ACTION_MAINT	0
870#define SMT_PORT_ACTION_ENABLE	1
871#define SMT_PORT_ACTION_DISABLE	2
872#define SMT_PORT_ACTION_START	3
873#define SMT_PORT_ACTION_STOP	4
874
875#endif	/* _SMT_ */
876