aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>2013-03-08 16:28:51 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-05-02 10:32:24 -0400
commitc13d2b6d3640d1ef180e40191178b4f1271982c1 (patch)
treeb30920c0567268216d1deaafabee472e017781f2 /drivers
parent353c2ade1d7dee6551f4d17fc357c9f5adc8045a (diff)
[SCSI] bnx2fc: Include chip number in the symbolic name
[jejb: move PCI_DEVICE_ID definitions to include/pci_ids.h] Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc.h4
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c51
2 files changed, 49 insertions, 6 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 11596b2c4702..5d47c08ed99e 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -68,6 +68,8 @@
68 68
69#define PFX "bnx2fc: " 69#define PFX "bnx2fc: "
70 70
71#define BCM_CHIP_LEN 16
72
71#define BNX2X_DOORBELL_PCI_BAR 2 73#define BNX2X_DOORBELL_PCI_BAR 2
72 74
73#define BNX2FC_MAX_BD_LEN 0xffff 75#define BNX2FC_MAX_BD_LEN 0xffff
@@ -241,6 +243,8 @@ struct bnx2fc_hba {
241 int wait_for_link_down; 243 int wait_for_link_down;
242 int num_ofld_sess; 244 int num_ofld_sess;
243 struct list_head vports; 245 struct list_head vports;
246
247 char chip_num[BCM_CHIP_LEN];
244}; 248};
245 249
246struct bnx2fc_interface { 250struct bnx2fc_interface {
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 7dffec1e5715..a76925716986 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -679,6 +679,7 @@ static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev)
679{ 679{
680 struct fcoe_port *port = lport_priv(lport); 680 struct fcoe_port *port = lport_priv(lport);
681 struct bnx2fc_interface *interface = port->priv; 681 struct bnx2fc_interface *interface = port->priv;
682 struct bnx2fc_hba *hba = interface->hba;
682 struct Scsi_Host *shost = lport->host; 683 struct Scsi_Host *shost = lport->host;
683 int rc = 0; 684 int rc = 0;
684 685
@@ -699,8 +700,9 @@ static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev)
699 } 700 }
700 if (!lport->vport) 701 if (!lport->vport)
701 fc_host_max_npiv_vports(lport->host) = USHRT_MAX; 702 fc_host_max_npiv_vports(lport->host) = USHRT_MAX;
702 sprintf(fc_host_symbolic_name(lport->host), "%s v%s over %s", 703 snprintf(fc_host_symbolic_name(lport->host), 256,
703 BNX2FC_NAME, BNX2FC_VERSION, 704 "%s (Broadcom %s) v%s over %s",
705 BNX2FC_NAME, hba->chip_num, BNX2FC_VERSION,
704 interface->netdev->name); 706 interface->netdev->name);
705 707
706 return 0; 708 return 0;
@@ -1656,23 +1658,60 @@ mem_err:
1656static int bnx2fc_bind_pcidev(struct bnx2fc_hba *hba) 1658static int bnx2fc_bind_pcidev(struct bnx2fc_hba *hba)
1657{ 1659{
1658 struct cnic_dev *cnic; 1660 struct cnic_dev *cnic;
1661 struct pci_dev *pdev;
1659 1662
1660 if (!hba->cnic) { 1663 if (!hba->cnic) {
1661 printk(KERN_ERR PFX "cnic is NULL\n"); 1664 printk(KERN_ERR PFX "cnic is NULL\n");
1662 return -ENODEV; 1665 return -ENODEV;
1663 } 1666 }
1664 cnic = hba->cnic; 1667 cnic = hba->cnic;
1665 hba->pcidev = cnic->pcidev; 1668 pdev = hba->pcidev = cnic->pcidev;
1666 if (hba->pcidev) 1669 if (!hba->pcidev)
1667 pci_dev_get(hba->pcidev); 1670 return -ENODEV;
1668 1671
1672 switch (pdev->device) {
1673 case PCI_DEVICE_ID_NX2_57710:
1674 strncpy(hba->chip_num, "BCM57710", BCM_CHIP_LEN);
1675 break;
1676 case PCI_DEVICE_ID_NX2_57711:
1677 strncpy(hba->chip_num, "BCM57711", BCM_CHIP_LEN);
1678 break;
1679 case PCI_DEVICE_ID_NX2_57712:
1680 case PCI_DEVICE_ID_NX2_57712_MF:
1681 case PCI_DEVICE_ID_NX2_57712_VF:
1682 strncpy(hba->chip_num, "BCM57712", BCM_CHIP_LEN);
1683 break;
1684 case PCI_DEVICE_ID_NX2_57800:
1685 case PCI_DEVICE_ID_NX2_57800_MF:
1686 case PCI_DEVICE_ID_NX2_57800_VF:
1687 strncpy(hba->chip_num, "BCM57800", BCM_CHIP_LEN);
1688 break;
1689 case PCI_DEVICE_ID_NX2_57810:
1690 case PCI_DEVICE_ID_NX2_57810_MF:
1691 case PCI_DEVICE_ID_NX2_57810_VF:
1692 strncpy(hba->chip_num, "BCM57810", BCM_CHIP_LEN);
1693 break;
1694 case PCI_DEVICE_ID_NX2_57840:
1695 case PCI_DEVICE_ID_NX2_57840_MF:
1696 case PCI_DEVICE_ID_NX2_57840_VF:
1697 case PCI_DEVICE_ID_NX2_57840_2_20:
1698 case PCI_DEVICE_ID_NX2_57840_4_10:
1699 strncpy(hba->chip_num, "BCM57840", BCM_CHIP_LEN);
1700 break;
1701 default:
1702 pr_err(PFX "Unknown device id 0x%x\n", pdev->device);
1703 break;
1704 }
1705 pci_dev_get(hba->pcidev);
1669 return 0; 1706 return 0;
1670} 1707}
1671 1708
1672static void bnx2fc_unbind_pcidev(struct bnx2fc_hba *hba) 1709static void bnx2fc_unbind_pcidev(struct bnx2fc_hba *hba)
1673{ 1710{
1674 if (hba->pcidev) 1711 if (hba->pcidev) {
1712 hba->chip_num[0] = '\0';
1675 pci_dev_put(hba->pcidev); 1713 pci_dev_put(hba->pcidev);
1714 }
1676 hba->pcidev = NULL; 1715 hba->pcidev = NULL;
1677} 1716}
1678 1717