Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git] / drivers / net / via-velocity.h
index 9a187de..b9e114d 100644 (file)
@@ -29,7 +29,9 @@
 
 #define VELOCITY_NAME          "via-velocity"
 #define VELOCITY_FULL_DRV_NAM  "VIA Networking Velocity Family Gigabit Ethernet Adapter Driver"
-#define VELOCITY_VERSION       "1.13"
+#define VELOCITY_VERSION       "1.14"
+
+#define VELOCITY_IO_SIZE       256
 
 #define PKT_BUF_SZ          1540
 
@@ -244,7 +246,7 @@ struct tdesc1 {
 struct td_buf {
        u32 pa_low;
        u16 pa_high;
-       u16 bufsize:14; 
+       u16 bufsize:14;
        u16 reserved:1;
        u16 queue:1;
 } __attribute__ ((__packed__));
@@ -260,25 +262,6 @@ struct velocity_rd_info {
        dma_addr_t skb_dma;
 };
 
-/**
- *     alloc_rd_info           -       allocate an rd info block
- *
- *     Alocate and initialize a receive info structure used for keeping
- *     track of kernel side information related to each receive
- *     descriptor we are using
- */
-
-static inline struct velocity_rd_info *alloc_rd_info(void)
-{
-       struct velocity_rd_info *ptr;
-       if ((ptr = kmalloc(sizeof(struct velocity_rd_info), GFP_ATOMIC)) == NULL)
-               return NULL;
-       else {
-               memset(ptr, 0, sizeof(struct velocity_rd_info));
-               return ptr;
-       }
-}
-
 /*
  *     Used to track transmit side buffers.
  */
@@ -291,10 +274,10 @@ struct velocity_td_info {
        dma_addr_t buf_dma;
 };
 
-enum {
+enum  velocity_owner {
        OWNED_BY_HOST = 0,
        OWNED_BY_NIC = 1
-} velocity_owner;
+};
 
 
 /*
@@ -307,7 +290,7 @@ enum {
 #define TX_QUEUE_NO         4
 
 #define MAX_HW_MIB_COUNTER  32
-#define VELOCITY_MIN_MTU    (1514-14)
+#define VELOCITY_MIN_MTU    (64)
 #define VELOCITY_MAX_MTU    (9000)
 
 /*
@@ -1191,7 +1174,6 @@ enum chip_type {
 struct velocity_info_tbl {
        enum chip_type chip_id;
        char *name;
-       int io_size;
        int txqueue;
        u32 flags;
 };
@@ -1270,7 +1252,7 @@ enum velocity_cam_type {
  *     provided mask buffer.
  */
 
-static inline void mac_get_cam_mask(struct mac_regs * regs, u8 * mask, enum velocity_cam_type cam_type)
+static inline void mac_get_cam_mask(struct mac_regs __iomem * regs, u8 * mask, enum velocity_cam_type cam_type)
 {
        int i;
        /* Select CAM mask */
@@ -1302,7 +1284,7 @@ static inline void mac_get_cam_mask(struct mac_regs * regs, u8 * mask, enum velo
  *     Store a new mask into a CAM
  */
 
-static inline void mac_set_cam_mask(struct mac_regs * regs, u8 * mask, enum velocity_cam_type cam_type)
+static inline void mac_set_cam_mask(struct mac_regs __iomem * regs, u8 * mask, enum velocity_cam_type cam_type)
 {
        int i;
        /* Select CAM mask */
@@ -1333,7 +1315,7 @@ static inline void mac_set_cam_mask(struct mac_regs * regs, u8 * mask, enum velo
  *     Load an address or vlan tag into a CAM
  */
 
-static inline void mac_set_cam(struct mac_regs * regs, int idx, u8 *addr, enum velocity_cam_type cam_type)
+static inline void mac_set_cam(struct mac_regs __iomem * regs, int idx, u8 *addr, enum velocity_cam_type cam_type)
 {
        int i;
 
@@ -1375,7 +1357,7 @@ static inline void mac_set_cam(struct mac_regs * regs, int idx, u8 *addr, enum v
  *     the caller. VLAN tags are 2 bytes the address cam entries are 6.
  */
 
-static inline void mac_get_cam(struct mac_regs * regs, int idx, u8 *addr, enum velocity_cam_type cam_type)
+static inline void mac_get_cam(struct mac_regs __iomem * regs, int idx, u8 *addr, enum velocity_cam_type cam_type)
 {
        int i;
 
@@ -1414,7 +1396,7 @@ static inline void mac_get_cam(struct mac_regs * regs, int idx, u8 *addr, enum v
  *     the rest of the logic from the result of sleep/wakeup
  */
 
-inline static void mac_wol_reset(struct mac_regs * regs)
+static inline void mac_wol_reset(struct mac_regs __iomem * regs)
 {
 
        /* Turn off SWPTAG right after leaving power mode */
@@ -1739,10 +1721,6 @@ struct velocity_info {
        struct net_device *dev;
        struct net_device_stats stats;
 
-#ifdef CONFIG_PM
-       u32 pci_state[16];
-#endif
-
        dma_addr_t rd_pool_dma;
        dma_addr_t td_pool_dma[TX_QUEUE_NO];
 
@@ -1752,10 +1730,9 @@ struct velocity_info {
        u8 ip_addr[4];
        enum chip_type chip_id;
 
-       struct mac_regs * mac_regs;
+       struct mac_regs __iomem * mac_regs;
        unsigned long memaddr;
        unsigned long ioaddr;
-       u32 io_size;
 
        u8 rev_id;
 
@@ -1815,7 +1792,7 @@ struct velocity_info {
  *     CHECK ME: locking
  */
 
-inline static int velocity_get_ip(struct velocity_info *vptr)
+static inline int velocity_get_ip(struct velocity_info *vptr)
 {
        struct in_device *in_dev = (struct in_device *) vptr->dev->ip_ptr;
        struct in_ifaddr *ifa;
@@ -1865,7 +1842,7 @@ static inline void velocity_update_hw_mibs(struct velocity_info *vptr)
 
 static inline void init_flow_control_register(struct velocity_info *vptr)
 {
-       struct mac_regs * regs = vptr->mac_regs;
+       struct mac_regs __iomem * regs = vptr->mac_regs;
 
        /* Set {XHITH1, XHITH0, XLTH1, XLTH0} in FlowCR1 to {1, 0, 1, 1}
           depend on RD=64, and Turn on XNOEN in FlowCR1 */