2 * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved.
4 * Author: Shlomi Gridish <gridish@freescale.com>
7 * Internal header file for UCC Gigabit Ethernet unit routines.
10 * Jun 28, 2006 Li Yang <LeoLi@freescale.com>
11 * - Rearrange code and style fixes
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
18 #ifndef __UCC_GETH_H__
19 #define __UCC_GETH_H__
21 #include <linux/kernel.h>
22 #include <linux/list.h>
23 #include <linux/fsl_devices.h>
25 #include <asm/immap_qe.h>
29 #include <asm/ucc_fast.h>
31 #include "ucc_geth_mii.h"
33 #define NUM_TX_QUEUES 8
34 #define NUM_RX_QUEUES 8
35 #define NUM_BDS_IN_PREFETCHED_BDS 4
36 #define TX_IP_OFFSET_ENTRY_MAX 8
37 #define NUM_OF_PADDRS 4
38 #define ENET_INIT_PARAM_MAX_ENTRIES_RX 9
39 #define ENET_INIT_PARAM_MAX_ENTRIES_TX 8
44 u32 maccfg1; /* mac configuration reg. 1 */
45 u32 maccfg2; /* mac configuration reg. 2 */
46 u32 ipgifg; /* interframe gap reg. */
47 u32 hafdup; /* half-duplex reg. */
49 u8 miimng[0x18]; /* MII management structure moved to _mii.h */
50 u32 ifctl; /* interface control reg */
51 u32 ifstat; /* interface statux reg */
52 u32 macstnaddr1; /* mac station address part 1 reg */
53 u32 macstnaddr2; /* mac station address part 2 reg */
55 u32 uempr; /* UCC Ethernet Mac parameter reg */
56 u32 utbipar; /* UCC tbi address reg */
57 u16 uescr; /* UCC Ethernet statistics control reg */
58 u8 res3[0x180 - 0x15A];
59 u32 tx64; /* Total number of frames (including bad
60 frames) transmitted that were exactly of the
61 minimal length (64 for un tagged, 68 for
62 tagged, or with length exactly equal to the
63 parameter MINLength */
64 u32 tx127; /* Total number of frames (including bad
65 frames) transmitted that were between
66 MINLength (Including FCS length==4) and 127
68 u32 tx255; /* Total number of frames (including bad
69 frames) transmitted that were between 128
70 (Including FCS length==4) and 255 octets */
71 u32 rx64; /* Total number of frames received including
72 bad frames that were exactly of the mninimal
74 u32 rx127; /* Total number of frames (including bad
75 frames) received that were between MINLength
76 (Including FCS length==4) and 127 octets */
77 u32 rx255; /* Total number of frames (including bad
78 frames) received that were between 128
79 (Including FCS length==4) and 255 octets */
80 u32 txok; /* Total number of octets residing in frames
81 that where involved in succesfull
83 u16 txcf; /* Total number of PAUSE control frames
84 transmitted by this MAC */
86 u32 tmca; /* Total number of frames that were transmitted
87 succesfully with the group address bit set
88 that are not broadcast frames */
89 u32 tbca; /* Total number of frames transmitted
90 succesfully that had destination address
91 field equal to the broadcast address */
92 u32 rxfok; /* Total number of frames received OK */
93 u32 rxbok; /* Total number of octets received OK */
94 u32 rbyt; /* Total number of octets received including
95 octets in bad frames. Must be implemented in
96 HW because it includes octets in frames that
97 never even reach the UCC */
98 u32 rmca; /* Total number of frames that were received
99 succesfully with the group address bit set
100 that are not broadcast frames */
101 u32 rbca; /* Total number of frames received succesfully
102 that had destination address equal to the
104 u32 scar; /* Statistics carry register */
105 u32 scam; /* Statistics caryy mask register */
106 u8 res5[0x200 - 0x1c4];
107 } __attribute__ ((packed));
109 /* UCC GETH TEMODR Register */
110 #define TEMODER_TX_RMON_STATISTICS_ENABLE 0x0100 /* enable Tx statistics
112 #define TEMODER_SCHEDULER_ENABLE 0x2000 /* enable scheduler */
113 #define TEMODER_IP_CHECKSUM_GENERATE 0x0400 /* generate IPv4
115 #define TEMODER_PERFORMANCE_OPTIMIZATION_MODE1 0x0200 /* enable performance
117 enhancement (mode1) */
118 #define TEMODER_RMON_STATISTICS 0x0100 /* enable tx statistics
120 #define TEMODER_NUM_OF_QUEUES_SHIFT (15-15) /* Number of queues <<
123 /* UCC GETH TEMODR Register */
124 #define REMODER_RX_RMON_STATISTICS_ENABLE 0x00001000 /* enable Rx
126 #define REMODER_RX_EXTENDED_FEATURES 0x80000000 /* enable
129 #define REMODER_VLAN_OPERATION_TAGGED_SHIFT (31-9 ) /* vlan operation
131 #define REMODER_VLAN_OPERATION_NON_TAGGED_SHIFT (31-10) /* vlan operation non
133 #define REMODER_RX_QOS_MODE_SHIFT (31-15) /* rx QoS mode << shift
135 #define REMODER_RMON_STATISTICS 0x00001000 /* enable rx
137 #define REMODER_RX_EXTENDED_FILTERING 0x00000800 /* extended
142 #define REMODER_NUM_OF_QUEUES_SHIFT (31-23) /* Number of queues <<
144 #define REMODER_DYNAMIC_MAX_FRAME_LENGTH 0x00000008 /* enable
148 #define REMODER_DYNAMIC_MIN_FRAME_LENGTH 0x00000004 /* enable
152 #define REMODER_IP_CHECKSUM_CHECK 0x00000002 /* check IPv4
154 #define REMODER_IP_ADDRESS_ALIGNMENT 0x00000001 /* align ip
159 /* UCC GETH Event Register */
160 #define UCCE_MPD 0x80000000 /* Magic packet
162 #define UCCE_SCAR 0x40000000
163 #define UCCE_GRA 0x20000000 /* Tx graceful
166 #define UCCE_CBPR 0x10000000
167 #define UCCE_BSY 0x08000000
168 #define UCCE_RXC 0x04000000
169 #define UCCE_TXC 0x02000000
170 #define UCCE_TXE 0x01000000
171 #define UCCE_TXB7 0x00800000
172 #define UCCE_TXB6 0x00400000
173 #define UCCE_TXB5 0x00200000
174 #define UCCE_TXB4 0x00100000
175 #define UCCE_TXB3 0x00080000
176 #define UCCE_TXB2 0x00040000
177 #define UCCE_TXB1 0x00020000
178 #define UCCE_TXB0 0x00010000
179 #define UCCE_RXB7 0x00008000
180 #define UCCE_RXB6 0x00004000
181 #define UCCE_RXB5 0x00002000
182 #define UCCE_RXB4 0x00001000
183 #define UCCE_RXB3 0x00000800
184 #define UCCE_RXB2 0x00000400
185 #define UCCE_RXB1 0x00000200
186 #define UCCE_RXB0 0x00000100
187 #define UCCE_RXF7 0x00000080
188 #define UCCE_RXF6 0x00000040
189 #define UCCE_RXF5 0x00000020
190 #define UCCE_RXF4 0x00000010
191 #define UCCE_RXF3 0x00000008
192 #define UCCE_RXF2 0x00000004
193 #define UCCE_RXF1 0x00000002
194 #define UCCE_RXF0 0x00000001
196 #define UCCE_RXBF_SINGLE_MASK (UCCE_RXF0)
197 #define UCCE_TXBF_SINGLE_MASK (UCCE_TXB0)
199 #define UCCE_TXB (UCCE_TXB7 | UCCE_TXB6 | UCCE_TXB5 | UCCE_TXB4 |\
200 UCCE_TXB3 | UCCE_TXB2 | UCCE_TXB1 | UCCE_TXB0)
201 #define UCCE_RXB (UCCE_RXB7 | UCCE_RXB6 | UCCE_RXB5 | UCCE_RXB4 |\
202 UCCE_RXB3 | UCCE_RXB2 | UCCE_RXB1 | UCCE_RXB0)
203 #define UCCE_RXF (UCCE_RXF7 | UCCE_RXF6 | UCCE_RXF5 | UCCE_RXF4 |\
204 UCCE_RXF3 | UCCE_RXF2 | UCCE_RXF1 | UCCE_RXF0)
205 #define UCCE_OTHER (UCCE_SCAR | UCCE_GRA | UCCE_CBPR | UCCE_BSY |\
206 UCCE_RXC | UCCE_TXC | UCCE_TXE)
208 /* UCC GETH UPSMR (Protocol Specific Mode Register) */
209 #define UPSMR_ECM 0x04000000 /* Enable CAM
214 #define UPSMR_HSE 0x02000000 /* Hardware
217 #define UPSMR_PRO 0x00400000 /* Promiscuous*/
218 #define UPSMR_CAP 0x00200000 /* CAM polarity
220 #define UPSMR_RSH 0x00100000 /* Receive
223 #define UPSMR_RPM 0x00080000 /* Reduced Pin
226 #define UPSMR_R10M 0x00040000 /* RGMII/RMII
228 #define UPSMR_RLPB 0x00020000 /* RMII
231 #define UPSMR_TBIM 0x00010000 /* Ten-bit
234 #define UPSMR_RMM 0x00001000 /* RMII/RGMII
236 #define UPSMR_CAM 0x00000400 /* CAM Address
238 #define UPSMR_BRO 0x00000200 /* Broadcast
240 #define UPSMR_RES1 0x00002000 /* Reserved
244 /* UCC GETH MACCFG1 (MAC Configuration 1 Register) */
245 #define MACCFG1_FLOW_RX 0x00000020 /* Flow Control
247 #define MACCFG1_FLOW_TX 0x00000010 /* Flow Control
249 #define MACCFG1_ENABLE_SYNCHED_RX 0x00000008 /* Rx Enable
253 #define MACCFG1_ENABLE_RX 0x00000004 /* Enable Rx */
254 #define MACCFG1_ENABLE_SYNCHED_TX 0x00000002 /* Tx Enable
258 #define MACCFG1_ENABLE_TX 0x00000001 /* Enable Tx */
260 /* UCC GETH MACCFG2 (MAC Configuration 2 Register) */
261 #define MACCFG2_PREL_SHIFT (31 - 19) /* Preamble
264 #define MACCFG2_PREL_MASK 0x0000f000 /* Preamble
266 #define MACCFG2_SRP 0x00000080 /* Soft Receive
268 #define MACCFG2_STP 0x00000040 /* Soft
271 #define MACCFG2_RESERVED_1 0x00000020 /* Reserved -
274 #define MACCFG2_LC 0x00000010 /* Length Check
276 #define MACCFG2_MPE 0x00000008 /* Magic packet
278 #define MACCFG2_FDX 0x00000001 /* Full Duplex */
279 #define MACCFG2_FDX_MASK 0x00000001 /* Full Duplex
281 #define MACCFG2_PAD_CRC 0x00000004
282 #define MACCFG2_CRC_EN 0x00000002
283 #define MACCFG2_PAD_AND_CRC_MODE_NONE 0x00000000 /* Neither
287 #define MACCFG2_PAD_AND_CRC_MODE_CRC_ONLY 0x00000002 /* Append CRC
289 #define MACCFG2_PAD_AND_CRC_MODE_PAD_AND_CRC 0x00000004
290 #define MACCFG2_INTERFACE_MODE_NIBBLE 0x00000100 /* nibble mode
293 #define MACCFG2_INTERFACE_MODE_BYTE 0x00000200 /* byte mode
296 #define MACCFG2_INTERFACE_MODE_MASK 0x00000300 /* mask
301 /* UCC GETH IPGIFG (Inter-frame Gap / Inter-Frame Gap Register) */
302 #define IPGIFG_NON_BACK_TO_BACK_IFG_PART1_SHIFT (31 - 7) /* Non
307 #define IPGIFG_NON_BACK_TO_BACK_IFG_PART2_SHIFT (31 - 15) /* Non
312 #define IPGIFG_MINIMUM_IFG_ENFORCEMENT_SHIFT (31 - 23) /* Mimimum IFG
315 #define IPGIFG_BACK_TO_BACK_IFG_SHIFT (31 - 31) /* back-to-back
319 #define IPGIFG_NON_BACK_TO_BACK_IFG_PART1_MAX 127 /* Non back-to-back
322 #define IPGIFG_NON_BACK_TO_BACK_IFG_PART2_MAX 127 /* Non back-to-back
325 #define IPGIFG_MINIMUM_IFG_ENFORCEMENT_MAX 255 /* Mimimum IFG
326 Enforcement max val */
327 #define IPGIFG_BACK_TO_BACK_IFG_MAX 127 /* back-to-back inter
329 #define IPGIFG_NBTB_CS_IPG_MASK 0x7F000000
330 #define IPGIFG_NBTB_IPG_MASK 0x007F0000
331 #define IPGIFG_MIN_IFG_MASK 0x0000FF00
332 #define IPGIFG_BTB_IPG_MASK 0x0000007F
334 /* UCC GETH HAFDUP (Half Duplex Register) */
335 #define HALFDUP_ALT_BEB_TRUNCATION_SHIFT (31 - 11) /* Alternate
341 #define HALFDUP_ALT_BEB_TRUNCATION_MAX 0xf /* Alternate Binary
343 Truncation max val */
344 #define HALFDUP_ALT_BEB 0x00080000 /* Alternate
348 #define HALFDUP_BACK_PRESSURE_NO_BACKOFF 0x00040000 /* Back
351 #define HALFDUP_NO_BACKOFF 0x00020000 /* No Backoff */
352 #define HALFDUP_EXCESSIVE_DEFER 0x00010000 /* Excessive
354 #define HALFDUP_MAX_RETRANSMISSION_SHIFT (31 - 19) /* Maximum
357 #define HALFDUP_MAX_RETRANSMISSION_MAX 0xf /* Maximum
360 #define HALFDUP_COLLISION_WINDOW_SHIFT (31 - 31) /* Collision
363 #define HALFDUP_COLLISION_WINDOW_MAX 0x3f /* Collision Window max
365 #define HALFDUP_ALT_BEB_TR_MASK 0x00F00000
366 #define HALFDUP_RETRANS_MASK 0x0000F000
367 #define HALFDUP_COL_WINDOW_MASK 0x0000003F
369 /* UCC GETH UCCS (Ethernet Status Register) */
370 #define UCCS_BPR 0x02 /* Back pressure (in
372 #define UCCS_PAU 0x02 /* Pause state (in full
374 #define UCCS_MPD 0x01 /* Magic Packet
377 /* UCC GETH IFSTAT (Interface Status Register) */
378 #define IFSTAT_EXCESS_DEFER 0x00000200 /* Excessive
382 /* UCC GETH MACSTNADDR1 (Station Address Part 1 Register) */
383 #define MACSTNADDR1_OCTET_6_SHIFT (31 - 7) /* Station
387 #define MACSTNADDR1_OCTET_5_SHIFT (31 - 15) /* Station
391 #define MACSTNADDR1_OCTET_4_SHIFT (31 - 23) /* Station
395 #define MACSTNADDR1_OCTET_3_SHIFT (31 - 31) /* Station
400 /* UCC GETH MACSTNADDR2 (Station Address Part 2 Register) */
401 #define MACSTNADDR2_OCTET_2_SHIFT (31 - 7) /* Station
405 #define MACSTNADDR2_OCTET_1_SHIFT (31 - 15) /* Station
410 /* UCC GETH UEMPR (Ethernet Mac Parameter Register) */
411 #define UEMPR_PAUSE_TIME_VALUE_SHIFT (31 - 15) /* Pause time
414 #define UEMPR_EXTENDED_PAUSE_TIME_VALUE_SHIFT (31 - 31) /* Extended
419 /* UCC GETH UTBIPAR (Ten Bit Interface Physical Address Register) */
420 #define UTBIPAR_PHY_ADDRESS_SHIFT (31 - 31) /* Phy address
422 #define UTBIPAR_PHY_ADDRESS_MASK 0x0000001f /* Phy address
425 /* UCC GETH UESCR (Ethernet Statistics Control Register) */
426 #define UESCR_AUTOZ 0x8000 /* Automatically zero
430 #define UESCR_CLRCNT 0x4000 /* Clear all statistics
432 #define UESCR_MAXCOV_SHIFT (15 - 7) /* Max
436 #define UESCR_SCOV_SHIFT (15 - 15) /* Status
441 /* UCC GETH UDSR (Data Synchronization Register) */
442 #define UDSR_MAGIC 0x067E
444 struct ucc_geth_thread_data_tx {
446 } __attribute__ ((packed));
448 struct ucc_geth_thread_data_rx {
450 } __attribute__ ((packed));
452 /* Send Queue Queue-Descriptor */
453 struct ucc_geth_send_queue_qd {
454 u32 bd_ring_base; /* pointer to BD ring base address */
456 u32 last_bd_completed_address;/* initialize to last entry in BD ring */
458 } __attribute__ ((packed));
460 struct ucc_geth_send_queue_mem_region {
461 struct ucc_geth_send_queue_qd sqqd[NUM_TX_QUEUES];
462 } __attribute__ ((packed));
464 struct ucc_geth_thread_tx_pram {
466 } __attribute__ ((packed));
468 struct ucc_geth_thread_rx_pram {
470 } __attribute__ ((packed));
472 #define THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING 64
473 #define THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING_8 64
474 #define THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING_16 96
476 struct ucc_geth_scheduler {
477 u16 cpucount0; /* CPU packet counter */
478 u16 cpucount1; /* CPU packet counter */
479 u16 cecount0; /* QE packet counter */
480 u16 cecount1; /* QE packet counter */
481 u16 cpucount2; /* CPU packet counter */
482 u16 cpucount3; /* CPU packet counter */
483 u16 cecount2; /* QE packet counter */
484 u16 cecount3; /* QE packet counter */
485 u16 cpucount4; /* CPU packet counter */
486 u16 cpucount5; /* CPU packet counter */
487 u16 cecount4; /* QE packet counter */
488 u16 cecount5; /* QE packet counter */
489 u16 cpucount6; /* CPU packet counter */
490 u16 cpucount7; /* CPU packet counter */
491 u16 cecount6; /* QE packet counter */
492 u16 cecount7; /* QE packet counter */
493 u32 weightstatus[NUM_TX_QUEUES]; /* accumulated weight factor */
494 u32 rtsrshadow; /* temporary variable handled by QE */
495 u32 time; /* temporary variable handled by QE */
496 u32 ttl; /* temporary variable handled by QE */
497 u32 mblinterval; /* max burst length interval */
498 u16 nortsrbytetime; /* normalized value of byte time in tsr units */
499 u8 fracsiz; /* radix 2 log value of denom. of
502 u8 strictpriorityq; /* Strict Priority Mask register */
503 u8 txasap; /* Transmit ASAP register */
504 u8 extrabw; /* Extra BandWidth register */
505 u8 oldwfqmask; /* temporary variable handled by QE */
506 u8 weightfactor[NUM_TX_QUEUES];
507 /**< weight factor for queues */
508 u32 minw; /* temporary variable handled by QE */
509 u8 res1[0x70 - 0x64];
510 } __attribute__ ((packed));
512 struct ucc_geth_tx_firmware_statistics_pram {
513 u32 sicoltx; /* single collision */
514 u32 mulcoltx; /* multiple collision */
515 u32 latecoltxfr; /* late collision */
516 u32 frabortduecol; /* frames aborted due to transmit collision */
517 u32 frlostinmactxer; /* frames lost due to internal MAC error
518 transmission that are not counted on any
520 u32 carriersenseertx; /* carrier sense error */
521 u32 frtxok; /* frames transmitted OK */
522 u32 txfrexcessivedefer; /* frames with defferal time greater than
523 specified threshold */
524 u32 txpkts256; /* total packets (including bad) between 256
526 u32 txpkts512; /* total packets (including bad) between 512
528 u32 txpkts1024; /* total packets (including bad) between 1024
530 u32 txpktsjumbo; /* total packets (including bad) between 1024
531 and MAXLength octets */
532 } __attribute__ ((packed));
534 struct ucc_geth_rx_firmware_statistics_pram {
535 u32 frrxfcser; /* frames with crc error */
536 u32 fraligner; /* frames with alignment error */
537 u32 inrangelenrxer; /* in range length error */
538 u32 outrangelenrxer; /* out of range length error */
539 u32 frtoolong; /* frame too long */
541 u32 verylongevent; /* very long event */
542 u32 symbolerror; /* symbol error */
543 u32 dropbsy; /* drop because of BD not ready */
545 u32 mismatchdrop; /* drop because of MAC filtering (e.g. address
547 u32 underpkts; /* total frames less than 64 octets */
548 u32 pkts256; /* total frames (including bad) between 256 and
550 u32 pkts512; /* total frames (including bad) between 512 and
552 u32 pkts1024; /* total frames (including bad) between 1024
554 u32 pktsjumbo; /* total frames (including bad) between 1024
555 and MAXLength octets */
556 u32 frlossinmacer; /* frames lost because of internal MAC error
557 that is not counted in any other counter */
558 u32 pausefr; /* pause frames */
560 u32 removevlan; /* total frames that had their VLAN tag removed
562 u32 replacevlan; /* total frames that had their VLAN tag
564 u32 insertvlan; /* total frames that had their VLAN tag
566 } __attribute__ ((packed));
568 struct ucc_geth_rx_interrupt_coalescing_entry {
569 u32 interruptcoalescingmaxvalue; /* interrupt coalescing max
571 u32 interruptcoalescingcounter; /* interrupt coalescing counter,
573 interruptcoalescingmaxvalue */
574 } __attribute__ ((packed));
576 struct ucc_geth_rx_interrupt_coalescing_table {
577 struct ucc_geth_rx_interrupt_coalescing_entry coalescingentry[NUM_RX_QUEUES];
578 /**< interrupt coalescing entry */
579 } __attribute__ ((packed));
581 struct ucc_geth_rx_prefetched_bds {
582 struct qe_bd bd[NUM_BDS_IN_PREFETCHED_BDS]; /* prefetched bd */
583 } __attribute__ ((packed));
585 struct ucc_geth_rx_bd_queues_entry {
586 u32 bdbaseptr; /* BD base pointer */
587 u32 bdptr; /* BD pointer */
588 u32 externalbdbaseptr; /* external BD base pointer */
589 u32 externalbdptr; /* external BD pointer */
590 } __attribute__ ((packed));
592 struct ucc_geth_tx_global_pram {
594 u8 res0[0x38 - 0x02];
595 u32 sqptr; /* a base pointer to send queue memory region */
596 u32 schedulerbasepointer; /* a base pointer to scheduler memory
598 u32 txrmonbaseptr; /* base pointer to Tx RMON statistics counter */
599 u32 tstate; /* tx internal state. High byte contains
601 u8 iphoffset[TX_IP_OFFSET_ENTRY_MAX];
602 u32 vtagtable[0x8]; /* 8 4-byte VLAN tags */
603 u32 tqptr; /* a base pointer to the Tx Queues Memory
605 u8 res2[0x80 - 0x74];
606 } __attribute__ ((packed));
608 /* structure representing Extended Filtering Global Parameters in PRAM */
609 struct ucc_geth_exf_global_pram {
610 u32 l2pcdptr; /* individual address filter, high */
611 u8 res0[0x10 - 0x04];
612 } __attribute__ ((packed));
614 struct ucc_geth_rx_global_pram {
615 u32 remoder; /* ethernet mode reg. */
616 u32 rqptr; /* base pointer to the Rx Queues Memory Region*/
619 u16 typeorlen; /* cutoff point less than which, type/len field
620 is considered length */
622 u8 rxgstpack; /* acknowledgement on GRACEFUL STOP RX command*/
623 u32 rxrmonbaseptr; /* base pointer to Rx RMON statistics counter */
624 u8 res3[0x30 - 0x28];
625 u32 intcoalescingptr; /* Interrupt coalescing table pointer */
626 u8 res4[0x36 - 0x34];
627 u8 rstate; /* rx internal state. High byte contains
629 u8 res5[0x46 - 0x37];
630 u16 mrblr; /* max receive buffer length reg. */
631 u32 rbdqptr; /* base pointer to RxBD parameter table
633 u16 mflr; /* max frame length reg. */
634 u16 minflr; /* min frame length reg. */
635 u16 maxd1; /* max dma1 length reg. */
636 u16 maxd2; /* max dma2 length reg. */
637 u32 ecamptr; /* external CAM address */
638 u32 l2qt; /* VLAN priority mapping table. */
639 u32 l3qt[0x8]; /* IP priority mapping table. */
640 u16 vlantype; /* vlan type */
641 u16 vlantci; /* default vlan tci */
642 u8 addressfiltering[64]; /* address filtering data structure */
643 u32 exfGlobalParam; /* base address for extended filtering global
645 u8 res6[0x100 - 0xC4]; /* Initialize to zero */
646 } __attribute__ ((packed));
648 #define GRACEFUL_STOP_ACKNOWLEDGE_RX 0x01
650 /* structure representing InitEnet command */
651 struct ucc_geth_init_pram {
658 u8 largestexternallookupkeysize;
660 u32 rxthread[ENET_INIT_PARAM_MAX_ENTRIES_RX]; /* rx threads */
661 u8 res2[0x38 - 0x30];
662 u32 txglobal; /* tx global */
663 u32 txthread[ENET_INIT_PARAM_MAX_ENTRIES_TX]; /* tx threads */
665 } __attribute__ ((packed));
667 #define ENET_INIT_PARAM_RGF_SHIFT (32 - 4)
668 #define ENET_INIT_PARAM_TGF_SHIFT (32 - 8)
670 #define ENET_INIT_PARAM_RISC_MASK 0x0000003f
671 #define ENET_INIT_PARAM_PTR_MASK 0x00ffffc0
672 #define ENET_INIT_PARAM_SNUM_MASK 0xff000000
673 #define ENET_INIT_PARAM_SNUM_SHIFT 24
675 #define ENET_INIT_PARAM_MAGIC_RES_INIT1 0x06
676 #define ENET_INIT_PARAM_MAGIC_RES_INIT2 0x30
677 #define ENET_INIT_PARAM_MAGIC_RES_INIT3 0xff
678 #define ENET_INIT_PARAM_MAGIC_RES_INIT4 0x00
679 #define ENET_INIT_PARAM_MAGIC_RES_INIT5 0x0400
681 /* structure representing 82xx Address Filtering Enet Address in PRAM */
682 struct ucc_geth_82xx_enet_address {
684 u16 h; /* address (MSB) */
686 u16 l; /* address (LSB) */
687 } __attribute__ ((packed));
689 /* structure representing 82xx Address Filtering PRAM */
690 struct ucc_geth_82xx_address_filtering_pram {
691 u32 iaddr_h; /* individual address filter, high */
692 u32 iaddr_l; /* individual address filter, low */
693 u32 gaddr_h; /* group address filter, high */
694 u32 gaddr_l; /* group address filter, low */
695 struct ucc_geth_82xx_enet_address taddr;
696 struct ucc_geth_82xx_enet_address paddr[NUM_OF_PADDRS];
697 u8 res0[0x40 - 0x38];
698 } __attribute__ ((packed));
700 /* GETH Tx firmware statistics structure, used when calling
701 UCC_GETH_GetStatistics. */
702 struct ucc_geth_tx_firmware_statistics {
703 u32 sicoltx; /* single collision */
704 u32 mulcoltx; /* multiple collision */
705 u32 latecoltxfr; /* late collision */
706 u32 frabortduecol; /* frames aborted due to transmit collision */
707 u32 frlostinmactxer; /* frames lost due to internal MAC error
708 transmission that are not counted on any
710 u32 carriersenseertx; /* carrier sense error */
711 u32 frtxok; /* frames transmitted OK */
712 u32 txfrexcessivedefer; /* frames with defferal time greater than
713 specified threshold */
714 u32 txpkts256; /* total packets (including bad) between 256
716 u32 txpkts512; /* total packets (including bad) between 512
718 u32 txpkts1024; /* total packets (including bad) between 1024
720 u32 txpktsjumbo; /* total packets (including bad) between 1024
721 and MAXLength octets */
722 } __attribute__ ((packed));
724 /* GETH Rx firmware statistics structure, used when calling
725 UCC_GETH_GetStatistics. */
726 struct ucc_geth_rx_firmware_statistics {
727 u32 frrxfcser; /* frames with crc error */
728 u32 fraligner; /* frames with alignment error */
729 u32 inrangelenrxer; /* in range length error */
730 u32 outrangelenrxer; /* out of range length error */
731 u32 frtoolong; /* frame too long */
733 u32 verylongevent; /* very long event */
734 u32 symbolerror; /* symbol error */
735 u32 dropbsy; /* drop because of BD not ready */
737 u32 mismatchdrop; /* drop because of MAC filtering (e.g. address
739 u32 underpkts; /* total frames less than 64 octets */
740 u32 pkts256; /* total frames (including bad) between 256 and
742 u32 pkts512; /* total frames (including bad) between 512 and
744 u32 pkts1024; /* total frames (including bad) between 1024
746 u32 pktsjumbo; /* total frames (including bad) between 1024
747 and MAXLength octets */
748 u32 frlossinmacer; /* frames lost because of internal MAC error
749 that is not counted in any other counter */
750 u32 pausefr; /* pause frames */
752 u32 removevlan; /* total frames that had their VLAN tag removed
754 u32 replacevlan; /* total frames that had their VLAN tag
756 u32 insertvlan; /* total frames that had their VLAN tag
758 } __attribute__ ((packed));
760 /* GETH hardware statistics structure, used when calling
761 UCC_GETH_GetStatistics. */
762 struct ucc_geth_hardware_statistics {
763 u32 tx64; /* Total number of frames (including bad
764 frames) transmitted that were exactly of the
765 minimal length (64 for un tagged, 68 for
766 tagged, or with length exactly equal to the
767 parameter MINLength */
768 u32 tx127; /* Total number of frames (including bad
769 frames) transmitted that were between
770 MINLength (Including FCS length==4) and 127
772 u32 tx255; /* Total number of frames (including bad
773 frames) transmitted that were between 128
774 (Including FCS length==4) and 255 octets */
775 u32 rx64; /* Total number of frames received including
776 bad frames that were exactly of the mninimal
778 u32 rx127; /* Total number of frames (including bad
779 frames) received that were between MINLength
780 (Including FCS length==4) and 127 octets */
781 u32 rx255; /* Total number of frames (including bad
782 frames) received that were between 128
783 (Including FCS length==4) and 255 octets */
784 u32 txok; /* Total number of octets residing in frames
785 that where involved in succesfull
787 u16 txcf; /* Total number of PAUSE control frames
788 transmitted by this MAC */
789 u32 tmca; /* Total number of frames that were transmitted
790 succesfully with the group address bit set
791 that are not broadcast frames */
792 u32 tbca; /* Total number of frames transmitted
793 succesfully that had destination address
794 field equal to the broadcast address */
795 u32 rxfok; /* Total number of frames received OK */
796 u32 rxbok; /* Total number of octets received OK */
797 u32 rbyt; /* Total number of octets received including
798 octets in bad frames. Must be implemented in
799 HW because it includes octets in frames that
800 never even reach the UCC */
801 u32 rmca; /* Total number of frames that were received
802 succesfully with the group address bit set
803 that are not broadcast frames */
804 u32 rbca; /* Total number of frames received succesfully
805 that had destination address equal to the
807 } __attribute__ ((packed));
809 /* UCC GETH Tx errors returned via TxConf callback */
810 #define TX_ERRORS_DEF 0x0200
811 #define TX_ERRORS_EXDEF 0x0100
812 #define TX_ERRORS_LC 0x0080
813 #define TX_ERRORS_RL 0x0040
814 #define TX_ERRORS_RC_MASK 0x003C
815 #define TX_ERRORS_RC_SHIFT 2
816 #define TX_ERRORS_UN 0x0002
817 #define TX_ERRORS_CSL 0x0001
819 /* UCC GETH Rx errors returned via RxStore callback */
820 #define RX_ERRORS_CMR 0x0200
821 #define RX_ERRORS_M 0x0100
822 #define RX_ERRORS_BC 0x0080
823 #define RX_ERRORS_MC 0x0040
825 /* Transmit BD. These are in addition to values defined in uccf. */
826 #define T_VID 0x003c0000 /* insert VLAN id index mask. */
827 #define T_DEF (((u32) TX_ERRORS_DEF ) << 16)
828 #define T_EXDEF (((u32) TX_ERRORS_EXDEF ) << 16)
829 #define T_LC (((u32) TX_ERRORS_LC ) << 16)
830 #define T_RL (((u32) TX_ERRORS_RL ) << 16)
831 #define T_RC_MASK (((u32) TX_ERRORS_RC_MASK ) << 16)
832 #define T_UN (((u32) TX_ERRORS_UN ) << 16)
833 #define T_CSL (((u32) TX_ERRORS_CSL ) << 16)
834 #define T_ERRORS_REPORT (T_DEF | T_EXDEF | T_LC | T_RL | T_RC_MASK \
835 | T_UN | T_CSL) /* transmit errors to report */
837 /* Receive BD. These are in addition to values defined in uccf. */
838 #define R_LG 0x00200000 /* Frame length violation. */
839 #define R_NO 0x00100000 /* Non-octet aligned frame. */
840 #define R_SH 0x00080000 /* Short frame. */
841 #define R_CR 0x00040000 /* CRC error. */
842 #define R_OV 0x00020000 /* Overrun. */
843 #define R_IPCH 0x00010000 /* IP checksum check failed. */
844 #define R_CMR (((u32) RX_ERRORS_CMR ) << 16)
845 #define R_M (((u32) RX_ERRORS_M ) << 16)
846 #define R_BC (((u32) RX_ERRORS_BC ) << 16)
847 #define R_MC (((u32) RX_ERRORS_MC ) << 16)
848 #define R_ERRORS_REPORT (R_CMR | R_M | R_BC | R_MC) /* receive errors to
850 #define R_ERRORS_FATAL (R_LG | R_NO | R_SH | R_CR | \
851 R_OV | R_IPCH) /* receive errors to discard */
854 #define UCC_GETH_RX_GLOBAL_PRAM_ALIGNMENT 256
855 #define UCC_GETH_TX_GLOBAL_PRAM_ALIGNMENT 128
856 #define UCC_GETH_THREAD_RX_PRAM_ALIGNMENT 128
857 #define UCC_GETH_THREAD_TX_PRAM_ALIGNMENT 64
858 #define UCC_GETH_THREAD_DATA_ALIGNMENT 256 /* spec gives values
863 #define UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT 32
864 #define UCC_GETH_SCHEDULER_ALIGNMENT 4 /* This is a guess */
865 #define UCC_GETH_TX_STATISTICS_ALIGNMENT 4 /* This is a guess */
866 #define UCC_GETH_RX_STATISTICS_ALIGNMENT 4 /* This is a guess */
867 #define UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT 4 /* This is a
869 #define UCC_GETH_RX_BD_QUEUES_ALIGNMENT 8 /* This is a guess */
870 #define UCC_GETH_RX_PREFETCHED_BDS_ALIGNMENT 128 /* This is a guess */
871 #define UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT 4 /* This
875 #define UCC_GETH_RX_BD_RING_ALIGNMENT 32
876 #define UCC_GETH_TX_BD_RING_ALIGNMENT 32
877 #define UCC_GETH_MRBLR_ALIGNMENT 128
878 #define UCC_GETH_RX_BD_RING_SIZE_ALIGNMENT 4
879 #define UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT 32
880 #define UCC_GETH_RX_DATA_BUF_ALIGNMENT 64
882 #define UCC_GETH_TAD_EF 0x80
883 #define UCC_GETH_TAD_V 0x40
884 #define UCC_GETH_TAD_REJ 0x20
885 #define UCC_GETH_TAD_VTAG_OP_RIGHT_SHIFT 2
886 #define UCC_GETH_TAD_VTAG_OP_SHIFT 6
887 #define UCC_GETH_TAD_V_NON_VTAG_OP 0x20
888 #define UCC_GETH_TAD_RQOS_SHIFT 0
889 #define UCC_GETH_TAD_V_PRIORITY_SHIFT 5
890 #define UCC_GETH_TAD_CFI 0x10
892 #define UCC_GETH_VLAN_PRIORITY_MAX 8
893 #define UCC_GETH_IP_PRIORITY_MAX 64
894 #define UCC_GETH_TX_VTAG_TABLE_ENTRY_MAX 8
895 #define UCC_GETH_RX_BD_RING_SIZE_MIN 8
896 #define UCC_GETH_TX_BD_RING_SIZE_MIN 2
898 #define UCC_GETH_SIZE_OF_BD QE_SIZEOF_BD
900 /* Driver definitions */
901 #define TX_BD_RING_LEN 0x10
902 #define RX_BD_RING_LEN 0x10
903 #define UCC_GETH_DEV_WEIGHT TX_BD_RING_LEN
905 #define TX_RING_MOD_MASK(size) (size-1)
906 #define RX_RING_MOD_MASK(size) (size-1)
908 #define ENET_NUM_OCTETS_PER_ADDRESS 6
909 #define ENET_GROUP_ADDR 0x01 /* Group address mask
913 #define TX_TIMEOUT (1*HZ)
914 #define SKB_ALLOC_TIMEOUT 100000
915 #define PHY_INIT_TIMEOUT 100000
916 #define PHY_CHANGE_TIME 2
918 /* Fast Ethernet (10/100 Mbps) */
919 #define UCC_GETH_URFS_INIT 512 /* Rx virtual FIFO size
921 #define UCC_GETH_URFET_INIT 256 /* 1/2 urfs */
922 #define UCC_GETH_URFSET_INIT 384 /* 3/4 urfs */
923 #define UCC_GETH_UTFS_INIT 512 /* Tx virtual FIFO size
925 #define UCC_GETH_UTFET_INIT 256 /* 1/2 utfs */
926 #define UCC_GETH_UTFTT_INIT 128
927 /* Gigabit Ethernet (1000 Mbps) */
928 #define UCC_GETH_URFS_GIGA_INIT 4096/*2048*/ /* Rx virtual
930 #define UCC_GETH_URFET_GIGA_INIT 2048/*1024*/ /* 1/2 urfs */
931 #define UCC_GETH_URFSET_GIGA_INIT 3072/*1536*/ /* 3/4 urfs */
932 #define UCC_GETH_UTFS_GIGA_INIT 8192/*2048*/ /* Tx virtual
934 #define UCC_GETH_UTFET_GIGA_INIT 4096/*1024*/ /* 1/2 utfs */
935 #define UCC_GETH_UTFTT_GIGA_INIT 0x400/*0x40*/ /* */
937 #define UCC_GETH_REMODER_INIT 0 /* bits that must be
939 #define UCC_GETH_TEMODER_INIT 0xC000 /* bits that must */
940 #define UCC_GETH_UPSMR_INIT (UPSMR_RES1) /* Start value
943 #define UCC_GETH_MACCFG1_INIT 0
944 #define UCC_GETH_MACCFG2_INIT (MACCFG2_RESERVED_1)
946 /* Ethernet Address Type. */
947 enum enet_addr_type {
948 ENET_ADDR_TYPE_INDIVIDUAL,
949 ENET_ADDR_TYPE_GROUP,
950 ENET_ADDR_TYPE_BROADCAST
953 /* UCC GETH 82xx Ethernet Address Recognition Location */
954 enum ucc_geth_enet_address_recognition_location {
955 UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_STATION_ADDRESS,/* station
957 UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_PADDR_FIRST, /* additional
961 UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_PADDR2, /* additional
965 UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_PADDR3, /* additional
969 UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_PADDR_LAST, /* additional
973 UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_GROUP_HASH, /* group hash */
974 UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_INDIVIDUAL_HASH /* individual
978 /* UCC GETH vlan operation tagged */
979 enum ucc_geth_vlan_operation_tagged {
980 UCC_GETH_VLAN_OPERATION_TAGGED_NOP = 0x0, /* Tagged - nop */
981 UCC_GETH_VLAN_OPERATION_TAGGED_REPLACE_VID_PORTION_OF_Q_TAG
982 = 0x1, /* Tagged - replace vid portion of q tag */
983 UCC_GETH_VLAN_OPERATION_TAGGED_IF_VID0_REPLACE_VID_WITH_DEFAULT_VALUE
984 = 0x2, /* Tagged - if vid0 replace vid with default value */
985 UCC_GETH_VLAN_OPERATION_TAGGED_EXTRACT_Q_TAG_FROM_FRAME
986 = 0x3 /* Tagged - extract q tag from frame */
989 /* UCC GETH vlan operation non-tagged */
990 enum ucc_geth_vlan_operation_non_tagged {
991 UCC_GETH_VLAN_OPERATION_NON_TAGGED_NOP = 0x0, /* Non tagged - nop */
992 UCC_GETH_VLAN_OPERATION_NON_TAGGED_Q_TAG_INSERT = 0x1 /* Non tagged -
997 /* UCC GETH Rx Quality of Service Mode */
998 enum ucc_geth_qos_mode {
999 UCC_GETH_QOS_MODE_DEFAULT = 0x0, /* default queue */
1000 UCC_GETH_QOS_MODE_QUEUE_NUM_FROM_L2_CRITERIA = 0x1, /* queue
1004 UCC_GETH_QOS_MODE_QUEUE_NUM_FROM_L3_CRITERIA = 0x2 /* queue
1010 /* UCC GETH Statistics Gathering Mode - These are bit flags, 'or' them together
1011 for combined functionality */
1012 enum ucc_geth_statistics_gathering_mode {
1013 UCC_GETH_STATISTICS_GATHERING_MODE_NONE = 0x00000000, /* No
1016 UCC_GETH_STATISTICS_GATHERING_MODE_HARDWARE = 0x00000001,/* Enable
1021 UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX = 0x00000004,/*Enable
1027 UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX = 0x00000008/* Enable
1035 /* UCC GETH Pad and CRC Mode - Note, Padding without CRC is not possible */
1036 enum ucc_geth_maccfg2_pad_and_crc_mode {
1037 UCC_GETH_PAD_AND_CRC_MODE_NONE
1038 = MACCFG2_PAD_AND_CRC_MODE_NONE, /* Neither Padding
1041 UCC_GETH_PAD_AND_CRC_MODE_CRC_ONLY
1042 = MACCFG2_PAD_AND_CRC_MODE_CRC_ONLY, /* Append
1044 UCC_GETH_PAD_AND_CRC_MODE_PAD_AND_CRC =
1045 MACCFG2_PAD_AND_CRC_MODE_PAD_AND_CRC
1048 /* UCC GETH upsmr Flow Control Mode */
1049 enum ucc_geth_flow_control_mode {
1050 UPSMR_AUTOMATIC_FLOW_CONTROL_MODE_NONE = 0x00000000, /* No automatic
1053 UPSMR_AUTOMATIC_FLOW_CONTROL_MODE_PAUSE_WHEN_EMERGENCY
1054 = 0x00004000 /* Send pause frame when RxFIFO reaches its
1055 emergency threshold */
1058 /* UCC GETH number of threads */
1059 enum ucc_geth_num_of_threads {
1060 UCC_GETH_NUM_OF_THREADS_1 = 0x1, /* 1 */
1061 UCC_GETH_NUM_OF_THREADS_2 = 0x2, /* 2 */
1062 UCC_GETH_NUM_OF_THREADS_4 = 0x0, /* 4 */
1063 UCC_GETH_NUM_OF_THREADS_6 = 0x3, /* 6 */
1064 UCC_GETH_NUM_OF_THREADS_8 = 0x4 /* 8 */
1067 /* UCC GETH number of station addresses */
1068 enum ucc_geth_num_of_station_addresses {
1069 UCC_GETH_NUM_OF_STATION_ADDRESSES_1, /* 1 */
1070 UCC_GETH_NUM_OF_STATION_ADDRESSES_5 /* 5 */
1073 /* UCC GETH 82xx Ethernet Address Container */
1074 struct enet_addr_container {
1075 u8 address[ENET_NUM_OCTETS_PER_ADDRESS]; /* ethernet address */
1076 enum ucc_geth_enet_address_recognition_location location; /* location in
1080 struct list_head node;
1083 #define ENET_ADDR_CONT_ENTRY(ptr) list_entry(ptr, struct enet_addr_container, node)
1085 /* UCC GETH Termination Action Descriptor (TAD) structure. */
1086 struct ucc_geth_tad_params {
1087 int rx_non_dynamic_extended_features_mode;
1089 enum ucc_geth_vlan_operation_tagged vtag_op;
1090 enum ucc_geth_vlan_operation_non_tagged vnontag_op;
1091 enum ucc_geth_qos_mode rqos;
1096 /* GETH protocol initialization structure */
1097 struct ucc_geth_info {
1098 struct ucc_fast_info uf_info;
1101 int ipCheckSumCheck;
1102 int ipCheckSumGenerate;
1103 int rxExtendedFiltering;
1104 u32 extendedFilteringChainPointer;
1106 int dynamicMaxFrameLength;
1107 int dynamicMinFrameLength;
1108 u8 nonBackToBackIfgPart1;
1109 u8 nonBackToBackIfgPart2;
1110 u8 miminumInterFrameGapEnforcement;
1111 u8 backToBackInterFrameGap;
1112 int ipAddressAlignment;
1120 int miiPreambleSupress;
1121 u8 altBebTruncation;
1123 int backPressureNoBackoff;
1126 u8 maxRetransmission;
1135 int receiveFlowControl;
1136 u8 maxGroupAddrInHash;
1137 u8 maxIndAddrInHash;
1151 u8 weightfactor[NUM_TX_QUEUES];
1152 u8 interruptcoalescingmaxvalue[NUM_RX_QUEUES];
1153 u8 l2qt[UCC_GETH_VLAN_PRIORITY_MAX];
1154 u8 l3qt[UCC_GETH_IP_PRIORITY_MAX];
1155 u32 vtagtable[UCC_GETH_TX_VTAG_TABLE_ENTRY_MAX];
1156 u8 iphoffset[TX_IP_OFFSET_ENTRY_MAX];
1157 u16 bdRingLenTx[NUM_TX_QUEUES];
1158 u16 bdRingLenRx[NUM_RX_QUEUES];
1159 enum ucc_geth_num_of_station_addresses numStationAddresses;
1160 enum qe_fltr_largest_external_tbl_lookup_key_size
1161 largestexternallookupkeysize;
1162 enum ucc_geth_statistics_gathering_mode statisticsMode;
1163 enum ucc_geth_vlan_operation_tagged vlanOperationTagged;
1164 enum ucc_geth_vlan_operation_non_tagged vlanOperationNonTagged;
1165 enum ucc_geth_qos_mode rxQoSMode;
1166 enum ucc_geth_flow_control_mode aufc;
1167 enum ucc_geth_maccfg2_pad_and_crc_mode padAndCrc;
1168 enum ucc_geth_num_of_threads numThreadsTx;
1169 enum ucc_geth_num_of_threads numThreadsRx;
1170 enum qe_risc_allocation riscTx;
1171 enum qe_risc_allocation riscRx;
1174 /* structure representing UCC GETH */
1175 struct ucc_geth_private {
1176 struct ucc_geth_info *ug_info;
1177 struct ucc_fast_private *uccf;
1178 struct net_device *dev;
1179 struct net_device_stats stats; /* linux network statistics */
1180 struct ucc_geth *ug_regs;
1181 struct ucc_geth_init_pram *p_init_enet_param_shadow;
1182 struct ucc_geth_exf_global_pram *p_exf_glbl_param;
1183 u32 exf_glbl_param_offset;
1184 struct ucc_geth_rx_global_pram *p_rx_glbl_pram;
1185 u32 rx_glbl_pram_offset;
1186 struct ucc_geth_tx_global_pram *p_tx_glbl_pram;
1187 u32 tx_glbl_pram_offset;
1188 struct ucc_geth_send_queue_mem_region *p_send_q_mem_reg;
1189 u32 send_q_mem_reg_offset;
1190 struct ucc_geth_thread_data_tx *p_thread_data_tx;
1191 u32 thread_dat_tx_offset;
1192 struct ucc_geth_thread_data_rx *p_thread_data_rx;
1193 u32 thread_dat_rx_offset;
1194 struct ucc_geth_scheduler *p_scheduler;
1195 u32 scheduler_offset;
1196 struct ucc_geth_tx_firmware_statistics_pram *p_tx_fw_statistics_pram;
1197 u32 tx_fw_statistics_pram_offset;
1198 struct ucc_geth_rx_firmware_statistics_pram *p_rx_fw_statistics_pram;
1199 u32 rx_fw_statistics_pram_offset;
1200 struct ucc_geth_rx_interrupt_coalescing_table *p_rx_irq_coalescing_tbl;
1201 u32 rx_irq_coalescing_tbl_offset;
1202 struct ucc_geth_rx_bd_queues_entry *p_rx_bd_qs_tbl;
1203 u32 rx_bd_qs_tbl_offset;
1204 u8 *p_tx_bd_ring[NUM_TX_QUEUES];
1205 u32 tx_bd_ring_offset[NUM_TX_QUEUES];
1206 u8 *p_rx_bd_ring[NUM_RX_QUEUES];
1207 u32 rx_bd_ring_offset[NUM_RX_QUEUES];
1208 u8 *confBd[NUM_TX_QUEUES];
1209 u8 *txBd[NUM_TX_QUEUES];
1210 u8 *rxBd[NUM_RX_QUEUES];
1211 int badFrame[NUM_RX_QUEUES];
1212 u16 cpucount[NUM_TX_QUEUES];
1213 volatile u16 *p_cpucount[NUM_TX_QUEUES];
1214 int indAddrRegUsed[NUM_OF_PADDRS];
1215 u8 paddr[NUM_OF_PADDRS][ENET_NUM_OCTETS_PER_ADDRESS]; /* ethernet address */
1216 u8 numGroupAddrInHash;
1217 u8 numIndAddrInHash;
1219 int rx_extended_features;
1220 int rx_non_dynamic_extended_features;
1221 struct list_head conf_skbs;
1222 struct list_head group_hash_q;
1223 struct list_head ind_hash_q;
1226 /* pointers to arrays of skbuffs for tx and rx */
1227 struct sk_buff **tx_skbuff[NUM_TX_QUEUES];
1228 struct sk_buff **rx_skbuff[NUM_RX_QUEUES];
1229 /* indices pointing to the next free sbk in skb arrays */
1230 u16 skb_curtx[NUM_TX_QUEUES];
1231 u16 skb_currx[NUM_RX_QUEUES];
1232 /* index of the first skb which hasn't been transmitted yet. */
1233 u16 skb_dirtytx[NUM_TX_QUEUES];
1235 struct ugeth_mii_info *mii_info;
1236 struct phy_device *phydev;
1237 phy_interface_t phy_interface;
1239 uint32_t msg_enable;
1245 #endif /* __UCC_GETH_H__ */