diff options
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_fcoe.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 7dffec1e5715..69ac55495c1d 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * cnic modules to create FCoE instances, send/receive non-offloaded | 3 | * cnic modules to create FCoE instances, send/receive non-offloaded |
4 | * FIP/FCoE packets, listen to link events etc. | 4 | * FIP/FCoE packets, listen to link events etc. |
5 | * | 5 | * |
6 | * Copyright (c) 2008 - 2011 Broadcom Corporation | 6 | * Copyright (c) 2008 - 2013 Broadcom Corporation |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -22,7 +22,7 @@ DEFINE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu); | |||
22 | 22 | ||
23 | #define DRV_MODULE_NAME "bnx2fc" | 23 | #define DRV_MODULE_NAME "bnx2fc" |
24 | #define DRV_MODULE_VERSION BNX2FC_VERSION | 24 | #define DRV_MODULE_VERSION BNX2FC_VERSION |
25 | #define DRV_MODULE_RELDATE "Dec 21, 2012" | 25 | #define DRV_MODULE_RELDATE "Mar 08, 2013" |
26 | 26 | ||
27 | 27 | ||
28 | static char version[] = | 28 | static char version[] = |
@@ -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: | |||
1656 | static int bnx2fc_bind_pcidev(struct bnx2fc_hba *hba) | 1658 | static 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 | ||
1672 | static void bnx2fc_unbind_pcidev(struct bnx2fc_hba *hba) | 1709 | static 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 | ||