slichw.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837
  1. /**************************************************************************
  2. *
  3. * Copyright (c) 2000-2002 Alacritech, Inc. All rights reserved.
  4. *
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above
  13. * copyright notice, this list of conditions and the following
  14. * disclaimer in the documentation and/or other materials provided
  15. * with the distribution.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY ALACRITECH, INC. ``AS IS'' AND ANY
  18. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ALACRITECH, INC. OR
  21. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  22. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  23. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  24. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  25. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  27. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * The views and conclusions contained in the software and documentation
  31. * are those of the authors and should not be interpreted as representing
  32. * official policies, either expressed or implied, of Alacritech, Inc.
  33. *
  34. **************************************************************************/
  35. /*
  36. * FILENAME: slichw.h
  37. *
  38. * This header file contains definitions that are common to our hardware.
  39. */
  40. #ifndef __SLICHW_H__
  41. #define __SLICHW_H__
  42. #define PCI_VENDOR_ID_ALACRITECH 0x139A
  43. #define SLIC_1GB_DEVICE_ID 0x0005
  44. #define SLIC_2GB_DEVICE_ID 0x0007 /* Oasis Device ID */
  45. #define SLIC_1GB_CICADA_SUBSYS_ID 0x0008
  46. #define SLIC_NBR_MACS 4
  47. #define SLIC_RCVBUF_SIZE 2048
  48. #define SLIC_RCVBUF_HEADSIZE 34
  49. #define SLIC_RCVBUF_TAILSIZE 0
  50. #define SLIC_RCVBUF_DATASIZE (SLIC_RCVBUF_SIZE - \
  51. (SLIC_RCVBUF_HEADSIZE + \
  52. SLIC_RCVBUF_TAILSIZE))
  53. #define VGBSTAT_XPERR 0x40000000
  54. #define VGBSTAT_XERRSHFT 25
  55. #define VGBSTAT_XCSERR 0x23
  56. #define VGBSTAT_XUFLOW 0x22
  57. #define VGBSTAT_XHLEN 0x20
  58. #define VGBSTAT_NETERR 0x01000000
  59. #define VGBSTAT_NERRSHFT 16
  60. #define VGBSTAT_NERRMSK 0x1ff
  61. #define VGBSTAT_NCSERR 0x103
  62. #define VGBSTAT_NUFLOW 0x102
  63. #define VGBSTAT_NHLEN 0x100
  64. #define VGBSTAT_LNKERR 0x00000080
  65. #define VGBSTAT_LERRMSK 0xff
  66. #define VGBSTAT_LDEARLY 0x86
  67. #define VGBSTAT_LBOFLO 0x85
  68. #define VGBSTAT_LCODERR 0x84
  69. #define VGBSTAT_LDBLNBL 0x83
  70. #define VGBSTAT_LCRCERR 0x82
  71. #define VGBSTAT_LOFLO 0x81
  72. #define VGBSTAT_LUFLO 0x80
  73. #define IRHDDR_FLEN_MSK 0x0000ffff
  74. #define IRHDDR_SVALID 0x80000000
  75. #define IRHDDR_ERR 0x10000000
  76. #define VRHSTAT_802OE 0x80000000
  77. #define VRHSTAT_TPOFLO 0x10000000
  78. #define VRHSTATB_802UE 0x80000000
  79. #define VRHSTATB_RCVE 0x40000000
  80. #define VRHSTATB_BUFF 0x20000000
  81. #define VRHSTATB_CARRE 0x08000000
  82. #define VRHSTATB_LONGE 0x02000000
  83. #define VRHSTATB_PREA 0x01000000
  84. #define VRHSTATB_CRC 0x00800000
  85. #define VRHSTATB_DRBL 0x00400000
  86. #define VRHSTATB_CODE 0x00200000
  87. #define VRHSTATB_TPCSUM 0x00100000
  88. #define VRHSTATB_TPHLEN 0x00080000
  89. #define VRHSTATB_IPCSUM 0x00040000
  90. #define VRHSTATB_IPLERR 0x00020000
  91. #define VRHSTATB_IPHERR 0x00010000
  92. #define SLIC_MAX64_BCNT 23
  93. #define SLIC_MAX32_BCNT 26
  94. #define IHCMD_XMT_REQ 0x01
  95. #define IHFLG_IFSHFT 2
  96. #define SLIC_RSPBUF_SIZE 32
  97. #define SLIC_RESET_MAGIC 0xDEAD
  98. #define ICR_INT_OFF 0
  99. #define ICR_INT_ON 1
  100. #define ICR_INT_MASK 2
  101. #define ISR_ERR 0x80000000
  102. #define ISR_RCV 0x40000000
  103. #define ISR_CMD 0x20000000
  104. #define ISR_IO 0x60000000
  105. #define ISR_UPC 0x10000000
  106. #define ISR_LEVENT 0x08000000
  107. #define ISR_RMISS 0x02000000
  108. #define ISR_UPCERR 0x01000000
  109. #define ISR_XDROP 0x00800000
  110. #define ISR_UPCBSY 0x00020000
  111. #define ISR_EVMSK 0xffff0000
  112. #define ISR_PINGMASK 0x00700000
  113. #define ISR_PINGDSMASK 0x00710000
  114. #define ISR_UPCMASK 0x11000000
  115. #define SLIC_WCS_START 0x80000000
  116. #define SLIC_WCS_COMPARE 0x40000000
  117. #define SLIC_RCVWCS_BEGIN 0x40000000
  118. #define SLIC_RCVWCS_FINISH 0x80000000
  119. #define SLIC_PM_MAXPATTERNS 6
  120. #define SLIC_PM_PATTERNSIZE 128
  121. #define SLIC_PMCAPS_WAKEONLAN 0x00000001
  122. #define MIICR_REG_PCR 0x00000000
  123. #define MIICR_REG_4 0x00040000
  124. #define MIICR_REG_9 0x00090000
  125. #define MIICR_REG_16 0x00100000
  126. #define PCR_RESET 0x8000
  127. #define PCR_POWERDOWN 0x0800
  128. #define PCR_SPEED_100 0x2000
  129. #define PCR_SPEED_1000 0x0040
  130. #define PCR_AUTONEG 0x1000
  131. #define PCR_AUTONEG_RST 0x0200
  132. #define PCR_DUPLEX_FULL 0x0100
  133. #define PSR_LINKUP 0x0004
  134. #define PAR_ADV100FD 0x0100
  135. #define PAR_ADV100HD 0x0080
  136. #define PAR_ADV10FD 0x0040
  137. #define PAR_ADV10HD 0x0020
  138. #define PAR_ASYMPAUSE 0x0C00
  139. #define PAR_802_3 0x0001
  140. #define PAR_ADV1000XFD 0x0020
  141. #define PAR_ADV1000XHD 0x0040
  142. #define PAR_ASYMPAUSE_FIBER 0x0180
  143. #define PGC_ADV1000FD 0x0200
  144. #define PGC_ADV1000HD 0x0100
  145. #define SEEQ_LINKFAIL 0x4000
  146. #define SEEQ_SPEED 0x0080
  147. #define SEEQ_DUPLEX 0x0040
  148. #define TDK_DUPLEX 0x0800
  149. #define TDK_SPEED 0x0400
  150. #define MRV_REG16_XOVERON 0x0068
  151. #define MRV_REG16_XOVEROFF 0x0008
  152. #define MRV_SPEED_1000 0x8000
  153. #define MRV_SPEED_100 0x4000
  154. #define MRV_SPEED_10 0x0000
  155. #define MRV_FULLDUPLEX 0x2000
  156. #define MRV_LINKUP 0x0400
  157. #define GIG_LINKUP 0x0001
  158. #define GIG_FULLDUPLEX 0x0002
  159. #define GIG_SPEED_MASK 0x000C
  160. #define GIG_SPEED_1000 0x0008
  161. #define GIG_SPEED_100 0x0004
  162. #define GIG_SPEED_10 0x0000
  163. #define MCR_RESET 0x80000000
  164. #define MCR_CRCEN 0x40000000
  165. #define MCR_FULLD 0x10000000
  166. #define MCR_PAD 0x02000000
  167. #define MCR_RETRYLATE 0x01000000
  168. #define MCR_BOL_SHIFT 21
  169. #define MCR_IPG1_SHIFT 14
  170. #define MCR_IPG2_SHIFT 7
  171. #define MCR_IPG3_SHIFT 0
  172. #define GMCR_RESET 0x80000000
  173. #define GMCR_GBIT 0x20000000
  174. #define GMCR_FULLD 0x10000000
  175. #define GMCR_GAPBB_SHIFT 14
  176. #define GMCR_GAPR1_SHIFT 7
  177. #define GMCR_GAPR2_SHIFT 0
  178. #define GMCR_GAPBB_1000 0x60
  179. #define GMCR_GAPR1_1000 0x2C
  180. #define GMCR_GAPR2_1000 0x40
  181. #define GMCR_GAPBB_100 0x70
  182. #define GMCR_GAPR1_100 0x2C
  183. #define GMCR_GAPR2_100 0x40
  184. #define XCR_RESET 0x80000000
  185. #define XCR_XMTEN 0x40000000
  186. #define XCR_PAUSEEN 0x20000000
  187. #define XCR_LOADRNG 0x10000000
  188. #define RCR_RESET 0x80000000
  189. #define RCR_RCVEN 0x40000000
  190. #define RCR_RCVALL 0x20000000
  191. #define RCR_RCVBAD 0x10000000
  192. #define RCR_CTLEN 0x08000000
  193. #define RCR_ADDRAEN 0x02000000
  194. #define GXCR_RESET 0x80000000
  195. #define GXCR_XMTEN 0x40000000
  196. #define GXCR_PAUSEEN 0x20000000
  197. #define GRCR_RESET 0x80000000
  198. #define GRCR_RCVEN 0x40000000
  199. #define GRCR_RCVALL 0x20000000
  200. #define GRCR_RCVBAD 0x10000000
  201. #define GRCR_CTLEN 0x08000000
  202. #define GRCR_ADDRAEN 0x02000000
  203. #define GRCR_HASHSIZE_SHIFT 17
  204. #define GRCR_HASHSIZE 14
  205. #define SLIC_EEPROM_ID 0xA5A5
  206. #define SLIC_SRAM_SIZE2GB (64 * 1024)
  207. #define SLIC_SRAM_SIZE1GB (32 * 1024)
  208. #define SLIC_HOSTID_DEFAULT 0xFFFF /* uninitialized hostid */
  209. #define SLIC_NBR_MACS 4
  210. struct slic_rcvbuf {
  211. u8 pad1[6];
  212. u16 pad2;
  213. u32 pad3;
  214. u32 pad4;
  215. u32 buffer;
  216. u32 length;
  217. u32 status;
  218. u32 pad5;
  219. u16 pad6;
  220. u8 data[SLIC_RCVBUF_DATASIZE];
  221. };
  222. struct slic_hddr_wds {
  223. union {
  224. struct {
  225. u32 frame_status;
  226. u32 frame_status_b;
  227. u32 time_stamp;
  228. u32 checksum;
  229. } hdrs_14port;
  230. struct {
  231. u32 frame_status;
  232. u16 ByteCnt;
  233. u16 TpChksum;
  234. u16 CtxHash;
  235. u16 MacHash;
  236. u32 BufLnk;
  237. } hdrs_gbit;
  238. } u0;
  239. };
  240. #define frame_status14 u0.hdrs_14port.frame_status
  241. #define frame_status_b14 u0.hdrs_14port.frame_status_b
  242. #define frame_statusGB u0.hdrs_gbit.frame_status
  243. struct slic_host64sg {
  244. u32 paddrl;
  245. u32 paddrh;
  246. u32 length;
  247. };
  248. struct slic_host64_cmd {
  249. u32 hosthandle;
  250. u32 RSVD;
  251. u8 command;
  252. u8 flags;
  253. union {
  254. u16 rsv1;
  255. u16 rsv2;
  256. } u0;
  257. union {
  258. struct {
  259. u32 totlen;
  260. struct slic_host64sg bufs[SLIC_MAX64_BCNT];
  261. } slic_buffers;
  262. } u;
  263. };
  264. struct slic_rspbuf {
  265. u32 hosthandle;
  266. u32 pad0;
  267. u32 pad1;
  268. u32 status;
  269. u32 pad2[4];
  270. };
  271. struct slic_regs {
  272. u32 slic_reset; /* Reset Register */
  273. u32 pad0;
  274. u32 slic_icr; /* Interrupt Control Register */
  275. u32 pad2;
  276. #define SLIC_ICR 0x0008
  277. u32 slic_isp; /* Interrupt status pointer */
  278. u32 pad1;
  279. #define SLIC_ISP 0x0010
  280. u32 slic_isr; /* Interrupt status */
  281. u32 pad3;
  282. #define SLIC_ISR 0x0018
  283. u32 slic_hbar; /* Header buffer address reg */
  284. u32 pad4;
  285. /*
  286. * 31-8 - phy addr of set of contiguous hdr buffers
  287. * 7-0 - number of buffers passed
  288. * Buffers are 256 bytes long on 256-byte boundaries.
  289. */
  290. #define SLIC_HBAR 0x0020
  291. #define SLIC_HBAR_CNT_MSK 0x000000FF
  292. u32 slic_dbar; /* Data buffer handle & address reg */
  293. u32 pad5;
  294. /* 4 sets of registers; Buffers are 2K bytes long 2 per 4K page. */
  295. #define SLIC_DBAR 0x0028
  296. #define SLIC_DBAR_SIZE 2048
  297. u32 slic_cbar; /* Xmt Cmd buf addr regs.*/
  298. /*
  299. * 1 per XMT interface
  300. * 31-5 - phy addr of host command buffer
  301. * 4-0 - length of cmd in multiples of 32 bytes
  302. * Buffers are 32 bytes up to 512 bytes long
  303. */
  304. #define SLIC_CBAR 0x0030
  305. #define SLIC_CBAR_LEN_MSK 0x0000001F
  306. #define SLIC_CBAR_ALIGN 0x00000020
  307. u32 slic_wcs; /* write control store*/
  308. #define SLIC_WCS 0x0034
  309. #define SLIC_WCS_START 0x80000000 /*Start the SLIC (Jump to WCS)*/
  310. #define SLIC_WCS_COMPARE 0x40000000 /* Compare with value in WCS*/
  311. u32 slic_rbar; /* Response buffer address reg.*/
  312. u32 pad7;
  313. /*
  314. * 31-8 - phy addr of set of contiguous response buffers
  315. * 7-0 - number of buffers passed
  316. * Buffers are 32 bytes long on 32-byte boundaries.
  317. */
  318. #define SLIC_RBAR 0x0038
  319. #define SLIC_RBAR_CNT_MSK 0x000000FF
  320. #define SLIC_RBAR_SIZE 32
  321. u32 slic_stats; /* read statistics (UPR) */
  322. u32 pad8;
  323. #define SLIC_RSTAT 0x0040
  324. u32 slic_rlsr; /* read link status */
  325. u32 pad9;
  326. #define SLIC_LSTAT 0x0048
  327. u32 slic_wmcfg; /* Write Mac Config */
  328. u32 pad10;
  329. #define SLIC_WMCFG 0x0050
  330. u32 slic_wphy; /* Write phy register */
  331. u32 pad11;
  332. #define SLIC_WPHY 0x0058
  333. u32 slic_rcbar; /* Rcv Cmd buf addr reg */
  334. u32 pad12;
  335. #define SLIC_RCBAR 0x0060
  336. u32 slic_rconfig; /* Read SLIC Config*/
  337. u32 pad13;
  338. #define SLIC_RCONFIG 0x0068
  339. u32 slic_intagg; /* Interrupt aggregation time */
  340. u32 pad14;
  341. #define SLIC_INTAGG 0x0070
  342. u32 slic_wxcfg; /* Write XMIT config reg*/
  343. u32 pad16;
  344. #define SLIC_WXCFG 0x0078
  345. u32 slic_wrcfg; /* Write RCV config reg*/
  346. u32 pad17;
  347. #define SLIC_WRCFG 0x0080
  348. u32 slic_wraddral; /* Write rcv addr a low*/
  349. u32 pad18;
  350. #define SLIC_WRADDRAL 0x0088
  351. u32 slic_wraddrah; /* Write rcv addr a high*/
  352. u32 pad19;
  353. #define SLIC_WRADDRAH 0x0090
  354. u32 slic_wraddrbl; /* Write rcv addr b low*/
  355. u32 pad20;
  356. #define SLIC_WRADDRBL 0x0098
  357. u32 slic_wraddrbh; /* Write rcv addr b high*/
  358. u32 pad21;
  359. #define SLIC_WRADDRBH 0x00a0
  360. u32 slic_mcastlow; /* Low bits of mcast mask*/
  361. u32 pad22;
  362. #define SLIC_MCASTLOW 0x00a8
  363. u32 slic_mcasthigh; /* High bits of mcast mask*/
  364. u32 pad23;
  365. #define SLIC_MCASTHIGH 0x00b0
  366. u32 slic_ping; /* Ping the card*/
  367. u32 pad24;
  368. #define SLIC_PING 0x00b8
  369. u32 slic_dump_cmd; /* Dump command */
  370. u32 pad25;
  371. #define SLIC_DUMP_CMD 0x00c0
  372. u32 slic_dump_data; /* Dump data pointer */
  373. u32 pad26;
  374. #define SLIC_DUMP_DATA 0x00c8
  375. u32 slic_pcistatus; /* Read card's pci_status register */
  376. u32 pad27;
  377. #define SLIC_PCISTATUS 0x00d0
  378. u32 slic_wrhostid; /* Write hostid field */
  379. u32 pad28;
  380. #define SLIC_WRHOSTID 0x00d8
  381. #define SLIC_RDHOSTID_1GB 0x1554
  382. #define SLIC_RDHOSTID_2GB 0x1554
  383. u32 slic_low_power; /* Put card in a low power state */
  384. u32 pad29;
  385. #define SLIC_LOW_POWER 0x00e0
  386. u32 slic_quiesce; /* force slic into quiescent state
  387. * before soft reset
  388. */
  389. u32 pad30;
  390. #define SLIC_QUIESCE 0x00e8
  391. u32 slic_reset_iface;/* reset interface queues */
  392. u32 pad31;
  393. #define SLIC_RESET_IFACE 0x00f0
  394. u32 slic_addr_upper;/* Bits 63-32 for host i/f addrs */
  395. u32 pad32;
  396. #define SLIC_ADDR_UPPER 0x00f8 /*Register is only written when it has changed*/
  397. u32 slic_hbar64; /* 64 bit Header buffer address reg */
  398. u32 pad33;
  399. #define SLIC_HBAR64 0x0100
  400. u32 slic_dbar64; /* 64 bit Data buffer handle & address reg */
  401. u32 pad34;
  402. #define SLIC_DBAR64 0x0108
  403. u32 slic_cbar64; /* 64 bit Xmt Cmd buf addr regs. */
  404. u32 pad35;
  405. #define SLIC_CBAR64 0x0110
  406. u32 slic_rbar64; /* 64 bit Response buffer address reg.*/
  407. u32 pad36;
  408. #define SLIC_RBAR64 0x0118
  409. u32 slic_rcbar64; /* 64 bit Rcv Cmd buf addr reg*/
  410. u32 pad37;
  411. #define SLIC_RCBAR64 0x0120
  412. u32 slic_stats64; /* read statistics (64 bit UPR) */
  413. u32 pad38;
  414. #define SLIC_RSTAT64 0x0128
  415. u32 slic_rcv_wcs; /*Download Gigabit RCV sequencer ucode*/
  416. u32 pad39;
  417. #define SLIC_RCV_WCS 0x0130
  418. #define SLIC_RCVWCS_BEGIN 0x40000000
  419. #define SLIC_RCVWCS_FINISH 0x80000000
  420. u32 slic_wrvlanid; /* Write VlanId field */
  421. u32 pad40;
  422. #define SLIC_WRVLANID 0x0138
  423. u32 slic_read_xf_info; /* Read Transformer info */
  424. u32 pad41;
  425. #define SLIC_READ_XF_INFO 0x0140
  426. u32 slic_write_xf_info; /* Write Transformer info */
  427. u32 pad42;
  428. #define SLIC_WRITE_XF_INFO 0x0148
  429. u32 RSVD1; /* TOE Only */
  430. u32 pad43;
  431. u32 RSVD2; /* TOE Only */
  432. u32 pad44;
  433. u32 RSVD3; /* TOE Only */
  434. u32 pad45;
  435. u32 RSVD4; /* TOE Only */
  436. u32 pad46;
  437. u32 slic_ticks_per_sec; /* Write card ticks per second */
  438. u32 pad47;
  439. #define SLIC_TICKS_PER_SEC 0x0170
  440. };
  441. enum UPR_REQUEST {
  442. SLIC_UPR_STATS,
  443. SLIC_UPR_RLSR,
  444. SLIC_UPR_WCFG,
  445. SLIC_UPR_RCONFIG,
  446. SLIC_UPR_RPHY,
  447. SLIC_UPR_ENLB,
  448. SLIC_UPR_ENCT,
  449. SLIC_UPR_PDWN,
  450. SLIC_UPR_PING,
  451. SLIC_UPR_DUMP,
  452. };
  453. struct inicpm_wakepattern {
  454. u32 patternlength;
  455. u8 pattern[SLIC_PM_PATTERNSIZE];
  456. u8 mask[SLIC_PM_PATTERNSIZE];
  457. };
  458. struct inicpm_state {
  459. u32 powercaps;
  460. u32 powerstate;
  461. u32 wake_linkstatus;
  462. u32 wake_magicpacket;
  463. u32 wake_framepattern;
  464. struct inicpm_wakepattern wakepattern[SLIC_PM_MAXPATTERNS];
  465. };
  466. struct slicpm_packet_pattern {
  467. u32 priority;
  468. u32 reserved;
  469. u32 masksize;
  470. u32 patternoffset;
  471. u32 patternsize;
  472. u32 patternflags;
  473. };
  474. enum slicpm_power_state {
  475. slicpm_state_unspecified = 0,
  476. slicpm_state_d0,
  477. slicpm_state_d1,
  478. slicpm_state_d2,
  479. slicpm_state_d3,
  480. slicpm_state_maximum
  481. };
  482. struct slicpm_wakeup_capabilities {
  483. enum slicpm_power_state min_magic_packet_wakeup;
  484. enum slicpm_power_state min_pattern_wakeup;
  485. enum slicpm_power_state min_link_change_wakeup;
  486. };
  487. struct slic_pnp_capabilities {
  488. u32 flags;
  489. struct slicpm_wakeup_capabilities wakeup_capabilities;
  490. };
  491. struct xmt_stats {
  492. u32 xmit_tcp_bytes;
  493. u32 xmit_tcp_segs;
  494. u32 xmit_bytes;
  495. u32 xmit_collisions;
  496. u32 xmit_unicasts;
  497. u32 xmit_other_error;
  498. u32 xmit_excess_collisions;
  499. };
  500. struct rcv_stats {
  501. u32 rcv_tcp_bytes;
  502. u32 rcv_tcp_segs;
  503. u32 rcv_bytes;
  504. u32 rcv_unicasts;
  505. u32 rcv_other_error;
  506. u32 rcv_drops;
  507. };
  508. struct xmt_statsgb {
  509. u64 xmit_tcp_bytes;
  510. u64 xmit_tcp_segs;
  511. u64 xmit_bytes;
  512. u64 xmit_collisions;
  513. u64 xmit_unicasts;
  514. u64 xmit_other_error;
  515. u64 xmit_excess_collisions;
  516. };
  517. struct rcv_statsgb {
  518. u64 rcv_tcp_bytes;
  519. u64 rcv_tcp_segs;
  520. u64 rcv_bytes;
  521. u64 rcv_unicasts;
  522. u64 rcv_other_error;
  523. u64 rcv_drops;
  524. };
  525. struct slic_stats {
  526. union {
  527. struct {
  528. struct xmt_stats xmt100;
  529. struct rcv_stats rcv100;
  530. } stats_100;
  531. struct {
  532. struct xmt_statsgb xmtGB;
  533. struct rcv_statsgb rcvGB;
  534. } stats_GB;
  535. } u;
  536. };
  537. #define xmit_tcp_segs100 u.stats_100.xmt100.xmit_tcp_segs
  538. #define xmit_tcp_bytes100 u.stats_100.xmt100.xmit_tcp_bytes
  539. #define xmit_bytes100 u.stats_100.xmt100.xmit_bytes
  540. #define xmit_collisions100 u.stats_100.xmt100.xmit_collisions
  541. #define xmit_unicasts100 u.stats_100.xmt100.xmit_unicasts
  542. #define xmit_other_error100 u.stats_100.xmt100.xmit_other_error
  543. #define xmit_excess_collisions100 u.stats_100.xmt100.xmit_excess_collisions
  544. #define rcv_tcp_segs100 u.stats_100.rcv100.rcv_tcp_segs
  545. #define rcv_tcp_bytes100 u.stats_100.rcv100.rcv_tcp_bytes
  546. #define rcv_bytes100 u.stats_100.rcv100.rcv_bytes
  547. #define rcv_unicasts100 u.stats_100.rcv100.rcv_unicasts
  548. #define rcv_other_error100 u.stats_100.rcv100.rcv_other_error
  549. #define rcv_drops100 u.stats_100.rcv100.rcv_drops
  550. #define xmit_tcp_segs_gb u.stats_GB.xmtGB.xmit_tcp_segs
  551. #define xmit_tcp_bytes_gb u.stats_GB.xmtGB.xmit_tcp_bytes
  552. #define xmit_bytes_gb u.stats_GB.xmtGB.xmit_bytes
  553. #define xmit_collisions_gb u.stats_GB.xmtGB.xmit_collisions
  554. #define xmit_unicasts_gb u.stats_GB.xmtGB.xmit_unicasts
  555. #define xmit_other_error_gb u.stats_GB.xmtGB.xmit_other_error
  556. #define xmit_excess_collisions_gb u.stats_GB.xmtGB.xmit_excess_collisions
  557. #define rcv_tcp_segs_gb u.stats_GB.rcvGB.rcv_tcp_segs
  558. #define rcv_tcp_bytes_gb u.stats_GB.rcvGB.rcv_tcp_bytes
  559. #define rcv_bytes_gb u.stats_GB.rcvGB.rcv_bytes
  560. #define rcv_unicasts_gb u.stats_GB.rcvGB.rcv_unicasts
  561. #define rcv_other_error_gb u.stats_GB.rcvGB.rcv_other_error
  562. #define rcv_drops_gb u.stats_GB.rcvGB.rcv_drops
  563. struct slic_config_mac {
  564. u8 macaddrA[6];
  565. };
  566. #define ATK_FRU_FORMAT 0x00
  567. #define VENDOR1_FRU_FORMAT 0x01
  568. #define VENDOR2_FRU_FORMAT 0x02
  569. #define VENDOR3_FRU_FORMAT 0x03
  570. #define VENDOR4_FRU_FORMAT 0x04
  571. #define NO_FRU_FORMAT 0xFF
  572. struct atk_fru {
  573. u8 assembly[6];
  574. u8 revision[2];
  575. u8 serial[14];
  576. u8 pad[3];
  577. };
  578. struct vendor1_fru {
  579. u8 commodity;
  580. u8 assembly[4];
  581. u8 revision[2];
  582. u8 supplier[2];
  583. u8 date[2];
  584. u8 sequence[3];
  585. u8 pad[13];
  586. };
  587. struct vendor2_fru {
  588. u8 part[8];
  589. u8 supplier[5];
  590. u8 date[3];
  591. u8 sequence[4];
  592. u8 pad[7];
  593. };
  594. struct vendor3_fru {
  595. u8 assembly[6];
  596. u8 revision[2];
  597. u8 serial[14];
  598. u8 pad[3];
  599. };
  600. struct vendor4_fru {
  601. u8 number[8];
  602. u8 part[8];
  603. u8 version[8];
  604. u8 pad[3];
  605. };
  606. union oemfru {
  607. struct vendor1_fru vendor1_fru;
  608. struct vendor2_fru vendor2_fru;
  609. struct vendor3_fru vendor3_fru;
  610. struct vendor4_fru vendor4_fru;
  611. };
  612. /*
  613. * SLIC EEPROM structure for Mojave
  614. */
  615. struct slic_eeprom {
  616. u16 Id; /* 00 EEPROM/FLASH Magic code 'A5A5'*/
  617. u16 EecodeSize; /* 01 Size of EEPROM Codes (bytes * 4)*/
  618. u16 FlashSize; /* 02 Flash size */
  619. u16 EepromSize; /* 03 EEPROM Size */
  620. u16 VendorId; /* 04 Vendor ID */
  621. u16 DeviceId; /* 05 Device ID */
  622. u8 RevisionId; /* 06 Revision ID */
  623. u8 ClassCode[3]; /* 07 Class Code */
  624. u8 DbgIntPin; /* 08 Debug Interrupt pin */
  625. u8 NetIntPin0; /* Network Interrupt Pin */
  626. u8 MinGrant; /* 09 Minimum grant */
  627. u8 MaxLat; /* Maximum Latency */
  628. u16 PciStatus; /* 10 PCI Status */
  629. u16 SubSysVId; /* 11 Subsystem Vendor Id */
  630. u16 SubSysId; /* 12 Subsystem ID */
  631. u16 DbgDevId; /* 13 Debug Device Id */
  632. u16 DramRomFn; /* 14 Dram/Rom function */
  633. u16 DSize2Pci; /* 15 DRAM size to PCI (bytes * 64K) */
  634. u16 RSize2Pci; /* 16 ROM extension size to PCI (bytes * 4k) */
  635. u8 NetIntPin1; /* 17 Network Interface Pin 1
  636. * (simba/leone only)
  637. */
  638. u8 NetIntPin2; /* Network Interface Pin 2 (simba/leone only)*/
  639. union {
  640. u8 NetIntPin3; /* 18 Network Interface Pin 3 (simba only) */
  641. u8 FreeTime; /* FreeTime setting (leone/mojave only) */
  642. } u1;
  643. u8 TBIctl; /* 10-bit interface control (Mojave only) */
  644. u16 DramSize; /* 19 DRAM size (bytes * 64k) */
  645. union {
  646. struct {
  647. /* Mac Interface Specific portions */
  648. struct slic_config_mac MacInfo[SLIC_NBR_MACS];
  649. } mac; /* MAC access for all boards */
  650. struct {
  651. /* use above struct for MAC access */
  652. struct slic_config_mac pad[SLIC_NBR_MACS - 1];
  653. u16 DeviceId2; /* Device ID for 2nd PCI function */
  654. u8 IntPin2; /* Interrupt pin for 2nd PCI function */
  655. u8 ClassCode2[3]; /* Class Code for 2nd PCI function */
  656. } mojave; /* 2nd function access for gigabit board */
  657. } u2;
  658. u16 CfgByte6; /* Config Byte 6 */
  659. u16 PMECapab; /* Power Mgment capabilities */
  660. u16 NwClkCtrls; /* NetworkClockControls */
  661. u8 FruFormat; /* Alacritech FRU format type */
  662. struct atk_fru AtkFru; /* Alacritech FRU information */
  663. u8 OemFruFormat; /* optional OEM FRU format type */
  664. union oemfru OemFru; /* optional OEM FRU information */
  665. u8 Pad[4]; /* Pad to 128 bytes - includes 2 cksum bytes
  666. * (if OEM FRU info exists) and two unusable
  667. * bytes at the end
  668. */
  669. };
  670. /* SLIC EEPROM structure for Oasis */
  671. struct oslic_eeprom {
  672. u16 Id; /* 00 EEPROM/FLASH Magic code 'A5A5' */
  673. u16 EecodeSize; /* 01 Size of EEPROM Codes (bytes * 4)*/
  674. u16 FlashConfig0; /* 02 Flash Config for SPI device 0 */
  675. u16 FlashConfig1; /* 03 Flash Config for SPI device 1 */
  676. u16 VendorId; /* 04 Vendor ID */
  677. u16 DeviceId; /* 05 Device ID (function 0) */
  678. u8 RevisionId; /* 06 Revision ID */
  679. u8 ClassCode[3]; /* 07 Class Code for PCI function 0 */
  680. u8 IntPin1; /* 08 Interrupt pin for PCI function 1*/
  681. u8 ClassCode2[3]; /* 09 Class Code for PCI function 1 */
  682. u8 IntPin2; /* 10 Interrupt pin for PCI function 2*/
  683. u8 IntPin0; /* Interrupt pin for PCI function 0*/
  684. u8 MinGrant; /* 11 Minimum grant */
  685. u8 MaxLat; /* Maximum Latency */
  686. u16 SubSysVId; /* 12 Subsystem Vendor Id */
  687. u16 SubSysId; /* 13 Subsystem ID */
  688. u16 FlashSize; /* 14 Flash size (bytes / 4K) */
  689. u16 DSize2Pci; /* 15 DRAM size to PCI (bytes / 64K) */
  690. u16 RSize2Pci; /* 16 Flash (ROM extension) size to PCI
  691. * (bytes / 4K)
  692. */
  693. u16 DeviceId1; /* 17 Device Id (function 1) */
  694. u16 DeviceId2; /* 18 Device Id (function 2) */
  695. u16 CfgByte6; /* 19 Device Status Config Bytes 6-7 */
  696. u16 PMECapab; /* 20 Power Mgment capabilities */
  697. u8 MSICapab; /* 21 MSI capabilities */
  698. u8 ClockDivider; /* Clock divider */
  699. u16 PciStatusLow; /* 22 PCI Status bits 15:0 */
  700. u16 PciStatusHigh; /* 23 PCI Status bits 31:16 */
  701. u16 DramConfigLow; /* 24 DRAM Configuration bits 15:0 */
  702. u16 DramConfigHigh; /* 25 DRAM Configuration bits 31:16 */
  703. u16 DramSize; /* 26 DRAM size (bytes / 64K) */
  704. u16 GpioTbiCtl; /* 27 GPIO/TBI controls for functions 1/0 */
  705. u16 EepromSize; /* 28 EEPROM Size */
  706. struct slic_config_mac MacInfo[2]; /* 29 MAC addresses (2 ports) */
  707. u8 FruFormat; /* 35 Alacritech FRU format type */
  708. struct atk_fru AtkFru; /* Alacritech FRU information */
  709. u8 OemFruFormat; /* optional OEM FRU format type */
  710. union oemfru OemFru; /* optional OEM FRU information */
  711. u8 Pad[4]; /* Pad to 128 bytes - includes 2 checksum bytes
  712. * (if OEM FRU info exists) and two unusable
  713. * bytes at the end
  714. */
  715. };
  716. #define MAX_EECODE_SIZE sizeof(struct slic_eeprom)
  717. #define MIN_EECODE_SIZE 0x62 /* code size without optional OEM FRU stuff */
  718. /*
  719. * SLIC CONFIG structure
  720. *
  721. * This structure lives in the CARD structure and is valid for all board types.
  722. * It is filled in from the appropriate EEPROM structure by
  723. * SlicGetConfigData()
  724. */
  725. struct slic_config {
  726. bool EepromValid; /* Valid EEPROM flag (checksum good?) */
  727. u16 DramSize; /* DRAM size (bytes / 64K) */
  728. struct slic_config_mac MacInfo[SLIC_NBR_MACS]; /* MAC addresses */
  729. u8 FruFormat; /* Alacritech FRU format type */
  730. struct atk_fru AtkFru; /* Alacritech FRU information */
  731. u8 OemFruFormat; /* optional OEM FRU format type */
  732. union {
  733. struct vendor1_fru vendor1_fru;
  734. struct vendor2_fru vendor2_fru;
  735. struct vendor3_fru vendor3_fru;
  736. struct vendor4_fru vendor4_fru;
  737. } OemFru;
  738. };
  739. #pragma pack()
  740. #endif