smt.h 23 KB

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