defxx.h 53 KB

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