b43: Remove reset after fatal DMA error
[safe/jmp/linux-2.6] / drivers / net / ucc_geth.h
index a665612..03a6ca0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved.
+ * Copyright (C) Freescale Semicondutor, Inc. 2006-2009. All rights reserved.
  *
  * Author: Shlomi Gridish <gridish@freescale.com>
  *
@@ -20,7 +20,6 @@
 
 #include <linux/kernel.h>
 #include <linux/list.h>
-#include <linux/fsl_devices.h>
 
 #include <asm/immap_qe.h>
 #include <asm/qe.h>
 #include <asm/ucc.h>
 #include <asm/ucc_fast.h>
 
+#define DRV_DESC "QE UCC Gigabit Ethernet Controller"
+#define DRV_NAME "ucc_geth"
+#define DRV_VERSION "1.1"
+
 #define NUM_TX_QUEUES                   8
 #define NUM_RX_QUEUES                   8
 #define NUM_BDS_IN_PREFETCHED_BDS       4
 #define ENET_INIT_PARAM_MAX_ENTRIES_RX  9
 #define ENET_INIT_PARAM_MAX_ENTRIES_TX  8
 
-struct ucc_mii_mng {
-       u32 miimcfg;            /* MII management configuration reg */
-       u32 miimcom;            /* MII management command reg */
-       u32 miimadd;            /* MII management address reg */
-       u32 miimcon;            /* MII management control reg */
-       u32 miimstat;           /* MII management status reg */
-       u32 miimind;            /* MII management indication reg */
-} __attribute__ ((packed));
-
 struct ucc_geth {
        struct ucc_fast uccf;
+       u8 res0[0x100 - sizeof(struct ucc_fast)];
 
        u32 maccfg1;            /* mac configuration reg. 1 */
        u32 maccfg2;            /* mac configuration reg. 2 */
        u32 ipgifg;             /* interframe gap reg.  */
        u32 hafdup;             /* half-duplex reg.  */
        u8 res1[0x10];
-       struct ucc_mii_mng miimng;      /* MII management structure */
+       u8 miimng[0x18];        /* MII management structure moved to _mii.h */
        u32 ifctl;              /* interface control reg */
        u32 ifstat;             /* interface statux reg */
        u32 macstnaddr1;        /* mac station address part 1 reg */
@@ -164,89 +159,64 @@ struct ucc_geth {
                                                                   boundary */
 
 /* UCC GETH Event Register */
-#define UCCE_MPD                                0x80000000     /* Magic packet
-                                                                  detection */
-#define UCCE_SCAR                               0x40000000
-#define UCCE_GRA                                0x20000000     /* Tx graceful
-                                                                  stop
-                                                                  complete */
-#define UCCE_CBPR                               0x10000000
-#define UCCE_BSY                                0x08000000
-#define UCCE_RXC                                0x04000000
-#define UCCE_TXC                                0x02000000
-#define UCCE_TXE                                0x01000000
-#define UCCE_TXB7                               0x00800000
-#define UCCE_TXB6                               0x00400000
-#define UCCE_TXB5                               0x00200000
-#define UCCE_TXB4                               0x00100000
-#define UCCE_TXB3                               0x00080000
-#define UCCE_TXB2                               0x00040000
-#define UCCE_TXB1                               0x00020000
-#define UCCE_TXB0                               0x00010000
-#define UCCE_RXB7                               0x00008000
-#define UCCE_RXB6                               0x00004000
-#define UCCE_RXB5                               0x00002000
-#define UCCE_RXB4                               0x00001000
-#define UCCE_RXB3                               0x00000800
-#define UCCE_RXB2                               0x00000400
-#define UCCE_RXB1                               0x00000200
-#define UCCE_RXB0                               0x00000100
-#define UCCE_RXF7                               0x00000080
-#define UCCE_RXF6                               0x00000040
-#define UCCE_RXF5                               0x00000020
-#define UCCE_RXF4                               0x00000010
-#define UCCE_RXF3                               0x00000008
-#define UCCE_RXF2                               0x00000004
-#define UCCE_RXF1                               0x00000002
-#define UCCE_RXF0                               0x00000001
-
-#define UCCE_RXBF_SINGLE_MASK                   (UCCE_RXF0)
-#define UCCE_TXBF_SINGLE_MASK                   (UCCE_TXB0)
-
-#define UCCE_TXB         (UCCE_TXB7 | UCCE_TXB6 | UCCE_TXB5 | UCCE_TXB4 |\
-                       UCCE_TXB3 | UCCE_TXB2 | UCCE_TXB1 | UCCE_TXB0)
-#define UCCE_RXB         (UCCE_RXB7 | UCCE_RXB6 | UCCE_RXB5 | UCCE_RXB4 |\
-                       UCCE_RXB3 | UCCE_RXB2 | UCCE_RXB1 | UCCE_RXB0)
-#define UCCE_RXF         (UCCE_RXF7 | UCCE_RXF6 | UCCE_RXF5 | UCCE_RXF4 |\
-                       UCCE_RXF3 | UCCE_RXF2 | UCCE_RXF1 | UCCE_RXF0)
-#define UCCE_OTHER       (UCCE_SCAR | UCCE_GRA  | UCCE_CBPR | UCCE_BSY  |\
-                       UCCE_RXC  | UCCE_TXC  | UCCE_TXE)
-
-/* UCC GETH UPSMR (Protocol Specific Mode Register) */
-#define UPSMR_ECM                               0x04000000     /* Enable CAM
-                                                                  Miss or
-                                                                  Enable
-                                                                  Filtering
-                                                                  Miss */
-#define UPSMR_HSE                               0x02000000     /* Hardware
-                                                                  Statistics
-                                                                  Enable */
-#define UPSMR_PRO                               0x00400000     /* Promiscuous*/
-#define UPSMR_CAP                               0x00200000     /* CAM polarity
-                                                                */
-#define UPSMR_RSH                               0x00100000     /* Receive
-                                                                  Short Frames
-                                                                */
-#define UPSMR_RPM                               0x00080000     /* Reduced Pin
-                                                                  Mode
-                                                                  interfaces */
-#define UPSMR_R10M                              0x00040000     /* RGMII/RMII
-                                                                  10 Mode */
-#define UPSMR_RLPB                              0x00020000     /* RMII
-                                                                  Loopback
-                                                                  Mode */
-#define UPSMR_TBIM                              0x00010000     /* Ten-bit
-                                                                  Interface
-                                                                  Mode */
-#define UPSMR_RMM                               0x00001000     /* RMII/RGMII
-                                                                  Mode */
-#define UPSMR_CAM                               0x00000400     /* CAM Address
-                                                                  Matching */
-#define UPSMR_BRO                               0x00000200     /* Broadcast
-                                                                  Address */
-#define UPSMR_RES1                              0x00002000     /* Reserved
-                                                                  feild - must
-                                                                  be 1 */
+#define UCCE_TXB   (UCC_GETH_UCCE_TXB7 | UCC_GETH_UCCE_TXB6 | \
+                   UCC_GETH_UCCE_TXB5 | UCC_GETH_UCCE_TXB4 | \
+                   UCC_GETH_UCCE_TXB3 | UCC_GETH_UCCE_TXB2 | \
+                   UCC_GETH_UCCE_TXB1 | UCC_GETH_UCCE_TXB0)
+
+#define UCCE_RXB   (UCC_GETH_UCCE_RXB7 | UCC_GETH_UCCE_RXB6 | \
+                   UCC_GETH_UCCE_RXB5 | UCC_GETH_UCCE_RXB4 | \
+                   UCC_GETH_UCCE_RXB3 | UCC_GETH_UCCE_RXB2 | \
+                   UCC_GETH_UCCE_RXB1 | UCC_GETH_UCCE_RXB0)
+
+#define UCCE_RXF   (UCC_GETH_UCCE_RXF7 | UCC_GETH_UCCE_RXF6 | \
+                   UCC_GETH_UCCE_RXF5 | UCC_GETH_UCCE_RXF4 | \
+                   UCC_GETH_UCCE_RXF3 | UCC_GETH_UCCE_RXF2 | \
+                   UCC_GETH_UCCE_RXF1 | UCC_GETH_UCCE_RXF0)
+
+#define UCCE_OTHER (UCC_GETH_UCCE_SCAR | UCC_GETH_UCCE_GRA | \
+                   UCC_GETH_UCCE_CBPR | UCC_GETH_UCCE_BSY | \
+                   UCC_GETH_UCCE_RXC  | UCC_GETH_UCCE_TXC | UCC_GETH_UCCE_TXE)
+
+#define UCCE_RX_EVENTS  (UCCE_RXF | UCC_GETH_UCCE_BSY)
+#define UCCE_TX_EVENTS (UCCE_TXB | UCC_GETH_UCCE_TXE)
+
+/* TBI defines */
+#define        ENET_TBI_MII_CR         0x00    /* Control */
+#define        ENET_TBI_MII_SR         0x01    /* Status */
+#define        ENET_TBI_MII_ANA        0x04    /* AN advertisement */
+#define        ENET_TBI_MII_ANLPBPA    0x05    /* AN link partner base page ability */
+#define        ENET_TBI_MII_ANEX       0x06    /* AN expansion */
+#define        ENET_TBI_MII_ANNPT      0x07    /* AN next page transmit */
+#define        ENET_TBI_MII_ANLPANP    0x08    /* AN link partner ability next page */
+#define        ENET_TBI_MII_EXST       0x0F    /* Extended status */
+#define        ENET_TBI_MII_JD         0x10    /* Jitter diagnostics */
+#define        ENET_TBI_MII_TBICON     0x11    /* TBI control */
+
+/* TBI MDIO register bit fields*/
+#define TBISR_LSTATUS          0x0004
+#define TBICON_CLK_SELECT       0x0020
+#define TBIANA_ASYMMETRIC_PAUSE 0x0100
+#define TBIANA_SYMMETRIC_PAUSE  0x0080
+#define TBIANA_HALF_DUPLEX      0x0040
+#define TBIANA_FULL_DUPLEX      0x0020
+#define TBICR_PHY_RESET         0x8000
+#define TBICR_ANEG_ENABLE       0x1000
+#define TBICR_RESTART_ANEG      0x0200
+#define TBICR_FULL_DUPLEX       0x0100
+#define TBICR_SPEED1_SET        0x0040
+
+#define TBIANA_SETTINGS ( \
+               TBIANA_ASYMMETRIC_PAUSE \
+               | TBIANA_SYMMETRIC_PAUSE \
+               | TBIANA_FULL_DUPLEX \
+               )
+#define TBICR_SETTINGS ( \
+               TBICR_PHY_RESET \
+               | TBICR_ANEG_ENABLE \
+               | TBICR_FULL_DUPLEX \
+               | TBICR_SPEED1_SET \
+               )
 
 /* UCC GETH MACCFG1 (MAC Configuration 1 Register) */
 #define MACCFG1_FLOW_RX                         0x00000020     /* Flow Control
