1
2
3
4
5
6
7
8
9
10
11 #ifndef __BFA_DEFS_MFG_COMM_H__
12 #define __BFA_DEFS_MFG_COMM_H__
13
14 #include "bfa_defs.h"
15
16
17 #define BFA_MFG_VERSION 3
18 #define BFA_MFG_VERSION_UNINIT 0xFF
19
20
21 #define BFA_MFG_ENC_VER 2
22
23
24 #define BFA_MFG_VER1_LEN 128
25
26
27 #define BFA_MFG_HDR_LEN 4
28
29 #define BFA_MFG_SERIALNUM_SIZE 11
30 #define STRSZ(_n) (((_n) + 4) & ~3)
31
32
33 enum {
34 BFA_MFG_TYPE_CB_MAX = 825,
35 BFA_MFG_TYPE_FC8P2 = 825,
36 BFA_MFG_TYPE_FC8P1 = 815,
37 BFA_MFG_TYPE_FC4P2 = 425,
38 BFA_MFG_TYPE_FC4P1 = 415,
39 BFA_MFG_TYPE_CNA10P2 = 1020,
40 BFA_MFG_TYPE_CNA10P1 = 1010,
41 BFA_MFG_TYPE_JAYHAWK = 804,
42 BFA_MFG_TYPE_WANCHESE = 1007,
43 BFA_MFG_TYPE_ASTRA = 807,
44 BFA_MFG_TYPE_LIGHTNING_P0 = 902,
45 BFA_MFG_TYPE_LIGHTNING = 1741,
46 BFA_MFG_TYPE_PROWLER_F = 1560,
47 BFA_MFG_TYPE_PROWLER_N = 1410,
48 BFA_MFG_TYPE_PROWLER_C = 1710,
49 BFA_MFG_TYPE_PROWLER_D = 1860,
50 BFA_MFG_TYPE_CHINOOK = 1867,
51 BFA_MFG_TYPE_INVALID = 0,
52 };
53
54
55 #define bfa_mfg_is_mezz(type) (( \
56 (type) == BFA_MFG_TYPE_JAYHAWK || \
57 (type) == BFA_MFG_TYPE_WANCHESE || \
58 (type) == BFA_MFG_TYPE_ASTRA || \
59 (type) == BFA_MFG_TYPE_LIGHTNING_P0 || \
60 (type) == BFA_MFG_TYPE_LIGHTNING || \
61 (type) == BFA_MFG_TYPE_CHINOOK))
62
63 enum {
64 CB_GPIO_TTV = (1),
65 CB_GPIO_FC8P2 = (2),
66 CB_GPIO_FC8P1 = (3),
67 CB_GPIO_FC4P2 = (4),
68 CB_GPIO_FC4P1 = (5),
69 CB_GPIO_DFLY = (6),
70 CB_GPIO_PROTO = BIT(7)
71 };
72
73 #define bfa_mfg_adapter_prop_init_gpio(gpio, card_type, prop) \
74 do { \
75 if ((gpio) & CB_GPIO_PROTO) { \
76 (prop) |= BFI_ADAPTER_PROTO; \
77 (gpio) &= ~CB_GPIO_PROTO; \
78 } \
79 switch (gpio) { \
80 case CB_GPIO_TTV: \
81 (prop) |= BFI_ADAPTER_TTV; \
82 case CB_GPIO_DFLY: \
83 case CB_GPIO_FC8P2: \
84 (prop) |= BFI_ADAPTER_SETP(NPORTS, 2); \
85 (prop) |= BFI_ADAPTER_SETP(SPEED, 8); \
86 (card_type) = BFA_MFG_TYPE_FC8P2; \
87 break; \
88 case CB_GPIO_FC8P1: \
89 (prop) |= BFI_ADAPTER_SETP(NPORTS, 1); \
90 (prop) |= BFI_ADAPTER_SETP(SPEED, 8); \
91 (card_type) = BFA_MFG_TYPE_FC8P1; \
92 break; \
93 case CB_GPIO_FC4P2: \
94 (prop) |= BFI_ADAPTER_SETP(NPORTS, 2); \
95 (prop) |= BFI_ADAPTER_SETP(SPEED, 4); \
96 (card_type) = BFA_MFG_TYPE_FC4P2; \
97 break; \
98 case CB_GPIO_FC4P1: \
99 (prop) |= BFI_ADAPTER_SETP(NPORTS, 1); \
100 (prop) |= BFI_ADAPTER_SETP(SPEED, 4); \
101 (card_type) = BFA_MFG_TYPE_FC4P1; \
102 break; \
103 default: \
104 (prop) |= BFI_ADAPTER_UNSUPP; \
105 (card_type) = BFA_MFG_TYPE_INVALID; \
106 } \
107 } while (0)
108
109
110 #define BFA_MFG_VPD_LEN 512
111 #define BFA_MFG_VPD_LEN_INVALID 0
112
113 #define BFA_MFG_VPD_PCI_HDR_OFF 137
114 #define BFA_MFG_VPD_PCI_VER_MASK 0x07
115 #define BFA_MFG_VPD_PCI_VDR_MASK 0xf8
116
117
118 enum {
119 BFA_MFG_VPD_UNKNOWN = 0,
120 BFA_MFG_VPD_IBM = 1,
121 BFA_MFG_VPD_HP = 2,
122 BFA_MFG_VPD_DELL = 3,
123 BFA_MFG_VPD_PCI_IBM = 0x08,
124 BFA_MFG_VPD_PCI_HP = 0x10,
125 BFA_MFG_VPD_PCI_DELL = 0x20,
126 BFA_MFG_VPD_PCI_BRCD = 0xf8,
127 };
128
129
130
131
132
133 struct bfa_mfg_vpd {
134 u8 version;
135 u8 vpd_sig[3];
136 u8 chksum;
137 u8 vendor;
138 u8 len;
139 u8 rsv;
140 u8 data[BFA_MFG_VPD_LEN];
141 } __packed;
142
143 #endif