Go to the documentation of this file.
11 #define GREG_SEBSTATE 0x0000UL
12 #define GREG_CFG 0x0004UL
13 #define GREG_STAT 0x000CUL
14 #define GREG_IMASK 0x0010UL
15 #define GREG_IACK 0x0014UL
16 #define GREG_STAT2 0x001CUL
17 #define GREG_PCIESTAT 0x1000UL
18 #define GREG_PCIEMASK 0x1004UL
19 #define GREG_BIFCFG 0x1008UL
20 #define GREG_BIFDIAG 0x100CUL
21 #define GREG_SWRST 0x1010UL
24 #define GREG_SEBSTATE_ARB 0x00000003
25 #define GREG_SEBSTATE_RXWON 0x00000004
28 #define GREG_CFG_IBURST 0x00000001
29 #define GREG_CFG_TXDMALIM 0x0000003e
30 #define GREG_CFG_RXDMALIM 0x000007c0
31 #define GREG_CFG_RONPAULBIT 0x00000800
33 #define GREG_CFG_ENBUG2FIX 0x00001000
44 #define GREG_STAT_TXINTME 0x00000001
45 #define GREG_STAT_TXALL 0x00000002
46 #define GREG_STAT_TXDONE 0x00000004
47 #define GREG_STAT_RXDONE 0x00000010
48 #define GREG_STAT_RXNOBUF 0x00000020
49 #define GREG_STAT_RXTAGERR 0x00000040
50 #define GREG_STAT_PCS 0x00002000
51 #define GREG_STAT_TXMAC 0x00004000
52 #define GREG_STAT_RXMAC 0x00008000
53 #define GREG_STAT_MAC 0x00010000
54 #define GREG_STAT_MIF 0x00020000
55 #define GREG_STAT_PCIERR 0x00040000
56 #define GREG_STAT_TXNR 0xfff80000
57 #define GREG_STAT_TXNR_SHIFT 19
59 #define GREG_STAT_ABNORMAL (GREG_STAT_RXNOBUF | GREG_STAT_RXTAGERR | \
60 GREG_STAT_PCS | GREG_STAT_TXMAC | GREG_STAT_RXMAC | \
61 GREG_STAT_MAC | GREG_STAT_MIF | GREG_STAT_PCIERR)
63 #define GREG_STAT_NAPI (GREG_STAT_TXALL | GREG_STAT_TXINTME | \
64 GREG_STAT_RXDONE | GREG_STAT_ABNORMAL)
75 #define GREG_PCIESTAT_BADACK 0x00000001
76 #define GREG_PCIESTAT_DTRTO 0x00000002
77 #define GREG_PCIESTAT_OTHER 0x00000004
85 #define GREG_BIFCFG_SLOWCLK 0x00000001
86 #define GREG_BIFCFG_B64DIS 0x00000002
87 #define GREG_BIFCFG_M66EN 0x00000004
90 #define GREG_BIFDIAG_BURSTSM 0x007f0000
91 #define GREG_BIFDIAG_BIFSM 0xff000000
100 #define GREG_SWRST_TXRST 0x00000001
101 #define GREG_SWRST_RXRST 0x00000002
102 #define GREG_SWRST_RSTOUT 0x00000004
103 #define GREG_SWRST_CACHESIZE 0x00ff0000
104 #define GREG_SWRST_CACHE_SHIFT 16
107 #define TXDMA_KICK 0x2000UL
108 #define TXDMA_CFG 0x2004UL
109 #define TXDMA_DBLOW 0x2008UL
110 #define TXDMA_DBHI 0x200CUL
111 #define TXDMA_FWPTR 0x2014UL
112 #define TXDMA_FSWPTR 0x2018UL
113 #define TXDMA_FRPTR 0x201CUL
114 #define TXDMA_FSRPTR 0x2020UL
115 #define TXDMA_PCNT 0x2024UL
116 #define TXDMA_SMACHINE 0x2028UL
117 #define TXDMA_DPLOW 0x2030UL
118 #define TXDMA_DPHI 0x2034UL
119 #define TXDMA_TXDONE 0x2100UL
120 #define TXDMA_FADDR 0x2104UL
121 #define TXDMA_FTAG 0x2108UL
122 #define TXDMA_DLOW 0x210CUL
123 #define TXDMA_DHIT1 0x2110UL
124 #define TXDMA_DHIT0 0x2114UL
125 #define TXDMA_FSZ 0x2118UL
147 #define TXDMA_CFG_ENABLE 0x00000001
148 #define TXDMA_CFG_RINGSZ 0x0000001e
149 #define TXDMA_CFG_RINGSZ_32 0x00000000
150 #define TXDMA_CFG_RINGSZ_64 0x00000002
151 #define TXDMA_CFG_RINGSZ_128 0x00000004
152 #define TXDMA_CFG_RINGSZ_256 0x00000006
153 #define TXDMA_CFG_RINGSZ_512 0x00000008
154 #define TXDMA_CFG_RINGSZ_1K 0x0000000a
155 #define TXDMA_CFG_RINGSZ_2K 0x0000000c
156 #define TXDMA_CFG_RINGSZ_4K 0x0000000e
157 #define TXDMA_CFG_RINGSZ_8K 0x00000010
158 #define TXDMA_CFG_PIOSEL 0x00000020
159 #define TXDMA_CFG_FTHRESH 0x001ffc00
160 #define TXDMA_CFG_PMODE 0x00200000
174 #define WOL_MATCH0 0x3000UL
175 #define WOL_MATCH1 0x3004UL
176 #define WOL_MATCH2 0x3008UL
177 #define WOL_MCOUNT 0x300CUL
178 #define WOL_WAKECSR 0x3010UL
182 #define WOL_MCOUNT_N 0x00000010
183 #define WOL_MCOUNT_M 0x00000000
185 #define WOL_WAKECSR_ENABLE 0x00000001
186 #define WOL_WAKECSR_MII 0x00000002
187 #define WOL_WAKECSR_SEEN 0x00000004
188 #define WOL_WAKECSR_FILT_UCAST 0x00000008
189 #define WOL_WAKECSR_FILT_MCAST 0x00000010
190 #define WOL_WAKECSR_FILT_BCAST 0x00000020
191 #define WOL_WAKECSR_FILT_SEEN 0x00000040
195 #define RXDMA_CFG 0x4000UL
196 #define RXDMA_DBLOW 0x4004UL
197 #define RXDMA_DBHI 0x4008UL
198 #define RXDMA_FWPTR 0x400CUL
199 #define RXDMA_FSWPTR 0x4010UL
200 #define RXDMA_FRPTR 0x4014UL
201 #define RXDMA_PCNT 0x4018UL
202 #define RXDMA_SMACHINE 0x401CUL
203 #define RXDMA_PTHRESH 0x4020UL
204 #define RXDMA_DPLOW 0x4024UL
205 #define RXDMA_DPHI 0x4028UL
206 #define RXDMA_KICK 0x4100UL
207 #define RXDMA_DONE 0x4104UL
208 #define RXDMA_BLANK 0x4108UL
209 #define RXDMA_FADDR 0x410CUL
210 #define RXDMA_FTAG 0x4110UL
211 #define RXDMA_DLOW 0x4114UL
212 #define RXDMA_DHIT1 0x4118UL
213 #define RXDMA_DHIT0 0x411CUL
214 #define RXDMA_FSZ 0x4120UL
217 #define RXDMA_CFG_ENABLE 0x00000001
218 #define RXDMA_CFG_RINGSZ 0x0000001e
219 #define RXDMA_CFG_RINGSZ_32 0x00000000
220 #define RXDMA_CFG_RINGSZ_64 0x00000002
221 #define RXDMA_CFG_RINGSZ_128 0x00000004
222 #define RXDMA_CFG_RINGSZ_256 0x00000006
223 #define RXDMA_CFG_RINGSZ_512 0x00000008
224 #define RXDMA_CFG_RINGSZ_1K 0x0000000a
225 #define RXDMA_CFG_RINGSZ_2K 0x0000000c
226 #define RXDMA_CFG_RINGSZ_4K 0x0000000e
227 #define RXDMA_CFG_RINGSZ_8K 0x00000010
228 #define RXDMA_CFG_RINGSZ_BDISAB 0x00000020
229 #define RXDMA_CFG_FBOFF 0x00001c00
230 #define RXDMA_CFG_CSUMOFF 0x000fe000
231 #define RXDMA_CFG_FTHRESH 0x07000000
232 #define RXDMA_CFG_FTHRESH_64 0x00000000
233 #define RXDMA_CFG_FTHRESH_128 0x01000000
234 #define RXDMA_CFG_FTHRESH_256 0x02000000
235 #define RXDMA_CFG_FTHRESH_512 0x03000000
236 #define RXDMA_CFG_FTHRESH_1K 0x04000000
237 #define RXDMA_CFG_FTHRESH_2K 0x05000000
251 #define RXDMA_PTHRESH_OFF 0x000001ff
252 #define RXDMA_PTHRESH_ON 0x001ff000
278 #define RXDMA_BLANK_IPKTS 0x000001ff
282 #define RXDMA_BLANK_ITIME 0x000ff000
300 #define MAC_TXRST 0x6000UL
301 #define MAC_RXRST 0x6004UL
302 #define MAC_SNDPAUSE 0x6008UL
303 #define MAC_TXSTAT 0x6010UL
304 #define MAC_RXSTAT 0x6014UL
305 #define MAC_CSTAT 0x6018UL
306 #define MAC_TXMASK 0x6020UL
307 #define MAC_RXMASK 0x6024UL
308 #define MAC_MCMASK 0x6028UL
309 #define MAC_TXCFG 0x6030UL
310 #define MAC_RXCFG 0x6034UL
311 #define MAC_MCCFG 0x6038UL
312 #define MAC_XIFCFG 0x603CUL
313 #define MAC_IPG0 0x6040UL
314 #define MAC_IPG1 0x6044UL
315 #define MAC_IPG2 0x6048UL
316 #define MAC_STIME 0x604CUL
317 #define MAC_MINFSZ 0x6050UL
318 #define MAC_MAXFSZ 0x6054UL
319 #define MAC_PASIZE 0x6058UL
320 #define MAC_JAMSIZE 0x605CUL
321 #define MAC_ATTLIM 0x6060UL
322 #define MAC_MCTYPE 0x6064UL
323 #define MAC_ADDR0 0x6080UL
324 #define MAC_ADDR1 0x6084UL
325 #define MAC_ADDR2 0x6088UL
326 #define MAC_ADDR3 0x608CUL
327 #define MAC_ADDR4 0x6090UL
328 #define MAC_ADDR5 0x6094UL
329 #define MAC_ADDR6 0x6098UL
330 #define MAC_ADDR7 0x609CUL
331 #define MAC_ADDR8 0x60A0UL
332 #define MAC_AFILT0 0x60A4UL
333 #define MAC_AFILT1 0x60A8UL
334 #define MAC_AFILT2 0x60ACUL
335 #define MAC_AF21MSK 0x60B0UL
336 #define MAC_AF0MSK 0x60B4UL
337 #define MAC_HASH0 0x60C0UL
338 #define MAC_HASH1 0x60C4UL
339 #define MAC_HASH2 0x60C8UL
340 #define MAC_HASH3 0x60CCUL
341 #define MAC_HASH4 0x60D0UL
342 #define MAC_HASH5 0x60D4UL
343 #define MAC_HASH6 0x60D8UL
344 #define MAC_HASH7 0x60DCUL
345 #define MAC_HASH8 0x60E0UL
346 #define MAC_HASH9 0x60E4UL
347 #define MAC_HASH10 0x60E8UL
348 #define MAC_HASH11 0x60ECUL
349 #define MAC_HASH12 0x60F0UL
350 #define MAC_HASH13 0x60F4UL
351 #define MAC_HASH14 0x60F8UL
352 #define MAC_HASH15 0x60FCUL
353 #define MAC_NCOLL 0x6100UL
354 #define MAC_FASUCC 0x6104UL
355 #define MAC_ECOLL 0x6108UL
356 #define MAC_LCOLL 0x610CUL
357 #define MAC_DTIMER 0x6110UL
358 #define MAC_PATMPS 0x6114UL
359 #define MAC_RFCTR 0x6118UL
360 #define MAC_LERR 0x611CUL
361 #define MAC_AERR 0x6120UL
362 #define MAC_FCSERR 0x6124UL
363 #define MAC_RXCVERR 0x6128UL
364 #define MAC_RANDSEED 0x6130UL
365 #define MAC_SMACHINE 0x6134UL
368 #define MAC_TXRST_CMD 0x00000001
371 #define MAC_RXRST_CMD 0x00000001
374 #define MAC_SNDPAUSE_TS 0x0000ffff
378 #define MAC_SNDPAUSE_SP 0x00010000
384 #define MAC_TXSTAT_XMIT 0x00000001
385 #define MAC_TXSTAT_URUN 0x00000002
386 #define MAC_TXSTAT_MPE 0x00000004
387 #define MAC_TXSTAT_NCE 0x00000008
388 #define MAC_TXSTAT_ECE 0x00000010
389 #define MAC_TXSTAT_LCE 0x00000020
390 #define MAC_TXSTAT_FCE 0x00000040
391 #define MAC_TXSTAT_DTE 0x00000080
392 #define MAC_TXSTAT_PCE 0x00000100
395 #define MAC_RXSTAT_RCV 0x00000001
396 #define MAC_RXSTAT_OFLW 0x00000002
397 #define MAC_RXSTAT_FCE 0x00000004
398 #define MAC_RXSTAT_ACE 0x00000008
399 #define MAC_RXSTAT_CCE 0x00000010
400 #define MAC_RXSTAT_LCE 0x00000020
401 #define MAC_RXSTAT_VCE 0x00000040
404 #define MAC_CSTAT_PRCV 0x00000001
405 #define MAC_CSTAT_PS 0x00000002
406 #define MAC_CSTAT_NPS 0x00000004
407 #define MAC_CSTAT_PTR 0xffff0000
427 #define MAC_TXCFG_ENAB 0x00000001
428 #define MAC_TXCFG_ICS 0x00000002
429 #define MAC_TXCFG_ICOLL 0x00000004
430 #define MAC_TXCFG_EIPG0 0x00000008
431 #define MAC_TXCFG_NGU 0x00000010
432 #define MAC_TXCFG_NGUL 0x00000020
433 #define MAC_TXCFG_NBO 0x00000040
434 #define MAC_TXCFG_SD 0x00000080
435 #define MAC_TXCFG_NFCS 0x00000100
436 #define MAC_TXCFG_TCE 0x00000200
447 #define MAC_RXCFG_ENAB 0x00000001
448 #define MAC_RXCFG_SPAD 0x00000002
449 #define MAC_RXCFG_SFCS 0x00000004
450 #define MAC_RXCFG_PROM 0x00000008
451 #define MAC_RXCFG_PGRP 0x00000010
452 #define MAC_RXCFG_HFE 0x00000020
453 #define MAC_RXCFG_AFE 0x00000040
454 #define MAC_RXCFG_DDE 0x00000080
455 #define MAC_RXCFG_RCE 0x00000100
458 #define MAC_MCCFG_SPE 0x00000001
459 #define MAC_MCCFG_RPE 0x00000002
460 #define MAC_MCCFG_PMC 0x00000004
467 #define MAC_XIFCFG_OE 0x00000001
468 #define MAC_XIFCFG_LBCK 0x00000002
469 #define MAC_XIFCFG_DISE 0x00000004
470 #define MAC_XIFCFG_GMII 0x00000008
471 #define MAC_XIFCFG_MBOE 0x00000010
472 #define MAC_XIFCFG_LLED 0x00000020
473 #define MAC_XIFCFG_FLED 0x00000040
525 #define MAC_MAXFSZ_MFS 0x00007fff
526 #define MAC_MAXFSZ_MBS 0x7fff0000
611 #define MIF_BBCLK 0x6200UL
612 #define MIF_BBDATA 0x6204UL
613 #define MIF_BBOENAB 0x6208UL
614 #define MIF_FRAME 0x620CUL
615 #define MIF_CFG 0x6210UL
616 #define MIF_MASK 0x6214UL
617 #define MIF_STATUS 0x6218UL
618 #define MIF_SMACHINE 0x621CUL
649 #define MIF_CFG_PSELECT 0x00000001
650 #define MIF_CFG_POLL 0x00000002
651 #define MIF_CFG_BBMODE 0x00000004
652 #define MIF_CFG_PRADDR 0x000000f8
653 #define MIF_CFG_MDI0 0x00000100
654 #define MIF_CFG_MDI1 0x00000200
655 #define MIF_CFG_PPADDR 0x00007c00
664 #define MIF_FRAME_ST 0xc0000000
665 #define MIF_FRAME_OP 0x30000000
666 #define MIF_FRAME_PHYAD 0x0f800000
667 #define MIF_FRAME_REGAD 0x007c0000
668 #define MIF_FRAME_TAMSB 0x00020000
669 #define MIF_FRAME_TALSB 0x00010000
670 #define MIF_FRAME_DATA 0x0000ffff
676 #define MIF_STATUS_DATA 0xffff0000
677 #define MIF_STATUS_STAT 0x0000ffff
685 #define PCS_MIICTRL 0x9000UL
686 #define PCS_MIISTAT 0x9004UL
687 #define PCS_MIIADV 0x9008UL
688 #define PCS_MIILP 0x900CUL
689 #define PCS_CFG 0x9010UL
690 #define PCS_SMACHINE 0x9014UL
691 #define PCS_ISTAT 0x9018UL
692 #define PCS_DMODE 0x9050UL
693 #define PCS_SCTRL 0x9054UL
694 #define PCS_SOS 0x9058UL
695 #define PCS_SSTATE 0x905CUL
698 #define PCS_MIICTRL_SPD 0x00000040
699 #define PCS_MIICTRL_CT 0x00000080
700 #define PCS_MIICTRL_DM 0x00000100
701 #define PCS_MIICTRL_RAN 0x00000200
702 #define PCS_MIICTRL_ISO 0x00000400
703 #define PCS_MIICTRL_PD 0x00000800
704 #define PCS_MIICTRL_ANE 0x00001000
705 #define PCS_MIICTRL_SS 0x00002000
706 #define PCS_MIICTRL_WB 0x00004000
709 #define PCS_MIICTRL_RST 0x00008000
712 #define PCS_MIISTAT_EC 0x00000001
713 #define PCS_MIISTAT_JD 0x00000002
714 #define PCS_MIISTAT_LS 0x00000004
715 #define PCS_MIISTAT_ANA 0x00000008
716 #define PCS_MIISTAT_RF 0x00000010
717 #define PCS_MIISTAT_ANC 0x00000020
718 #define PCS_MIISTAT_ES 0x00000100
721 #define PCS_MIIADV_FD 0x00000020
722 #define PCS_MIIADV_HD 0x00000040
723 #define PCS_MIIADV_SP 0x00000080
724 #define PCS_MIIADV_AP 0x00000100
725 #define PCS_MIIADV_RF 0x00003000
726 #define PCS_MIIADV_ACK 0x00004000
727 #define PCS_MIIADV_NP 0x00008000
735 #define PCS_CFG_ENABLE 0x00000001
738 #define PCS_CFG_SDO 0x00000002
739 #define PCS_CFG_SDL 0x00000004
740 #define PCS_CFG_JS 0x00000018
746 #define PCS_CFG_TO 0x00000020
751 #define PCS_ISTAT_LSC 0x00000004
754 #define PCS_DMODE_SM 0x00000001
755 #define PCS_DMODE_ESM 0x00000002
756 #define PCS_DMODE_MGM 0x00000004
757 #define PCS_DMODE_GMOE 0x00000008
763 #define PCS_SCTRL_LOOP 0x00000001
764 #define PCS_SCTRL_ESCD 0x00000002
765 #define PCS_SCTRL_LOCK 0x00000004
766 #define PCS_SCTRL_EMP 0x00000018
767 #define PCS_SCTRL_STEST 0x000001c0
768 #define PCS_SCTRL_PDWN 0x00000200
769 #define PCS_SCTRL_RXZ 0x00000c00
770 #define PCS_SCTRL_RXP 0x00003000
771 #define PCS_SCTRL_TXZ 0x0000c000
772 #define PCS_SCTRL_TXP 0x00030000
778 #define PCS_SOS_PADDR 0x00000003
781 #define PROM_START 0x100000UL
782 #define PROM_SIZE 0x0fffffUL
783 #define PROM_END 0x200000UL
787 #define BMCR_SPD2 0x0040
788 #define LPA_PAUSE 0x0400
793 #define MII_BCM5201_INTERRUPT 0x1A
794 #define MII_BCM5201_INTERRUPT_INTENABLE 0x4000
796 #define MII_BCM5201_AUXMODE2 0x1B
797 #define MII_BCM5201_AUXMODE2_LOWPOWER 0x0008
799 #define MII_BCM5201_MULTIPHY 0x1E
802 #define MII_BCM5201_MULTIPHY_SERIALMODE 0x0002
803 #define MII_BCM5201_MULTIPHY_SUPERISOLATE 0x0008
806 #define MII_BCM5400_GB_CONTROL 0x09
807 #define MII_BCM5400_GB_CONTROL_FULLDUPLEXCAP 0x0200
810 #define MII_BCM5400_AUXCONTROL 0x18
811 #define MII_BCM5400_AUXCONTROL_PWR10BASET 0x0004
814 #define MII_BCM5400_AUXSTATUS 0x19
815 #define MII_BCM5400_AUXSTATUS_LINKMODE_MASK 0x0700
816 #define MII_BCM5400_AUXSTATUS_LINKMODE_SHIFT 8
835 #define TXDCTRL_BUFSZ 0x0000000000007fffULL
836 #define TXDCTRL_CSTART 0x00000000001f8000ULL
837 #define TXDCTRL_COFF 0x000000001fe00000ULL
838 #define TXDCTRL_CENAB 0x0000000020000000ULL
839 #define TXDCTRL_EOF 0x0000000040000000ULL
840 #define TXDCTRL_SOF 0x0000000080000000ULL
841 #define TXDCTRL_INTME 0x0000000100000000ULL
842 #define TXDCTRL_NOCRC 0x0000000200000000ULL
870 #define RXDCTRL_TCPCSUM 0x000000000000ffffULL
871 #define RXDCTRL_BUFSZ 0x000000007fff0000ULL
872 #define RXDCTRL_OWN 0x0000000080000000ULL
873 #define RXDCTRL_HASHVAL 0x0ffff00000000000ULL
874 #define RXDCTRL_HPASS 0x1000000000000000ULL
875 #define RXDCTRL_ALTMAC 0x2000000000000000ULL
876 #define RXDCTRL_BAD 0x4000000000000000ULL
878 #define RXDCTRL_FRESH(gp) \
879 ((((RX_BUF_ALLOC_SIZE(gp) - RX_OFFSET) << 16) & RXDCTRL_BUFSZ) | \
882 #define TX_RING_SIZE 128
883 #define RX_RING_SIZE 128
885 #if TX_RING_SIZE == 32
886 #define TXDMA_CFG_BASE TXDMA_CFG_RINGSZ_32
887 #elif TX_RING_SIZE == 64
888 #define TXDMA_CFG_BASE TXDMA_CFG_RINGSZ_64
889 #elif TX_RING_SIZE == 128
890 #define TXDMA_CFG_BASE TXDMA_CFG_RINGSZ_128
891 #elif TX_RING_SIZE == 256
892 #define TXDMA_CFG_BASE TXDMA_CFG_RINGSZ_256
893 #elif TX_RING_SIZE == 512
894 #define TXDMA_CFG_BASE TXDMA_CFG_RINGSZ_512
895 #elif TX_RING_SIZE == 1024
896 #define TXDMA_CFG_BASE TXDMA_CFG_RINGSZ_1K
897 #elif TX_RING_SIZE == 2048
898 #define TXDMA_CFG_BASE TXDMA_CFG_RINGSZ_2K
899 #elif TX_RING_SIZE == 4096
900 #define TXDMA_CFG_BASE TXDMA_CFG_RINGSZ_4K
901 #elif TX_RING_SIZE == 8192
902 #define TXDMA_CFG_BASE TXDMA_CFG_RINGSZ_8K
904 #error TX_RING_SIZE value is illegal...
907 #if RX_RING_SIZE == 32
908 #define RXDMA_CFG_BASE RXDMA_CFG_RINGSZ_32
909 #elif RX_RING_SIZE == 64
910 #define RXDMA_CFG_BASE RXDMA_CFG_RINGSZ_64
911 #elif RX_RING_SIZE == 128
912 #define RXDMA_CFG_BASE RXDMA_CFG_RINGSZ_128
913 #elif RX_RING_SIZE == 256
914 #define RXDMA_CFG_BASE RXDMA_CFG_RINGSZ_256
915 #elif RX_RING_SIZE == 512
916 #define RXDMA_CFG_BASE RXDMA_CFG_RINGSZ_512
917 #elif RX_RING_SIZE == 1024
918 #define RXDMA_CFG_BASE RXDMA_CFG_RINGSZ_1K
919 #elif RX_RING_SIZE == 2048
920 #define RXDMA_CFG_BASE RXDMA_CFG_RINGSZ_2K
921 #elif RX_RING_SIZE == 4096
922 #define RXDMA_CFG_BASE RXDMA_CFG_RINGSZ_4K
923 #elif RX_RING_SIZE == 8192
924 #define RXDMA_CFG_BASE RXDMA_CFG_RINGSZ_8K
926 #error RX_RING_SIZE is illegal...
929 #define NEXT_TX(N) (((N) + 1) & (TX_RING_SIZE - 1))
930 #define NEXT_RX(N) (((N) + 1) & (RX_RING_SIZE - 1))
932 #define TX_BUFFS_AVAIL(GP) \
933 (((GP)->tx_old <= (GP)->tx_new) ? \
934 (GP)->tx_old + (TX_RING_SIZE - 1) - (GP)->tx_new : \
935 (GP)->tx_old - (GP)->tx_new - 1)
938 #define RX_BUF_ALLOC_SIZE(gp) ((gp)->rx_buf_sz + 28 + RX_OFFSET + 64)
940 #define RX_COPY_THRESHOLD 256
942 #if TX_RING_SIZE < 128
943 #define INIT_BLOCK_TX_RING_SIZE 128
945 #define INIT_BLOCK_TX_RING_SIZE TX_RING_SIZE
948 #if RX_RING_SIZE < 128
949 #define INIT_BLOCK_RX_RING_SIZE 128
951 #define INIT_BLOCK_RX_RING_SIZE RX_RING_SIZE
1019 #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_SPARC)
1024 #define found_mii_phy(gp) ((gp->phy_type == phy_mii_mdio0 || gp->phy_type == phy_mii_mdio1) && \
1025 gp->phy_mii.def && gp->phy_mii.def->ops)