diff options
author | Rasesh Mody <rmody@brocade.com> | 2011-09-27 10:39:08 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-29 19:36:35 -0400 |
commit | 586b2816e3eaf187341f75c4f4e27404f943cb29 (patch) | |
tree | 9535f56776d50111b9b92f4f387ba1689c6c6036 /drivers/net/ethernet/brocade | |
parent | 1bf9fd70dd7411372e80fdb8b4b3d5c36236e7b7 (diff) | |
download | linux-3.10-586b2816e3eaf187341f75c4f4e27404f943cb29.tar.gz linux-3.10-586b2816e3eaf187341f75c4f4e27404f943cb29.tar.bz2 linux-3.10-586b2816e3eaf187341f75c4f4e27404f943cb29.zip |
bna: Brocade 1860 HW Enablement
This patch enables new HW Brocade 1860. Add BFA_CM_NIC capability mask to
bfa_ioc_attr, Sub-System Device ID Info and support for Brocade 1860 device
ID to bfa_ioc.c and bnad.c.
Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/brocade')
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bfa_defs.h | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bfa_ioc.c | 23 | ||||
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bfa_ioc.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bna_hw_defs.h | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bnad.c | 9 |
5 files changed, 51 insertions, 2 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bfa_defs.h b/drivers/net/ethernet/brocade/bna/bfa_defs.h index f9d4100f919..2f12d68021d 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_defs.h +++ b/drivers/net/ethernet/brocade/bna/bfa_defs.h @@ -193,6 +193,7 @@ struct bfa_ioc_attr { enum { BFA_CM_HBA = 0x01, BFA_CM_CNA = 0x02, + BFA_CM_NIC = 0x04, }; /** @@ -271,7 +272,20 @@ enum { #define bfa_asic_id_ct(device) \ ((device) == PCI_DEVICE_ID_BROCADE_CT || \ (device) == PCI_DEVICE_ID_BROCADE_CT_FC) -#define bfa_asic_id_ctc(device) (bfa_asic_id_ct(device)) +#define bfa_asic_id_ct2(device) \ + ((device) == BFA_PCI_DEVICE_ID_CT2) +#define bfa_asic_id_ctc(device) \ + (bfa_asic_id_ct(device) || bfa_asic_id_ct2(device)) + +/** + * PCI sub-system device and vendor ID information + */ +enum { + BFA_PCI_FCOE_SSDEVICE_ID = 0x14, + BFA_PCI_CT2_SSID_FCoE = 0x22, + BFA_PCI_CT2_SSID_ETH = 0x23, + BFA_PCI_CT2_SSID_FC = 0x24, +}; enum bfa_mode { BFA_MODE_HBA = 1, diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net/ethernet/brocade/bna/bfa_ioc.c index 1e60aa7c6c5..f89ac7a6569 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_ioc.c +++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.c @@ -1977,6 +1977,29 @@ bfa_nw_ioc_pci_init(struct bfa_ioc *ioc, struct bfa_pcidev *pcidev, ioc->ad_cap_bm = BFA_CM_CNA; break; + case BFA_PCI_DEVICE_ID_CT2: + ioc->asic_gen = BFI_ASIC_GEN_CT2; + if (clscode == BFI_PCIFN_CLASS_FC && + pcidev->ssid == BFA_PCI_CT2_SSID_FC) { + ioc->asic_mode = BFI_ASIC_MODE_FC16; + ioc->fcmode = true; + ioc->port_mode = ioc->port_mode_cfg = BFA_MODE_HBA; + ioc->ad_cap_bm = BFA_CM_HBA; + } else { + ioc->port0_mode = ioc->port1_mode = BFI_PORT_MODE_ETH; + ioc->asic_mode = BFI_ASIC_MODE_ETH; + if (pcidev->ssid == BFA_PCI_CT2_SSID_FCoE) { + ioc->port_mode = + ioc->port_mode_cfg = BFA_MODE_CNA; + ioc->ad_cap_bm = BFA_CM_CNA; + } else { + ioc->port_mode = + ioc->port_mode_cfg = BFA_MODE_NIC; + ioc->ad_cap_bm = BFA_CM_NIC; + } + } + break; + default: BUG_ON(1); } diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.h b/drivers/net/ethernet/brocade/bna/bfa_ioc.h index 5899a564839..c3981700488 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_ioc.h +++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.h @@ -35,6 +35,7 @@ struct bfa_pcidev { int pci_slot; u8 pci_func; u16 device_id; + u16 ssid; void __iomem *pci_bar_kva; }; diff --git a/drivers/net/ethernet/brocade/bna/bna_hw_defs.h b/drivers/net/ethernet/brocade/bna/bna_hw_defs.h index dde8a463b8d..4c6aab2a953 100644 --- a/drivers/net/ethernet/brocade/bna/bna_hw_defs.h +++ b/drivers/net/ethernet/brocade/bna/bna_hw_defs.h @@ -133,6 +133,10 @@ ct_reg_addr_init((_bna), (_pcidev)); \ ct_bit_defn_init((_bna), (_pcidev)); \ break; \ + case BFA_PCI_DEVICE_ID_CT2: \ + ct2_reg_addr_init((_bna), (_pcidev)); \ + ct2_bit_defn_init((_bna), (_pcidev)); \ + break; \ } \ } diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c index 320f11c76e1..d76d7cb0dd0 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c @@ -3428,7 +3428,14 @@ static DEFINE_PCI_DEVICE_TABLE(bnad_pci_id_table) = { PCI_DEVICE_ID_BROCADE_CT), .class = PCI_CLASS_NETWORK_ETHERNET << 8, .class_mask = 0xffff00 - }, {0, } + }, + { + PCI_DEVICE(PCI_VENDOR_ID_BROCADE, + BFA_PCI_DEVICE_ID_CT2), + .class = PCI_CLASS_NETWORK_ETHERNET << 8, + .class_mask = 0xffff00 + }, + {0, }, }; MODULE_DEVICE_TABLE(pci, bnad_pci_id_table); |