diff options
author | Rasesh Mody <rmody@brocade.com> | 2011-09-27 06:39:08 -0400 |
---|---|---|
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) |
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 f9d4100f919d..2f12d68021d5 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 { | |||
193 | enum { | 193 | enum { |
194 | BFA_CM_HBA = 0x01, | 194 | BFA_CM_HBA = 0x01, |
195 | BFA_CM_CNA = 0x02, | 195 | BFA_CM_CNA = 0x02, |
196 | BFA_CM_NIC = 0x04, | ||
196 | }; | 197 | }; |
197 | 198 | ||
198 | /** | 199 | /** |
@@ -271,7 +272,20 @@ enum { | |||
271 | #define bfa_asic_id_ct(device) \ | 272 | #define bfa_asic_id_ct(device) \ |
272 | ((device) == PCI_DEVICE_ID_BROCADE_CT || \ | 273 | ((device) == PCI_DEVICE_ID_BROCADE_CT || \ |
273 | (device) == PCI_DEVICE_ID_BROCADE_CT_FC) | 274 | (device) == PCI_DEVICE_ID_BROCADE_CT_FC) |
274 | #define bfa_asic_id_ctc(device) (bfa_asic_id_ct(device)) | 275 | #define bfa_asic_id_ct2(device) \ |
276 | ((device) == BFA_PCI_DEVICE_ID_CT2) | ||
277 | #define bfa_asic_id_ctc(device) \ | ||
278 | (bfa_asic_id_ct(device) || bfa_asic_id_ct2(device)) | ||
279 | |||
280 | /** | ||
281 | * PCI sub-system device and vendor ID information | ||
282 | */ | ||
283 | enum { | ||
284 | BFA_PCI_FCOE_SSDEVICE_ID = 0x14, | ||
285 | BFA_PCI_CT2_SSID_FCoE = 0x22, | ||
286 | BFA_PCI_CT2_SSID_ETH = 0x23, | ||
287 | BFA_PCI_CT2_SSID_FC = 0x24, | ||
288 | }; | ||
275 | 289 | ||
276 | enum bfa_mode { | 290 | enum bfa_mode { |
277 | BFA_MODE_HBA = 1, | 291 | 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 1e60aa7c6c58..f89ac7a6569d 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, | |||
1977 | ioc->ad_cap_bm = BFA_CM_CNA; | 1977 | ioc->ad_cap_bm = BFA_CM_CNA; |
1978 | break; | 1978 | break; |
1979 | 1979 | ||
1980 | case BFA_PCI_DEVICE_ID_CT2: | ||
1981 | ioc->asic_gen = BFI_ASIC_GEN_CT2; | ||
1982 | if (clscode == BFI_PCIFN_CLASS_FC && | ||
1983 | pcidev->ssid == BFA_PCI_CT2_SSID_FC) { | ||
1984 | ioc->asic_mode = BFI_ASIC_MODE_FC16; | ||
1985 | ioc->fcmode = true; | ||
1986 | ioc->port_mode = ioc->port_mode_cfg = BFA_MODE_HBA; | ||
1987 | ioc->ad_cap_bm = BFA_CM_HBA; | ||
1988 | } else { | ||
1989 | ioc->port0_mode = ioc->port1_mode = BFI_PORT_MODE_ETH; | ||
1990 | ioc->asic_mode = BFI_ASIC_MODE_ETH; | ||
1991 | if (pcidev->ssid == BFA_PCI_CT2_SSID_FCoE) { | ||
1992 | ioc->port_mode = | ||
1993 | ioc->port_mode_cfg = BFA_MODE_CNA; | ||
1994 | ioc->ad_cap_bm = BFA_CM_CNA; | ||
1995 | } else { | ||
1996 | ioc->port_mode = | ||
1997 | ioc->port_mode_cfg = BFA_MODE_NIC; | ||
1998 | ioc->ad_cap_bm = BFA_CM_NIC; | ||
1999 | } | ||
2000 | } | ||
2001 | break; | ||
2002 | |||
1980 | default: | 2003 | default: |
1981 | BUG_ON(1); | 2004 | BUG_ON(1); |
1982 | } | 2005 | } |
diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.h b/drivers/net/ethernet/brocade/bna/bfa_ioc.h index 5899a5648393..c3981700488a 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 { | |||
35 | int pci_slot; | 35 | int pci_slot; |
36 | u8 pci_func; | 36 | u8 pci_func; |
37 | u16 device_id; | 37 | u16 device_id; |
38 | u16 ssid; | ||
38 | void __iomem *pci_bar_kva; | 39 | void __iomem *pci_bar_kva; |
39 | }; | 40 | }; |
40 | 41 | ||
diff --git a/drivers/net/ethernet/brocade/bna/bna_hw_defs.h b/drivers/net/ethernet/brocade/bna/bna_hw_defs.h index dde8a463b8d9..4c6aab2a9534 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 @@ | |||
133 | ct_reg_addr_init((_bna), (_pcidev)); \ | 133 | ct_reg_addr_init((_bna), (_pcidev)); \ |
134 | ct_bit_defn_init((_bna), (_pcidev)); \ | 134 | ct_bit_defn_init((_bna), (_pcidev)); \ |
135 | break; \ | 135 | break; \ |
136 | case BFA_PCI_DEVICE_ID_CT2: \ | ||
137 | ct2_reg_addr_init((_bna), (_pcidev)); \ | ||
138 | ct2_bit_defn_init((_bna), (_pcidev)); \ | ||
139 | break; \ | ||
136 | } \ | 140 | } \ |
137 | } | 141 | } |
138 | 142 | ||
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c index 320f11c76e14..d76d7cb0dd0e 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) = { | |||
3428 | PCI_DEVICE_ID_BROCADE_CT), | 3428 | PCI_DEVICE_ID_BROCADE_CT), |
3429 | .class = PCI_CLASS_NETWORK_ETHERNET << 8, | 3429 | .class = PCI_CLASS_NETWORK_ETHERNET << 8, |
3430 | .class_mask = 0xffff00 | 3430 | .class_mask = 0xffff00 |
3431 | }, {0, } | 3431 | }, |
3432 | { | ||
3433 | PCI_DEVICE(PCI_VENDOR_ID_BROCADE, | ||
3434 | BFA_PCI_DEVICE_ID_CT2), | ||
3435 | .class = PCI_CLASS_NETWORK_ETHERNET << 8, | ||
3436 | .class_mask = 0xffff00 | ||
3437 | }, | ||
3438 | {0, }, | ||
3432 | }; | 3439 | }; |
3433 | 3440 | ||
3434 | MODULE_DEVICE_TABLE(pci, bnad_pci_id_table); | 3441 | MODULE_DEVICE_TABLE(pci, bnad_pci_id_table); |