@@ -381,66 +351,6 @@ struct ucc_geth {
 #define UCCS_MPD                                0x01   /* Magic Packet
                                                           Detected */
 
-/* UCC GETH MIIMCFG (MII Management Configuration Register) */
-#define MIIMCFG_RESET_MANAGEMENT                0x80000000     /* Reset
-                                                                  management */
-#define MIIMCFG_NO_PREAMBLE                     0x00000010     /* Preamble
-                                                                  suppress */
-#define MIIMCFG_CLOCK_DIVIDE_SHIFT              (31 - 31)      /* clock divide
-                                                                  << shift */
-#define MIIMCFG_CLOCK_DIVIDE_MAX                0xf    /* clock divide max val
-                                                        */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_2    0x00000000     /* divide by 2 */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_4    0x00000001     /* divide by 4 */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_6    0x00000002     /* divide by 6 */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_8    0x00000003     /* divide by 8 */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_10   0x00000004     /* divide by 10
-                                                                */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_14   0x00000005     /* divide by 14
-                                                                */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_16   0x00000008     /* divide by 16
-                                                                */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_20   0x00000006     /* divide by 20
-                                                                */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_28   0x00000007     /* divide by 28
-                                                                */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_32   0x00000009     /* divide by 32
-                                                                */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_48   0x0000000a     /* divide by 48
-                                                                */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_64   0x0000000b     /* divide by 64
-                                                                */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_80   0x0000000c     /* divide by 80
-                                                                */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_112  0x0000000d     /* divide by
-                                                                  112 */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_160  0x0000000e     /* divide by
-                                                                  160 */
-#define MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_224  0x0000000f     /* divide by
-                                                                  224 */
-
-/* UCC GETH MIIMCOM (MII Management Command Register) */
-#define MIIMCOM_SCAN_CYCLE                      0x00000002     /* Scan cycle */
-#define MIIMCOM_READ_CYCLE                      0x00000001     /* Read cycle */
-
-/* UCC GETH MIIMADD (MII Management Address Register) */
-#define MIIMADD_PHY_ADDRESS_SHIFT               (31 - 23)      /* PHY Address
-                                                                  << shift */
-#define MIIMADD_PHY_REGISTER_SHIFT              (31 - 31)      /* PHY Register
-                                                                  << shift */
-
-/* UCC GETH MIIMCON (MII Management Control Register) */
-#define MIIMCON_PHY_CONTROL_SHIFT               (31 - 31)      /* PHY Control
-                                                                  << shift */
-#define MIIMCON_PHY_STATUS_SHIFT                (31 - 31)      /* PHY Status
-                                                                  << shift */
-
-/* UCC GETH MIIMIND (MII Management Indicator Register) */
-#define MIIMIND_NOT_VALID                       0x00000004     /* Not valid */
-#define MIIMIND_SCAN                            0x00000002     /* Scan in
-                                                                  progress */
-#define MIIMIND_BUSY                            0x00000001
-
 /* UCC GETH IFSTAT (Interface Status Register) */
 #define IFSTAT_EXCESS_DEFER                     0x00000200     /* Excessive
                                                                   transmission
@@ -759,8 +669,8 @@ struct ucc_geth_82xx_address_filtering_pram {
        u32 iaddr_l;            /* individual address filter, low */
        u32 gaddr_h;            /* group address filter, high */
        u32 gaddr_l;            /* group address filter, low */
-       struct ucc_geth_82xx_enet_address taddr;
-       struct ucc_geth_82xx_enet_address paddr[NUM_OF_PADDRS];
+       struct ucc_geth_82xx_enet_address __iomem taddr;
+       struct ucc_geth_82xx_enet_address __iomem paddr[NUM_OF_PADDRS];
        u8 res0[0x40 - 0x38];
 } __attribute__ ((packed));
 
@@ -931,8 +841,7 @@ struct ucc_geth_hardware_statistics {
 #define UCC_GETH_SCHEDULER_ALIGNMENT           4       /* This is a guess */
 #define UCC_GETH_TX_STATISTICS_ALIGNMENT       4       /* This is a guess */
 #define UCC_GETH_RX_STATISTICS_ALIGNMENT       4       /* This is a guess */
-#define UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT     4       /* This is a
-                                                                  guess */
+#define UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT     64
 #define UCC_GETH_RX_BD_QUEUES_ALIGNMENT                8       /* This is a guess */
 #define UCC_GETH_RX_PREFETCHED_BDS_ALIGNMENT   128     /* This is a guess */
 #define UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT 4   /* This
@@ -961,13 +870,13 @@ struct ucc_geth_hardware_statistics {
 #define UCC_GETH_TX_VTAG_TABLE_ENTRY_MAX        8
 #define UCC_GETH_RX_BD_RING_SIZE_MIN            8
 #define UCC_GETH_TX_BD_RING_SIZE_MIN            2
+#define UCC_GETH_BD_RING_SIZE_MAX              0xffff
 
 #define UCC_GETH_SIZE_OF_BD                     QE_SIZEOF_BD
 
 /* Driver definitions */
 #define TX_BD_RING_LEN                          0x10
 #define RX_BD_RING_LEN                          0x10
-#define UCC_GETH_DEV_WEIGHT                     TX_BD_RING_LEN
 
 #define TX_RING_MOD_MASK(size)                  (size-1)
 #define RX_RING_MOD_MASK(size)                  (size-1)
@@ -1004,20 +913,12 @@ struct ucc_geth_hardware_statistics {
 #define UCC_GETH_REMODER_INIT                   0      /* bits that must be
                                                           set */
 #define UCC_GETH_TEMODER_INIT                   0xC000 /* bits that must */
-#define UCC_GETH_UPSMR_INIT                     (UPSMR_RES1)   /* Start value
-                                                                  for this
-                                                                  register */
+
+/* Initial value for UPSMR */
+#define UCC_GETH_UPSMR_INIT                     UCC_GETH_UPSMR_RES1
+
 #define UCC_GETH_MACCFG1_INIT                   0
 #define UCC_GETH_MACCFG2_INIT                   (MACCFG2_RESERVED_1)
-#define UCC_GETH_MIIMCFG_MNGMNT_CLC_DIV_INIT    \
-                               (MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_112)
-
-/* Ethernet speed */
-enum enet_speed {
-       ENET_SPEED_10BT,        /* 10 Base T */
-       ENET_SPEED_100BT,       /* 100 Base T */
-       ENET_SPEED_1000BT       /* 1000 Base T */
-};
 
 /* Ethernet Address Type. */
 enum enet_addr_type {
@@ -1026,22 +927,6 @@ enum enet_addr_type {
        ENET_ADDR_TYPE_BROADCAST
 };
 
-/* TBI / MII Set Register */
-enum enet_tbi_mii_reg {
-       ENET_TBI_MII_CR = 0x00, /* Control (CR ) */
-       ENET_TBI_MII_SR = 0x01, /* Status (SR ) */
-       ENET_TBI_MII_ANA = 0x04,        /* AN advertisement (ANA ) */
-       ENET_TBI_MII_ANLPBPA = 0x05,    /* AN link partner base page ability
-                                          (ANLPBPA) */
-       ENET_TBI_MII_ANEX = 0x06,       /* AN expansion (ANEX ) */
-       ENET_TBI_MII_ANNPT = 0x07,      /* AN next page transmit (ANNPT ) */
-       ENET_TBI_MII_ANLPANP = 0x08,    /* AN link partner ability next page
-                                          (ANLPANP) */
-       ENET_TBI_MII_EXST = 0x0F,       /* Extended status (EXST ) */
-       ENET_TBI_MII_JD = 0x10, /* Jitter diagnostics (JD ) */
-       ENET_TBI_MII_TBICON = 0x11      /* TBI control (TBICON ) */
-};
-
 /* UCC GETH 82xx Ethernet Address Recognition Location */
 enum ucc_geth_enet_address_recognition_location {
        UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_STATION_ADDRESS,/* station
@@ -1225,6 +1110,7 @@ struct ucc_geth_info {
        int bro;
        int ecm;
        int receiveFlowControl;
+       int transmitFlowControl;
        u8 maxGroupAddrInHash;
        u8 maxIndAddrInHash;
        u8 prel;
@@ -1238,9 +1124,8 @@ struct ucc_geth_info {
        u32 eventRegMask;
        u16 pausePeriod;
        u16 extensionField;
-       u8 phy_address;
-       u32 board_flags;
-       u32 phy_interrupt;
+       struct device_node *phy_node;
+       struct device_node *tbi_node;
        u8 weightfactor[NUM_TX_QUEUES];
        u8 interruptcoalescingmaxvalue[NUM_RX_QUEUES];
        u8 l2qt[UCC_GETH_VLAN_PRIORITY_MAX];
@@ -1249,7 +1134,6 @@ struct ucc_geth_info {
        u8 iphoffset[TX_IP_OFFSET_ENTRY_MAX];
        u16 bdRingLenTx[NUM_TX_QUEUES];
        u16 bdRingLenRx[NUM_RX_QUEUES];
-       enum enet_interface enet_interface;
        enum ucc_geth_num_of_station_addresses numStationAddresses;
        enum qe_fltr_largest_external_tbl_lookup_key_size
            largestexternallookupkeysize;
@@ -1261,50 +1145,52 @@ struct ucc_geth_info {
        enum ucc_geth_maccfg2_pad_and_crc_mode padAndCrc;
        enum ucc_geth_num_of_threads numThreadsTx;
        enum ucc_geth_num_of_threads numThreadsRx;
-       enum qe_risc_allocation riscTx;
-       enum qe_risc_allocation riscRx;
+       unsigned int riscTx;
+       unsigned int riscRx;
 };
 
 /* structure representing UCC GETH */
 struct ucc_geth_private {
        struct ucc_geth_info *ug_info;
        struct ucc_fast_private *uccf;
-       struct net_device *dev;
-       struct net_device_stats stats;  /* linux network statistics */
-       struct ucc_geth *ug_regs;
+       struct device *dev;
+       struct net_device *ndev;
+       struct napi_struct napi;
+       struct work_struct timeout_work;
+       struct ucc_geth __iomem *ug_regs;
        struct ucc_geth_init_pram *p_init_enet_param_shadow;
-       struct ucc_geth_exf_global_pram *p_exf_glbl_param;
+       struct ucc_geth_exf_global_pram __iomem *p_exf_glbl_param;
        u32 exf_glbl_param_offset;
-       struct ucc_geth_rx_global_pram *p_rx_glbl_pram;
+       struct ucc_geth_rx_global_pram __iomem *p_rx_glbl_pram;
        u32 rx_glbl_pram_offset;
-       struct ucc_geth_tx_global_pram *p_tx_glbl_pram;
+       struct ucc_geth_tx_global_pram __iomem *p_tx_glbl_pram;
        u32 tx_glbl_pram_offset;
-       struct ucc_geth_send_queue_mem_region *p_send_q_mem_reg;
+       struct ucc_geth_send_queue_mem_region __iomem *p_send_q_mem_reg;
        u32 send_q_mem_reg_offset;
-       struct ucc_geth_thread_data_tx *p_thread_data_tx;
+       struct ucc_geth_thread_data_tx __iomem *p_thread_data_tx;
        u32 thread_dat_tx_offset;
-       struct ucc_geth_thread_data_rx *p_thread_data_rx;
+       struct ucc_geth_thread_data_rx __iomem *p_thread_data_rx;
        u32 thread_dat_rx_offset;
-       struct ucc_geth_scheduler *p_scheduler;
+       struct ucc_geth_scheduler __iomem *p_scheduler;
        u32 scheduler_offset;
-       struct ucc_geth_tx_firmware_statistics_pram *p_tx_fw_statistics_pram;
+       struct ucc_geth_tx_firmware_statistics_pram __iomem *p_tx_fw_statistics_pram;
        u32 tx_fw_statistics_pram_offset;
-       struct ucc_geth_rx_firmware_statistics_pram *p_rx_fw_statistics_pram;
+       struct ucc_geth_rx_firmware_statistics_pram __iomem *p_rx_fw_statistics_pram;
        u32 rx_fw_statistics_pram_offset;
-       struct ucc_geth_rx_interrupt_coalescing_table *p_rx_irq_coalescing_tbl;
+       struct ucc_geth_rx_interrupt_coalescing_table __iomem *p_rx_irq_coalescing_tbl;
        u32 rx_irq_coalescing_tbl_offset;
-       struct ucc_geth_rx_bd_queues_entry *p_rx_bd_qs_tbl;
+       struct ucc_geth_rx_bd_queues_entry __iomem *p_rx_bd_qs_tbl;
        u32 rx_bd_qs_tbl_offset;
-       u8 *p_tx_bd_ring[NUM_TX_QUEUES];
+       u8 __iomem *p_tx_bd_ring[NUM_TX_QUEUES];
        u32 tx_bd_ring_offset[NUM_TX_QUEUES];
-       u8 *p_rx_bd_ring[NUM_RX_QUEUES];
+       u8 __iomem *p_rx_bd_ring[NUM_RX_QUEUES];
        u32 rx_bd_ring_offset[NUM_RX_QUEUES];
-       u8 *confBd[NUM_TX_QUEUES];
-       u8 *txBd[NUM_TX_QUEUES];
-       u8 *rxBd[NUM_RX_QUEUES];
+       u8 __iomem *confBd[NUM_TX_QUEUES];
+       u8 __iomem *txBd[NUM_TX_QUEUES];
+       u8 __iomem *rxBd[NUM_RX_QUEUES];
        int badFrame[NUM_RX_QUEUES];
        u16 cpucount[NUM_TX_QUEUES];
-       volatile u16 *p_cpucount[NUM_TX_QUEUES];
+       u16 __iomem *p_cpucount[NUM_TX_QUEUES];
        int indAddrRegUsed[NUM_OF_PADDRS];
        u8 paddr[NUM_OF_PADDRS][ENET_NUM_OCTETS_PER_ADDRESS];   /* ethernet address */
        u8 numGroupAddrInHash;
@@ -1326,12 +1212,27 @@ struct ucc_geth_private {
        /* index of the first skb which hasn't been transmitted yet. */
        u16 skb_dirtytx[NUM_TX_QUEUES];
 
-       struct work_struct tq;
-       struct timer_list phy_info_timer;
+       struct sk_buff_head rx_recycle;
+
        struct ugeth_mii_info *mii_info;
+       struct phy_device *phydev;
+       phy_interface_t phy_interface;
+       int max_speed;
+       uint32_t msg_enable;
        int oldspeed;
        int oldduplex;
        int oldlink;
+       int wol_en;
+
+       struct device_node *node;
 };
 
+void uec_set_ethtool_ops(struct net_device *netdev);
+int init_flow_control_params(u32 automatic_flow_control_mode,
+               int rx_flow_control_enable, int tx_flow_control_enable,
+               u16 pause_period, u16 extension_field,
+               u32 __iomem *upsmr_register, u32 __iomem *uempr_register,
+               u32 __iomem *maccfg1_register);
+
+
 #endif                         /* __UCC_GETH_H__ */