2 * Linux network driver for Brocade Converged Network Adapter.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License (GPL) Version 2 as
6 * published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
14 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
18 #ifndef __BFA_DEFS_MFG_COMM_H__
19 #define __BFA_DEFS_MFG_COMM_H__
23 /* Manufacturing block version */
24 #define BFA_MFG_VERSION 3
25 #define BFA_MFG_VERSION_UNINIT 0xFF
27 /* Manufacturing block encrypted version */
28 #define BFA_MFG_ENC_VER 2
30 /* Manufacturing block version 1 length */
31 #define BFA_MFG_VER1_LEN 128
33 /* Manufacturing block header length */
34 #define BFA_MFG_HDR_LEN 4
36 #define BFA_MFG_SERIALNUM_SIZE 11
37 #define STRSZ(_n) (((_n) + 4) & ~3)
39 /* Manufacturing card type */
41 BFA_MFG_TYPE_CB_MAX
= 825, /*!< Crossbow card type max */
42 BFA_MFG_TYPE_FC8P2
= 825, /*!< 8G 2port FC card */
43 BFA_MFG_TYPE_FC8P1
= 815, /*!< 8G 1port FC card */
44 BFA_MFG_TYPE_FC4P2
= 425, /*!< 4G 2port FC card */
45 BFA_MFG_TYPE_FC4P1
= 415, /*!< 4G 1port FC card */
46 BFA_MFG_TYPE_CNA10P2
= 1020, /*!< 10G 2port CNA card */
47 BFA_MFG_TYPE_CNA10P1
= 1010, /*!< 10G 1port CNA card */
48 BFA_MFG_TYPE_JAYHAWK
= 804, /*!< Jayhawk mezz card */
49 BFA_MFG_TYPE_WANCHESE
= 1007, /*!< Wanchese mezz card */
50 BFA_MFG_TYPE_ASTRA
= 807, /*!< Astra mezz card */
51 BFA_MFG_TYPE_LIGHTNING_P0
= 902, /*!< Lightning mezz card - old */
52 BFA_MFG_TYPE_LIGHTNING
= 1741, /*!< Lightning mezz card */
53 BFA_MFG_TYPE_PROWLER_F
= 1560, /*!< Prowler FC only cards */
54 BFA_MFG_TYPE_PROWLER_N
= 1410, /*!< Prowler NIC only cards */
55 BFA_MFG_TYPE_PROWLER_C
= 1710, /*!< Prowler CNA only cards */
56 BFA_MFG_TYPE_PROWLER_D
= 1860, /*!< Prowler Dual cards */
57 BFA_MFG_TYPE_CHINOOK
= 1867, /*!< Chinook cards */
58 BFA_MFG_TYPE_INVALID
= 0, /*!< Invalid card type */
63 /* Check if Mezz card */
64 #define bfa_mfg_is_mezz(type) (( \
65 (type) == BFA_MFG_TYPE_JAYHAWK || \
66 (type) == BFA_MFG_TYPE_WANCHESE || \
67 (type) == BFA_MFG_TYPE_ASTRA || \
68 (type) == BFA_MFG_TYPE_LIGHTNING_P0 || \
69 (type) == BFA_MFG_TYPE_LIGHTNING || \
70 (type) == BFA_MFG_TYPE_CHINOOK))
73 CB_GPIO_TTV
= (1), /*!< TTV debug capable cards */
74 CB_GPIO_FC8P2
= (2), /*!< 8G 2port FC card */
75 CB_GPIO_FC8P1
= (3), /*!< 8G 1port FC card */
76 CB_GPIO_FC4P2
= (4), /*!< 4G 2port FC card */
77 CB_GPIO_FC4P1
= (5), /*!< 4G 1port FC card */
78 CB_GPIO_DFLY
= (6), /*!< 8G 2port FC mezzanine card */
79 CB_GPIO_PROTO
= (1 << 7) /*!< 8G 2port FC prototypes */
82 #define bfa_mfg_adapter_prop_init_gpio(gpio, card_type, prop) \
84 if ((gpio) & CB_GPIO_PROTO) { \
85 (prop) |= BFI_ADAPTER_PROTO; \
86 (gpio) &= ~CB_GPIO_PROTO; \
90 (prop) |= BFI_ADAPTER_TTV; \
93 (prop) |= BFI_ADAPTER_SETP(NPORTS, 2); \
94 (prop) |= BFI_ADAPTER_SETP(SPEED, 8); \
95 (card_type) = BFA_MFG_TYPE_FC8P2; \
98 (prop) |= BFI_ADAPTER_SETP(NPORTS, 1); \
99 (prop) |= BFI_ADAPTER_SETP(SPEED, 8); \
100 (card_type) = BFA_MFG_TYPE_FC8P1; \
102 case CB_GPIO_FC4P2: \
103 (prop) |= BFI_ADAPTER_SETP(NPORTS, 2); \
104 (prop) |= BFI_ADAPTER_SETP(SPEED, 4); \
105 (card_type) = BFA_MFG_TYPE_FC4P2; \
107 case CB_GPIO_FC4P1: \
108 (prop) |= BFI_ADAPTER_SETP(NPORTS, 1); \
109 (prop) |= BFI_ADAPTER_SETP(SPEED, 4); \
110 (card_type) = BFA_MFG_TYPE_FC4P1; \
113 (prop) |= BFI_ADAPTER_UNSUPP; \
114 (card_type) = BFA_MFG_TYPE_INVALID; \
118 /* VPD data length */
119 #define BFA_MFG_VPD_LEN 512
120 #define BFA_MFG_VPD_LEN_INVALID 0
122 #define BFA_MFG_VPD_PCI_HDR_OFF 137
123 #define BFA_MFG_VPD_PCI_VER_MASK 0x07 /*!< version mask 3 bits */
124 #define BFA_MFG_VPD_PCI_VDR_MASK 0xf8 /*!< vendor mask 5 bits */
128 BFA_MFG_VPD_UNKNOWN
= 0, /*!< vendor unknown */
129 BFA_MFG_VPD_IBM
= 1, /*!< vendor IBM */
130 BFA_MFG_VPD_HP
= 2, /*!< vendor HP */
131 BFA_MFG_VPD_DELL
= 3, /*!< vendor DELL */
132 BFA_MFG_VPD_PCI_IBM
= 0x08, /*!< PCI VPD IBM */
133 BFA_MFG_VPD_PCI_HP
= 0x10, /*!< PCI VPD HP */
134 BFA_MFG_VPD_PCI_DELL
= 0x20, /*!< PCI VPD DELL */
135 BFA_MFG_VPD_PCI_BRCD
= 0xf8, /*!< PCI VPD Brocade */
138 /* BFA adapter flash vpd data definition.
140 * All numerical fields are in big-endian format.
143 u8 version
; /*!< vpd data version */
144 u8 vpd_sig
[3]; /*!< characters 'V', 'P', 'D' */
145 u8 chksum
; /*!< u8 checksum */
146 u8 vendor
; /*!< vendor */
147 u8 len
; /*!< vpd data length excluding header */
149 u8 data
[BFA_MFG_VPD_LEN
]; /*!< vpd data */
154 #endif /* __BFA_DEFS_MFG_H__ */