qereg.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /* $OpenBSD: qereg.h,v 1.4 2008/06/26 05:42:18 ray Exp $ */
  2. /* $NetBSD: qereg.h,v 1.3 2000/07/24 04:28:51 mycroft Exp $ */
  3. /*-
  4. * Copyright (c) 1999 The NetBSD Foundation, Inc.
  5. * All rights reserved.
  6. *
  7. * This code is derived from software contributed to The NetBSD Foundation
  8. * by Paul Kranenburg.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in the
  17. * documentation and/or other materials provided with the distribution.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  21. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  22. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  23. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  24. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  25. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  27. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  28. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  29. * POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. /*
  32. * Copyright (c) 1998 Jason L. Wright.
  33. * All rights reserved.
  34. *
  35. * Redistribution and use in source and binary forms, with or without
  36. * modification, are permitted provided that the following conditions
  37. * are met:
  38. * 1. Redistributions of source code must retain the above copyright
  39. * notice, this list of conditions and the following disclaimer.
  40. * 2. Redistributions in binary form must reproduce the above copyright
  41. * notice, this list of conditions and the following disclaimer in the
  42. * documentation and/or other materials provided with the distribution.
  43. *
  44. * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
  45. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  46. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  47. * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  48. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  49. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  50. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  51. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  52. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  53. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  54. */
  55. /*
  56. * QE Channel registers
  57. */
  58. #if 0
  59. struct qe_cregs {
  60. u_int32_t ctrl; /* control */
  61. u_int32_t stat; /* status */
  62. u_int32_t rxds; /* rx descriptor ring ptr */
  63. u_int32_t txds; /* tx descriptor ring ptr */
  64. u_int32_t rimask; /* rx interrupt mask */
  65. u_int32_t timask; /* tx interrupt mask */
  66. u_int32_t qmask; /* qec error interrupt mask */
  67. u_int32_t mmask; /* mace error interrupt mask */
  68. u_int32_t rxwbufptr; /* local memory rx write ptr */
  69. u_int32_t rxrbufptr; /* local memory rx read ptr */
  70. u_int32_t txwbufptr; /* local memory tx write ptr */
  71. u_int32_t txrbufptr; /* local memory tx read ptr */
  72. u_int32_t ccnt; /* collision counter */
  73. u_int32_t pipg; /* inter-frame gap */
  74. };
  75. #endif
  76. /* register indices: */
  77. #define QE_CRI_CTRL (0*4)
  78. #define QE_CRI_STAT (1*4)
  79. #define QE_CRI_RXDS (2*4)
  80. #define QE_CRI_TXDS (3*4)
  81. #define QE_CRI_RIMASK (4*4)
  82. #define QE_CRI_TIMASK (5*4)
  83. #define QE_CRI_QMASK (6*4)
  84. #define QE_CRI_MMASK (7*4)
  85. #define QE_CRI_RXWBUF (8*4)
  86. #define QE_CRI_RXRBUF (9*4)
  87. #define QE_CRI_TXWBUF (10*4)
  88. #define QE_CRI_TXRBUF (11*4)
  89. #define QE_CRI_CCNT (12*4)
  90. #define QE_CRI_PIPG (13*4)
  91. /* qe_cregs.ctrl: control. */
  92. #define QE_CR_CTRL_RXOFF 0x00000004 /* disable receiver */
  93. #define QE_CR_CTRL_RESET 0x00000002 /* reset this channel */
  94. #define QE_CR_CTRL_TWAKEUP 0x00000001 /* tx dma wakeup */
  95. /* qe_cregs.stat: status. */
  96. #define QE_CR_STAT_EDEFER 0x10000000 /* excessive defers */
  97. #define QE_CR_STAT_CLOSS 0x08000000 /* loss of carrier */
  98. #define QE_CR_STAT_ERETRIES 0x04000000 /* >16 retries */
  99. #define QE_CR_STAT_LCOLL 0x02000000 /* late tx collision */
  100. #define QE_CR_STAT_FUFLOW 0x01000000 /* fifo underflow */
  101. #define QE_CR_STAT_JERROR 0x00800000 /* jabber error */
  102. #define QE_CR_STAT_BERROR 0x00400000 /* babble error */
  103. #define QE_CR_STAT_TXIRQ 0x00200000 /* tx interrupt */
  104. #define QE_CR_STAT_TCCOFLOW 0x00100000 /* tx collision cntr expired */
  105. #define QE_CR_STAT_TXDERROR 0x00080000 /* tx descriptor is bad */
  106. #define QE_CR_STAT_TXLERR 0x00040000 /* tx late error */
  107. #define QE_CR_STAT_TXPERR 0x00020000 /* tx parity error */
  108. #define QE_CR_STAT_TXSERR 0x00010000 /* tx sbus error ack */
  109. #define QE_CR_STAT_RCCOFLOW 0x00001000 /* rx collision cntr expired */
  110. #define QE_CR_STAT_RUOFLOW 0x00000800 /* rx runt counter expired */
  111. #define QE_CR_STAT_MCOFLOW 0x00000400 /* rx missed counter expired */
  112. #define QE_CR_STAT_RXFOFLOW 0x00000200 /* rx fifo over flow */
  113. #define QE_CR_STAT_RLCOLL 0x00000100 /* rx late collision */
  114. #define QE_CR_STAT_FCOFLOW 0x00000080 /* rx frame counter expired */
  115. #define QE_CR_STAT_CECOFLOW 0x00000040 /* rx crc error cntr expired */
  116. #define QE_CR_STAT_RXIRQ 0x00000020 /* rx interrupt */
  117. #define QE_CR_STAT_RXDROP 0x00000010 /* rx dropped packet */
  118. #define QE_CR_STAT_RXSMALL 0x00000008 /* rx buffer too small */
  119. #define QE_CR_STAT_RXLERR 0x00000004 /* rx late error */
  120. #define QE_CR_STAT_RXPERR 0x00000002 /* rx parity error */
  121. #define QE_CR_STAT_RXSERR 0x00000001 /* rx sbus error ack */
  122. #define QE_CR_STAT_BITS "\020" \
  123. "\01RXSERR\02RXPERR\03RXLERR" \
  124. "\04RXSMALL\05RXDROP\06RXIRQ" \
  125. "\07CECOFLOW\010FCOFLOW\011RLCOLL" \
  126. "\012RXFOFLOW\013MCOFLOW\014RUOFLOW" \
  127. "\015RCCOFLOW\021TXSERR\022TXPERR" \
  128. "\023TXLERR\024TXDERROR\025TCCOFLOW" \
  129. "\026TXIRQ\027BERROR\030JERROR" \
  130. "\031FUFLOW\032LCOLL\033ERETRIES" \
  131. "\034CLOSS\035EDEFER"
  132. /*
  133. * Errors: all status bits except for TX/RX IRQ
  134. */
  135. #define QE_CR_STAT_ALLERRORS \
  136. ( QE_CR_STAT_EDEFER | QE_CR_STAT_CLOSS | QE_CR_STAT_ERETRIES \
  137. | QE_CR_STAT_LCOLL | QE_CR_STAT_FUFLOW | QE_CR_STAT_JERROR \
  138. | QE_CR_STAT_BERROR | QE_CR_STAT_TCCOFLOW | QE_CR_STAT_TXDERROR \
  139. | QE_CR_STAT_TXLERR | QE_CR_STAT_TXPERR | QE_CR_STAT_TXSERR \
  140. | QE_CR_STAT_RCCOFLOW | QE_CR_STAT_RUOFLOW | QE_CR_STAT_MCOFLOW \
  141. | QE_CR_STAT_RXFOFLOW | QE_CR_STAT_RLCOLL | QE_CR_STAT_FCOFLOW \
  142. | QE_CR_STAT_CECOFLOW | QE_CR_STAT_RXDROP | QE_CR_STAT_RXSMALL \
  143. | QE_CR_STAT_RXLERR | QE_CR_STAT_RXPERR | QE_CR_STAT_RXSERR)
  144. /* qe_cregs.qmask: qec error interrupt mask. */
  145. #define QE_CR_QMASK_COFLOW 0x00100000 /* collision cntr overflow */
  146. #define QE_CR_QMASK_TXDERROR 0x00080000 /* tx descriptor error */
  147. #define QE_CR_QMASK_TXLERR 0x00040000 /* tx late error */
  148. #define QE_CR_QMASK_TXPERR 0x00020000 /* tx parity error */
  149. #define QE_CR_QMASK_TXSERR 0x00010000 /* tx sbus error ack */
  150. #define QE_CR_QMASK_RXDROP 0x00000010 /* rx packet dropped */
  151. #define QE_CR_QMASK_RXSMALL 0x00000008 /* rx buffer too small */
  152. #define QE_CR_QMASK_RXLERR 0x00000004 /* rx late error */
  153. #define QE_CR_QMASK_RXPERR 0x00000002 /* rx parity error */
  154. #define QE_CR_QMASK_RXSERR 0x00000001 /* rx sbus error ack */
  155. /* qe_cregs.mmask: MACE error interrupt mask. */
  156. #define QE_CR_MMASK_EDEFER 0x10000000 /* excess defer */
  157. #define QE_CR_MMASK_CLOSS 0x08000000 /* carrier loss */
  158. #define QE_CR_MMASK_ERETRY 0x04000000 /* excess retry */
  159. #define QE_CR_MMASK_LCOLL 0x02000000 /* late collision error */
  160. #define QE_CR_MMASK_UFLOW 0x01000000 /* underflow */
  161. #define QE_CR_MMASK_JABBER 0x00800000 /* jabber error */
  162. #define QE_CR_MMASK_BABBLE 0x00400000 /* babble error */
  163. #define QE_CR_MMASK_OFLOW 0x00000800 /* overflow */
  164. #define QE_CR_MMASK_RXCOLL 0x00000400 /* rx coll-cntr overflow */
  165. #define QE_CR_MMASK_RPKT 0x00000200 /* runt pkt overflow */
  166. #define QE_CR_MMASK_MPKT 0x00000100 /* missed pkt overflow */
  167. /* qe_cregs.pipg: inter-frame gap. */
  168. #define QE_CR_PIPG_TENAB 0x00000020 /* enable throttle */
  169. #define QE_CR_PIPG_MMODE 0x00000010 /* manual mode */
  170. #define QE_CR_PIPG_WMASK 0x0000000f /* sbus wait mask */
  171. /*
  172. * MACE registers
  173. */
  174. #if 0
  175. struct qe_mregs {
  176. u_int8_t rcvfifo; [0] /* receive fifo */
  177. u_int8_t xmtfifo; [1] /* transmit fifo */
  178. u_int8_t xmtfc; [2] /* transmit frame control */
  179. u_int8_t xmtfs; [3] /* transmit frame status */
  180. u_int8_t xmtrc; [4] /* tx retry count */
  181. u_int8_t rcvfc; [5] /* receive frame control */
  182. u_int8_t rcvfs; [6] /* receive frame status */
  183. u_int8_t fifofc; [7] /* fifo frame count */
  184. u_int8_t ir; [8] /* interrupt register */
  185. u_int8_t imr; [9] /* interrupt mask register */
  186. u_int8_t pr; [10] /* poll register */
  187. u_int8_t biucc; [11] /* biu config control */
  188. u_int8_t fifocc; [12] /* fifo config control */
  189. u_int8_t maccc; [13] /* mac config control */
  190. u_int8_t plscc; [14] /* pls config control */
  191. u_int8_t phycc; [15] /* phy config control */
  192. u_int8_t chipid1; [16] /* chipid, low byte */
  193. u_int8_t chipid2; [17] /* chipid, high byte */
  194. u_int8_t iac; [18] /* internal address config */
  195. u_int8_t _reserved0; [19] /* reserved */
  196. u_int8_t ladrf; [20] /* logical address filter */
  197. u_int8_t padr; [21] /* physical address */
  198. u_int8_t _reserved1; [22] /* reserved */
  199. u_int8_t _reserved2; [23] /* reserved */
  200. u_int8_t mpc; [24] /* missed packet count */
  201. u_int8_t _reserved3; [25] /* reserved */
  202. u_int8_t rntpc; [26] /* runt packet count */
  203. u_int8_t rcvcc; [27] /* receive collision count */
  204. u_int8_t _reserved4; [28] /* reserved */
  205. u_int8_t utr; [29] /* user test register */
  206. u_int8_t rtr1; [30] /* reserved test register 1 */
  207. u_int8_t rtr2; [31] /* reserved test register 2 */
  208. };
  209. #endif
  210. /* register indices: */
  211. #define QE_MRI_RCVFIFO 0 /* receive fifo */
  212. #define QE_MRI_XMTFIFO 1 /* transmit fifo */
  213. #define QE_MRI_XMTFC 2 /* transmit frame control */
  214. #define QE_MRI_XMTFS 3 /* transmit frame status */
  215. #define QE_MRI_XMTRC 4 /* tx retry count */
  216. #define QE_MRI_RCVFC 5 /* receive frame control */
  217. #define QE_MRI_RCVFS 6 /* receive frame status */
  218. #define QE_MRI_FIFOFC 7 /* fifo frame count */
  219. #define QE_MRI_IR 8 /* interrupt register */
  220. #define QE_MRI_IMR 9 /* interrupt mask register */
  221. #define QE_MRI_PR 10 /* poll register */
  222. #define QE_MRI_BIUCC 11 /* biu config control */
  223. #define QE_MRI_FIFOCC 12 /* fifo config control */
  224. #define QE_MRI_MACCC 13 /* mac config control */
  225. #define QE_MRI_PLSCC 14 /* pls config control */
  226. #define QE_MRI_PHYCC 15 /* phy config control */
  227. #define QE_MRI_CHIPID1 16 /* chipid, low byte */
  228. #define QE_MRI_CHIPID2 17 /* chipid, high byte */
  229. #define QE_MRI_IAC 18 /* internal address config */
  230. #define QE_MRI_LADRF 20 /* logical address filter */
  231. #define QE_MRI_PADR 21 /* physical address */
  232. #define QE_MRI_MPC 24 /* missed packet count */
  233. #define QE_MRI_RNTPC 26 /* runt packet count */
  234. #define QE_MRI_RCVCC 27 /* receive collision count */
  235. #define QE_MRI_UTR 29 /* user test register */
  236. #define QE_MRI_RTR1 30 /* reserved test register 1 */
  237. #define QE_MRI_RTR2 31 /* reserved test register 2 */
  238. /* qe_mregs.xmtfc: transmit frame control. */
  239. #define QE_MR_XMTFC_DRETRY 0x80 /* disable retries */
  240. #define QE_MR_XMTFC_DXMTFCS 0x08 /* disable tx fcs */
  241. #define QE_MR_XMTFC_APADXMT 0x01 /* enable auto padding */
  242. /* qe_mregs.xmtfs: transmit frame status. */
  243. #define QE_MR_XMTFS_XMTSV 0x80 /* tx valid */
  244. #define QE_MR_XMTFS_UFLO 0x40 /* tx underflow */
  245. #define QE_MR_XMTFS_LCOL 0x20 /* tx late collision */
  246. #define QE_MR_XMTFS_MORE 0x10 /* tx > 1 retries */
  247. #define QE_MR_XMTFS_ONE 0x08 /* tx 1 retry */
  248. #define QE_MR_XMTFS_DEFER 0x04 /* tx pkt deferred */
  249. #define QE_MR_XMTFS_LCAR 0x02 /* tx carrier lost */
  250. #define QE_MR_XMTFS_RTRY 0x01 /* tx retry error */
  251. /* qe_mregs.xmtrc: transmit retry count. */
  252. #define QE_MR_XMTRC_EXDEF 0x80 /* tx excess defers */
  253. #define QE_MR_XMTRC_XMTRC 0x0f /* tx retry count mask */
  254. /* qe_mregs.rcvfc: receive frame control. */
  255. #define QE_MR_RCVFC_LLRCV 0x08 /* rx low latency */
  256. #define QE_MR_RCVFC_MR 0x04 /* rx addr match/reject */
  257. #define QE_MR_RCVFC_ASTRPRCV 0x01 /* rx auto strip */
  258. /* qe_mregs.rcvfs: receive frame status. */
  259. #define QE_MR_RCVFS_OFLO 0x80 /* rx overflow */
  260. #define QE_MR_RCVFS_CLSN 0x40 /* rx late collision */
  261. #define QE_MR_RCVFS_FRAM 0x20 /* rx framing error */
  262. #define QE_MR_RCVFS_FCS 0x10 /* rx fcs error */
  263. #define QE_MR_RCVFS_RCVCNT 0x0f /* rx msg byte count mask */
  264. /* qe_mregs.fifofc: fifo frame count. */
  265. #define QE_MR_FIFOFC_RCVFC 0xf0 /* rx fifo frame count */
  266. #define QE_MR_FIFOFC_XMTFC 0x0f /* tx fifo frame count */
  267. /* qe_mregs.ir: interrupt register. */
  268. #define QE_MR_IR_JAB 0x80 /* jabber error */
  269. #define QE_MR_IR_BABL 0x40 /* babble error */
  270. #define QE_MR_IR_CERR 0x20 /* collision error */
  271. #define QE_MR_IR_RCVCCO 0x10 /* collision cnt overflow */
  272. #define QE_MR_IR_RNTPCO 0x08 /* runt pkt cnt overflow */
  273. #define QE_MR_IR_MPCO 0x04 /* miss pkt cnt overflow */
  274. #define QE_MR_IR_RCVINT 0x02 /* packet received */
  275. #define QE_MR_IR_XMTINT 0x01 /* packet transmitted */
  276. /* qe_mregs.imr: interrupt mask register. */
  277. #define QE_MR_IMR_JABM 0x80 /* jabber errors */
  278. #define QE_MR_IMR_BABLM 0x40 /* babble errors */
  279. #define QE_MR_IMR_CERRM 0x20 /* collision errors */
  280. #define QE_MR_IMR_RCVCCOM 0x10 /* rx collision count oflow */
  281. #define QE_MR_IMR_RNTPCOM 0x08 /* runt pkt cnt ovrflw */
  282. #define QE_MR_IMR_MPCOM 0x04 /* miss pkt cnt ovrflw */
  283. #define QE_MR_IMR_RCVINTM 0x02 /* rx interrupts */
  284. #define QE_MR_IMR_XMTINTM 0x01 /* tx interrupts */
  285. /* qe_mregs.pr: poll register. */
  286. #define QE_MR_PR_XMTSV 0x80 /* tx status is valid */
  287. #define QE_MR_PR_TDTREQ 0x40 /* tx data xfer request */
  288. #define QE_MR_PR_RDTREQ 0x20 /* rx data xfer request */
  289. /* qe_mregs.biucc: biu config control. */
  290. #define QE_MR_BIUCC_BSWAP 0x40 /* byte swap */
  291. #define QE_MR_BIUCC_4TS 0x00 /* 4byte xmit start point */
  292. #define QE_MR_BIUCC_16TS 0x10 /* 16byte xmit start point */
  293. #define QE_MR_BIUCC_64TS 0x20 /* 64byte xmit start point */
  294. #define QE_MR_BIUCC_112TS 0x30 /* 112byte xmit start point */
  295. #define QE_MR_BIUCC_SWRST 0x01 /* sw-reset mace */
  296. /* qe_mregs.fifocc: fifo config control. */
  297. #define QE_MR_FIFOCC_TXF8 0x00 /* tx fifo 8 write cycles */
  298. #define QE_MR_FIFOCC_TXF32 0x80 /* tx fifo 32 write cycles */
  299. #define QE_MR_FIFOCC_TXF16 0x40 /* tx fifo 16 write cycles */
  300. #define QE_MR_FIFOCC_RXF64 0x20 /* rx fifo 64 write cycles */
  301. #define QE_MR_FIFOCC_RXF32 0x10 /* rx fifo 32 write cycles */
  302. #define QE_MR_FIFOCC_RXF16 0x00 /* rx fifo 16 write cycles */
  303. #define QE_MR_FIFOCC_TFWU 0x08 /* tx fifo watermark update */
  304. #define QE_MR_FIFOCC_RFWU 0x04 /* rx fifo watermark update */
  305. #define QE_MR_FIFOCC_XMTBRST 0x02 /* tx burst enable */
  306. #define QE_MR_FIFOCC_RCVBRST 0x01 /* rx burst enable */
  307. /* qe_mregs.maccc: mac config control. */
  308. #define QE_MR_MACCC_PROM 0x80 /* promiscuous mode enable */
  309. #define QE_MR_MACCC_DXMT2PD 0x40 /* tx 2part deferral enable */
  310. #define QE_MR_MACCC_EMBA 0x20 /* modified backoff enable */
  311. #define QE_MR_MACCC_DRCVPA 0x08 /* rx physical addr disable */
  312. #define QE_MR_MACCC_DRCVBC 0x04 /* rx broadcast disable */
  313. #define QE_MR_MACCC_ENXMT 0x02 /* enable transmitter */
  314. #define QE_MR_MACCC_ENRCV 0x01 /* enable receiver */
  315. /* qe_mregs.plscc: pls config control. */
  316. #define QE_MR_PLSCC_XMTSEL 0x08 /* tx mode select */
  317. #define QE_MR_PLSCC_PORTMASK 0x06 /* port selection bits */
  318. #define QE_MR_PLSCC_GPSI 0x06 /* use gpsi connector */
  319. #define QE_MR_PLSCC_DAI 0x04 /* use dai connector */
  320. #define QE_MR_PLSCC_TP 0x02 /* use twistedpair connector */
  321. #define QE_MR_PLSCC_AUI 0x00 /* use aui connector */
  322. #define QE_MR_PLSCC_ENPLSIO 0x01 /* pls i/o enable */
  323. /* qe_mregs.phycc: phy config control. */
  324. #define QE_MR_PHYCC_LNKFL 0x80 /* link fail */
  325. #define QE_MR_PHYCC_DLNKTST 0x40 /* disable link test logic */
  326. #define QE_MR_PHYCC_REVPOL 0x20 /* rx polarity */
  327. #define QE_MR_PHYCC_DAPC 0x10 /* autopolaritycorrect disab */
  328. #define QE_MR_PHYCC_LRT 0x08 /* select low threshold */
  329. #define QE_MR_PHYCC_ASEL 0x04 /* connector port auto-sel */
  330. #define QE_MR_PHYCC_RWAKE 0x02 /* remote wakeup */
  331. #define QE_MR_PHYCC_AWAKE 0x01 /* auto wakeup */
  332. /* qe_mregs.iac: internal address config. */
  333. #define QE_MR_IAC_ADDRCHG 0x80 /* start address change */
  334. #define QE_MR_IAC_PHYADDR 0x04 /* physical address reset */
  335. #define QE_MR_IAC_LOGADDR 0x02 /* logical address reset */
  336. /* qe_mregs.utr: user test register. */
  337. #define QE_MR_UTR_RTRE 0x80 /* enable resv test register */
  338. #define QE_MR_UTR_RTRD 0x40 /* disab resv test register */
  339. #define QE_MR_UTR_RPA 0x20 /* accept runt packets */
  340. #define QE_MR_UTR_FCOLL 0x10 /* force collision status */
  341. #define QE_MR_UTR_RCVSFCSE 0x08 /* enable fcs on rx */
  342. #define QE_MR_UTR_INTLOOPM 0x06 /* Internal loopback w/mandec */
  343. #define QE_MR_UTR_INTLOOP 0x04 /* Internal loopback */
  344. #define QE_MR_UTR_EXTLOOP 0x02 /* external loopback */
  345. #define QE_MR_UTR_NOLOOP 0x00 /* no loopback */
  346. /* Buffer and Ring sizes: fixed ring size */
  347. #define QE_TX_RING_MAXSIZE 256 /* maximum tx ring size */
  348. #define QE_RX_RING_MAXSIZE 256 /* maximum rx ring size */
  349. #define QE_TX_RING_SIZE 16
  350. #define QE_RX_RING_SIZE 16
  351. #define QE_PKT_BUF_SZ 2048
  352. #define MC_POLY_LE 0xedb88320 /* mcast crc, little endian */