smt.h 23 KB

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