b44: the poll handler b44_poll must not enable IRQ unconditionally
[linux-2.6-microblaze.git] / drivers / net / bnx2x.h
index 633acca..bbf8422 100644 (file)
 #define REG_RD_DMAE(bp, offset, valp, len32) \
        do { \
                bnx2x_read_dmae(bp, offset, len32);\
-               memcpy(valp, bnx2x_sp(bp, wb_data[0]), len32 * 4); \
+               memcpy(valp, bnx2x_sp(bp, wb_data[0]), (len32) * 4); \
        } while (0)
 
 #define REG_WR_DMAE(bp, offset, valp, len32) \
        do { \
-               memcpy(bnx2x_sp(bp, wb_data[0]), valp, len32 * 4); \
+               memcpy(bnx2x_sp(bp, wb_data[0]), valp, (len32) * 4); \
                bnx2x_write_dmae(bp, bnx2x_sp_mapping(bp, wb_data), \
                                 offset, len32); \
        } while (0)
 
+#define VIRT_WR_DMAE_LEN(bp, data, addr, len32) \
+       do { \
+               memcpy(GUNZIP_BUF(bp), data, (len32) * 4); \
+               bnx2x_write_big_buf_wb(bp, addr, len32); \
+       } while (0)
+
 #define SHMEM_ADDR(bp, field)          (bp->common.shmem_base + \
                                         offsetof(struct shmem_region, field))
 #define SHMEM_RD(bp, field)            REG_RD(bp, SHMEM_ADDR(bp, field))
@@ -308,9 +314,11 @@ struct bnx2x_fastpath {
        __le16                  *rx_cons_sb;
        __le16                  *rx_bd_cons_sb;
 
+
        unsigned long           tx_pkt,
                                rx_pkt,
                                rx_calls;
+
        /* TPA related */
        struct sw_rx_bd         tpa_pool[ETH_MAX_AGGREGATION_QUEUES_E1H];
        u8                      tpa_state[ETH_MAX_AGGREGATION_QUEUES_E1H];
@@ -973,7 +981,6 @@ struct bnx2x {
        int                     dmae_ready;
        /* used to synchronize dmae accesses */
        struct mutex            dmae_mutex;
-       struct dmae_command     init_dmae;
 
        /* used to synchronize stats collecting */
        int                     stats_state;
@@ -989,22 +996,37 @@ struct bnx2x {
        dma_addr_t              gunzip_mapping;
        int                     gunzip_outlen;
 #define FW_BUF_SIZE                    0x8000
+#define GUNZIP_BUF(bp)                 (bp->gunzip_buf)
+#define GUNZIP_PHYS(bp)                        (bp->gunzip_mapping)
+#define GUNZIP_OUTLEN(bp)              (bp->gunzip_outlen)
 
-       struct raw_op          *init_ops;
+       struct raw_op           *init_ops;
        /* Init blocks offsets inside init_ops */
-       u16                    *init_ops_offsets;
+       u16                     *init_ops_offsets;
        /* Data blob - has 32 bit granularity */
-       u32                    *init_data;
+       u32                     *init_data;
        /* Zipped PRAM blobs - raw data */
-       const u8               *tsem_int_table_data;
-       const u8               *tsem_pram_data;
-       const u8               *usem_int_table_data;
-       const u8               *usem_pram_data;
-       const u8               *xsem_int_table_data;
-       const u8               *xsem_pram_data;
-       const u8               *csem_int_table_data;
-       const u8               *csem_pram_data;
-        const struct firmware  *firmware;
+       const u8                *tsem_int_table_data;
+       const u8                *tsem_pram_data;
+       const u8                *usem_int_table_data;
+       const u8                *usem_pram_data;
+       const u8                *xsem_int_table_data;
+       const u8                *xsem_pram_data;
+       const u8                *csem_int_table_data;
+       const u8                *csem_pram_data;
+#define INIT_OPS(bp)                   (bp->init_ops)
+#define INIT_OPS_OFFSETS(bp)           (bp->init_ops_offsets)
+#define INIT_DATA(bp)                  (bp->init_data)
+#define INIT_TSEM_INT_TABLE_DATA(bp)   (bp->tsem_int_table_data)
+#define INIT_TSEM_PRAM_DATA(bp)                (bp->tsem_pram_data)
+#define INIT_USEM_INT_TABLE_DATA(bp)   (bp->usem_int_table_data)
+#define INIT_USEM_PRAM_DATA(bp)                (bp->usem_pram_data)
+#define INIT_XSEM_INT_TABLE_DATA(bp)   (bp->xsem_int_table_data)
+#define INIT_XSEM_PRAM_DATA(bp)                (bp->xsem_pram_data)
+#define INIT_CSEM_INT_TABLE_DATA(bp)   (bp->csem_int_table_data)
+#define INIT_CSEM_PRAM_DATA(bp)                (bp->csem_pram_data)
+
+       const struct firmware   *firmware;
 };
 
 
@@ -1031,6 +1053,9 @@ int bnx2x_get_gpio(struct bnx2x *bp, int gpio_num, u8 port);
 int bnx2x_set_gpio(struct bnx2x *bp, int gpio_num, u32 mode, u8 port);
 int bnx2x_set_gpio_int(struct bnx2x *bp, int gpio_num, u32 mode, u8 port);
 u32 bnx2x_fw_command(struct bnx2x *bp, u32 command);
+void bnx2x_reg_wr_ind(struct bnx2x *bp, u32 addr, u32 val);
+void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr,
+                              u32 addr, u32 len);
 
 static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
                           int wait)
