Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[safe/jmp/linux-2.6] / drivers / net / ucc_geth.h
index 48fde5a..ef1fbeb 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>
  *
@@ -80,16 +80,16 @@ struct ucc_geth {
                                   frames) received that were between 128
                                   (Including FCS length==4) and 255 octets */
        u32 txok;               /* Total number of octets residing in frames
-                                  that where involved in succesfull
+                                  that where involved in successfull
                                   transmission */
        u16 txcf;               /* Total number of PAUSE control frames
                                   transmitted by this MAC */
        u8 res4[0x2];
        u32 tmca;               /* Total number of frames that were transmitted
-                                  succesfully with the group address bit set
+                                  successfully with the group address bit set
                                   that are not broadcast frames */
        u32 tbca;               /* Total number of frames transmitted
-                                  succesfully that had destination address
+                                  successfully that had destination address
                                   field equal to the broadcast address */
        u32 rxfok;              /* Total number of frames received OK */
        u32 rxbok;              /* Total number of octets received OK */
@@ -98,9 +98,9 @@ struct ucc_geth {
                                   HW because it includes octets in frames that
                                   never even reach the UCC */
        u32 rmca;               /* Total number of frames that were received
-                                  succesfully with the group address bit set
+                                  successfully with the group address bit set
                                   that are not broadcast frames */
-       u32 rbca;               /* Total number of frames received succesfully
+       u32 rbca;               /* Total number of frames received successfully
                                   that had destination address equal to the
                                   broadcast address */
        u32 scar;               /* Statistics carry register */
@@ -193,6 +193,31 @@ struct ucc_geth {
 #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
                                                                   Rx */
@@ -734,15 +759,15 @@ struct ucc_geth_hardware_statistics {
                                   frames) received that were between 128
                                   (Including FCS length==4) and 255 octets */
        u32 txok;               /* Total number of octets residing in frames
-                                  that where involved in succesfull
+                                  that where involved in successfull
                                   transmission */
        u16 txcf;               /* Total number of PAUSE control frames
                                   transmitted by this MAC */
        u32 tmca;               /* Total number of frames that were transmitted
-                                  succesfully with the group address bit set
+                                  successfully with the group address bit set
                                   that are not broadcast frames */
        u32 tbca;               /* Total number of frames transmitted
-                                  succesfully that had destination address
+                                  successfully that had destination address
                                   field equal to the broadcast address */
        u32 rxfok;              /* Total number of frames received OK */
        u32 rxbok;              /* Total number of octets received OK */
@@ -751,9 +776,9 @@ struct ucc_geth_hardware_statistics {
                                   HW because it includes octets in frames that
                                   never even reach the UCC */
        u32 rmca;               /* Total number of frames that were received
-                                  succesfully with the group address bit set
+                                  successfully with the group address bit set
                                   that are not broadcast frames */
-       u32 rbca;               /* Total number of frames received succesfully
+       u32 rbca;               /* Total number of frames received successfully
                                   that had destination address equal to the
                                   broadcast address */
 } __attribute__ ((packed));
@@ -813,13 +838,13 @@ struct ucc_geth_hardware_statistics {
                                                           using the maximum is
                                                           easier */
 #define UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT 32
-#define UCC_GETH_SCHEDULER_ALIGNMENT           4       /* This is a guess */
+#define UCC_GETH_SCHEDULER_ALIGNMENT           8       /* 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     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
+#define UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT 8   /* This
                                                                           is a
                                                                           guess
                                                                         */
@@ -852,7 +877,6 @@ struct ucc_geth_hardware_statistics {
 /* 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)
@@ -875,16 +899,17 @@ struct ucc_geth_hardware_statistics {
 #define UCC_GETH_UTFS_INIT                      512    /* Tx virtual FIFO size
                                                         */
 #define UCC_GETH_UTFET_INIT                     256    /* 1/2 utfs */
-#define UCC_GETH_UTFTT_INIT                     128
+#define UCC_GETH_UTFTT_INIT                     512
 /* Gigabit Ethernet (1000 Mbps) */
 #define UCC_GETH_URFS_GIGA_INIT                 4096/*2048*/   /* Rx virtual
                                                                   FIFO size */
 #define UCC_GETH_URFET_GIGA_INIT                2048/*1024*/   /* 1/2 urfs */
 #define UCC_GETH_URFSET_GIGA_INIT               3072/*1536*/   /* 3/4 urfs */
-#define UCC_GETH_UTFS_GIGA_INIT                 8192/*2048*/   /* Tx virtual
+#define UCC_GETH_UTFS_GIGA_INIT                 4096/*2048*/   /* Tx virtual
+                                                                  FIFO size */
+#define UCC_GETH_UTFET_GIGA_INIT                2048/*1024*/   /* 1/2 utfs */
+#define UCC_GETH_UTFTT_GIGA_INIT                4096/*0x40*/   /* Tx virtual
                                                                   FIFO size */
-#define UCC_GETH_UTFET_GIGA_INIT                4096/*1024*/   /* 1/2 utfs */
-#define UCC_GETH_UTFTT_GIGA_INIT                0x400/*0x40*/  /* */
 
 #define UCC_GETH_REMODER_INIT                   0      /* bits that must be
                                                           set */
@@ -1100,7 +1125,8 @@ struct ucc_geth_info {
        u32 eventRegMask;
        u16 pausePeriod;
        u16 extensionField;
-       char phy_bus_id[BUS_ID_SIZE];
+       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];
@@ -1120,15 +1146,16 @@ 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 device *dev;
+       struct net_device *ndev;
        struct napi_struct napi;
        struct work_struct timeout_work;
        struct ucc_geth __iomem *ug_regs;
@@ -1186,6 +1213,8 @@ struct ucc_geth_private {
        /* index of the first skb which hasn't been transmitted yet. */
        u16 skb_dirtytx[NUM_TX_QUEUES];
 
+       struct sk_buff_head rx_recycle;
+
        struct ugeth_mii_info *mii_info;
        struct phy_device *phydev;
        phy_interface_t phy_interface;
@@ -1194,6 +1223,7 @@ struct ucc_geth_private {
        int oldspeed;
        int oldduplex;
        int oldlink;
+       int wol_en;
 
        struct device_node *node;
 };