Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[safe/jmp/linux-2.6] / drivers / net / ipg.h
index a328221..dfc2541 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef __LINUX_IPG_H
 #define __LINUX_IPG_H
 
-#include <linux/version.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -21,7 +20,6 @@
 #include <linux/etherdevice.h>
 #include <linux/init.h>
 #include <linux/skbuff.h>
-#include <linux/version.h>
 #include <asm/bitops.h>
 
 /*
@@ -51,7 +49,7 @@
 /* I/O register offsets. */
 enum ipg_regs {
        DMA_CTRL                = 0x00,
-       RX_DMA_STATUS           = 0x08, // Unused + reserved
+       RX_DMA_STATUS           = 0x08, /* Unused + reserved */
        TFD_LIST_PTR_0          = 0x10,
        TFD_LIST_PTR_1          = 0x14,
        TX_DMA_BURST_THRESH     = 0x18,
@@ -64,21 +62,21 @@ enum ipg_regs {
        RX_DMA_POLL_PERIOD      = 0x26,
        DEBUG_CTRL              = 0x2c,
        ASIC_CTRL               = 0x30,
-       FIFO_CTRL               = 0x38, // Unused
+       FIFO_CTRL               = 0x38, /* Unused */
        FLOW_OFF_THRESH         = 0x3c,
        FLOW_ON_THRESH          = 0x3e,
        EEPROM_DATA             = 0x48,
        EEPROM_CTRL             = 0x4a,
-       EXPROM_ADDR             = 0x4c, // Unused
-       EXPROM_DATA             = 0x50, // Unused
-       WAKE_EVENT              = 0x51, // Unused
-       COUNTDOWN               = 0x54, // Unused
+       EXPROM_ADDR             = 0x4c, /* Unused */
+       EXPROM_DATA             = 0x50, /* Unused */
+       WAKE_EVENT              = 0x51, /* Unused */
+       COUNTDOWN               = 0x54, /* Unused */
        INT_STATUS_ACK          = 0x5a,
        INT_ENABLE              = 0x5c,
-       INT_STATUS              = 0x5e, // Unused
+       INT_STATUS              = 0x5e, /* Unused */
        TX_STATUS               = 0x60,
        MAC_CTRL                = 0x6c,
-       VLAN_TAG                = 0x70, // Unused
+       VLAN_TAG                = 0x70, /* Unused */
        PHY_SET                 = 0x75,
        PHY_CTRL                = 0x76,
        STATION_ADDRESS_0       = 0x78,
@@ -90,11 +88,11 @@ enum ipg_regs {
        HASHTABLE_1             = 0x90,
        RMON_STATISTICS_MASK    = 0x98,
        STATISTICS_MASK         = 0x9c,
-       RX_JUMBO_FRAMES         = 0xbc, // Unused
-       TCP_CHECKSUM_ERRORS     = 0xc0, // Unused
-       IP_CHECKSUM_ERRORS      = 0xc2, // Unused
-       UDP_CHECKSUM_ERRORS     = 0xc4, // Unused
-       TX_JUMBO_FRAMES         = 0xf4  // Unused
+       RX_JUMBO_FRAMES         = 0xbc, /* Unused */
+       TCP_CHECKSUM_ERRORS     = 0xc0, /* Unused */
+       IP_CHECKSUM_ERRORS      = 0xc2, /* Unused */
+       UDP_CHECKSUM_ERRORS     = 0xc4, /* Unused */
+       TX_JUMBO_FRAMES         = 0xf4  /* Unused */
 };
 
 /* Ethernet MIB statistic register offsets. */
@@ -516,7 +514,7 @@ enum ipg_regs {
 #define                IPG_DMALIST_ALIGN_PAD   0x07
 #define                IPG_MULTICAST_HASHTABLE_SIZE    0x40
 
-/* Number of miliseconds to wait after issuing a software reset.
+/* Number of milliseconds to wait after issuing a software reset.
  * 0x05 <= IPG_AC_RESETWAIT to account for proper 10Mbps operation.
  */
 #define         IPG_AC_RESETWAIT             0x05
@@ -536,83 +534,6 @@ enum ipg_regs {
  */
 #define                IPG_FRAMESBETWEENTXDMACOMPLETES 0x1
 
-#ifdef JUMBO_FRAME
-
-# ifdef JUMBO_FRAME_SIZE_2K
-# define JUMBO_FRAME_SIZE 2048
-# define __IPG_RXFRAG_SIZE 2048
-# else
-#  ifdef JUMBO_FRAME_SIZE_3K
-#  define JUMBO_FRAME_SIZE 3072
-#  define __IPG_RXFRAG_SIZE 3072
-#  else
-#   ifdef JUMBO_FRAME_SIZE_4K
-#   define JUMBO_FRAME_SIZE 4096
-#   define __IPG_RXFRAG_SIZE 4088
-#   else
-#    ifdef JUMBO_FRAME_SIZE_5K
-#    define JUMBO_FRAME_SIZE 5120
-#    define __IPG_RXFRAG_SIZE 4088
-#    else
-#     ifdef JUMBO_FRAME_SIZE_6K
-#     define JUMBO_FRAME_SIZE 6144
-#     define __IPG_RXFRAG_SIZE 4088
-#     else
-#      ifdef JUMBO_FRAME_SIZE_7K
-#      define JUMBO_FRAME_SIZE 7168
-#      define __IPG_RXFRAG_SIZE 4088
-#      else
-#       ifdef JUMBO_FRAME_SIZE_8K
-#       define JUMBO_FRAME_SIZE 8192
-#       define __IPG_RXFRAG_SIZE 4088
-#       else
-#        ifdef JUMBO_FRAME_SIZE_9K
-#        define JUMBO_FRAME_SIZE 9216
-#        define __IPG_RXFRAG_SIZE 4088
-#        else
-#         ifdef JUMBO_FRAME_SIZE_10K
-#         define JUMBO_FRAME_SIZE 10240
-#         define __IPG_RXFRAG_SIZE 4088
-#         else
-#         define JUMBO_FRAME_SIZE 4096
-#         endif
-#        endif
-#       endif
-#      endif
-#     endif
-#    endif
-#   endif
-#  endif
-# endif
-#endif
-
-/* Size of allocated received buffers. Nominally 0x0600.
- * Define larger if expecting jumbo frames.
- */
-#ifdef JUMBO_FRAME
-//IPG_TXFRAG_SIZE must <= 0x2b00, or TX will crash
-#define                IPG_TXFRAG_SIZE         JUMBO_FRAME_SIZE
-#endif
-
-/* Size of allocated received buffers. Nominally 0x0600.
- * Define larger if expecting jumbo frames.
- */
-#ifdef JUMBO_FRAME
-//4088=4096-8
-#define                IPG_RXFRAG_SIZE         __IPG_RXFRAG_SIZE
-#define     IPG_RXSUPPORT_SIZE   IPG_MAX_RXFRAME_SIZE
-#else
-#define                IPG_RXFRAG_SIZE         0x0600
-#define     IPG_RXSUPPORT_SIZE   IPG_RXFRAG_SIZE
-#endif
-
-/* IPG_MAX_RXFRAME_SIZE <= IPG_RXFRAG_SIZE */
-#ifdef JUMBO_FRAME
-#define                IPG_MAX_RXFRAME_SIZE            JUMBO_FRAME_SIZE
-#else
-#define                IPG_MAX_RXFRAME_SIZE            0x0600
-#endif
-
 #define                IPG_RFDLIST_LENGTH              0x100
 
 /* Maximum number of RFDs to process per interrupt.
@@ -626,9 +547,9 @@ enum ipg_regs {
 #define                IPG_MINUSEDRFDSTOFREE   0x80
 
 /* specify the jumbo frame maximum size
- * per unit is 0x600 (the RxBuffer size that one RFD can carry)
+ * per unit is 0x600 (the rx_buffer size that one RFD can carry)
  */
-#define     MAX_JUMBOSIZE              0x8     // max is 12K
+#define     MAX_JUMBOSIZE              0x8     /* max is 12K */
 
 /* Key register values loaded at driver start up. */
 
@@ -767,11 +688,12 @@ struct ipg_rx {
        __le64 frag_info;
 };
 
-struct SJumbo {
-       int FoundStart;
-       int CurrentSize;
+struct ipg_jumbo {
+       int found_start;
+       int current_size;
        struct sk_buff *skb;
 };
+
 /* Structure of IPG NIC specific data. */
 struct ipg_nic_private {
        void __iomem *ioaddr;
@@ -779,15 +701,17 @@ struct ipg_nic_private {
        struct ipg_rx *rxd;
        dma_addr_t txd_map;
        dma_addr_t rxd_map;
-       struct sk_buff *TxBuff[IPG_TFDLIST_LENGTH];
-       struct sk_buff *RxBuff[IPG_RFDLIST_LENGTH];
+       struct sk_buff *tx_buff[IPG_TFDLIST_LENGTH];
+       struct sk_buff *rx_buff[IPG_RFDLIST_LENGTH];
        unsigned int tx_current;
        unsigned int tx_dirty;
        unsigned int rx_current;
        unsigned int rx_dirty;
-#ifdef JUMBO_FRAME
-       struct SJumbo Jumbo;
-#endif
+       bool is_jumbo;
+       struct ipg_jumbo jumbo;
+       unsigned long rxfrag_size;
+       unsigned long rxsupport_size;
+       unsigned long max_rxframe_size;
        unsigned int rx_buf_sz;
        struct pci_dev *pdev;
        struct net_device *dev;
@@ -795,12 +719,12 @@ struct ipg_nic_private {
        spinlock_t lock;
        int tenmbpsmode;
 
-       u16 LED_Mode;
+       u16 led_mode;
        u16 station_addr[3];    /* Station Address in EEPROM Reg 0x10..0x12 */
 
        struct mutex            mii_mutex;
        struct mii_if_info      mii_if;
-       int ResetCurrentTFD;
+       int reset_current_tfd;
 #ifdef IPG_DEBUG
        int RFDlistendCount;
        int RFDListCheckedCount;