]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/gianfar.h
r8169: update the phy init for the 8168C
[linux-2.6-omap-h63xx.git] / drivers / net / gianfar.h
index d37d5401be6ece4fb506527cb7104956b0723f50..c16cc8b946a92be6a762495b5b7c0c4cf0eb521a 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef __GIANFAR_H
 #define __GIANFAR_H
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
@@ -46,7 +45,6 @@
 #include <linux/crc32.h>
 #include <linux/workqueue.h>
 #include <linux/ethtool.h>
-#include <linux/netdevice.h>
 #include <linux/fsl_devices.h>
 #include "gianfar_mii.h"
 
@@ -137,6 +135,12 @@ extern const char gfar_driver_version[];
 #define MIIMCFG_RESET           0x80000000
 #define MIIMIND_BUSY            0x00000001
 
+/* TBI register addresses */
+#define MII_TBICON             0x11
+
+/* TBICON register bit fields */
+#define TBICON_CLK_SELECT      0x0020
+
 /* MAC register bits */
 #define MACCFG1_SOFT_RESET     0x80000000
 #define MACCFG1_RESET_RX_MC    0x00080000
@@ -161,7 +165,10 @@ extern const char gfar_driver_version[];
 
 #define ECNTRL_INIT_SETTINGS   0x00001000
 #define ECNTRL_TBI_MODE         0x00000020
+#define ECNTRL_REDUCED_MODE    0x00000010
 #define ECNTRL_R100            0x00000008
+#define ECNTRL_REDUCED_MII_MODE        0x00000004
+#define ECNTRL_SGMII_MODE      0x00000002
 
 #define MRBLR_INIT_SETTINGS    DEFAULT_RX_BUFFER_SIZE
 
@@ -656,43 +663,65 @@ struct gfar {
  * the buffer descriptor determines the actual condition.
  */
 struct gfar_private {
-       /* pointers to arrays of skbuffs for tx and rx */
+       /* Fields controlled by TX lock */
+       spinlock_t txlock;
+
+       /* Pointer to the array of skbuffs */
        struct sk_buff ** tx_skbuff;
-       struct sk_buff ** rx_skbuff;
 
-       /* indices pointing to the next free sbk in skb arrays */
+       /* next free skb in the array */
        u16 skb_curtx;
-       u16 skb_currx;
 
-       /* index of the first skb which hasn't been transmitted
-        * yet. */
+       /* First skb in line to be transmitted */
        u16 skb_dirtytx;
 
        /* Configuration info for the coalescing features */
        unsigned char txcoalescing;
        unsigned short txcount;
        unsigned short txtime;
+
+       /* Buffer descriptor pointers */
+       struct txbd8 *tx_bd_base;       /* First tx buffer descriptor */
+       struct txbd8 *cur_tx;           /* Next free ring entry */
+       struct txbd8 *dirty_tx;         /* First buffer in line
+                                          to be transmitted */
+       unsigned int tx_ring_size;
+
+       /* RX Locked fields */
+       spinlock_t rxlock;
+
+       struct net_device *dev;
+       struct napi_struct napi;
+
+       /* skb array and index */
+       struct sk_buff ** rx_skbuff;
+       u16 skb_currx;
+
+       /* RX Coalescing values */
        unsigned char rxcoalescing;
        unsigned short rxcount;
        unsigned short rxtime;
 
-       /* GFAR addresses */
-       struct rxbd8 *rx_bd_base;       /* Base addresses of Rx and Tx Buffers */
-       struct txbd8 *tx_bd_base;
+       struct rxbd8 *rx_bd_base;       /* First Rx buffers */
        struct rxbd8 *cur_rx;           /* Next free rx ring entry */
-       struct txbd8 *cur_tx;           /* Next free ring entry */
-       struct txbd8 *dirty_tx;         /* The Ring entry to be freed. */
-       struct gfar __iomem *regs;      /* Pointer to the GFAR memory mapped Registers */
-       u32 __iomem *hash_regs[16];
-       int hash_width;
-       struct net_device_stats stats; /* linux network statistics */
-       struct gfar_extra_stats extra_stats;
-       spinlock_t lock;
+
+       /* RX parameters */
+       unsigned int rx_ring_size;
        unsigned int rx_buffer_size;
        unsigned int rx_stash_size;
        unsigned int rx_stash_index;
-       unsigned int tx_ring_size;
-       unsigned int rx_ring_size;
+
+       struct vlan_group *vlgrp;
+
+       /* Unprotected fields */
+       /* Pointer to the GFAR memory mapped Registers */
+       struct gfar __iomem *regs;
+
+       /* Hash registers and their width */
+       u32 __iomem *hash_regs[16];
+       int hash_width;
+
+       /* global parameters */
        unsigned int fifo_threshold;
        unsigned int fifo_starve;
        unsigned int fifo_starve_off;
@@ -702,13 +731,15 @@ struct gfar_private {
                extended_hash:1,
                bd_stash_en:1;
        unsigned short padding;
-       struct vlan_group *vlgrp;
-       /* Info structure initialized by board setup code */
+
        unsigned int interruptTransmit;
        unsigned int interruptReceive;
        unsigned int interruptError;
+
+       /* info structure initialized by platform code */
        struct gianfar_platform_data *einfo;
 
+       /* PHY stuff */
        struct phy_device *phydev;
        struct mii_bus *mii_bus;
        int oldspeed;
@@ -716,6 +747,10 @@ struct gfar_private {
        int oldlink;
 
        uint32_t msg_enable;
+
+       /* Network Statistics */
+       struct net_device_stats stats;
+       struct gfar_extra_stats extra_stats;
 };
 
 static inline u32 gfar_read(volatile unsigned __iomem *addr)
@@ -730,9 +765,7 @@ static inline void gfar_write(volatile unsigned __iomem *addr, u32 val)
        out_be32(addr, val);
 }
 
-extern struct ethtool_ops *gfar_op_array[];
-
-extern irqreturn_t gfar_receive(int irq, void *dev_id, struct pt_regs *regs);
+extern irqreturn_t gfar_receive(int irq, void *dev_id);
 extern int startup_gfar(struct net_device *dev);
 extern void stop_gfar(struct net_device *dev);
 extern void gfar_halt(struct net_device *dev);