Pull acpi_device_handle_cleanup into release branch
[pandora-kernel.git] / drivers / net / bnx2.h
index fd4b7f2..658c5ee 100644 (file)
 #ifndef BNX2_H
 #define BNX2_H
 
-#include <linux/config.h>
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-
-#include <linux/kernel.h>
-#include <linux/timer.h>
-#include <linux/errno.h>
-#include <linux/ioport.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-#include <linux/interrupt.h>
-#include <linux/pci.h>
-#include <linux/init.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-#include <linux/dma-mapping.h>
-#include <asm/bitops.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <linux/delay.h>
-#include <asm/byteorder.h>
-#include <linux/time.h>
-#include <linux/ethtool.h>
-#include <linux/mii.h>
-#ifdef NETIF_F_HW_VLAN_TX
-#include <linux/if_vlan.h>
-#define BCM_VLAN 1
-#endif
-#ifdef NETIF_F_TSO
-#include <net/ip.h>
-#include <net/tcp.h>
-#include <net/checksum.h>
-#define BCM_TSO 1
-#endif
-#include <linux/workqueue.h>
-#include <linux/crc32.h>
-#include <linux/prefetch.h>
-
 /* Hardware data structures and register definitions automatically
  * generated from RTL code. Do not modify.
  */
@@ -271,6 +231,7 @@ struct statistics_block {
        u32 stat_GenStat13;
        u32 stat_GenStat14;
        u32 stat_GenStat15;
+       u32 stat_FwRxDrop;
 };
 
 
@@ -3521,6 +3482,8 @@ struct l2_fhdr {
 
 #define BNX2_COM_SCRATCH                               0x00120000
 
+#define BNX2_FW_RX_DROP_COUNT                           0x00120084
+
 
 /*
  *  cp_reg definition
@@ -3787,7 +3750,12 @@ struct l2_fhdr {
 #define DMA_READ_CHANS 5
 #define DMA_WRITE_CHANS        3
 
-#define BCM_PAGE_BITS  12
+/* Use CPU native page size up to 16K for the ring sizes.  */
+#if (PAGE_SHIFT > 14)
+#define BCM_PAGE_BITS  14
+#else
+#define BCM_PAGE_BITS  PAGE_SHIFT
+#endif
 #define BCM_PAGE_SIZE  (1 << BCM_PAGE_BITS)
 
 #define TX_DESC_CNT  (BCM_PAGE_SIZE / sizeof(struct tx_bd))
@@ -3810,7 +3778,7 @@ struct l2_fhdr {
 
 #define RX_RING_IDX(x) ((x) & bp->rx_max_ring_idx)
 
-#define RX_RING(x) (((x) & ~MAX_RX_DESC_CNT) >> 8)
+#define RX_RING(x) (((x) & ~MAX_RX_DESC_CNT) >> (BCM_PAGE_BITS - 4))
 #define RX_IDX(x) ((x) & MAX_RX_DESC_CNT)
 
 /* Context size. */
@@ -3917,15 +3885,17 @@ struct bnx2 {
 #define USING_MSI_FLAG                 0x20
 #define ASF_ENABLE_FLAG                        0x40
 
-       struct tx_bd            *tx_desc_ring;
-       struct sw_bd            *tx_buf_ring;
-       u32                     tx_prod_bseq;
-       u16                     tx_prod;
-       u16                     tx_cons;
-       int                     tx_ring_size;
+       /* Put tx producer and consumer fields in separate cache lines. */
 
-       u16                     hw_tx_cons;
-       u16                     hw_rx_cons;
+       u32             tx_prod_bseq __attribute__((aligned(L1_CACHE_BYTES)));
+       u16             tx_prod;
+
+       struct tx_bd    *tx_desc_ring;
+       struct sw_bd    *tx_buf_ring;
+       int             tx_ring_size;
+
+       u16             tx_cons __attribute__((aligned(L1_CACHE_BYTES)));
+       u16             hw_tx_cons;
 
 #ifdef BCM_VLAN 
        struct                  vlan_group *vlgrp;
@@ -3939,6 +3909,7 @@ struct bnx2 {
        u32                     rx_prod_bseq;
        u16                     rx_prod;
        u16                     rx_cons;
+       u16                     hw_rx_cons;
 
        u32                     rx_csum;
 
@@ -4038,6 +4009,7 @@ struct bnx2 {
        struct statistics_block *stats_blk;
        dma_addr_t              stats_blk_mapping;
 
+       u32                     hc_cmd;
        u32                     rx_mode;
 
        u16                     req_line_speed;
@@ -4082,6 +4054,11 @@ struct bnx2 {
 
        struct flash_spec       *flash_info;
        u32                     flash_size;
+
+       int                     status_stats_size;
+
+       struct z_stream_s       *strm;
+       void                    *gunzip_buf;
 };
 
 static u32 bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset);
@@ -4197,6 +4174,7 @@ struct fw_info {
 #define BNX2_DRV_MSG_CODE_PULSE                         0x06000000
 #define BNX2_DRV_MSG_CODE_DIAG                  0x07000000
 #define BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL        0x09000000
+#define BNX2_DRV_MSG_CODE_UNLOAD_LNK_DN                 0x0b000000
 
 #define BNX2_DRV_MSG_DATA                       0x00ff0000
 #define BNX2_DRV_MSG_DATA_WAIT0                         0x00010000