Commit 37b091ba authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

bnx2x: Add hw init code to support iSCSI.

Add code to initialize hardware blocks used for iSCSI.
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarShmulik Ravid - Rabinovitz <shmulikr@broadcom.com>
Acked-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e665bfda
...@@ -762,7 +762,11 @@ struct bnx2x_eth_stats { ...@@ -762,7 +762,11 @@ struct bnx2x_eth_stats {
(offsetof(struct bnx2x_eth_stats, stat_name) / 4) (offsetof(struct bnx2x_eth_stats, stat_name) / 4)
#ifdef BCM_CNIC
#define MAX_CONTEXT 15
#else
#define MAX_CONTEXT 16 #define MAX_CONTEXT 16
#endif
union cdu_context { union cdu_context {
struct eth_context eth; struct eth_context eth;
...@@ -811,13 +815,21 @@ struct bnx2x { ...@@ -811,13 +815,21 @@ struct bnx2x {
struct bnx2x_fastpath fp[MAX_CONTEXT]; struct bnx2x_fastpath fp[MAX_CONTEXT];
void __iomem *regview; void __iomem *regview;
void __iomem *doorbells; void __iomem *doorbells;
#ifdef BCM_CNIC
#define BNX2X_DB_SIZE (18*BCM_PAGE_SIZE)
#else
#define BNX2X_DB_SIZE (16*BCM_PAGE_SIZE) #define BNX2X_DB_SIZE (16*BCM_PAGE_SIZE)
#endif
struct net_device *dev; struct net_device *dev;
struct pci_dev *pdev; struct pci_dev *pdev;
atomic_t intr_sem; atomic_t intr_sem;
#ifdef BCM_CNIC
struct msix_entry msix_table[MAX_CONTEXT+2];
#else
struct msix_entry msix_table[MAX_CONTEXT+1]; struct msix_entry msix_table[MAX_CONTEXT+1];
#endif
#define INT_MODE_INTx 1 #define INT_MODE_INTx 1
#define INT_MODE_MSI 2 #define INT_MODE_MSI 2
#define INT_MODE_MSIX 3 #define INT_MODE_MSIX 3
...@@ -891,6 +903,11 @@ struct bnx2x { ...@@ -891,6 +903,11 @@ struct bnx2x {
#define BP_E1HVN(bp) (bp->func >> 1) #define BP_E1HVN(bp) (bp->func >> 1)
#define BP_L_ID(bp) (BP_E1HVN(bp) << 2) #define BP_L_ID(bp) (BP_E1HVN(bp) << 2)
#ifdef BCM_CNIC
#define BCM_CNIC_CID_START 16
#define BCM_ISCSI_ETH_CL_ID 17
#endif
int pm_cap; int pm_cap;
int pcie_cap; int pcie_cap;
int mrrs; int mrrs;
...@@ -960,12 +977,19 @@ struct bnx2x { ...@@ -960,12 +977,19 @@ struct bnx2x {
#define BNX2X_MAX_MULTICAST 64 #define BNX2X_MAX_MULTICAST 64
#define BNX2X_MAX_EMUL_MULTI 16 #define BNX2X_MAX_EMUL_MULTI 16
u32 rx_mode_cl_mask;
dma_addr_t def_status_blk_mapping; dma_addr_t def_status_blk_mapping;
struct bnx2x_slowpath *slowpath; struct bnx2x_slowpath *slowpath;
dma_addr_t slowpath_mapping; dma_addr_t slowpath_mapping;
#ifdef BCM_ISCSI int dropless_fc;
#ifdef BCM_CNIC
u32 cnic_flags;
#define BNX2X_CNIC_FLAG_MAC_SET 1
void *t1; void *t1;
dma_addr_t t1_mapping; dma_addr_t t1_mapping;
void *t2; void *t2;
...@@ -974,10 +998,23 @@ struct bnx2x { ...@@ -974,10 +998,23 @@ struct bnx2x {
dma_addr_t timers_mapping; dma_addr_t timers_mapping;
void *qm; void *qm;
dma_addr_t qm_mapping; dma_addr_t qm_mapping;
struct cnic_ops *cnic_ops;
void *cnic_data;
u32 cnic_tag;
struct cnic_eth_dev cnic_eth_dev;
struct host_status_block *cnic_sb;
dma_addr_t cnic_sb_mapping;
#define CNIC_SB_ID(bp) BP_L_ID(bp)
struct eth_spe *cnic_kwq;
struct eth_spe *cnic_kwq_prod;
struct eth_spe *cnic_kwq_cons;
struct eth_spe *cnic_kwq_last;
u16 cnic_kwq_pending;
u16 cnic_spq_pending;
struct mutex cnic_mutex;
u8 iscsi_mac[6];
#endif #endif
int dropless_fc;
int dmae_ready; int dmae_ready;
/* used to synchronize dmae accesses */ /* used to synchronize dmae accesses */
struct mutex dmae_mutex; struct mutex dmae_mutex;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment