aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2011-06-08 15:29:36 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-09 02:52:37 -0400
commit7625eb2f2fff7bfae41d3119b472c20b48874895 (patch)
tree4d1cd5f9cfb5b563faa3e5afe5a3f3e2e641e6cb /drivers/net
parentdb1d350fcb156b58f66a67680617077bcacfe6fc (diff)
cnic, bnx2: Check iSCSI support early in bnx2_init_one()
Based on earlier patch from Neil Horman <nhorman@tuxdriver.com> If iSCSI is not supported on a bnx2 device, bnx2_cnic_probe() will return NULL and the cnic device will not be visible to bnx2i. This will prevent bnx2i from registering and then unregistering during cnic_start() and cause the warning message: bnx2 0003:01:00.1: eth1: Failed waiting for ULP up call to complete Signed-off-by: Michael Chan <mchan@broadcom.com> Cc: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bnx2.c7
-rw-r--r--drivers/net/cnic.c12
2 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 57d3293c65bd..74580bb175f1 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -416,6 +416,9 @@ struct cnic_eth_dev *bnx2_cnic_probe(struct net_device *dev)
416 struct bnx2 *bp = netdev_priv(dev); 416 struct bnx2 *bp = netdev_priv(dev);
417 struct cnic_eth_dev *cp = &bp->cnic_eth_dev; 417 struct cnic_eth_dev *cp = &bp->cnic_eth_dev;
418 418
419 if (!cp->max_iscsi_conn)
420 return NULL;
421
419 cp->drv_owner = THIS_MODULE; 422 cp->drv_owner = THIS_MODULE;
420 cp->chip_id = bp->chip_id; 423 cp->chip_id = bp->chip_id;
421 cp->pdev = bp->pdev; 424 cp->pdev = bp->pdev;
@@ -8177,6 +8180,10 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
8177 bp->timer.data = (unsigned long) bp; 8180 bp->timer.data = (unsigned long) bp;
8178 bp->timer.function = bnx2_timer; 8181 bp->timer.function = bnx2_timer;
8179 8182
8183#ifdef BCM_CNIC
8184 bp->cnic_eth_dev.max_iscsi_conn =
8185 bnx2_reg_rd_ind(bp, BNX2_FW_MAX_ISCSI_CONN);
8186#endif
8180 pci_save_state(pdev); 8187 pci_save_state(pdev);
8181 8188
8182 return 0; 8189 return 0;
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 6c544b3411fa..363c7f368909 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -4225,14 +4225,6 @@ static void cnic_enable_bnx2_int(struct cnic_dev *dev)
4225 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | cp->last_status_idx); 4225 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | cp->last_status_idx);
4226} 4226}
4227 4227
4228static void cnic_get_bnx2_iscsi_info(struct cnic_dev *dev)
4229{
4230 u32 max_conn;
4231
4232 max_conn = cnic_reg_rd_ind(dev, BNX2_FW_MAX_ISCSI_CONN);
4233 dev->max_iscsi_conn = max_conn;
4234}
4235
4236static void cnic_disable_bnx2_int_sync(struct cnic_dev *dev) 4228static void cnic_disable_bnx2_int_sync(struct cnic_dev *dev)
4237{ 4229{
4238 struct cnic_local *cp = dev->cnic_priv; 4230 struct cnic_local *cp = dev->cnic_priv;
@@ -4557,8 +4549,6 @@ static int cnic_start_bnx2_hw(struct cnic_dev *dev)
4557 return err; 4549 return err;
4558 } 4550 }
4559 4551
4560 cnic_get_bnx2_iscsi_info(dev);
4561
4562 return 0; 4552 return 0;
4563} 4553}
4564 4554
@@ -5224,6 +5214,8 @@ static struct cnic_dev *init_bnx2_cnic(struct net_device *dev)
5224 cdev->pcidev = pdev; 5214 cdev->pcidev = pdev;
5225 cp->chip_id = ethdev->chip_id; 5215 cp->chip_id = ethdev->chip_id;
5226 5216
5217 cdev->max_iscsi_conn = ethdev->max_iscsi_conn;
5218
5227 cp->cnic_ops = &cnic_bnx2_ops; 5219 cp->cnic_ops = &cnic_bnx2_ops;
5228 cp->start_hw = cnic_start_bnx2_hw; 5220 cp->start_hw = cnic_start_bnx2_hw;
5229 cp->stop_hw = cnic_stop_bnx2_hw; 5221 cp->stop_hw = cnic_stop_bnx2_hw;