slichw.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  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. /* 31-8 - phy addr of set of contiguous hdr buffers
  286. 7-0 - number of buffers passed
  287. Buffers are 256 bytes long on 256-byte boundaries. */
  288. #define SLIC_HBAR 0x0020
  289. #define SLIC_HBAR_CNT_MSK 0x000000FF
  290. u32 slic_dbar; /* Data buffer handle & address reg */
  291. u32 pad5;
  292. /* 4 sets of registers; Buffers are 2K bytes long 2 per 4K page. */
  293. #define SLIC_DBAR 0x0028
  294. #define SLIC_DBAR_SIZE 2048
  295. u32 slic_cbar; /* Xmt Cmd buf addr regs.*/
  296. /* 1 per XMT interface
  297. 31-5 - phy addr of host command buffer
  298. 4-0 - length of cmd in multiples of 32 bytes
  299. Buffers are 32 bytes up to 512 bytes long */
  300. #define SLIC_CBAR 0x0030
  301. #define SLIC_CBAR_LEN_MSK 0x0000001F
  302. #define SLIC_CBAR_ALIGN 0x00000020
  303. u32 slic_wcs; /* write control store*/
  304. #define SLIC_WCS 0x0034
  305. #define SLIC_WCS_START 0x80000000 /*Start the SLIC (Jump to WCS)*/
  306. #define SLIC_WCS_COMPARE 0x40000000 /* Compare with value in WCS*/
  307. u32 slic_rbar; /* Response buffer address reg.*/
  308. u32 pad7;
  309. /*31-8 - phy addr of set of contiguous response buffers
  310. 7-0 - number of buffers passed
  311. Buffers are 32 bytes long on 32-byte boundaries.*/
  312. #define SLIC_RBAR 0x0038
  313. #define SLIC_RBAR_CNT_MSK 0x000000FF
  314. #define SLIC_RBAR_SIZE 32
  315. u32 slic_stats; /* read statistics (UPR) */
  316. u32 pad8;
  317. #define SLIC_RSTAT 0x0040
  318. u32 slic_rlsr; /* read link status */
  319. u32 pad9;
  320. #define SLIC_LSTAT 0x0048
  321. u32 slic_wmcfg; /* Write Mac Config */
  322. u32 pad10;
  323. #define SLIC_WMCFG 0x0050
  324. u32 slic_wphy; /* Write phy register */
  325. u32 pad11;
  326. #define SLIC_WPHY 0x0058
  327. u32 slic_rcbar; /* Rcv Cmd buf addr reg */
  328. u32 pad12;
  329. #define SLIC_RCBAR 0x0060
  330. u32 slic_rconfig; /* Read SLIC Config*/
  331. u32 pad13;
  332. #define SLIC_RCONFIG 0x0068
  333. u32 slic_intagg; /* Interrupt aggregation time */
  334. u32 pad14;
  335. #define SLIC_INTAGG 0x0070
  336. u32 slic_wxcfg; /* Write XMIT config reg*/
  337. u32 pad16;
  338. #define SLIC_WXCFG 0x0078
  339. u32 slic_wrcfg; /* Write RCV config reg*/
  340. u32 pad17;
  341. #define SLIC_WRCFG 0x0080
  342. u32 slic_wraddral; /* Write rcv addr a low*/
  343. u32 pad18;
  344. #define SLIC_WRADDRAL 0x0088
  345. u32 slic_wraddrah; /* Write rcv addr a high*/
  346. u32 pad19;
  347. #define SLIC_WRADDRAH 0x0090
  348. u32 slic_wraddrbl; /* Write rcv addr b low*/
  349. u32 pad20;
  350. #define SLIC_WRADDRBL 0x0098
  351. u32 slic_wraddrbh; /* Write rcv addr b high*/
  352. u32 pad21;
  353. #define SLIC_WRADDRBH 0x00a0
  354. u32 slic_mcastlow; /* Low bits of mcast mask*/
  355. u32 pad22;
  356. #define SLIC_MCASTLOW 0x00a8
  357. u32 slic_mcasthigh; /* High bits of mcast mask*/
  358. u32 pad23;
  359. #define SLIC_MCASTHIGH 0x00b0
  360. u32 slic_ping; /* Ping the card*/
  361. u32 pad24;
  362. #define SLIC_PING 0x00b8
  363. u32 slic_dump_cmd; /* Dump command */
  364. u32 pad25;
  365. #define SLIC_DUMP_CMD 0x00c0
  366. u32 slic_dump_data; /* Dump data pointer */
  367. u32 pad26;
  368. #define SLIC_DUMP_DATA 0x00c8
  369. u32 slic_pcistatus; /* Read card's pci_status register */
  370. u32 pad27;
  371. #define SLIC_PCISTATUS 0x00d0
  372. u32 slic_wrhostid; /* Write hostid field */
  373. u32 pad28;
  374. #define SLIC_WRHOSTID 0x00d8
  375. #define SLIC_RDHOSTID_1GB 0x1554
  376. #define SLIC_RDHOSTID_2GB 0x1554
  377. u32 slic_low_power; /* Put card in a low power state */
  378. u32 pad29;
  379. #define SLIC_LOW_POWER 0x00e0
  380. u32 slic_quiesce; /* force slic into quiescent state
  381. before soft reset */
  382. u32 pad30;
  383. #define SLIC_QUIESCE 0x00e8
  384. u32 slic_reset_iface;/* reset interface queues */
  385. u32 pad31;
  386. #define SLIC_RESET_IFACE 0x00f0
  387. u32 slic_addr_upper;/* Bits 63-32 for host i/f addrs */
  388. u32 pad32;
  389. #define SLIC_ADDR_UPPER 0x00f8 /*Register is only written when it has changed*/
  390. u32 slic_hbar64; /* 64 bit Header buffer address reg */
  391. u32 pad33;
  392. #define SLIC_HBAR64 0x0100
  393. u32 slic_dbar64; /* 64 bit Data buffer handle & address reg */
  394. u32 pad34;
  395. #define SLIC_DBAR64 0x0108
  396. u32 slic_cbar64; /* 64 bit Xmt Cmd buf addr regs. */
  397. u32 pad35;
  398. #define SLIC_CBAR64 0x0110
  399. u32 slic_rbar64; /* 64 bit Response buffer address reg.*/
  400. u32 pad36;
  401. #define SLIC_RBAR64 0x0118
  402. u32 slic_rcbar64; /* 64 bit Rcv Cmd buf addr reg*/
  403. u32 pad37;
  404. #define SLIC_RCBAR64 0x0120
  405. u32 slic_stats64; /* read statistics (64 bit UPR) */
  406. u32 pad38;
  407. #define SLIC_RSTAT64 0x0128
  408. u32 slic_rcv_wcs; /*Download Gigabit RCV sequencer ucode*/
  409. u32 pad39;
  410. #define SLIC_RCV_WCS 0x0130
  411. #define SLIC_RCVWCS_BEGIN 0x40000000
  412. #define SLIC_RCVWCS_FINISH 0x80000000
  413. u32 slic_wrvlanid; /* Write VlanId field */
  414. u32 pad40;
  415. #define SLIC_WRVLANID 0x0138
  416. u32 slic_read_xf_info; /* Read Transformer info */
  417. u32 pad41;
  418. #define SLIC_READ_XF_INFO 0x0140
  419. u32 slic_write_xf_info; /* Write Transformer info */
  420. u32 pad42;
  421. #define SLIC_WRITE_XF_INFO 0x0148
  422. u32 RSVD1; /* TOE Only */
  423. u32 pad43;
  424. u32 RSVD2; /* TOE Only */
  425. u32 pad44;
  426. u32 RSVD3; /* TOE Only */
  427. u32 pad45;
  428. u32 RSVD4; /* TOE Only */
  429. u32 pad46;
  430. u32 slic_ticks_per_sec; /* Write card ticks per second */
  431. u32 pad47;
  432. #define SLIC_TICKS_PER_SEC 0x0170
  433. };
  434. enum UPR_REQUEST {
  435. SLIC_UPR_STATS,
  436. SLIC_UPR_RLSR,
  437. SLIC_UPR_WCFG,
  438. SLIC_UPR_RCONFIG,
  439. SLIC_UPR_RPHY,
  440. SLIC_UPR_ENLB,
  441. SLIC_UPR_ENCT,
  442. SLIC_UPR_PDWN,
  443. SLIC_UPR_PING,
  444. SLIC_UPR_DUMP,
  445. };
  446. struct inicpm_wakepattern {
  447. u32 patternlength;
  448. u8 pattern[SLIC_PM_PATTERNSIZE];
  449. u8 mask[SLIC_PM_PATTERNSIZE];
  450. };
  451. struct inicpm_state {
  452. u32 powercaps;
  453. u32 powerstate;
  454. u32 wake_linkstatus;
  455. u32 wake_magicpacket;
  456. u32 wake_framepattern;
  457. struct inicpm_wakepattern wakepattern[SLIC_PM_MAXPATTERNS];
  458. };
  459. struct slicpm_packet_pattern {
  460. u32 priority;
  461. u32 reserved;
  462. u32 masksize;
  463. u32 patternoffset;
  464. u32 patternsize;
  465. u32 patternflags;
  466. };
  467. enum slicpm_power_state {
  468. slicpm_state_unspecified = 0,
  469. slicpm_state_d0,
  470. slicpm_state_d1,
  471. slicpm_state_d2,
  472. slicpm_state_d3,
  473. slicpm_state_maximum
  474. };
  475. struct slicpm_wakeup_capabilities {
  476. enum slicpm_power_state min_magic_packet_wakeup;
  477. enum slicpm_power_state min_pattern_wakeup;
  478. enum slicpm_power_state min_link_change_wakeup;
  479. };
  480. struct slic_pnp_capabilities {
  481. u32 flags;
  482. struct slicpm_wakeup_capabilities wakeup_capabilities;
  483. };
  484. struct xmt_stats {
  485. u32 xmit_tcp_bytes;
  486. u32 xmit_tcp_segs;
  487. u32 xmit_bytes;
  488. u32 xmit_collisions;
  489. u32 xmit_unicasts;
  490. u32 xmit_other_error;
  491. u32 xmit_excess_collisions;
  492. };
  493. struct rcv_stats {
  494. u32 rcv_tcp_bytes;
  495. u32 rcv_tcp_segs;
  496. u32 rcv_bytes;
  497. u32 rcv_unicasts;
  498. u32 rcv_other_error;
  499. u32 rcv_drops;
  500. };
  501. struct xmt_statsgb {
  502. u64 xmit_tcp_bytes;
  503. u64 xmit_tcp_segs;
  504. u64 xmit_bytes;
  505. u64 xmit_collisions;
  506. u64 xmit_unicasts;
  507. u64 xmit_other_error;
  508. u64 xmit_excess_collisions;
  509. };
  510. struct rcv_statsgb {
  511. u64 rcv_tcp_bytes;
  512. u64 rcv_tcp_segs;
  513. u64 rcv_bytes;
  514. u64 rcv_unicasts;
  515. u64 rcv_other_error;
  516. u64 rcv_drops;
  517. };
  518. struct slic_stats {
  519. union {
  520. struct {
  521. struct xmt_stats xmt100;
  522. struct rcv_stats rcv100;
  523. } stats_100;
  524. struct {
  525. struct xmt_statsgb xmtGB;
  526. struct rcv_statsgb rcvGB;
  527. } stats_GB;
  528. } u;
  529. };
  530. #define xmit_tcp_segs100 u.stats_100.xmt100.xmit_tcp_segs
  531. #define xmit_tcp_bytes100 u.stats_100.xmt100.xmit_tcp_bytes
  532. #define xmit_bytes100 u.stats_100.xmt100.xmit_bytes
  533. #define xmit_collisions100 u.stats_100.xmt100.xmit_collisions
  534. #define xmit_unicasts100 u.stats_100.xmt100.xmit_unicasts
  535. #define xmit_other_error100 u.stats_100.xmt100.xmit_other_error
  536. #define xmit_excess_collisions100 u.stats_100.xmt100.xmit_excess_collisions
  537. #define rcv_tcp_segs100 u.stats_100.rcv100.rcv_tcp_segs
  538. #define rcv_tcp_bytes100 u.stats_100.rcv100.rcv_tcp_bytes
  539. #define rcv_bytes100 u.stats_100.rcv100.rcv_bytes
  540. #define rcv_unicasts100 u.stats_100.rcv100.rcv_unicasts
  541. #define rcv_other_error100 u.stats_100.rcv100.rcv_other_error
  542. #define rcv_drops100 u.stats_100.rcv100.rcv_drops
  543. #define xmit_tcp_segs_gb u.stats_GB.xmtGB.xmit_tcp_segs
  544. #define xmit_tcp_bytes_gb u.stats_GB.xmtGB.xmit_tcp_bytes
  545. #define xmit_bytes_gb u.stats_GB.xmtGB.xmit_bytes
  546. #define xmit_collisions_gb u.stats_GB.xmtGB.xmit_collisions
  547. #define xmit_unicasts_gb u.stats_GB.xmtGB.xmit_unicasts
  548. #define xmit_other_error_gb u.stats_GB.xmtGB.xmit_other_error
  549. #define xmit_excess_collisions_gb u.stats_GB.xmtGB.xmit_excess_collisions
  550. #define rcv_tcp_segs_gb u.stats_GB.rcvGB.rcv_tcp_segs
  551. #define rcv_tcp_bytes_gb u.stats_GB.rcvGB.rcv_tcp_bytes
  552. #define rcv_bytes_gb u.stats_GB.rcvGB.rcv_bytes
  553. #define rcv_unicasts_gb u.stats_GB.rcvGB.rcv_unicasts
  554. #define rcv_other_error_gb u.stats_GB.rcvGB.rcv_other_error
  555. #define rcv_drops_gb u.stats_GB.rcvGB.rcv_drops
  556. struct slic_config_mac {
  557. u8 macaddrA[6];
  558. };
  559. #define ATK_FRU_FORMAT 0x00
  560. #define VENDOR1_FRU_FORMAT 0x01
  561. #define VENDOR2_FRU_FORMAT 0x02
  562. #define VENDOR3_FRU_FORMAT 0x03
  563. #define VENDOR4_FRU_FORMAT 0x04
  564. #define NO_FRU_FORMAT 0xFF
  565. struct atk_fru {
  566. u8 assembly[6];
  567. u8 revision[2];
  568. u8 serial[14];
  569. u8 pad[3];
  570. };
  571. struct vendor1_fru {
  572. u8 commodity;
  573. u8 assembly[4];
  574. u8 revision[2];
  575. u8 supplier[2];
  576. u8 date[2];
  577. u8 sequence[3];
  578. u8 pad[13];
  579. };
  580. struct vendor2_fru {
  581. u8 part[8];
  582. u8 supplier[5];
  583. u8 date[3];
  584. u8 sequence[4];
  585. u8 pad[7];
  586. };
  587. struct vendor3_fru {
  588. u8 assembly[6];
  589. u8 revision[2];
  590. u8 serial[14];
  591. u8 pad[3];
  592. };
  593. struct vendor4_fru {
  594. u8 number[8];
  595. u8 part[8];
  596. u8 version[8];
  597. u8 pad[3];
  598. };
  599. union oemfru {
  600. struct vendor1_fru vendor1_fru;
  601. struct vendor2_fru vendor2_fru;
  602. struct vendor3_fru vendor3_fru;
  603. struct vendor4_fru vendor4_fru;
  604. };
  605. /*
  606. * SLIC EEPROM structure for Mojave
  607. */
  608. struct slic_eeprom {
  609. u16 Id; /* 00 EEPROM/FLASH Magic code 'A5A5'*/
  610. u16 EecodeSize; /* 01 Size of EEPROM Codes (bytes * 4)*/
  611. u16 FlashSize; /* 02 Flash size */
  612. u16 EepromSize; /* 03 EEPROM Size */
  613. u16 VendorId; /* 04 Vendor ID */
  614. u16 DeviceId; /* 05 Device ID */
  615. u8 RevisionId; /* 06 Revision ID */
  616. u8 ClassCode[3]; /* 07 Class Code */
  617. u8 DbgIntPin; /* 08 Debug Interrupt pin */
  618. u8 NetIntPin0; /* Network Interrupt Pin */
  619. u8 MinGrant; /* 09 Minimum grant */
  620. u8 MaxLat; /* Maximum Latency */
  621. u16 PciStatus; /* 10 PCI Status */
  622. u16 SubSysVId; /* 11 Subsystem Vendor Id */
  623. u16 SubSysId; /* 12 Subsystem ID */
  624. u16 DbgDevId; /* 13 Debug Device Id */
  625. u16 DramRomFn; /* 14 Dram/Rom function */
  626. u16 DSize2Pci; /* 15 DRAM size to PCI (bytes * 64K) */
  627. u16 RSize2Pci; /* 16 ROM extension size to PCI (bytes * 4k) */
  628. u8 NetIntPin1; /* 17 Network Interface Pin 1
  629. (simba/leone only) */
  630. u8 NetIntPin2; /* Network Interface Pin 2 (simba/leone only)*/
  631. union {
  632. u8 NetIntPin3; /* 18 Network Interface Pin 3 (simba only) */
  633. u8 FreeTime; /* FreeTime setting (leone/mojave only) */
  634. } u1;
  635. u8 TBIctl; /* 10-bit interface control (Mojave only) */
  636. u16 DramSize; /* 19 DRAM size (bytes * 64k) */
  637. union {
  638. struct {
  639. /* Mac Interface Specific portions */
  640. struct slic_config_mac MacInfo[SLIC_NBR_MACS];
  641. } mac; /* MAC access for all boards */
  642. struct {
  643. /* use above struct for MAC access */
  644. struct slic_config_mac pad[SLIC_NBR_MACS - 1];
  645. u16 DeviceId2; /* Device ID for 2nd PCI function */
  646. u8 IntPin2; /* Interrupt pin for 2nd PCI function */
  647. u8 ClassCode2[3]; /* Class Code for 2nd PCI function */
  648. } mojave; /* 2nd function access for gigabit board */
  649. } u2;
  650. u16 CfgByte6; /* Config Byte 6 */
  651. u16 PMECapab; /* Power Mgment capabilities */
  652. u16 NwClkCtrls; /* NetworkClockControls */
  653. u8 FruFormat; /* Alacritech FRU format type */
  654. struct atk_fru AtkFru; /* Alacritech FRU information */
  655. u8 OemFruFormat; /* optional OEM FRU format type */
  656. union oemfru OemFru; /* optional OEM FRU information */
  657. u8 Pad[4]; /* Pad to 128 bytes - includes 2 cksum bytes
  658. * (if OEM FRU info exists) and two unusable
  659. * bytes at the end */
  660. };
  661. /* SLIC EEPROM structure for Oasis */
  662. struct oslic_eeprom {
  663. u16 Id; /* 00 EEPROM/FLASH Magic code 'A5A5' */
  664. u16 EecodeSize; /* 01 Size of EEPROM Codes (bytes * 4)*/
  665. u16 FlashConfig0; /* 02 Flash Config for SPI device 0 */
  666. u16 FlashConfig1; /* 03 Flash Config for SPI device 1 */
  667. u16 VendorId; /* 04 Vendor ID */
  668. u16 DeviceId; /* 05 Device ID (function 0) */
  669. u8 RevisionId; /* 06 Revision ID */
  670. u8 ClassCode[3]; /* 07 Class Code for PCI function 0 */
  671. u8 IntPin1; /* 08 Interrupt pin for PCI function 1*/
  672. u8 ClassCode2[3]; /* 09 Class Code for PCI function 1 */
  673. u8 IntPin2; /* 10 Interrupt pin for PCI function 2*/
  674. u8 IntPin0; /* Interrupt pin for PCI function 0*/
  675. u8 MinGrant; /* 11 Minimum grant */
  676. u8 MaxLat; /* Maximum Latency */
  677. u16 SubSysVId; /* 12 Subsystem Vendor Id */
  678. u16 SubSysId; /* 13 Subsystem ID */
  679. u16 FlashSize; /* 14 Flash size (bytes / 4K) */
  680. u16 DSize2Pci; /* 15 DRAM size to PCI (bytes / 64K) */
  681. u16 RSize2Pci; /* 16 Flash (ROM extension) size to PCI
  682. (bytes / 4K) */
  683. u16 DeviceId1; /* 17 Device Id (function 1) */
  684. u16 DeviceId2; /* 18 Device Id (function 2) */
  685. u16 CfgByte6; /* 19 Device Status Config Bytes 6-7 */
  686. u16 PMECapab; /* 20 Power Mgment capabilities */
  687. u8 MSICapab; /* 21 MSI capabilities */
  688. u8 ClockDivider; /* Clock divider */
  689. u16 PciStatusLow; /* 22 PCI Status bits 15:0 */
  690. u16 PciStatusHigh; /* 23 PCI Status bits 31:16 */
  691. u16 DramConfigLow; /* 24 DRAM Configuration bits 15:0 */
  692. u16 DramConfigHigh; /* 25 DRAM Configuration bits 31:16 */
  693. u16 DramSize; /* 26 DRAM size (bytes / 64K) */
  694. u16 GpioTbiCtl; /* 27 GPIO/TBI controls for functions 1/0 */
  695. u16 EepromSize; /* 28 EEPROM Size */
  696. struct slic_config_mac MacInfo[2]; /* 29 MAC addresses (2 ports) */
  697. u8 FruFormat; /* 35 Alacritech FRU format type */
  698. struct atk_fru AtkFru; /* Alacritech FRU information */
  699. u8 OemFruFormat; /* optional OEM FRU format type */
  700. union oemfru OemFru; /* optional OEM FRU information */
  701. u8 Pad[4]; /* Pad to 128 bytes - includes 2 checksum bytes
  702. * (if OEM FRU info exists) and two unusable
  703. * bytes at the end
  704. */
  705. };
  706. #define MAX_EECODE_SIZE sizeof(struct slic_eeprom)
  707. #define MIN_EECODE_SIZE 0x62 /* code size without optional OEM FRU stuff */
  708. /*
  709. * SLIC CONFIG structure
  710. *
  711. * This structure lives in the CARD structure and is valid for all board types.
  712. * It is filled in from the appropriate EEPROM structure by
  713. * SlicGetConfigData()
  714. */
  715. struct slic_config {
  716. bool EepromValid; /* Valid EEPROM flag (checksum good?) */
  717. u16 DramSize; /* DRAM size (bytes / 64K) */
  718. struct slic_config_mac MacInfo[SLIC_NBR_MACS]; /* MAC addresses */
  719. u8 FruFormat; /* Alacritech FRU format type */
  720. struct atk_fru AtkFru; /* Alacritech FRU information */
  721. u8 OemFruFormat; /* optional OEM FRU format type */
  722. union {
  723. struct vendor1_fru vendor1_fru;
  724. struct vendor2_fru vendor2_fru;
  725. struct vendor3_fru vendor3_fru;
  726. struct vendor4_fru vendor4_fru;
  727. } OemFru;
  728. };
  729. #pragma pack()
  730. #endif