defxx.h 53 KB

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