summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2011-07-13 17:24:22 +0000
committerDavid S. Miller <davem@davemloft.net>2011-07-14 08:46:08 -0700
commit41c2178adce37b249147063624f8a27b064b471e (patch)
treee74bf9c8c56954848fba61a863df040630c4f5f9
parentecdbf6e0d555d353188647d1b2dee9a79db69c68 (diff)
downloadlinux-41c2178adce37b249147063624f8a27b064b471e.tar.gz
linux-41c2178adce37b249147063624f8a27b064b471e.tar.bz2
linux-41c2178adce37b249147063624f8a27b064b471e.zip
bnx2: Read iSCSI config from shared memory during ->probe()
The scratchpad location that we were reading from has not been initialized yet during ->probe(), so we were getting inaccurate information. Update version to 2.1.10. Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bnx2.c13
-rw-r--r--drivers/net/bnx2.h7
2 files changed, 16 insertions, 4 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index d105f1f23391..4816d6a5fe62 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -56,8 +56,8 @@
#include "bnx2_fw.h"
#define DRV_MODULE_NAME "bnx2"
-#define DRV_MODULE_VERSION "2.1.6"
-#define DRV_MODULE_RELDATE "Mar 7, 2011"
+#define DRV_MODULE_VERSION "2.1.10"
+#define DRV_MODULE_RELDATE "July 12, 2011"
#define FW_MIPS_FILE_06 "bnx2/bnx2-mips-06-6.2.1.fw"
#define FW_RV2P_FILE_06 "bnx2/bnx2-rv2p-06-6.0.15.fw"
#define FW_MIPS_FILE_09 "bnx2/bnx2-mips-09-6.2.1a.fw"
@@ -385,6 +385,9 @@ static int bnx2_register_cnic(struct net_device *dev, struct cnic_ops *ops,
if (cp->drv_state & CNIC_DRV_STATE_REGD)
return -EBUSY;
+ if (!bnx2_reg_rd_ind(bp, BNX2_FW_MAX_ISCSI_CONN))
+ return -ENODEV;
+
bp->cnic_data = data;
rcu_assign_pointer(bp->cnic_ops, ops);
@@ -8215,8 +8218,10 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
bp->timer.function = bnx2_timer;
#ifdef BCM_CNIC
- bp->cnic_eth_dev.max_iscsi_conn =
- bnx2_reg_rd_ind(bp, BNX2_FW_MAX_ISCSI_CONN);
+ if (bnx2_shmem_rd(bp, BNX2_ISCSI_INITIATOR) & BNX2_ISCSI_INITIATOR_EN)
+ bp->cnic_eth_dev.max_iscsi_conn =
+ (bnx2_shmem_rd(bp, BNX2_ISCSI_MAX_CONN) &
+ BNX2_ISCSI_MAX_CONN_MASK) >> BNX2_ISCSI_MAX_CONN_SHIFT;
#endif
pci_save_state(pdev);
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index 0f0ad2b44c28..fc50d4267df8 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -7368,6 +7368,13 @@ struct bnx2_rv2p_fw_file {
#define BNX2_RPHY_SERDES_LINK 0x374
#define BNX2_RPHY_COPPER_LINK 0x378
+#define BNX2_ISCSI_INITIATOR 0x3dc
+#define BNX2_ISCSI_INITIATOR_EN 0x00080000
+
+#define BNX2_ISCSI_MAX_CONN 0x3e4
+#define BNX2_ISCSI_MAX_CONN_MASK 0xffff0000
+#define BNX2_ISCSI_MAX_CONN_SHIFT 16
+
#define HOST_VIEW_SHMEM_BASE 0x167c00
#define DP_SHMEM_LINE(bp, offset) \