⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smt.h

📁 h内核
💻 H
📖 第 1 页 / 共 2 页
字号:
/****************************************************************************** * *	(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. * ******************************************************************************//* *	SMT 7.2 frame definitions */#ifndef	_SMT_#define _SMT_/* #define SMT5_10 */#define SMT6_10#define SMT7_20#define	OPT_PMF		/* if parameter management is supported */#define	OPT_SRF		/* if status report is supported *//* * SMT frame version 5.1 */#define SMT_VID	0x0001			/* V 5.1 .. 6.1 */#define SMT_VID_2 0x0002		/* V 7.2 */struct smt_sid {	u_char	sid_oem[2] ;			/* implementation spec. */	struct fddi_addr sid_node ;		/* node address */} ;typedef u_char	t_station_id[8] ;/* * note on alignment : * sizeof(struct smt_header) = 32 * all parameters are long aligned * if struct smt_header starts at offset 0, all longs are aligned correctly * (FC starts at offset 3) */_packed struct smt_header {	struct fddi_addr    	smt_dest ;	/* destination address */	struct fddi_addr	smt_source ;	/* source address */	u_char			smt_class ;	/* NIF, SIF ... */	u_char			smt_type ;	/* req., response .. */	u_short			smt_version ;	/* version id */	u_int			smt_tid ;	/* transaction ID */	struct smt_sid		smt_sid ;	/* station ID */	u_short			smt_pad ;	/* pad with 0 */	u_short			smt_len ;	/* length of info field */} ;#define SWAP_SMTHEADER	"662sl8ss"#if	0/* * MAC FC values */#define FC_SMT_INFO	0x41		/* SMT info */#define FC_SMT_NSA	0x4f		/* SMT Next Station Addressing */#endif/* * type codes */#define SMT_ANNOUNCE	0x01		/* announcement */#define SMT_REQUEST	0x02		/* request */#define SMT_REPLY	0x03		/* reply *//* * class codes */#define SMT_NIF		0x01		/* neighbor information frames */#define SMT_SIF_CONFIG	0x02		/* station information configuration */#define SMT_SIF_OPER	0x03		/* station information operation */#define SMT_ECF		0x04		/* echo frames */#define SMT_RAF		0x05		/* resource allocation */#define SMT_RDF		0x06		/* request denied */#define SMT_SRF		0x07		/* status report */#define SMT_PMF_GET	0x08		/* parameter management get */#define SMT_PMF_SET	0x09		/* parameter management set */#define SMT_ESF		0xff		/* extended service */#define SMT_MAX_ECHO_LEN	4458	/* max length of SMT Echo */#if	defined(CONC) || defined(CONC_II)#define SMT_TEST_ECHO_LEN	50	/* test length of SMT Echo */#else#define SMT_TEST_ECHO_LEN	SMT_MAX_ECHO_LEN	/* test length */#endif#define SMT_MAX_INFO_LEN	(4352-20)	/* max length for SMT info *//* * parameter types */struct smt_para {	u_short	p_type ;		/* type */	u_short	p_len ;			/* length of parameter */} ;#define PARA_LEN	(sizeof(struct smt_para))#define SMTSETPARA(p,t)		(p)->para.p_type = (t),\				(p)->para.p_len = sizeof(*(p)) - PARA_LEN/* * P01 : Upstream Neighbor Address, UNA */#define SMT_P_UNA	0x0001		/* upstream neighbor address */#define SWAP_SMT_P_UNA	"s6"struct smt_p_una {	struct smt_para	para ;		/* generic parameter header */	u_short	una_pad ;	struct fddi_addr una_node ;	/* node address, zero if unknown */} ;/* * P02 : Station Descriptor */#define SMT_P_SDE	0x0002		/* station descriptor */#define SWAP_SMT_P_SDE	"1111"#define SMT_SDE_STATION		0	/* end node */#define SMT_SDE_CONCENTRATOR	1	/* concentrator */struct smt_p_sde {	struct smt_para	para ;		/* generic parameter header */	u_char	sde_type ;		/* station type */	u_char	sde_mac_count ;		/* number of MACs */	u_char	sde_non_master ;	/* number of A,B or S ports */	u_char	sde_master ;		/* number of S ports on conc. */} ;/* * P03 : Station State */#define SMT_P_STATE	0x0003		/* station state */#define SWAP_SMT_P_STATE	"scc"struct smt_p_state {	struct smt_para	para ;		/* generic parameter header */	u_short	st_pad ;	u_char	st_topology ;		/* topology */	u_char	st_dupl_addr ;		/* duplicate address detected */} ;#define SMT_ST_WRAPPED		(1<<0)	/* station wrapped */#define SMT_ST_UNATTACHED	(1<<1)	/* unattached concentrator */#define SMT_ST_TWISTED_A	(1<<2)	/* A-A connection, twisted ring */#define SMT_ST_TWISTED_B	(1<<3)	/* B-B connection, twisted ring */#define SMT_ST_ROOTED_S		(1<<4)	/* rooted station */#define SMT_ST_SRF		(1<<5)	/* SRF protocol supported */#define SMT_ST_SYNC_SERVICE	(1<<6)	/* use synchronous bandwidth */#define SMT_ST_MY_DUPA		(1<<0)	/* my station detected dupl. */#define SMT_ST_UNA_DUPA		(1<<1)	/* my UNA detected duplicate *//* * P04 : timestamp */#define SMT_P_TIMESTAMP	0x0004		/* time stamp */#define SWAP_SMT_P_TIMESTAMP	"8"struct smt_p_timestamp {	struct smt_para	para ;		/* generic parameter header */	u_char	ts_time[8] ;		/* time, resolution 80nS, unique */} ;/* * P05 : station policies */#define SMT_P_POLICY	0x0005		/* station policies */#define SWAP_SMT_P_POLICY	"ss"struct smt_p_policy {	struct smt_para	para ;		/* generic parameter header */	u_short	pl_config ;	u_short pl_connect ;		/* bit string POLICY_AA ... */} ;#define SMT_PL_HOLD		1	/* hold policy supported (Dual MAC) *//* * P06 : latency equivalent */#define SMT_P_LATENCY	0x0006		/* latency */#define SWAP_SMT_P_LATENCY	"ssss"/* * note: latency has two phy entries by definition * for a SAS, the 2nd one is null */struct smt_p_latency {	struct smt_para	para ;		/* generic parameter header */	u_short	lt_phyout_idx1 ;	/* index */	u_short	lt_latency1 ;		/* latency , unit : byte clock */	u_short	lt_phyout_idx2 ;	/* 0 if SAS */	u_short	lt_latency2 ;		/* 0 if SAS */} ;/* * P07 : MAC neighbors */#define SMT_P_NEIGHBORS	0x0007		/* MAC neighbor description */#define SWAP_SMT_P_NEIGHBORS	"ss66"struct smt_p_neighbor {	struct smt_para	para ;		/* generic parameter header */	u_short	nb_mib_index ;		/* MIB index */	u_short	nb_mac_index ;		/* n+1 .. n+m, m = #MACs, n = #PHYs */	struct fddi_addr nb_una ;	/* UNA , 0 for unknown */	struct fddi_addr nb_dna ;	/* DNA , 0 for unknown */} ;/* * PHY record */#define SMT_PHY_A	0		/* A port */#define SMT_PHY_B	1		/* B port */#define SMT_PHY_S	2		/* slave port */#define SMT_PHY_M	3		/* master port */#define SMT_CS_DISABLED	0		/* connect state : disabled */#define SMT_CS_CONNECTING	1	/* connect state : connecting */#define SMT_CS_STANDBY	2		/* connect state : stand by */#define SMT_CS_ACTIVE	3		/* connect state : active */#define SMT_RM_NONE	0#define SMT_RM_MAC	1struct smt_phy_rec {	u_short	phy_mib_index ;		/* MIB index */	u_char	phy_type ;		/* A/B/S/M */	u_char	phy_connect_state ;	/* disabled/connecting/active */	u_char	phy_remote_type ;	/* A/B/S/M */	u_char	phy_remote_mac ;	/* none/remote */	u_short	phy_resource_idx ;	/* 1 .. n */} ;/* * MAC record */struct smt_mac_rec {	struct fddi_addr mac_addr ;		/* MAC address */	u_short		mac_resource_idx ;	/* n+1 .. n+m */} ;/* * P08 : path descriptors * should be really an array ; however our environment has a fixed number of * PHYs and MACs */#define SMT_P_PATH	0x0008			/* path descriptor */#define SWAP_SMT_P_PATH	"[6s]"struct smt_p_path {	struct smt_para	para ;		/* generic parameter header */	struct smt_phy_rec	pd_phy[2] ;	/* PHY A */	struct smt_mac_rec	pd_mac ;	/* MAC record */} ;/* * P09 : MAC status */#define SMT_P_MAC_STATUS	0x0009		/* MAC status */#define SWAP_SMT_P_MAC_STATUS	"sslllllllll"struct smt_p_mac_status {	struct smt_para	para ;		/* generic parameter header */	u_short st_mib_index ;		/* MIB index */	u_short	st_mac_index ;		/* n+1 .. n+m */	u_int	st_t_req ;		/* T_Req */	u_int	st_t_neg ;		/* T_Neg */	u_int	st_t_max ;		/* T_Max */	u_int	st_tvx_value ;		/* TVX_Value */	u_int	st_t_min ;		/* T_Min */	u_int	st_sba ;		/* synchr. bandwidth alloc */	u_int	st_frame_ct ;		/* frame counter */	u_int	st_error_ct ;		/* error counter */	u_int	st_lost_ct ;		/* lost frames counter */} ;/* * P0A : PHY link error rate monitoring */#define SMT_P_LEM	0x000a		/* link error monitor */#define SWAP_SMT_P_LEM	"ssccccll"/* * units of lem_cutoff,lem_alarm,lem_estimate : 10**-x */struct smt_p_lem {	struct smt_para	para ;		/* generic parameter header */	u_short	lem_mib_index ;		/* MIB index */	u_short	lem_phy_index ;		/* 1 .. n */	u_char	lem_pad2 ;		/* be nice and make it even . */	u_char	lem_cutoff ;		/* 0x4 .. 0xf, default 0x7 */	u_char	lem_alarm ;		/* 0x4 .. 0xf, default 0x8 */	u_char	lem_estimate ;		/* 0x0 .. 0xff */	u_int	lem_reject_ct ;		/* 0x00000000 .. 0xffffffff */	u_int	lem_ct ;		/* 0x00000000 .. 0xffffffff */} ;/* * P0B : MAC frame counters */#define SMT_P_MAC_COUNTER 0x000b	/* MAC frame counters */#define SWAP_SMT_P_MAC_COUNTER	"ssll"struct smt_p_mac_counter {	struct smt_para	para ;		/* generic parameter header */	u_short	mc_mib_index ;		/* MIB index */	u_short	mc_index ;		/* mac index */	u_int	mc_receive_ct ;		/* receive counter */	u_int	mc_transmit_ct ;	/* transmit counter */} ;/* * P0C : MAC frame not copied counter */#define SMT_P_MAC_FNC	0x000c		/* MAC frame not copied counter */#define SWAP_SMT_P_MAC_FNC	"ssl"struct smt_p_mac_fnc {	struct smt_para	para ;		/* generic parameter header */	u_short	nc_mib_index ;		/* MIB index */	u_short	nc_index ;		/* mac index */	u_int	nc_counter ;		/* not copied counter */} ;/* * P0D : MAC priority values */#define SMT_P_PRIORITY	0x000d		/* MAC priority values */#define SWAP_SMT_P_PRIORITY	"ssl"struct smt_p_priority {	struct smt_para	para ;		/* generic parameter header */	u_short	pr_mib_index ;		/* MIB index */	u_short	pr_index ;		/* mac index */	u_int	pr_priority[7] ;	/* priority values */} ;/* * P0E : PHY elasticity buffer status */#define SMT_P_EB	0x000e		/* PHY EB status */#define SWAP_SMT_P_EB	"ssl"struct smt_p_eb {	struct smt_para	para ;		/* generic parameter header */	u_short	eb_mib_index ;		/* MIB index */	u_short	eb_index ;		/* phy index */	u_int	eb_error_ct ;		/* # of eb overflows */} ;/* * P0F : manufacturer field */#define SMT_P_MANUFACTURER	0x000f	/* manufacturer field */#define SWAP_SMT_P_MANUFACTURER	""struct smp_p_manufacturer {	struct smt_para	para ;		/* generic parameter header */	u_char mf_data[32] ;		/* OUI + arbitrary data */} ;/* * P10 : user field */#define SMT_P_USER		0x0010	/* manufacturer field */#define SWAP_SMT_P_USER	""struct smp_p_user {	struct smt_para	para ;		/* generic parameter header */	u_char us_data[32] ;		/* arbitrary data */} ;/* * P11 : echo data */#define SMT_P_ECHODATA	0x0011		/* echo data */#define SWAP_SMT_P_ECHODATA	""struct smt_p_echo {	struct smt_para	para ;		/* generic parameter header */	u_char	ec_data[SMT_MAX_ECHO_LEN-4] ;	/* echo data */} ;/* * P12 : reason code */#define SMT_P_REASON	0x0012		/* reason code */#define SWAP_SMT_P_REASON	"l"struct smt_p_reason {	struct smt_para	para ;		/* generic parameter header */	u_int	rdf_reason ;		/* CLASS/VERSION */} ;#define SMT_RDF_CLASS	0x00000001	/* class not supported */#define SMT_RDF_VERSION	0x00000002	/* version not supported */#define SMT_RDF_SUCCESS	0x00000003	/* success (PMF) */#define SMT_RDF_BADSET	0x00000004	/* bad set count (PMF) */#define SMT_RDF_ILLEGAL 0x00000005	/* read only (PMF) */#define SMT_RDF_NOPARAM	0x6		/* paramter not supported (PMF) */#define SMT_RDF_RANGE	0x8		/* out of range */#define SMT_RDF_AUTHOR	0x9		/* not autohorized */#define SMT_RDF_LENGTH	0x0a		/* length error */#define SMT_RDF_TOOLONG	0x0b		/* length error */#define SMT_RDF_SBA	0x0d		/* SBA denied *//* * P13 : refused frame beginning */#define SMT_P_REFUSED	0x0013		/* refused frame beginning */#define SWAP_SMT_P_REFUSED	"l"struct smt_p_refused {	struct smt_para	para ;		/* generic parameter header */	u_int	ref_fc ;		/* 3 bytes 0 + FC */	struct smt_header	ref_header ;	/* refused header */} ;/* * P14 : supported SMT versions */#define SMT_P_VERSION	0x0014		/* SMT supported versions */#define SWAP_SMT_P_VERSION	"sccss"struct smt_p_version {	struct smt_para	para ;		/* generic parameter header */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -