defxx.h 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806
  1. /*
  2. * File Name:
  3. * defxx.h
  4. *
  5. * Copyright Information:
  6. * Copyright Digital Equipment Corporation 1996.
  7. *
  8. * This software may be used and distributed according to the terms of
  9. * the GNU General Public License, incorporated herein by reference.
  10. *
  11. * Abstract:
  12. * Contains all definitions specified by port specification and required
  13. * by the defxx.c driver.
  14. *
  15. * The original author:
  16. * LVS Lawrence V. Stefani <[email protected]>
  17. *
  18. * Maintainers:
  19. * macro Maciej W. Rozycki <[email protected]>
  20. *
  21. * Modification History:
  22. * Date Name Description
  23. * 16-Aug-96 LVS Created.
  24. * 09-Sep-96 LVS Added group_prom field. Moved read/write I/O
  25. * macros to DEFXX.C.
  26. * 12-Sep-96 LVS Removed packet request header pointers.
  27. * 04 Aug 2003 macro Converted to the DMA API.
  28. * 23 Oct 2006 macro Big-endian host support.
  29. * 14 Dec 2006 macro TURBOchannel support.
  30. * 10 Mar 2021 macro Dynamic MMIO vs port I/O.
  31. */
  32. #ifndef _DEFXX_H_
  33. #define _DEFXX_H_
  34. /* Define basic types for unsigned chars, shorts, longs */
  35. typedef u8 PI_UINT8;
  36. typedef u16 PI_UINT16;
  37. typedef u32 PI_UINT32;
  38. /* Define general structures */
  39. typedef struct /* 64-bit counter */
  40. {
  41. PI_UINT32 ms;
  42. PI_UINT32 ls;
  43. } PI_CNTR;
  44. typedef struct /* LAN address */
  45. {
  46. PI_UINT32 lwrd_0;
  47. PI_UINT32 lwrd_1;
  48. } PI_LAN_ADDR;
  49. typedef struct /* Station ID address */
  50. {
  51. PI_UINT32 octet_7_4;
  52. PI_UINT32 octet_3_0;
  53. } PI_STATION_ID;
  54. /* Define general constants */
  55. #define PI_ALIGN_K_DESC_BLK 8192 /* Descriptor block boundary */
  56. #define PI_ALIGN_K_CONS_BLK 64 /* Consumer block boundary */
  57. #define PI_ALIGN_K_CMD_REQ_BUFF 128 /* Xmt Command que buffer alignment */
  58. #define PI_ALIGN_K_CMD_RSP_BUFF 128 /* Rcv Command que buffer alignment */
  59. #define PI_ALIGN_K_UNSOL_BUFF 128 /* Unsol que buffer alignment */
  60. #define PI_ALIGN_K_XMT_DATA_BUFF 0 /* Xmt data que buffer alignment */
  61. #define PI_ALIGN_K_RCV_DATA_BUFF 128 /* Rcv que buffer alignment */
  62. /* Define PHY index values */
  63. #define PI_PHY_K_S 0 /* Index to S phy */
  64. #define PI_PHY_K_A 0 /* Index to A phy */
  65. #define PI_PHY_K_B 1 /* Index to B phy */
  66. #define PI_PHY_K_MAX 2 /* Max number of phys */
  67. /* Define FMC descriptor fields */
  68. #define PI_FMC_DESCR_V_SOP 31
  69. #define PI_FMC_DESCR_V_EOP 30
  70. #define PI_FMC_DESCR_V_FSC 27
  71. #define PI_FMC_DESCR_V_FSB_ERROR 26
  72. #define PI_FMC_DESCR_V_FSB_ADDR_RECOG 25
  73. #define PI_FMC_DESCR_V_FSB_ADDR_COPIED 24
  74. #define PI_FMC_DESCR_V_FSB 22
  75. #define PI_FMC_DESCR_V_RCC_FLUSH 21
  76. #define PI_FMC_DESCR_V_RCC_CRC 20
  77. #define PI_FMC_DESCR_V_RCC_RRR 17
  78. #define PI_FMC_DESCR_V_RCC_DD 15
  79. #define PI_FMC_DESCR_V_RCC_SS 13
  80. #define PI_FMC_DESCR_V_RCC 13
  81. #define PI_FMC_DESCR_V_LEN 0
  82. #define PI_FMC_DESCR_M_SOP 0x80000000
  83. #define PI_FMC_DESCR_M_EOP 0x40000000
  84. #define PI_FMC_DESCR_M_FSC 0x38000000
  85. #define PI_FMC_DESCR_M_FSB_ERROR 0x04000000
  86. #define PI_FMC_DESCR_M_FSB_ADDR_RECOG 0x02000000
  87. #define PI_FMC_DESCR_M_FSB_ADDR_COPIED 0x01000000
  88. #define PI_FMC_DESCR_M_FSB 0x07C00000
  89. #define PI_FMC_DESCR_M_RCC_FLUSH 0x00200000
  90. #define PI_FMC_DESCR_M_RCC_CRC 0x00100000
  91. #define PI_FMC_DESCR_M_RCC_RRR 0x000E0000
  92. #define PI_FMC_DESCR_M_RCC_DD 0x00018000
  93. #define PI_FMC_DESCR_M_RCC_SS 0x00006000
  94. #define PI_FMC_DESCR_M_RCC 0x003FE000
  95. #define PI_FMC_DESCR_M_LEN 0x00001FFF
  96. #define PI_FMC_DESCR_K_RCC_FMC_INT_ERR 0x01AA
  97. #define PI_FMC_DESCR_K_RRR_SUCCESS 0x00
  98. #define PI_FMC_DESCR_K_RRR_SA_MATCH 0x01
  99. #define PI_FMC_DESCR_K_RRR_DA_MATCH 0x02
  100. #define PI_FMC_DESCR_K_RRR_FMC_ABORT 0x03
  101. #define PI_FMC_DESCR_K_RRR_LENGTH_BAD 0x04
  102. #define PI_FMC_DESCR_K_RRR_FRAGMENT 0x05
  103. #define PI_FMC_DESCR_K_RRR_FORMAT_ERR 0x06
  104. #define PI_FMC_DESCR_K_RRR_MAC_RESET 0x07
  105. #define PI_FMC_DESCR_K_DD_NO_MATCH 0x0
  106. #define PI_FMC_DESCR_K_DD_PROMISCUOUS 0x1
  107. #define PI_FMC_DESCR_K_DD_CAM_MATCH 0x2
  108. #define PI_FMC_DESCR_K_DD_LOCAL_MATCH 0x3
  109. #define PI_FMC_DESCR_K_SS_NO_MATCH 0x0
  110. #define PI_FMC_DESCR_K_SS_BRIDGE_MATCH 0x1
  111. #define PI_FMC_DESCR_K_SS_NOT_POSSIBLE 0x2
  112. #define PI_FMC_DESCR_K_SS_LOCAL_MATCH 0x3
  113. /* Define some max buffer sizes */
  114. #define PI_CMD_REQ_K_SIZE_MAX 512
  115. #define PI_CMD_RSP_K_SIZE_MAX 512
  116. #define PI_UNSOL_K_SIZE_MAX 512
  117. #define PI_SMT_HOST_K_SIZE_MAX 4608 /* 4 1/2 K */
  118. #define PI_RCV_DATA_K_SIZE_MAX 4608 /* 4 1/2 K */
  119. #define PI_XMT_DATA_K_SIZE_MAX 4608 /* 4 1/2 K */
  120. /* Define adapter states */
  121. #define PI_STATE_K_RESET 0
  122. #define PI_STATE_K_UPGRADE 1
  123. #define PI_STATE_K_DMA_UNAVAIL 2
  124. #define PI_STATE_K_DMA_AVAIL 3
  125. #define PI_STATE_K_LINK_AVAIL 4
  126. #define PI_STATE_K_LINK_UNAVAIL 5
  127. #define PI_STATE_K_HALTED 6
  128. #define PI_STATE_K_RING_MEMBER 7
  129. #define PI_STATE_K_NUMBER 8
  130. /* Define codes for command type */
  131. #define PI_CMD_K_START 0x00
  132. #define PI_CMD_K_FILTERS_SET 0x01
  133. #define PI_CMD_K_FILTERS_GET 0x02
  134. #define PI_CMD_K_CHARS_SET 0x03
  135. #define PI_CMD_K_STATUS_CHARS_GET 0x04
  136. #define PI_CMD_K_CNTRS_GET 0x05
  137. #define PI_CMD_K_CNTRS_SET 0x06
  138. #define PI_CMD_K_ADDR_FILTER_SET 0x07
  139. #define PI_CMD_K_ADDR_FILTER_GET 0x08
  140. #define PI_CMD_K_ERROR_LOG_CLEAR 0x09
  141. #define PI_CMD_K_ERROR_LOG_GET 0x0A
  142. #define PI_CMD_K_FDDI_MIB_GET 0x0B
  143. #define PI_CMD_K_DEC_EXT_MIB_GET 0x0C
  144. #define PI_CMD_K_DEVICE_SPECIFIC_GET 0x0D
  145. #define PI_CMD_K_SNMP_SET 0x0E
  146. #define PI_CMD_K_UNSOL_TEST 0x0F
  147. #define PI_CMD_K_SMT_MIB_GET 0x10
  148. #define PI_CMD_K_SMT_MIB_SET 0x11
  149. #define PI_CMD_K_MAX 0x11 /* Must match last */
  150. /* Define item codes for Chars_Set and Filters_Set commands */
  151. #define PI_ITEM_K_EOL 0x00 /* End-of-Item list */
  152. #define PI_ITEM_K_T_REQ 0x01 /* DECnet T_REQ */
  153. #define PI_ITEM_K_TVX 0x02 /* DECnet TVX */
  154. #define PI_ITEM_K_RESTRICTED_TOKEN 0x03 /* DECnet Restricted Token */
  155. #define PI_ITEM_K_LEM_THRESHOLD 0x04 /* DECnet LEM Threshold */
  156. #define PI_ITEM_K_RING_PURGER 0x05 /* DECnet Ring Purger Enable */
  157. #define PI_ITEM_K_CNTR_INTERVAL 0x06 /* Chars_Set */
  158. #define PI_ITEM_K_IND_GROUP_PROM 0x07 /* Filters_Set */
  159. #define PI_ITEM_K_GROUP_PROM 0x08 /* Filters_Set */
  160. #define PI_ITEM_K_BROADCAST 0x09 /* Filters_Set */
  161. #define PI_ITEM_K_SMT_PROM 0x0A /* Filters_Set */
  162. #define PI_ITEM_K_SMT_USER 0x0B /* Filters_Set */
  163. #define PI_ITEM_K_RESERVED 0x0C /* Filters_Set */
  164. #define PI_ITEM_K_IMPLEMENTOR 0x0D /* Filters_Set */
  165. #define PI_ITEM_K_LOOPBACK_MODE 0x0E /* Chars_Set */
  166. #define PI_ITEM_K_CONFIG_POLICY 0x10 /* SMTConfigPolicy */
  167. #define PI_ITEM_K_CON_POLICY 0x11 /* SMTConnectionPolicy */
  168. #define PI_ITEM_K_T_NOTIFY 0x12 /* SMTTNotify */
  169. #define PI_ITEM_K_STATION_ACTION 0x13 /* SMTStationAction */
  170. #define PI_ITEM_K_MAC_PATHS_REQ 0x15 /* MACPathsRequested */
  171. #define PI_ITEM_K_MAC_ACTION 0x17 /* MACAction */
  172. #define PI_ITEM_K_CON_POLICIES 0x18 /* PORTConnectionPolicies */
  173. #define PI_ITEM_K_PORT_PATHS_REQ 0x19 /* PORTPathsRequested */
  174. #define PI_ITEM_K_MAC_LOOP_TIME 0x1A /* PORTMACLoopTime */
  175. #define PI_ITEM_K_TB_MAX 0x1B /* PORTTBMax */
  176. #define PI_ITEM_K_LER_CUTOFF 0x1C /* PORTLerCutoff */
  177. #define PI_ITEM_K_LER_ALARM 0x1D /* PORTLerAlarm */
  178. #define PI_ITEM_K_PORT_ACTION 0x1E /* PORTAction */
  179. #define PI_ITEM_K_FLUSH_TIME 0x20 /* Chars_Set */
  180. #define PI_ITEM_K_MAC_T_REQ 0x29 /* MACTReq */
  181. #define PI_ITEM_K_EMAC_RING_PURGER 0x2A /* eMACRingPurgerEnable */
  182. #define PI_ITEM_K_EMAC_RTOKEN_TIMEOUT 0x2B /* eMACRestrictedTokenTimeout */
  183. #define PI_ITEM_K_FDX_ENB_DIS 0x2C /* eFDXEnable */
  184. #define PI_ITEM_K_MAX 0x2C /* Must equal high item */
  185. /* Values for some of the items */
  186. #define PI_K_FALSE 0 /* Generic false */
  187. #define PI_K_TRUE 1 /* Generic true */
  188. #define PI_SNMP_K_TRUE 1 /* SNMP true/false values */
  189. #define PI_SNMP_K_FALSE 2
  190. #define PI_FSTATE_K_BLOCK 0 /* Filter State */
  191. #define PI_FSTATE_K_PASS 1
  192. /* Define command return codes */
  193. #define PI_RSP_K_SUCCESS 0x00
  194. #define PI_RSP_K_FAILURE 0x01
  195. #define PI_RSP_K_WARNING 0x02
  196. #define PI_RSP_K_LOOP_MODE_BAD 0x03
  197. #define PI_RSP_K_ITEM_CODE_BAD 0x04
  198. #define PI_RSP_K_TVX_BAD 0x05
  199. #define PI_RSP_K_TREQ_BAD 0x06
  200. #define PI_RSP_K_TOKEN_BAD 0x07
  201. #define PI_RSP_K_NO_EOL 0x0C
  202. #define PI_RSP_K_FILTER_STATE_BAD 0x0D
  203. #define PI_RSP_K_CMD_TYPE_BAD 0x0E
  204. #define PI_RSP_K_ADAPTER_STATE_BAD 0x0F
  205. #define PI_RSP_K_RING_PURGER_BAD 0x10
  206. #define PI_RSP_K_LEM_THRESHOLD_BAD 0x11
  207. #define PI_RSP_K_LOOP_NOT_SUPPORTED 0x12
  208. #define PI_RSP_K_FLUSH_TIME_BAD 0x13
  209. #define PI_RSP_K_NOT_IMPLEMENTED 0x14
  210. #define PI_RSP_K_CONFIG_POLICY_BAD 0x15
  211. #define PI_RSP_K_STATION_ACTION_BAD 0x16
  212. #define PI_RSP_K_MAC_ACTION_BAD 0x17
  213. #define PI_RSP_K_CON_POLICIES_BAD 0x18
  214. #define PI_RSP_K_MAC_LOOP_TIME_BAD 0x19
  215. #define PI_RSP_K_TB_MAX_BAD 0x1A
  216. #define PI_RSP_K_LER_CUTOFF_BAD 0x1B
  217. #define PI_RSP_K_LER_ALARM_BAD 0x1C
  218. #define PI_RSP_K_MAC_PATHS_REQ_BAD 0x1D
  219. #define PI_RSP_K_MAC_T_REQ_BAD 0x1E
  220. #define PI_RSP_K_EMAC_RING_PURGER_BAD 0x1F
  221. #define PI_RSP_K_EMAC_RTOKEN_TIME_BAD 0x20
  222. #define PI_RSP_K_NO_SUCH_ENTRY 0x21
  223. #define PI_RSP_K_T_NOTIFY_BAD 0x22
  224. #define PI_RSP_K_TR_MAX_EXP_BAD 0x23
  225. #define PI_RSP_K_MAC_FRM_ERR_THR_BAD 0x24
  226. #define PI_RSP_K_MAX_T_REQ_BAD 0x25
  227. #define PI_RSP_K_FDX_ENB_DIS_BAD 0x26
  228. #define PI_RSP_K_ITEM_INDEX_BAD 0x27
  229. #define PI_RSP_K_PORT_ACTION_BAD 0x28
  230. /* Commonly used structures */
  231. typedef struct /* Item list */
  232. {
  233. PI_UINT32 item_code;
  234. PI_UINT32 value;
  235. } PI_ITEM_LIST;
  236. typedef struct /* Response header */
  237. {
  238. PI_UINT32 reserved;
  239. PI_UINT32 cmd_type;
  240. PI_UINT32 status;
  241. } PI_RSP_HEADER;
  242. /* Start Command */
  243. typedef struct
  244. {
  245. PI_UINT32 cmd_type;
  246. } PI_CMD_START_REQ;
  247. /* Start Response */
  248. typedef struct
  249. {
  250. PI_RSP_HEADER header;
  251. } PI_CMD_START_RSP;
  252. /* Filters_Set Request */
  253. #define PI_CMD_FILTERS_SET_K_ITEMS_MAX 63 /* Fits in a 512 byte buffer */
  254. typedef struct
  255. {
  256. PI_UINT32 cmd_type;
  257. PI_ITEM_LIST item[PI_CMD_FILTERS_SET_K_ITEMS_MAX];
  258. } PI_CMD_FILTERS_SET_REQ;
  259. /* Filters_Set Response */
  260. typedef struct
  261. {
  262. PI_RSP_HEADER header;
  263. } PI_CMD_FILTERS_SET_RSP;
  264. /* Filters_Get Request */
  265. typedef struct
  266. {
  267. PI_UINT32 cmd_type;
  268. } PI_CMD_FILTERS_GET_REQ;
  269. /* Filters_Get Response */
  270. typedef struct
  271. {
  272. PI_RSP_HEADER header;
  273. PI_UINT32 ind_group_prom;
  274. PI_UINT32 group_prom;
  275. PI_UINT32 broadcast_all;
  276. PI_UINT32 smt_all;
  277. PI_UINT32 smt_user;
  278. PI_UINT32 reserved_all;
  279. PI_UINT32 implementor_all;
  280. } PI_CMD_FILTERS_GET_RSP;
  281. /* Chars_Set Request */
  282. #define PI_CMD_CHARS_SET_K_ITEMS_MAX 42 /* Fits in a 512 byte buffer */
  283. typedef struct
  284. {
  285. PI_UINT32 cmd_type;
  286. struct /* Item list */
  287. {
  288. PI_UINT32 item_code;
  289. PI_UINT32 value;
  290. PI_UINT32 item_index;
  291. } item[PI_CMD_CHARS_SET_K_ITEMS_MAX];
  292. } PI_CMD_CHARS_SET_REQ;
  293. /* Chars_Set Response */
  294. typedef struct
  295. {
  296. PI_RSP_HEADER header;
  297. } PI_CMD_CHARS_SET_RSP;
  298. /* SNMP_Set Request */
  299. #define PI_CMD_SNMP_SET_K_ITEMS_MAX 42 /* Fits in a 512 byte buffer */
  300. typedef struct
  301. {
  302. PI_UINT32 cmd_type;
  303. struct /* Item list */
  304. {
  305. PI_UINT32 item_code;
  306. PI_UINT32 value;
  307. PI_UINT32 item_index;
  308. } item[PI_CMD_SNMP_SET_K_ITEMS_MAX];
  309. } PI_CMD_SNMP_SET_REQ;
  310. /* SNMP_Set Response */
  311. typedef struct
  312. {
  313. PI_RSP_HEADER header;
  314. } PI_CMD_SNMP_SET_RSP;
  315. /* SMT_MIB_Set Request */
  316. #define PI_CMD_SMT_MIB_SET_K_ITEMS_MAX 42 /* Max number of items */
  317. typedef struct
  318. {
  319. PI_UINT32 cmd_type;
  320. struct
  321. {
  322. PI_UINT32 item_code;
  323. PI_UINT32 value;
  324. PI_UINT32 item_index;
  325. } item[PI_CMD_SMT_MIB_SET_K_ITEMS_MAX];
  326. } PI_CMD_SMT_MIB_SET_REQ;
  327. /* SMT_MIB_Set Response */
  328. typedef struct
  329. {
  330. PI_RSP_HEADER header;
  331. } PI_CMD_SMT_MIB_SET_RSP;
  332. /* SMT_MIB_Get Request */
  333. typedef struct
  334. {
  335. PI_UINT32 cmd_type;
  336. } PI_CMD_SMT_MIB_GET_REQ;
  337. /* SMT_MIB_Get Response */
  338. typedef struct /* Refer to ANSI FDDI SMT Rev. 7.3 */
  339. {
  340. PI_RSP_HEADER header;
  341. /* SMT GROUP */
  342. PI_STATION_ID smt_station_id;
  343. PI_UINT32 smt_op_version_id;
  344. PI_UINT32 smt_hi_version_id;
  345. PI_UINT32 smt_lo_version_id;
  346. PI_UINT32 smt_user_data[8];
  347. PI_UINT32 smt_mib_version_id;
  348. PI_UINT32 smt_mac_ct;
  349. PI_UINT32 smt_non_master_ct;
  350. PI_UINT32 smt_master_ct;
  351. PI_UINT32 smt_available_paths;
  352. PI_UINT32 smt_config_capabilities;
  353. PI_UINT32 smt_config_policy;
  354. PI_UINT32 smt_connection_policy;
  355. PI_UINT32 smt_t_notify;
  356. PI_UINT32 smt_stat_rpt_policy;
  357. PI_UINT32 smt_trace_max_expiration;
  358. PI_UINT32 smt_bypass_present;
  359. PI_UINT32 smt_ecm_state;
  360. PI_UINT32 smt_cf_state;
  361. PI_UINT32 smt_remote_disconnect_flag;
  362. PI_UINT32 smt_station_status;
  363. PI_UINT32 smt_peer_wrap_flag;
  364. PI_CNTR smt_msg_time_stamp;
  365. PI_CNTR smt_transition_time_stamp;
  366. /* MAC GROUP */
  367. PI_UINT32 mac_frame_status_functions;
  368. PI_UINT32 mac_t_max_capability;
  369. PI_UINT32 mac_tvx_capability;
  370. PI_UINT32 mac_available_paths;
  371. PI_UINT32 mac_current_path;
  372. PI_LAN_ADDR mac_upstream_nbr;
  373. PI_LAN_ADDR mac_downstream_nbr;
  374. PI_LAN_ADDR mac_old_upstream_nbr;
  375. PI_LAN_ADDR mac_old_downstream_nbr;
  376. PI_UINT32 mac_dup_address_test;
  377. PI_UINT32 mac_requested_paths;
  378. PI_UINT32 mac_downstream_port_type;
  379. PI_LAN_ADDR mac_smt_address;
  380. PI_UINT32 mac_t_req;
  381. PI_UINT32 mac_t_neg;
  382. PI_UINT32 mac_t_max;
  383. PI_UINT32 mac_tvx_value;
  384. PI_UINT32 mac_frame_error_threshold;
  385. PI_UINT32 mac_frame_error_ratio;
  386. PI_UINT32 mac_rmt_state;
  387. PI_UINT32 mac_da_flag;
  388. PI_UINT32 mac_unda_flag;
  389. PI_UINT32 mac_frame_error_flag;
  390. PI_UINT32 mac_ma_unitdata_available;
  391. PI_UINT32 mac_hardware_present;
  392. PI_UINT32 mac_ma_unitdata_enable;
  393. /* PATH GROUP */
  394. PI_UINT32 path_configuration[8];
  395. PI_UINT32 path_tvx_lower_bound;
  396. PI_UINT32 path_t_max_lower_bound;
  397. PI_UINT32 path_max_t_req;
  398. /* PORT GROUP */
  399. PI_UINT32 port_my_type[PI_PHY_K_MAX];
  400. PI_UINT32 port_neighbor_type[PI_PHY_K_MAX];
  401. PI_UINT32 port_connection_policies[PI_PHY_K_MAX];
  402. PI_UINT32 port_mac_indicated[PI_PHY_K_MAX];
  403. PI_UINT32 port_current_path[PI_PHY_K_MAX];
  404. PI_UINT32 port_requested_paths[PI_PHY_K_MAX];
  405. PI_UINT32 port_mac_placement[PI_PHY_K_MAX];
  406. PI_UINT32 port_available_paths[PI_PHY_K_MAX];
  407. PI_UINT32 port_pmd_class[PI_PHY_K_MAX];
  408. PI_UINT32 port_connection_capabilities[PI_PHY_K_MAX];
  409. PI_UINT32 port_bs_flag[PI_PHY_K_MAX];
  410. PI_UINT32 port_ler_estimate[PI_PHY_K_MAX];
  411. PI_UINT32 port_ler_cutoff[PI_PHY_K_MAX];
  412. PI_UINT32 port_ler_alarm[PI_PHY_K_MAX];
  413. PI_UINT32 port_connect_state[PI_PHY_K_MAX];
  414. PI_UINT32 port_pcm_state[PI_PHY_K_MAX];
  415. PI_UINT32 port_pc_withhold[PI_PHY_K_MAX];
  416. PI_UINT32 port_ler_flag[PI_PHY_K_MAX];
  417. PI_UINT32 port_hardware_present[PI_PHY_K_MAX];
  418. /* GROUP for things that were added later, so must be at the end. */
  419. PI_CNTR path_ring_latency;
  420. } PI_CMD_SMT_MIB_GET_RSP;
  421. /*
  422. * Item and group code definitions for SMT 7.3 mandatory objects. These
  423. * definitions are to be used as appropriate in SMT_MIB_SET commands and
  424. * certain host-sent SMT frames such as PMF Get and Set requests. The
  425. * codes have been taken from the MIB summary section of ANSI SMT 7.3.
  426. */
  427. #define PI_GRP_K_SMT_STATION_ID 0x100A
  428. #define PI_ITEM_K_SMT_STATION_ID 0x100B
  429. #define PI_ITEM_K_SMT_OP_VERS_ID 0x100D
  430. #define PI_ITEM_K_SMT_HI_VERS_ID 0x100E
  431. #define PI_ITEM_K_SMT_LO_VERS_ID 0x100F
  432. #define PI_ITEM_K_SMT_USER_DATA 0x1011
  433. #define PI_ITEM_K_SMT_MIB_VERS_ID 0x1012
  434. #define PI_GRP_K_SMT_STATION_CONFIG 0x1014
  435. #define PI_ITEM_K_SMT_MAC_CT 0x1015
  436. #define PI_ITEM_K_SMT_NON_MASTER_CT 0x1016
  437. #define PI_ITEM_K_SMT_MASTER_CT 0x1017
  438. #define PI_ITEM_K_SMT_AVAIL_PATHS 0x1018
  439. #define PI_ITEM_K_SMT_CONFIG_CAPS 0x1019
  440. #define PI_ITEM_K_SMT_CONFIG_POL 0x101A
  441. #define PI_ITEM_K_SMT_CONN_POL 0x101B
  442. #define PI_ITEM_K_SMT_T_NOTIFY 0x101D
  443. #define PI_ITEM_K_SMT_STAT_POL 0x101E
  444. #define PI_ITEM_K_SMT_TR_MAX_EXP 0x101F
  445. #define PI_ITEM_K_SMT_PORT_INDEXES 0x1020
  446. #define PI_ITEM_K_SMT_MAC_INDEXES 0x1021
  447. #define PI_ITEM_K_SMT_BYPASS_PRESENT 0x1022
  448. #define PI_GRP_K_SMT_STATUS 0x1028
  449. #define PI_ITEM_K_SMT_ECM_STATE 0x1029
  450. #define PI_ITEM_K_SMT_CF_STATE 0x102A
  451. #define PI_ITEM_K_SMT_REM_DISC_FLAG 0x102C
  452. #define PI_ITEM_K_SMT_STATION_STATUS 0x102D
  453. #define PI_ITEM_K_SMT_PEER_WRAP_FLAG 0x102E
  454. #define PI_GRP_K_SMT_MIB_OPERATION 0x1032
  455. #define PI_ITEM_K_SMT_MSG_TIME_STAMP 0x1033
  456. #define PI_ITEM_K_SMT_TRN_TIME_STAMP 0x1034
  457. #define PI_ITEM_K_SMT_STATION_ACT 0x103C
  458. #define PI_GRP_K_MAC_CAPABILITIES 0x200A
  459. #define PI_ITEM_K_MAC_FRM_STAT_FUNC 0x200B
  460. #define PI_ITEM_K_MAC_T_MAX_CAP 0x200D
  461. #define PI_ITEM_K_MAC_TVX_CAP 0x200E
  462. #define PI_GRP_K_MAC_CONFIG 0x2014
  463. #define PI_ITEM_K_MAC_AVAIL_PATHS 0x2016
  464. #define PI_ITEM_K_MAC_CURRENT_PATH 0x2017
  465. #define PI_ITEM_K_MAC_UP_NBR 0x2018
  466. #define PI_ITEM_K_MAC_DOWN_NBR 0x2019
  467. #define PI_ITEM_K_MAC_OLD_UP_NBR 0x201A
  468. #define PI_ITEM_K_MAC_OLD_DOWN_NBR 0x201B
  469. #define PI_ITEM_K_MAC_DUP_ADDR_TEST 0x201D
  470. #define PI_ITEM_K_MAC_REQ_PATHS 0x2020
  471. #define PI_ITEM_K_MAC_DOWN_PORT_TYPE 0x2021
  472. #define PI_ITEM_K_MAC_INDEX 0x2022
  473. #define PI_GRP_K_MAC_ADDRESS 0x2028
  474. #define PI_ITEM_K_MAC_SMT_ADDRESS 0x2029
  475. #define PI_GRP_K_MAC_OPERATION 0x2032
  476. #define PI_ITEM_K_MAC_TREQ 0x2033
  477. #define PI_ITEM_K_MAC_TNEG 0x2034
  478. #define PI_ITEM_K_MAC_TMAX 0x2035
  479. #define PI_ITEM_K_MAC_TVX_VALUE 0x2036
  480. #define PI_GRP_K_MAC_COUNTERS 0x2046
  481. #define PI_ITEM_K_MAC_FRAME_CT 0x2047
  482. #define PI_ITEM_K_MAC_COPIED_CT 0x2048
  483. #define PI_ITEM_K_MAC_TRANSMIT_CT 0x2049
  484. #define PI_ITEM_K_MAC_ERROR_CT 0x2051
  485. #define PI_ITEM_K_MAC_LOST_CT 0x2052
  486. #define PI_GRP_K_MAC_FRM_ERR_COND 0x205A
  487. #define PI_ITEM_K_MAC_FRM_ERR_THR 0x205F
  488. #define PI_ITEM_K_MAC_FRM_ERR_RAT 0x2060
  489. #define PI_GRP_K_MAC_STATUS 0x206E
  490. #define PI_ITEM_K_MAC_RMT_STATE 0x206F
  491. #define PI_ITEM_K_MAC_DA_FLAG 0x2070
  492. #define PI_ITEM_K_MAC_UNDA_FLAG 0x2071
  493. #define PI_ITEM_K_MAC_FRM_ERR_FLAG 0x2072
  494. #define PI_ITEM_K_MAC_MA_UNIT_AVAIL 0x2074
  495. #define PI_ITEM_K_MAC_HW_PRESENT 0x2075
  496. #define PI_ITEM_K_MAC_MA_UNIT_ENAB 0x2076
  497. #define PI_GRP_K_PATH_CONFIG 0x320A
  498. #define PI_ITEM_K_PATH_INDEX 0x320B
  499. #define PI_ITEM_K_PATH_CONFIGURATION 0x3212
  500. #define PI_ITEM_K_PATH_TVX_LB 0x3215
  501. #define PI_ITEM_K_PATH_T_MAX_LB 0x3216
  502. #define PI_ITEM_K_PATH_MAX_T_REQ 0x3217
  503. #define PI_GRP_K_PORT_CONFIG 0x400A
  504. #define PI_ITEM_K_PORT_MY_TYPE 0x400C
  505. #define PI_ITEM_K_PORT_NBR_TYPE 0x400D
  506. #define PI_ITEM_K_PORT_CONN_POLS 0x400E
  507. #define PI_ITEM_K_PORT_MAC_INDICATED 0x400F
  508. #define PI_ITEM_K_PORT_CURRENT_PATH 0x4010
  509. #define PI_ITEM_K_PORT_REQ_PATHS 0x4011
  510. #define PI_ITEM_K_PORT_MAC_PLACEMENT 0x4012
  511. #define PI_ITEM_K_PORT_AVAIL_PATHS 0x4013
  512. #define PI_ITEM_K_PORT_PMD_CLASS 0x4016
  513. #define PI_ITEM_K_PORT_CONN_CAPS 0x4017
  514. #define PI_ITEM_K_PORT_INDEX 0x401D
  515. #define PI_GRP_K_PORT_OPERATION 0x401E
  516. #define PI_ITEM_K_PORT_BS_FLAG 0x4021
  517. #define PI_GRP_K_PORT_ERR_CNTRS 0x4028
  518. #define PI_ITEM_K_PORT_LCT_FAIL_CT 0x402A
  519. #define PI_GRP_K_PORT_LER 0x4032
  520. #define PI_ITEM_K_PORT_LER_ESTIMATE 0x4033
  521. #define PI_ITEM_K_PORT_LEM_REJ_CT 0x4034
  522. #define PI_ITEM_K_PORT_LEM_CT 0x4035
  523. #define PI_ITEM_K_PORT_LER_CUTOFF 0x403A
  524. #define PI_ITEM_K_PORT_LER_ALARM 0x403B
  525. #define PI_GRP_K_PORT_STATUS 0x403C
  526. #define PI_ITEM_K_PORT_CONNECT_STATE 0x403D
  527. #define PI_ITEM_K_PORT_PCM_STATE 0x403E
  528. #define PI_ITEM_K_PORT_PC_WITHHOLD 0x403F
  529. #define PI_ITEM_K_PORT_LER_FLAG 0x4040
  530. #define PI_ITEM_K_PORT_HW_PRESENT 0x4041
  531. #define PI_ITEM_K_PORT_ACT 0x4046
  532. /* Addr_Filter_Set Request */
  533. #define PI_CMD_ADDR_FILTER_K_SIZE 62
  534. typedef struct
  535. {
  536. PI_UINT32 cmd_type;
  537. PI_LAN_ADDR entry[PI_CMD_ADDR_FILTER_K_SIZE];
  538. } PI_CMD_ADDR_FILTER_SET_REQ;
  539. /* Addr_Filter_Set Response */
  540. typedef struct
  541. {
  542. PI_RSP_HEADER header;
  543. } PI_CMD_ADDR_FILTER_SET_RSP;
  544. /* Addr_Filter_Get Request */
  545. typedef struct
  546. {
  547. PI_UINT32 cmd_type;
  548. } PI_CMD_ADDR_FILTER_GET_REQ;
  549. /* Addr_Filter_Get Response */
  550. typedef struct
  551. {
  552. PI_RSP_HEADER header;
  553. PI_LAN_ADDR entry[PI_CMD_ADDR_FILTER_K_SIZE];
  554. } PI_CMD_ADDR_FILTER_GET_RSP;
  555. /* Status_Chars_Get Request */
  556. typedef struct
  557. {
  558. PI_UINT32 cmd_type;
  559. } PI_CMD_STATUS_CHARS_GET_REQ;
  560. /* Status_Chars_Get Response */
  561. typedef struct
  562. {
  563. PI_RSP_HEADER header;
  564. PI_STATION_ID station_id; /* Station */
  565. PI_UINT32 station_type;
  566. PI_UINT32 smt_ver_id;
  567. PI_UINT32 smt_ver_id_max;
  568. PI_UINT32 smt_ver_id_min;
  569. PI_UINT32 station_state;
  570. PI_LAN_ADDR link_addr; /* Link */
  571. PI_UINT32 t_req;
  572. PI_UINT32 tvx;
  573. PI_UINT32 token_timeout;
  574. PI_UINT32 purger_enb;
  575. PI_UINT32 link_state;
  576. PI_UINT32 tneg;
  577. PI_UINT32 dup_addr_flag;
  578. PI_LAN_ADDR una;
  579. PI_LAN_ADDR una_old;
  580. PI_UINT32 un_dup_addr_flag;
  581. PI_LAN_ADDR dna;
  582. PI_LAN_ADDR dna_old;
  583. PI_UINT32 purger_state;
  584. PI_UINT32 fci_mode;
  585. PI_UINT32 error_reason;
  586. PI_UINT32 loopback;
  587. PI_UINT32 ring_latency;
  588. PI_LAN_ADDR last_dir_beacon_sa;
  589. PI_LAN_ADDR last_dir_beacon_una;
  590. PI_UINT32 phy_type[PI_PHY_K_MAX]; /* Phy */
  591. PI_UINT32 pmd_type[PI_PHY_K_MAX];
  592. PI_UINT32 lem_threshold[PI_PHY_K_MAX];
  593. PI_UINT32 phy_state[PI_PHY_K_MAX];
  594. PI_UINT32 nbor_phy_type[PI_PHY_K_MAX];
  595. PI_UINT32 link_error_est[PI_PHY_K_MAX];
  596. PI_UINT32 broken_reason[PI_PHY_K_MAX];
  597. PI_UINT32 reject_reason[PI_PHY_K_MAX];
  598. PI_UINT32 cntr_interval; /* Miscellaneous */
  599. PI_UINT32 module_rev;
  600. PI_UINT32 firmware_rev;
  601. PI_UINT32 mop_device_type;
  602. PI_UINT32 phy_led[PI_PHY_K_MAX];
  603. PI_UINT32 flush_time;
  604. } PI_CMD_STATUS_CHARS_GET_RSP;
  605. /* FDDI_MIB_Get Request */
  606. typedef struct
  607. {
  608. PI_UINT32 cmd_type;
  609. } PI_CMD_FDDI_MIB_GET_REQ;
  610. /* FDDI_MIB_Get Response */
  611. typedef struct
  612. {
  613. PI_RSP_HEADER header;
  614. /* SMT GROUP */
  615. PI_STATION_ID smt_station_id;
  616. PI_UINT32 smt_op_version_id;
  617. PI_UINT32 smt_hi_version_id;
  618. PI_UINT32 smt_lo_version_id;
  619. PI_UINT32 smt_mac_ct;
  620. PI_UINT32 smt_non_master_ct;
  621. PI_UINT32 smt_master_ct;
  622. PI_UINT32 smt_paths_available;
  623. PI_UINT32 smt_config_capabilities;
  624. PI_UINT32 smt_config_policy;
  625. PI_UINT32 smt_connection_policy;
  626. PI_UINT32 smt_t_notify;
  627. PI_UINT32 smt_status_reporting;
  628. PI_UINT32 smt_ecm_state;
  629. PI_UINT32 smt_cf_state;
  630. PI_UINT32 smt_hold_state;
  631. PI_UINT32 smt_remote_disconnect_flag;
  632. PI_UINT32 smt_station_action;
  633. /* MAC GROUP */
  634. PI_UINT32 mac_frame_status_capabilities;
  635. PI_UINT32 mac_t_max_greatest_lower_bound;
  636. PI_UINT32 mac_tvx_greatest_lower_bound;
  637. PI_UINT32 mac_paths_available;
  638. PI_UINT32 mac_current_path;
  639. PI_LAN_ADDR mac_upstream_nbr;
  640. PI_LAN_ADDR mac_old_upstream_nbr;
  641. PI_UINT32 mac_dup_addr_test;
  642. PI_UINT32 mac_paths_requested;
  643. PI_UINT32 mac_downstream_port_type;
  644. PI_LAN_ADDR mac_smt_address;
  645. PI_UINT32 mac_t_req;
  646. PI_UINT32 mac_t_neg;
  647. PI_UINT32 mac_t_max;
  648. PI_UINT32 mac_tvx_value;
  649. PI_UINT32 mac_t_min;
  650. PI_UINT32 mac_current_frame_status;
  651. /* mac_frame_cts */
  652. /* mac_error_cts */
  653. /* mac_lost_cts */
  654. PI_UINT32 mac_frame_error_threshold;
  655. PI_UINT32 mac_frame_error_ratio;
  656. PI_UINT32 mac_rmt_state;
  657. PI_UINT32 mac_da_flag;
  658. PI_UINT32 mac_una_da_flag;
  659. PI_UINT32 mac_frame_condition;
  660. PI_UINT32 mac_chip_set;
  661. PI_UINT32 mac_action;
  662. /* PATH GROUP => Does not need to be implemented */
  663. /* PORT GROUP */
  664. PI_UINT32 port_pc_type[PI_PHY_K_MAX];
  665. PI_UINT32 port_pc_neighbor[PI_PHY_K_MAX];
  666. PI_UINT32 port_connection_policies[PI_PHY_K_MAX];
  667. PI_UINT32 port_remote_mac_indicated[PI_PHY_K_MAX];
  668. PI_UINT32 port_ce_state[PI_PHY_K_MAX];
  669. PI_UINT32 port_paths_requested[PI_PHY_K_MAX];
  670. PI_UINT32 port_mac_placement[PI_PHY_K_MAX];
  671. PI_UINT32 port_available_paths[PI_PHY_K_MAX];
  672. PI_UINT32 port_mac_loop_time[PI_PHY_K_MAX];
  673. PI_UINT32 port_tb_max[PI_PHY_K_MAX];
  674. PI_UINT32 port_bs_flag[PI_PHY_K_MAX];
  675. /* port_lct_fail_cts[PI_PHY_K_MAX]; */
  676. PI_UINT32 port_ler_estimate[PI_PHY_K_MAX];
  677. /* port_lem_reject_cts[PI_PHY_K_MAX]; */
  678. /* port_lem_cts[PI_PHY_K_MAX]; */
  679. PI_UINT32 port_ler_cutoff[PI_PHY_K_MAX];
  680. PI_UINT32 port_ler_alarm[PI_PHY_K_MAX];
  681. PI_UINT32 port_connect_state[PI_PHY_K_MAX];
  682. PI_UINT32 port_pcm_state[PI_PHY_K_MAX];
  683. PI_UINT32 port_pc_withhold[PI_PHY_K_MAX];
  684. PI_UINT32 port_ler_condition[PI_PHY_K_MAX];
  685. PI_UINT32 port_chip_set[PI_PHY_K_MAX];
  686. PI_UINT32 port_action[PI_PHY_K_MAX];
  687. /* ATTACHMENT GROUP */
  688. PI_UINT32 attachment_class;
  689. PI_UINT32 attachment_ob_present;
  690. PI_UINT32 attachment_imax_expiration;
  691. PI_UINT32 attachment_inserted_status;
  692. PI_UINT32 attachment_insert_policy;
  693. /* CHIP SET GROUP => Does not need to be implemented */
  694. } PI_CMD_FDDI_MIB_GET_RSP;
  695. /* DEC_Ext_MIB_Get Request */
  696. typedef struct
  697. {
  698. PI_UINT32 cmd_type;
  699. } PI_CMD_DEC_EXT_MIB_GET_REQ;
  700. /* DEC_Ext_MIB_Get (efddi and efdx groups only) Response */
  701. typedef struct
  702. {
  703. PI_RSP_HEADER header;
  704. /* SMT GROUP */
  705. PI_UINT32 esmt_station_type;
  706. /* MAC GROUP */
  707. PI_UINT32 emac_link_state;
  708. PI_UINT32 emac_ring_purger_state;
  709. PI_UINT32 emac_ring_purger_enable;
  710. PI_UINT32 emac_frame_strip_mode;
  711. PI_UINT32 emac_ring_error_reason;
  712. PI_UINT32 emac_up_nbr_dup_addr_flag;
  713. PI_UINT32 emac_restricted_token_timeout;
  714. /* PORT GROUP */
  715. PI_UINT32 eport_pmd_type[PI_PHY_K_MAX];
  716. PI_UINT32 eport_phy_state[PI_PHY_K_MAX];
  717. PI_UINT32 eport_reject_reason[PI_PHY_K_MAX];
  718. /* FDX (Full-Duplex) GROUP */
  719. PI_UINT32 efdx_enable; /* Valid only in SMT 7.3 */
  720. PI_UINT32 efdx_op; /* Valid only in SMT 7.3 */
  721. PI_UINT32 efdx_state; /* Valid only in SMT 7.3 */
  722. } PI_CMD_DEC_EXT_MIB_GET_RSP;
  723. typedef struct
  724. {
  725. PI_CNTR traces_rcvd; /* Station */
  726. PI_CNTR frame_cnt; /* Link */
  727. PI_CNTR error_cnt;
  728. PI_CNTR lost_cnt;
  729. PI_CNTR octets_rcvd;
  730. PI_CNTR octets_sent;
  731. PI_CNTR pdus_rcvd;
  732. PI_CNTR pdus_sent;
  733. PI_CNTR mcast_octets_rcvd;
  734. PI_CNTR mcast_octets_sent;
  735. PI_CNTR mcast_pdus_rcvd;
  736. PI_CNTR mcast_pdus_sent;
  737. PI_CNTR xmt_underruns;
  738. PI_CNTR xmt_failures;
  739. PI_CNTR block_check_errors;
  740. PI_CNTR frame_status_errors;
  741. PI_CNTR pdu_length_errors;
  742. PI_CNTR rcv_overruns;
  743. PI_CNTR user_buff_unavailable;
  744. PI_CNTR inits_initiated;
  745. PI_CNTR inits_rcvd;
  746. PI_CNTR beacons_initiated;
  747. PI_CNTR dup_addrs;
  748. PI_CNTR dup_tokens;
  749. PI_CNTR purge_errors;
  750. PI_CNTR fci_strip_errors;
  751. PI_CNTR traces_initiated;
  752. PI_CNTR directed_beacons_rcvd;
  753. PI_CNTR emac_frame_alignment_errors;
  754. PI_CNTR ebuff_errors[PI_PHY_K_MAX]; /* Phy */
  755. PI_CNTR lct_rejects[PI_PHY_K_MAX];
  756. PI_CNTR lem_rejects[PI_PHY_K_MAX];
  757. PI_CNTR link_errors[PI_PHY_K_MAX];
  758. PI_CNTR connections[PI_PHY_K_MAX];
  759. PI_CNTR copied_cnt; /* Valid only if using SMT 7.3 */
  760. PI_CNTR transmit_cnt; /* Valid only if using SMT 7.3 */
  761. PI_CNTR tokens;
  762. } PI_CNTR_BLK;
  763. /* Counters_Get Request */
  764. typedef struct
  765. {
  766. PI_UINT32 cmd_type;
  767. } PI_CMD_CNTRS_GET_REQ;
  768. /* Counters_Get Response */
  769. typedef struct
  770. {
  771. PI_RSP_HEADER header;
  772. PI_CNTR time_since_reset;
  773. PI_CNTR_BLK cntrs;
  774. } PI_CMD_CNTRS_GET_RSP;
  775. /* Counters_Set Request */
  776. typedef struct
  777. {
  778. PI_UINT32 cmd_type;
  779. PI_CNTR_BLK cntrs;
  780. } PI_CMD_CNTRS_SET_REQ;
  781. /* Counters_Set Response */
  782. typedef struct
  783. {
  784. PI_RSP_HEADER header;
  785. } PI_CMD_CNTRS_SET_RSP;
  786. /* Error_Log_Clear Request */
  787. typedef struct
  788. {
  789. PI_UINT32 cmd_type;
  790. } PI_CMD_ERROR_LOG_CLEAR_REQ;
  791. /* Error_Log_Clear Response */
  792. typedef struct
  793. {
  794. PI_RSP_HEADER header;
  795. } PI_CMD_ERROR_LOG_CLEAR_RSP;
  796. /* Error_Log_Get Request */
  797. #define PI_LOG_ENTRY_K_INDEX_MIN 0 /* Minimum index for entry */
  798. typedef struct
  799. {
  800. PI_UINT32 cmd_type;
  801. PI_UINT32 entry_index;
  802. } PI_CMD_ERROR_LOG_GET_REQ;
  803. /* Error_Log_Get Response */
  804. #define PI_K_LOG_FW_SIZE 111 /* Max number of fw longwords */
  805. #define PI_K_LOG_DIAG_SIZE 6 /* Max number of diag longwords */
  806. typedef struct
  807. {
  808. struct
  809. {
  810. PI_UINT32 fru_imp_mask;
  811. PI_UINT32 test_id;
  812. PI_UINT32 reserved[PI_K_LOG_DIAG_SIZE];
  813. } diag;
  814. PI_UINT32 fw[PI_K_LOG_FW_SIZE];
  815. } PI_LOG_ENTRY;
  816. typedef struct
  817. {
  818. PI_RSP_HEADER header;
  819. PI_UINT32 event_status;
  820. PI_UINT32 caller_id;
  821. PI_UINT32 timestamp_l;
  822. PI_UINT32 timestamp_h;
  823. PI_UINT32 write_count;
  824. PI_LOG_ENTRY entry_info;
  825. } PI_CMD_ERROR_LOG_GET_RSP;
  826. /* Define error log related constants and types. */
  827. /* Not all of the caller id's can occur. The only ones currently */
  828. /* implemented are: none, selftest, mfg, fw, console */
  829. #define PI_LOG_EVENT_STATUS_K_VALID 0 /* Valid Event Status */
  830. #define PI_LOG_EVENT_STATUS_K_INVALID 1 /* Invalid Event Status */
  831. #define PI_LOG_CALLER_ID_K_NONE 0 /* No caller */
  832. #define PI_LOG_CALLER_ID_K_SELFTEST 1 /* Normal power-up selftest */
  833. #define PI_LOG_CALLER_ID_K_MFG 2 /* Mfg power-up selftest */
  834. #define PI_LOG_CALLER_ID_K_ONLINE 3 /* On-line diagnostics */
  835. #define PI_LOG_CALLER_ID_K_HW 4 /* Hardware */
  836. #define PI_LOG_CALLER_ID_K_FW 5 /* Firmware */
  837. #define PI_LOG_CALLER_ID_K_CNS_HW 6 /* CNS firmware */
  838. #define PI_LOG_CALLER_ID_K_CNS_FW 7 /* CNS hardware */
  839. #define PI_LOG_CALLER_ID_K_CONSOLE 8 /* Console Caller Id */
  840. /*
  841. * Place all DMA commands in the following request and response structures
  842. * to simplify code.
  843. */
  844. typedef union
  845. {
  846. PI_UINT32 cmd_type;
  847. PI_CMD_START_REQ start;
  848. PI_CMD_FILTERS_SET_REQ filter_set;
  849. PI_CMD_FILTERS_GET_REQ filter_get;
  850. PI_CMD_CHARS_SET_REQ char_set;
  851. PI_CMD_ADDR_FILTER_SET_REQ addr_filter_set;
  852. PI_CMD_ADDR_FILTER_GET_REQ addr_filter_get;
  853. PI_CMD_STATUS_CHARS_GET_REQ stat_char_get;
  854. PI_CMD_CNTRS_GET_REQ cntrs_get;
  855. PI_CMD_CNTRS_SET_REQ cntrs_set;
  856. PI_CMD_ERROR_LOG_CLEAR_REQ error_log_clear;
  857. PI_CMD_ERROR_LOG_GET_REQ error_log_read;
  858. PI_CMD_SNMP_SET_REQ snmp_set;
  859. PI_CMD_FDDI_MIB_GET_REQ fddi_mib_get;
  860. PI_CMD_DEC_EXT_MIB_GET_REQ dec_mib_get;
  861. PI_CMD_SMT_MIB_SET_REQ smt_mib_set;
  862. PI_CMD_SMT_MIB_GET_REQ smt_mib_get;
  863. char pad[PI_CMD_REQ_K_SIZE_MAX];
  864. } PI_DMA_CMD_REQ;
  865. typedef union
  866. {
  867. PI_RSP_HEADER header;
  868. PI_CMD_START_RSP start;
  869. PI_CMD_FILTERS_SET_RSP filter_set;
  870. PI_CMD_FILTERS_GET_RSP filter_get;
  871. PI_CMD_CHARS_SET_RSP char_set;
  872. PI_CMD_ADDR_FILTER_SET_RSP addr_filter_set;
  873. PI_CMD_ADDR_FILTER_GET_RSP addr_filter_get;
  874. PI_CMD_STATUS_CHARS_GET_RSP stat_char_get;
  875. PI_CMD_CNTRS_GET_RSP cntrs_get;
  876. PI_CMD_CNTRS_SET_RSP cntrs_set;
  877. PI_CMD_ERROR_LOG_CLEAR_RSP error_log_clear;
  878. PI_CMD_ERROR_LOG_GET_RSP error_log_get;
  879. PI_CMD_SNMP_SET_RSP snmp_set;
  880. PI_CMD_FDDI_MIB_GET_RSP fddi_mib_get;
  881. PI_CMD_DEC_EXT_MIB_GET_RSP dec_mib_get;
  882. PI_CMD_SMT_MIB_SET_RSP smt_mib_set;
  883. PI_CMD_SMT_MIB_GET_RSP smt_mib_get;
  884. char pad[PI_CMD_RSP_K_SIZE_MAX];
  885. } PI_DMA_CMD_RSP;
  886. typedef union
  887. {
  888. PI_DMA_CMD_REQ request;
  889. PI_DMA_CMD_RSP response;
  890. } PI_DMA_CMD_BUFFER;
  891. /* Define format of Consumer Block (resident in host memory) */
  892. typedef struct
  893. {
  894. volatile PI_UINT32 xmt_rcv_data;
  895. volatile PI_UINT32 reserved_1;
  896. volatile PI_UINT32 smt_host;
  897. volatile PI_UINT32 reserved_2;
  898. volatile PI_UINT32 unsol;
  899. volatile PI_UINT32 reserved_3;
  900. volatile PI_UINT32 cmd_rsp;
  901. volatile PI_UINT32 reserved_4;
  902. volatile PI_UINT32 cmd_req;
  903. volatile PI_UINT32 reserved_5;
  904. } PI_CONSUMER_BLOCK;
  905. #define PI_CONS_M_RCV_INDEX 0x000000FF
  906. #define PI_CONS_M_XMT_INDEX 0x00FF0000
  907. #define PI_CONS_V_RCV_INDEX 0
  908. #define PI_CONS_V_XMT_INDEX 16
  909. /* Offsets into consumer block */
  910. #define PI_CONS_BLK_K_XMT_RCV 0x00
  911. #define PI_CONS_BLK_K_SMT_HOST 0x08
  912. #define PI_CONS_BLK_K_UNSOL 0x10
  913. #define PI_CONS_BLK_K_CMD_RSP 0x18
  914. #define PI_CONS_BLK_K_CMD_REQ 0x20
  915. /* Offsets into descriptor block */
  916. #define PI_DESCR_BLK_K_RCV_DATA 0x0000
  917. #define PI_DESCR_BLK_K_XMT_DATA 0x0800
  918. #define PI_DESCR_BLK_K_SMT_HOST 0x1000
  919. #define PI_DESCR_BLK_K_UNSOL 0x1200
  920. #define PI_DESCR_BLK_K_CMD_RSP 0x1280
  921. #define PI_DESCR_BLK_K_CMD_REQ 0x1300
  922. /* Define format of a rcv descr (Rcv Data, Cmd Rsp, Unsolicited, SMT Host) */
  923. /* Note a field has been added for later versions of the PDQ to allow for */
  924. /* finer granularity of the rcv buffer alignment. For backwards */
  925. /* compatibility, the two bits (which allow the rcv buffer to be longword */
  926. /* aligned) have been added at the MBZ bits. To support previous drivers, */
  927. /* the MBZ definition is left intact. */
  928. typedef struct
  929. {
  930. PI_UINT32 long_0;
  931. PI_UINT32 long_1;
  932. } PI_RCV_DESCR;
  933. #define PI_RCV_DESCR_M_SOP 0x80000000
  934. #define PI_RCV_DESCR_M_SEG_LEN_LO 0x60000000
  935. #define PI_RCV_DESCR_M_MBZ 0x60000000
  936. #define PI_RCV_DESCR_M_SEG_LEN 0x1F800000
  937. #define PI_RCV_DESCR_M_SEG_LEN_HI 0x1FF00000
  938. #define PI_RCV_DESCR_M_SEG_CNT 0x000F0000
  939. #define PI_RCV_DESCR_M_BUFF_HI 0x0000FFFF
  940. #define PI_RCV_DESCR_V_SOP 31
  941. #define PI_RCV_DESCR_V_SEG_LEN_LO 29
  942. #define PI_RCV_DESCR_V_MBZ 29
  943. #define PI_RCV_DESCR_V_SEG_LEN 23
  944. #define PI_RCV_DESCR_V_SEG_LEN_HI 20
  945. #define PI_RCV_DESCR_V_SEG_CNT 16
  946. #define PI_RCV_DESCR_V_BUFF_HI 0
  947. /* Define the format of a transmit descriptor (Xmt Data, Cmd Req) */
  948. typedef struct
  949. {
  950. PI_UINT32 long_0;
  951. PI_UINT32 long_1;
  952. } PI_XMT_DESCR;
  953. #define PI_XMT_DESCR_M_SOP 0x80000000
  954. #define PI_XMT_DESCR_M_EOP 0x40000000
  955. #define PI_XMT_DESCR_M_MBZ 0x20000000
  956. #define PI_XMT_DESCR_M_SEG_LEN 0x1FFF0000
  957. #define PI_XMT_DESCR_M_BUFF_HI 0x0000FFFF
  958. #define PI_XMT_DESCR_V_SOP 31
  959. #define PI_XMT_DESCR_V_EOP 30
  960. #define PI_XMT_DESCR_V_MBZ 29
  961. #define PI_XMT_DESCR_V_SEG_LEN 16
  962. #define PI_XMT_DESCR_V_BUFF_HI 0
  963. /* Define format of the Descriptor Block (resident in host memory) */
  964. #define PI_RCV_DATA_K_NUM_ENTRIES 256
  965. #define PI_XMT_DATA_K_NUM_ENTRIES 256
  966. #define PI_SMT_HOST_K_NUM_ENTRIES 64
  967. #define PI_UNSOL_K_NUM_ENTRIES 16
  968. #define PI_CMD_RSP_K_NUM_ENTRIES 16
  969. #define PI_CMD_REQ_K_NUM_ENTRIES 16
  970. typedef struct
  971. {
  972. PI_RCV_DESCR rcv_data[PI_RCV_DATA_K_NUM_ENTRIES];
  973. PI_XMT_DESCR xmt_data[PI_XMT_DATA_K_NUM_ENTRIES];
  974. PI_RCV_DESCR smt_host[PI_SMT_HOST_K_NUM_ENTRIES];
  975. PI_RCV_DESCR unsol[PI_UNSOL_K_NUM_ENTRIES];
  976. PI_RCV_DESCR cmd_rsp[PI_CMD_RSP_K_NUM_ENTRIES];
  977. PI_XMT_DESCR cmd_req[PI_CMD_REQ_K_NUM_ENTRIES];
  978. } PI_DESCR_BLOCK;
  979. /* Define Port Registers - offsets from PDQ Base address */
  980. #define PI_PDQ_K_REG_PORT_RESET 0x00000000
  981. #define PI_PDQ_K_REG_HOST_DATA 0x00000004
  982. #define PI_PDQ_K_REG_PORT_CTRL 0x00000008
  983. #define PI_PDQ_K_REG_PORT_DATA_A 0x0000000C
  984. #define PI_PDQ_K_REG_PORT_DATA_B 0x00000010
  985. #define PI_PDQ_K_REG_PORT_STATUS 0x00000014
  986. #define PI_PDQ_K_REG_TYPE_0_STATUS 0x00000018
  987. #define PI_PDQ_K_REG_HOST_INT_ENB 0x0000001C
  988. #define PI_PDQ_K_REG_TYPE_2_PROD_NOINT 0x00000020
  989. #define PI_PDQ_K_REG_TYPE_2_PROD 0x00000024
  990. #define PI_PDQ_K_REG_CMD_RSP_PROD 0x00000028
  991. #define PI_PDQ_K_REG_CMD_REQ_PROD 0x0000002C
  992. #define PI_PDQ_K_REG_SMT_HOST_PROD 0x00000030
  993. #define PI_PDQ_K_REG_UNSOL_PROD 0x00000034
  994. /* Port Control Register - Command codes for primary commands */
  995. #define PI_PCTRL_M_CMD_ERROR 0x8000
  996. #define PI_PCTRL_M_BLAST_FLASH 0x4000
  997. #define PI_PCTRL_M_HALT 0x2000
  998. #define PI_PCTRL_M_COPY_DATA 0x1000
  999. #define PI_PCTRL_M_ERROR_LOG_START 0x0800
  1000. #define PI_PCTRL_M_ERROR_LOG_READ 0x0400
  1001. #define PI_PCTRL_M_XMT_DATA_FLUSH_DONE 0x0200
  1002. #define PI_PCTRL_M_INIT 0x0100
  1003. #define PI_PCTRL_M_INIT_START 0x0080
  1004. #define PI_PCTRL_M_CONS_BLOCK 0x0040
  1005. #define PI_PCTRL_M_UNINIT 0x0020
  1006. #define PI_PCTRL_M_RING_MEMBER 0x0010
  1007. #define PI_PCTRL_M_MLA 0x0008
  1008. #define PI_PCTRL_M_FW_REV_READ 0x0004
  1009. #define PI_PCTRL_M_DEV_SPECIFIC 0x0002
  1010. #define PI_PCTRL_M_SUB_CMD 0x0001
  1011. /* Define sub-commands accessed via the PI_PCTRL_M_SUB_CMD command */
  1012. #define PI_SUB_CMD_K_LINK_UNINIT 0x0001
  1013. #define PI_SUB_CMD_K_BURST_SIZE_SET 0x0002
  1014. #define PI_SUB_CMD_K_PDQ_REV_GET 0x0004
  1015. #define PI_SUB_CMD_K_HW_REV_GET 0x0008
  1016. /* Define some Port Data B values */
  1017. #define PI_PDATA_B_DMA_BURST_SIZE_4 0 /* valid values for command */
  1018. #define PI_PDATA_B_DMA_BURST_SIZE_8 1
  1019. #define PI_PDATA_B_DMA_BURST_SIZE_16 2
  1020. #define PI_PDATA_B_DMA_BURST_SIZE_32 3 /* not supported on PCI */
  1021. #define PI_PDATA_B_DMA_BURST_SIZE_DEF PI_PDATA_B_DMA_BURST_SIZE_16
  1022. /* Port Data A Reset state */
  1023. #define PI_PDATA_A_RESET_M_UPGRADE 0x00000001
  1024. #define PI_PDATA_A_RESET_M_SOFT_RESET 0x00000002
  1025. #define PI_PDATA_A_RESET_M_SKIP_ST 0x00000004
  1026. /* Read adapter MLA address port control command constants */
  1027. #define PI_PDATA_A_MLA_K_LO 0
  1028. #define PI_PDATA_A_MLA_K_HI 1
  1029. /* Byte Swap values for init command */
  1030. #define PI_PDATA_A_INIT_M_DESC_BLK_ADDR 0x0FFFFE000
  1031. #define PI_PDATA_A_INIT_M_RESERVED 0x000001FFC
  1032. #define PI_PDATA_A_INIT_M_BSWAP_DATA 0x000000002
  1033. #define PI_PDATA_A_INIT_M_BSWAP_LITERAL 0x000000001
  1034. #define PI_PDATA_A_INIT_V_DESC_BLK_ADDR 13
  1035. #define PI_PDATA_A_INIT_V_RESERVED 3
  1036. #define PI_PDATA_A_INIT_V_BSWAP_DATA 1
  1037. #define PI_PDATA_A_INIT_V_BSWAP_LITERAL 0
  1038. /* Port Reset Register */
  1039. #define PI_RESET_M_ASSERT_RESET 1
  1040. /* Port Status register */
  1041. #define PI_PSTATUS_V_RCV_DATA_PENDING 31
  1042. #define PI_PSTATUS_V_XMT_DATA_PENDING 30
  1043. #define PI_PSTATUS_V_SMT_HOST_PENDING 29
  1044. #define PI_PSTATUS_V_UNSOL_PENDING 28
  1045. #define PI_PSTATUS_V_CMD_RSP_PENDING 27
  1046. #define PI_PSTATUS_V_CMD_REQ_PENDING 26
  1047. #define PI_PSTATUS_V_TYPE_0_PENDING 25
  1048. #define PI_PSTATUS_V_RESERVED_1 16
  1049. #define PI_PSTATUS_V_RESERVED_2 11
  1050. #define PI_PSTATUS_V_STATE 8
  1051. #define PI_PSTATUS_V_HALT_ID 0
  1052. #define PI_PSTATUS_M_RCV_DATA_PENDING 0x80000000
  1053. #define PI_PSTATUS_M_XMT_DATA_PENDING 0x40000000
  1054. #define PI_PSTATUS_M_SMT_HOST_PENDING 0x20000000
  1055. #define PI_PSTATUS_M_UNSOL_PENDING 0x10000000
  1056. #define PI_PSTATUS_M_CMD_RSP_PENDING 0x08000000
  1057. #define PI_PSTATUS_M_CMD_REQ_PENDING 0x04000000
  1058. #define PI_PSTATUS_M_TYPE_0_PENDING 0x02000000
  1059. #define PI_PSTATUS_M_RESERVED_1 0x01FF0000
  1060. #define PI_PSTATUS_M_RESERVED_2 0x0000F800
  1061. #define PI_PSTATUS_M_STATE 0x00000700
  1062. #define PI_PSTATUS_M_HALT_ID 0x000000FF
  1063. /* Define Halt Id's */
  1064. /* Do not insert into this list, only append. */
  1065. #define PI_HALT_ID_K_SELFTEST_TIMEOUT 0
  1066. #define PI_HALT_ID_K_PARITY_ERROR 1
  1067. #define PI_HALT_ID_K_HOST_DIR_HALT 2
  1068. #define PI_HALT_ID_K_SW_FAULT 3
  1069. #define PI_HALT_ID_K_HW_FAULT 4
  1070. #define PI_HALT_ID_K_PC_TRACE 5
  1071. #define PI_HALT_ID_K_DMA_ERROR 6 /* Host Data has error reg */
  1072. #define PI_HALT_ID_K_IMAGE_CRC_ERROR 7 /* Image is bad, update it */
  1073. #define PI_HALT_ID_K_BUS_EXCEPTION 8 /* 68K bus exception */
  1074. /* Host Interrupt Enable Register as seen by host */
  1075. #define PI_HOST_INT_M_XMT_DATA_ENB 0x80000000 /* Type 2 Enables */
  1076. #define PI_HOST_INT_M_RCV_DATA_ENB 0x40000000
  1077. #define PI_HOST_INT_M_SMT_HOST_ENB 0x10000000 /* Type 1 Enables */
  1078. #define PI_HOST_INT_M_UNSOL_ENB 0x20000000
  1079. #define PI_HOST_INT_M_CMD_RSP_ENB 0x08000000
  1080. #define PI_HOST_INT_M_CMD_REQ_ENB 0x04000000
  1081. #define PI_HOST_INT_M_TYPE_1_RESERVED 0x00FF0000
  1082. #define PI_HOST_INT_M_TYPE_0_RESERVED 0x0000FF00 /* Type 0 Enables */
  1083. #define PI_HOST_INT_M_1MS 0x00000080
  1084. #define PI_HOST_INT_M_20MS 0x00000040
  1085. #define PI_HOST_INT_M_CSR_CMD_DONE 0x00000020
  1086. #define PI_HOST_INT_M_STATE_CHANGE 0x00000010
  1087. #define PI_HOST_INT_M_XMT_FLUSH 0x00000008
  1088. #define PI_HOST_INT_M_NXM 0x00000004
  1089. #define PI_HOST_INT_M_PM_PAR_ERR 0x00000002
  1090. #define PI_HOST_INT_M_BUS_PAR_ERR 0x00000001
  1091. #define PI_HOST_INT_V_XMT_DATA_ENB 31 /* Type 2 Enables */
  1092. #define PI_HOST_INT_V_RCV_DATA_ENB 30
  1093. #define PI_HOST_INT_V_SMT_HOST_ENB 29 /* Type 1 Enables */
  1094. #define PI_HOST_INT_V_UNSOL_ENB 28
  1095. #define PI_HOST_INT_V_CMD_RSP_ENB 27
  1096. #define PI_HOST_INT_V_CMD_REQ_ENB 26
  1097. #define PI_HOST_INT_V_TYPE_1_RESERVED 16
  1098. #define PI_HOST_INT_V_TYPE_0_RESERVED 8 /* Type 0 Enables */
  1099. #define PI_HOST_INT_V_1MS_ENB 7
  1100. #define PI_HOST_INT_V_20MS_ENB 6
  1101. #define PI_HOST_INT_V_CSR_CMD_DONE_ENB 5
  1102. #define PI_HOST_INT_V_STATE_CHANGE_ENB 4
  1103. #define PI_HOST_INT_V_XMT_FLUSH_ENB 3
  1104. #define PI_HOST_INT_V_NXM_ENB 2
  1105. #define PI_HOST_INT_V_PM_PAR_ERR_ENB 1
  1106. #define PI_HOST_INT_V_BUS_PAR_ERR_ENB 0
  1107. #define PI_HOST_INT_K_ACK_ALL_TYPE_0 0x000000FF
  1108. #define PI_HOST_INT_K_DISABLE_ALL_INTS 0x00000000
  1109. #define PI_HOST_INT_K_ENABLE_ALL_INTS 0xFFFFFFFF
  1110. #define PI_HOST_INT_K_ENABLE_DEF_INTS 0xC000001F
  1111. /* Type 0 Interrupt Status Register */
  1112. #define PI_TYPE_0_STAT_M_1MS 0x00000080
  1113. #define PI_TYPE_0_STAT_M_20MS 0x00000040
  1114. #define PI_TYPE_0_STAT_M_CSR_CMD_DONE 0x00000020
  1115. #define PI_TYPE_0_STAT_M_STATE_CHANGE 0x00000010
  1116. #define PI_TYPE_0_STAT_M_XMT_FLUSH 0x00000008
  1117. #define PI_TYPE_0_STAT_M_NXM 0x00000004
  1118. #define PI_TYPE_0_STAT_M_PM_PAR_ERR 0x00000002
  1119. #define PI_TYPE_0_STAT_M_BUS_PAR_ERR 0x00000001
  1120. #define PI_TYPE_0_STAT_V_1MS 7
  1121. #define PI_TYPE_0_STAT_V_20MS 6
  1122. #define PI_TYPE_0_STAT_V_CSR_CMD_DONE 5
  1123. #define PI_TYPE_0_STAT_V_STATE_CHANGE 4
  1124. #define PI_TYPE_0_STAT_V_XMT_FLUSH 3
  1125. #define PI_TYPE_0_STAT_V_NXM 2
  1126. #define PI_TYPE_0_STAT_V_PM_PAR_ERR 1
  1127. #define PI_TYPE_0_STAT_V_BUS_PAR_ERR 0
  1128. /* Register definition structures are defined for both big and little endian systems */
  1129. #ifndef __BIG_ENDIAN
  1130. /* Little endian format of Type 1 Producer register */
  1131. typedef union
  1132. {
  1133. PI_UINT32 lword;
  1134. struct
  1135. {
  1136. PI_UINT8 prod;
  1137. PI_UINT8 comp;
  1138. PI_UINT8 mbz_1;
  1139. PI_UINT8 mbz_2;
  1140. } index;
  1141. } PI_TYPE_1_PROD_REG;
  1142. /* Little endian format of Type 2 Producer register */
  1143. typedef union
  1144. {
  1145. PI_UINT32 lword;
  1146. struct
  1147. {
  1148. PI_UINT8 rcv_prod;
  1149. PI_UINT8 xmt_prod;
  1150. PI_UINT8 rcv_comp;
  1151. PI_UINT8 xmt_comp;
  1152. } index;
  1153. } PI_TYPE_2_PROD_REG;
  1154. /* Little endian format of Type 1 Consumer Block longword */
  1155. typedef union
  1156. {
  1157. PI_UINT32 lword;
  1158. struct
  1159. {
  1160. PI_UINT8 cons;
  1161. PI_UINT8 res0;
  1162. PI_UINT8 res1;
  1163. PI_UINT8 res2;
  1164. } index;
  1165. } PI_TYPE_1_CONSUMER;
  1166. /* Little endian format of Type 2 Consumer Block longword */
  1167. typedef union
  1168. {
  1169. PI_UINT32 lword;
  1170. struct
  1171. {
  1172. PI_UINT8 rcv_cons;
  1173. PI_UINT8 res0;
  1174. PI_UINT8 xmt_cons;
  1175. PI_UINT8 res1;
  1176. } index;
  1177. } PI_TYPE_2_CONSUMER;
  1178. /* Define swapping required by DMA transfers. */
  1179. #define PI_PDATA_A_INIT_M_BSWAP_INIT \
  1180. (PI_PDATA_A_INIT_M_BSWAP_DATA)
  1181. #else /* __BIG_ENDIAN */
  1182. /* Big endian format of Type 1 Producer register */
  1183. typedef union
  1184. {
  1185. PI_UINT32 lword;
  1186. struct
  1187. {
  1188. PI_UINT8 mbz_2;
  1189. PI_UINT8 mbz_1;
  1190. PI_UINT8 comp;
  1191. PI_UINT8 prod;
  1192. } index;
  1193. } PI_TYPE_1_PROD_REG;
  1194. /* Big endian format of Type 2 Producer register */
  1195. typedef union
  1196. {
  1197. PI_UINT32 lword;
  1198. struct
  1199. {
  1200. PI_UINT8 xmt_comp;
  1201. PI_UINT8 rcv_comp;
  1202. PI_UINT8 xmt_prod;
  1203. PI_UINT8 rcv_prod;
  1204. } index;
  1205. } PI_TYPE_2_PROD_REG;
  1206. /* Big endian format of Type 1 Consumer Block longword */
  1207. typedef union
  1208. {
  1209. PI_UINT32 lword;
  1210. struct
  1211. {
  1212. PI_UINT8 res2;
  1213. PI_UINT8 res1;
  1214. PI_UINT8 res0;
  1215. PI_UINT8 cons;
  1216. } index;
  1217. } PI_TYPE_1_CONSUMER;
  1218. /* Big endian format of Type 2 Consumer Block longword */
  1219. typedef union
  1220. {
  1221. PI_UINT32 lword;
  1222. struct
  1223. {
  1224. PI_UINT8 res1;
  1225. PI_UINT8 xmt_cons;
  1226. PI_UINT8 res0;
  1227. PI_UINT8 rcv_cons;
  1228. } index;
  1229. } PI_TYPE_2_CONSUMER;
  1230. /* Define swapping required by DMA transfers. */
  1231. #define PI_PDATA_A_INIT_M_BSWAP_INIT \
  1232. (PI_PDATA_A_INIT_M_BSWAP_DATA | PI_PDATA_A_INIT_M_BSWAP_LITERAL)
  1233. #endif /* __BIG_ENDIAN */
  1234. /* Define TC PDQ CSR offset and length */
  1235. #define PI_TC_K_CSR_OFFSET 0x100000
  1236. #define PI_TC_K_CSR_LEN 0x40 /* 64 bytes */
  1237. /* Define EISA controller register offsets */
  1238. #define PI_ESIC_K_CSR_IO_LEN 0x40 /* 64 bytes */
  1239. #define PI_ESIC_K_BURST_HOLDOFF_LEN 0x04 /* 4 bytes */
  1240. #define PI_ESIC_K_ESIC_CSR_LEN 0x40 /* 64 bytes */
  1241. #define PI_DEFEA_K_CSR_IO 0x000
  1242. #define PI_DEFEA_K_BURST_HOLDOFF 0x040
  1243. #define PI_ESIC_K_ESIC_CSR 0xC80
  1244. #define PI_ESIC_K_SLOT_ID 0xC80
  1245. #define PI_ESIC_K_SLOT_CNTRL 0xC84
  1246. #define PI_ESIC_K_MEM_ADD_CMP_0 0xC85
  1247. #define PI_ESIC_K_MEM_ADD_CMP_1 0xC86
  1248. #define PI_ESIC_K_MEM_ADD_CMP_2 0xC87
  1249. #define PI_ESIC_K_MEM_ADD_HI_CMP_0 0xC88
  1250. #define PI_ESIC_K_MEM_ADD_HI_CMP_1 0xC89
  1251. #define PI_ESIC_K_MEM_ADD_HI_CMP_2 0xC8A
  1252. #define PI_ESIC_K_MEM_ADD_MASK_0 0xC8B
  1253. #define PI_ESIC_K_MEM_ADD_MASK_1 0xC8C
  1254. #define PI_ESIC_K_MEM_ADD_MASK_2 0xC8D
  1255. #define PI_ESIC_K_MEM_ADD_LO_CMP_0 0xC8E
  1256. #define PI_ESIC_K_MEM_ADD_LO_CMP_1 0xC8F
  1257. #define PI_ESIC_K_MEM_ADD_LO_CMP_2 0xC90
  1258. #define PI_ESIC_K_IO_ADD_CMP_0_0 0xC91
  1259. #define PI_ESIC_K_IO_ADD_CMP_0_1 0xC92
  1260. #define PI_ESIC_K_IO_ADD_CMP_1_0 0xC93
  1261. #define PI_ESIC_K_IO_ADD_CMP_1_1 0xC94
  1262. #define PI_ESIC_K_IO_ADD_CMP_2_0 0xC95
  1263. #define PI_ESIC_K_IO_ADD_CMP_2_1 0xC96
  1264. #define PI_ESIC_K_IO_ADD_CMP_3_0 0xC97
  1265. #define PI_ESIC_K_IO_ADD_CMP_3_1 0xC98
  1266. #define PI_ESIC_K_IO_ADD_MASK_0_0 0xC99
  1267. #define PI_ESIC_K_IO_ADD_MASK_0_1 0xC9A
  1268. #define PI_ESIC_K_IO_ADD_MASK_1_0 0xC9B
  1269. #define PI_ESIC_K_IO_ADD_MASK_1_1 0xC9C
  1270. #define PI_ESIC_K_IO_ADD_MASK_2_0 0xC9D
  1271. #define PI_ESIC_K_IO_ADD_MASK_2_1 0xC9E
  1272. #define PI_ESIC_K_IO_ADD_MASK_3_0 0xC9F
  1273. #define PI_ESIC_K_IO_ADD_MASK_3_1 0xCA0
  1274. #define PI_ESIC_K_MOD_CONFIG_1 0xCA1
  1275. #define PI_ESIC_K_MOD_CONFIG_2 0xCA2
  1276. #define PI_ESIC_K_MOD_CONFIG_3 0xCA3
  1277. #define PI_ESIC_K_MOD_CONFIG_4 0xCA4
  1278. #define PI_ESIC_K_MOD_CONFIG_5 0xCA5
  1279. #define PI_ESIC_K_MOD_CONFIG_6 0xCA6
  1280. #define PI_ESIC_K_MOD_CONFIG_7 0xCA7
  1281. #define PI_ESIC_K_DIP_SWITCH 0xCA8
  1282. #define PI_ESIC_K_IO_CONFIG_STAT_0 0xCA9
  1283. #define PI_ESIC_K_IO_CONFIG_STAT_1 0xCAA
  1284. #define PI_ESIC_K_DMA_CONFIG 0xCAB
  1285. #define PI_ESIC_K_INPUT_PORT 0xCAC
  1286. #define PI_ESIC_K_OUTPUT_PORT 0xCAD
  1287. #define PI_ESIC_K_FUNCTION_CNTRL 0xCAE
  1288. /* Define the bits in the function control register. */
  1289. #define PI_FUNCTION_CNTRL_M_IOCS0 0x01
  1290. #define PI_FUNCTION_CNTRL_M_IOCS1 0x02
  1291. #define PI_FUNCTION_CNTRL_M_IOCS2 0x04
  1292. #define PI_FUNCTION_CNTRL_M_IOCS3 0x08
  1293. #define PI_FUNCTION_CNTRL_M_MEMCS0 0x10
  1294. #define PI_FUNCTION_CNTRL_M_MEMCS1 0x20
  1295. #define PI_FUNCTION_CNTRL_M_DMA 0x80
  1296. /* Define the bits in the slot control register. */
  1297. #define PI_SLOT_CNTRL_M_RESET 0x04 /* Don't use. */
  1298. #define PI_SLOT_CNTRL_M_ERROR 0x02 /* Not implemented. */
  1299. #define PI_SLOT_CNTRL_M_ENB 0x01 /* Must be set. */
  1300. /* Define the bits in the burst holdoff register. */
  1301. #define PI_BURST_HOLDOFF_M_HOLDOFF 0xFC
  1302. #define PI_BURST_HOLDOFF_M_RESERVED 0x02
  1303. #define PI_BURST_HOLDOFF_M_MEM_MAP 0x01
  1304. #define PI_BURST_HOLDOFF_V_HOLDOFF 2
  1305. #define PI_BURST_HOLDOFF_V_RESERVED 1
  1306. #define PI_BURST_HOLDOFF_V_MEM_MAP 0
  1307. /* Define the implicit mask of the Memory Address Compare registers. */
  1308. #define PI_MEM_ADD_MASK_M 0x3ff
  1309. /* Define the fields in the I/O Address Compare and Mask registers. */
  1310. #define PI_IO_CMP_M_SLOT 0xf0
  1311. #define PI_IO_CMP_V_SLOT 4
  1312. /* Define the fields in the Interrupt Channel Configuration and Status reg */
  1313. #define PI_CONFIG_STAT_0_M_PEND 0x80
  1314. #define PI_CONFIG_STAT_0_M_RES_1 0x40
  1315. #define PI_CONFIG_STAT_0_M_IREQ_OUT 0x20
  1316. #define PI_CONFIG_STAT_0_M_IREQ_IN 0x10
  1317. #define PI_CONFIG_STAT_0_M_INT_ENB 0x08
  1318. #define PI_CONFIG_STAT_0_M_RES_0 0x04
  1319. #define PI_CONFIG_STAT_0_M_IRQ 0x03
  1320. #define PI_CONFIG_STAT_0_V_PEND 7
  1321. #define PI_CONFIG_STAT_0_V_RES_1 6
  1322. #define PI_CONFIG_STAT_0_V_IREQ_OUT 5
  1323. #define PI_CONFIG_STAT_0_V_IREQ_IN 4
  1324. #define PI_CONFIG_STAT_0_V_INT_ENB 3
  1325. #define PI_CONFIG_STAT_0_V_RES_0 2
  1326. #define PI_CONFIG_STAT_0_V_IRQ 0
  1327. #define PI_CONFIG_STAT_0_IRQ_K_9 0
  1328. #define PI_CONFIG_STAT_0_IRQ_K_10 1
  1329. #define PI_CONFIG_STAT_0_IRQ_K_11 2
  1330. #define PI_CONFIG_STAT_0_IRQ_K_15 3
  1331. /* Define DEC FDDIcontroller/EISA (DEFEA) EISA hardware ID's */
  1332. #define DEFEA_PRODUCT_ID 0x0030A310 /* DEC product 300 (no rev) */
  1333. #define DEFEA_PROD_ID_1 0x0130A310 /* DEC product 300, rev 1 */
  1334. #define DEFEA_PROD_ID_2 0x0230A310 /* DEC product 300, rev 2 */
  1335. #define DEFEA_PROD_ID_3 0x0330A310 /* DEC product 300, rev 3 */
  1336. #define DEFEA_PROD_ID_4 0x0430A310 /* DEC product 300, rev 4 */
  1337. /**********************************************/
  1338. /* Digital PFI Specification v1.0 Definitions */
  1339. /**********************************************/
  1340. /* PCI Configuration Space Constants */
  1341. #define PFI_K_LAT_TIMER_DEF 0x88 /* def max master latency timer */
  1342. #define PFI_K_LAT_TIMER_MIN 0x20 /* min max master latency timer */
  1343. #define PFI_K_CSR_MEM_LEN 0x80 /* 128 bytes */
  1344. #define PFI_K_CSR_IO_LEN 0x80 /* 128 bytes */
  1345. #define PFI_K_PKT_MEM_LEN 0x10000 /* 64K bytes */
  1346. /* PFI Register Offsets (starting at PDQ Register Base Address) */
  1347. #define PFI_K_REG_RESERVED_0 0X00000038
  1348. #define PFI_K_REG_RESERVED_1 0X0000003C
  1349. #define PFI_K_REG_MODE_CTRL 0X00000040
  1350. #define PFI_K_REG_STATUS 0X00000044
  1351. #define PFI_K_REG_FIFO_WRITE 0X00000048
  1352. #define PFI_K_REG_FIFO_READ 0X0000004C
  1353. /* PFI Mode Control Register Constants */
  1354. #define PFI_MODE_M_RESERVED 0XFFFFFFF0
  1355. #define PFI_MODE_M_TGT_ABORT_ENB 0X00000008
  1356. #define PFI_MODE_M_PDQ_INT_ENB 0X00000004
  1357. #define PFI_MODE_M_PFI_INT_ENB 0X00000002
  1358. #define PFI_MODE_M_DMA_ENB 0X00000001
  1359. #define PFI_MODE_V_RESERVED 4
  1360. #define PFI_MODE_V_TGT_ABORT_ENB 3
  1361. #define PFI_MODE_V_PDQ_INT_ENB 2
  1362. #define PFI_MODE_V_PFI_INT_ENB 1
  1363. #define PFI_MODE_V_DMA_ENB 0
  1364. #define PFI_MODE_K_ALL_DISABLE 0X00000000
  1365. /* PFI Status Register Constants */
  1366. #define PFI_STATUS_M_RESERVED 0XFFFFFFC0
  1367. #define PFI_STATUS_M_PFI_ERROR 0X00000020 /* only valid in rev 1 or later PFI */
  1368. #define PFI_STATUS_M_PDQ_INT 0X00000010
  1369. #define PFI_STATUS_M_PDQ_DMA_ABORT 0X00000008
  1370. #define PFI_STATUS_M_FIFO_FULL 0X00000004
  1371. #define PFI_STATUS_M_FIFO_EMPTY 0X00000002
  1372. #define PFI_STATUS_M_DMA_IN_PROGRESS 0X00000001
  1373. #define PFI_STATUS_V_RESERVED 6
  1374. #define PFI_STATUS_V_PFI_ERROR 5 /* only valid in rev 1 or later PFI */
  1375. #define PFI_STATUS_V_PDQ_INT 4
  1376. #define PFI_STATUS_V_PDQ_DMA_ABORT 3
  1377. #define PFI_STATUS_V_FIFO_FULL 2
  1378. #define PFI_STATUS_V_FIFO_EMPTY 1
  1379. #define PFI_STATUS_V_DMA_IN_PROGRESS 0
  1380. #define DFX_FC_PRH2_PRH1_PRH0 0x54003820 /* Packet Request Header bytes + FC */
  1381. #define DFX_PRH0_BYTE 0x20 /* Packet Request Header byte 0 */
  1382. #define DFX_PRH1_BYTE 0x38 /* Packet Request Header byte 1 */
  1383. #define DFX_PRH2_BYTE 0x00 /* Packet Request Header byte 2 */
  1384. /* Driver routine status (return) codes */
  1385. #define DFX_K_SUCCESS 0 /* routine succeeded */
  1386. #define DFX_K_FAILURE 1 /* routine failed */
  1387. #define DFX_K_OUTSTATE 2 /* bad state for command */
  1388. #define DFX_K_HW_TIMEOUT 3 /* command timed out */
  1389. /* Define LLC host receive buffer min/max/default values */
  1390. #define RCV_BUFS_MIN 2 /* minimum pre-allocated receive buffers */
  1391. #define RCV_BUFS_MAX 32 /* maximum pre-allocated receive buffers */
  1392. #define RCV_BUFS_DEF 8 /* default pre-allocated receive buffers */
  1393. /* Define offsets into FDDI LLC or SMT receive frame buffers - used when indicating frames */
  1394. #define RCV_BUFF_K_DESCR 0 /* four byte FMC descriptor */
  1395. #define RCV_BUFF_K_PADDING 4 /* three null bytes */
  1396. #define RCV_BUFF_K_FC 7 /* one byte frame control */
  1397. #define RCV_BUFF_K_DA 8 /* six byte destination address */
  1398. #define RCV_BUFF_K_SA 14 /* six byte source address */
  1399. #define RCV_BUFF_K_DATA 20 /* offset to start of packet data */
  1400. /* Define offsets into FDDI LLC transmit frame buffers - used when sending frames */
  1401. #define XMT_BUFF_K_FC 0 /* one byte frame control */
  1402. #define XMT_BUFF_K_DA 1 /* six byte destination address */
  1403. #define XMT_BUFF_K_SA 7 /* six byte source address */
  1404. #define XMT_BUFF_K_DATA 13 /* offset to start of packet data */
  1405. /* Macro for checking a "value" is within a specific range */
  1406. #define IN_RANGE(value,low,high) ((value >= low) && (value <= high))
  1407. /* Only execute special print call when debug driver was built */
  1408. #ifdef DEFXX_DEBUG
  1409. #define DBG_printk(args...) printk(args)
  1410. #else
  1411. #define DBG_printk(args...)
  1412. #endif
  1413. /* Define constants for masking/unmasking interrupts */
  1414. #define DFX_MASK_INTERRUPTS 1
  1415. #define DFX_UNMASK_INTERRUPTS 0
  1416. /* Define structure for driver transmit descriptor block */
  1417. typedef struct
  1418. {
  1419. struct sk_buff *p_skb; /* ptr to skb */
  1420. } XMT_DRIVER_DESCR;
  1421. typedef struct DFX_board_tag
  1422. {
  1423. /* Keep virtual and physical pointers to locked, physically contiguous memory */
  1424. char *kmalloced; /* pci_free_consistent this on unload */
  1425. dma_addr_t kmalloced_dma;
  1426. /* DMA handle for the above */
  1427. PI_DESCR_BLOCK *descr_block_virt; /* PDQ descriptor block virt address */
  1428. dma_addr_t descr_block_phys; /* PDQ descriptor block phys address */
  1429. PI_DMA_CMD_REQ *cmd_req_virt; /* Command request buffer virt address */
  1430. dma_addr_t cmd_req_phys; /* Command request buffer phys address */
  1431. PI_DMA_CMD_RSP *cmd_rsp_virt; /* Command response buffer virt address */
  1432. dma_addr_t cmd_rsp_phys; /* Command response buffer phys address */
  1433. char *rcv_block_virt; /* LLC host receive queue buf blk virt */
  1434. dma_addr_t rcv_block_phys; /* LLC host receive queue buf blk phys */
  1435. PI_CONSUMER_BLOCK *cons_block_virt; /* PDQ consumer block virt address */
  1436. dma_addr_t cons_block_phys; /* PDQ consumer block phys address */
  1437. /* Keep local copies of Type 1 and Type 2 register data */
  1438. PI_TYPE_1_PROD_REG cmd_req_reg; /* Command Request register */
  1439. PI_TYPE_1_PROD_REG cmd_rsp_reg; /* Command Response register */
  1440. PI_TYPE_2_PROD_REG rcv_xmt_reg; /* Type 2 (RCV/XMT) register */
  1441. /* Storage for unicast and multicast address entries in adapter CAM */
  1442. u8 uc_table[1*FDDI_K_ALEN];
  1443. u32 uc_count; /* number of unicast addresses */
  1444. u8 mc_table[PI_CMD_ADDR_FILTER_K_SIZE*FDDI_K_ALEN];
  1445. u32 mc_count; /* number of multicast addresses */
  1446. /* Current packet filter settings */
  1447. u32 ind_group_prom; /* LLC individual & group frame prom mode */
  1448. u32 group_prom; /* LLC group (multicast) frame prom mode */
  1449. /* Link available flag needed to determine whether to drop outgoing packet requests */
  1450. u32 link_available; /* is link available? */
  1451. /* Resources to indicate reset type when resetting adapter */
  1452. u32 reset_type; /* skip or rerun diagnostics */
  1453. /* Store pointers to receive buffers for queue processing code */
  1454. char *p_rcv_buff_va[PI_RCV_DATA_K_NUM_ENTRIES];
  1455. /* Store pointers to transmit buffers for transmit completion code */
  1456. XMT_DRIVER_DESCR xmt_drv_descr_blk[PI_XMT_DATA_K_NUM_ENTRIES];
  1457. /* Transmit spinlocks */
  1458. spinlock_t lock;
  1459. /* Store device, bus-specific, and parameter information for this adapter */
  1460. struct net_device *dev; /* pointer to device structure */
  1461. union {
  1462. void __iomem *mem;
  1463. int port;
  1464. } base; /* base address */
  1465. struct device *bus_dev;
  1466. /* Whether to use MMIO or port I/O. */
  1467. bool mmio;
  1468. u32 full_duplex_enb; /* FDDI Full Duplex enable (1 == on, 2 == off) */
  1469. u32 req_ttrt; /* requested TTRT value (in 80ns units) */
  1470. u32 burst_size; /* adapter burst size (enumerated) */
  1471. u32 rcv_bufs_to_post; /* receive buffers to post for LLC host queue */
  1472. u8 factory_mac_addr[FDDI_K_ALEN]; /* factory (on-board) MAC address */
  1473. /* Common FDDI statistics structure and private counters */
  1474. struct fddi_statistics stats;
  1475. u32 rcv_discards;
  1476. u32 rcv_crc_errors;
  1477. u32 rcv_frame_status_errors;
  1478. u32 rcv_length_errors;
  1479. u32 rcv_total_frames;
  1480. u32 rcv_multicast_frames;
  1481. u32 rcv_total_bytes;
  1482. u32 xmt_discards;
  1483. u32 xmt_length_errors;
  1484. u32 xmt_total_frames;
  1485. u32 xmt_total_bytes;
  1486. } DFX_board_t;
  1487. #endif /* #ifndef _DEFXX_H_ */