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