@@ -1088,9 +1113,9 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
 #define DMAE_COMP_VAL                  0xe0d0d0ae
 
 #define MAX_DMAE_C_PER_PORT            8
-#define INIT_DMAE_C(bp)                        (BP_PORT(bp)*MAX_DMAE_C_PER_PORT + \
+#define INIT_DMAE_C(bp)                        (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \
                                         BP_E1HVN(bp))
-#define PMF_DMAE_C(bp)                 (BP_PORT(bp)*MAX_DMAE_C_PER_PORT + \
+#define PMF_DMAE_C(bp)                 (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \
                                         E1HVN_MAX)
 
 
@@ -1115,7 +1140,8 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
 
 
 /* must be used on a CID before placing it on a HW ring */
-#define HW_CID(bp, x)          ((BP_PORT(bp) << 23) | (BP_E1HVN(bp) << 17) | x)
+#define HW_CID(bp, x)                  ((BP_PORT(bp) << 23) | \
+                                        (BP_E1HVN(bp) << 17) | (x))
 
 #define SP_DESC_CNT            (BCM_PAGE_SIZE / sizeof(struct eth_spe))
 #define MAX_SP_DESC_CNT                        (SP_DESC_CNT - 1)
@@ -1203,8 +1229,8 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
                                 AEU_INPUTS_ATTN_BITS_QM_PARITY_ERROR | \
                                 AEU_INPUTS_ATTN_BITS_XSDM_PARITY_ERROR | \
                                 AEU_INPUTS_ATTN_BITS_XSEMI_PARITY_ERROR | \
-                               AEU_INPUTS_ATTN_BITS_DOORBELLQ_PARITY_ERROR |\
-                           AEU_INPUTS_ATTN_BITS_VAUX_PCI_CORE_PARITY_ERROR |\
+                                AEU_INPUTS_ATTN_BITS_DOORBELLQ_PARITY_ERROR |\
+                            AEU_INPUTS_ATTN_BITS_VAUX_PCI_CORE_PARITY_ERROR |\
                                 AEU_INPUTS_ATTN_BITS_DEBUG_PARITY_ERROR | \
                                 AEU_INPUTS_ATTN_BITS_USDM_PARITY_ERROR | \
                                 AEU_INPUTS_ATTN_BITS_USEMI_PARITY_ERROR | \
@@ -1232,7 +1258,6 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
                 TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY | \
                 (bp->multi_mode << \
                  TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT))
-
 #define MULTI_MASK                     0x7f