Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bfa_defs.h
Go to the documentation of this file.
1 /*
2  * Linux network driver for Brocade Converged Network Adapter.
3  *
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
7  *
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.
12  */
13 /*
14  * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
15  * All rights reserved
16  * www.brocade.com
17  */
18 
19 #ifndef __BFA_DEFS_H__
20 #define __BFA_DEFS_H__
21 
22 #include "cna.h"
23 #include "bfa_defs_status.h"
24 #include "bfa_defs_mfg_comm.h"
25 
26 #define BFA_STRING_32 32
27 #define BFA_VERSION_LEN 64
28 
29 /* ---------------------- adapter definitions ------------ */
30 
31 /* BFA adapter level attributes. */
32 enum {
34  /*
35  *!< adapter serial num length
36  */
42 };
43 
56  struct bfa_mfg_vpd vpd;
57  struct mac mac;
58 
62  char asic_rev;
63 
68 
71 };
72 
73 /* ---------------------- IOC definitions ------------ */
74 
75 enum {
78 };
79 
80 /* Driver and firmware versions. */
88 };
89 
90 /* IOC PCI device attributes */
97  u32 rsvd; /* padding */
99 };
100 
101 /* IOC states */
116 };
117 
118 /* IOC firmware stats */
126 };
127 
128 /* IOC driver stats */
142 };
143 
144 /* IOC statistics */
148 };
149 
154 };
155 
156 /* IOC attributes returned in queries */
157 struct bfa_ioc_attr {
167  u8 rsvd[4];
168 };
169 
170 /* Adapter capability mask definition */
171 enum {
172  BFA_CM_HBA = 0x01,
173  BFA_CM_CNA = 0x02,
174  BFA_CM_NIC = 0x04,
175 };
176 
177 /* ---------------------- mfg definitions ------------ */
178 
179 /* Checksum size */
180 #define BFA_MFG_CHKSUM_SIZE 16
181 
182 #define BFA_MFG_PARTNUM_SIZE 14
183 #define BFA_MFG_SUPPLIER_ID_SIZE 10
184 #define BFA_MFG_SUPPLIER_PARTNUM_SIZE 20
185 #define BFA_MFG_SUPPLIER_SERIALNUM_SIZE 20
186 #define BFA_MFG_SUPPLIER_REVISION_SIZE 4
187 
188 #pragma pack(1)
189 
190 /* BFA adapter manufacturing block definition.
191  *
192  * All numerical fields are in big-endian format.
193  */
195  u8 version; /* manufacturing block version */
196  u8 mfg_sig[3]; /* characters 'M', 'F', 'G' */
197  u16 mfgsize; /* mfg block size */
198  u16 u16_chksum; /* old u16 checksum */
201  u8 mfg_day; /* manufacturing day */
202  u8 mfg_month; /* manufacturing month */
203  u16 mfg_year; /* manufacturing year */
204  u64 mfg_wwn; /* wwn base for this adapter */
205  u8 num_wwn; /* number of wwns assigned */
206  u8 mfg_speeds; /* speeds allowed for this adapter */
207  u8 rsv[2];
212  mac_t mfg_mac; /* base mac address */
213  u8 num_mac; /* number of mac addresses */
215  u32 card_type; /* card type */
216  char cap_nic; /* capability nic */
217  char cap_cna; /* capability cna */
218  char cap_hba; /* capability hba */
219  char cap_fc16g; /* capability fc 16g */
220  char cap_sriov; /* capability sriov */
221  char cap_mezz; /* capability mezz */
223  u8 mfg_nports; /* number of ports */
224  char media[8]; /* xfi/xaui */
225  char initial_mode[8]; /* initial mode: hba/cna/nic */
226  u8 rsv4[84];
227  u8 md5_chksum[BFA_MFG_CHKSUM_SIZE]; /* md5 checksum */
228 };
229 
230 #pragma pack()
231 
232 /* ---------------------- pci definitions ------------ */
233 
234 /*
235  * PCI device ID information
236  */
237 enum {
239 };
240 
241 #define bfa_asic_id_ct(device) \
242  ((device) == PCI_DEVICE_ID_BROCADE_CT || \
243  (device) == PCI_DEVICE_ID_BROCADE_CT_FC)
244 #define bfa_asic_id_ct2(device) \
245  ((device) == BFA_PCI_DEVICE_ID_CT2)
246 #define bfa_asic_id_ctc(device) \
247  (bfa_asic_id_ct(device) || bfa_asic_id_ct2(device))
248 
249 /* PCI sub-system device and vendor ID information */
250 enum {
255 };
256 
257 enum bfa_mode {
261 };
262 
263 /*
264  * Flash module specific
265  */
266 #define BFA_FLASH_PART_ENTRY_SIZE 32 /* partition entry size */
267 #define BFA_FLASH_PART_MAX 32 /* maximal # of partitions */
268 #define BFA_TOTAL_FLASH_SIZE 0x400000
269 #define BFA_FLASH_PART_FWIMG 2
270 #define BFA_FLASH_PART_MFG 7
271 
272 /*
273  * flash partition attributes
274  */
276  u32 part_type; /* partition type */
277  u32 part_instance; /* partition instance */
278  u32 part_off; /* partition offset */
279  u32 part_size; /* partition size */
280  u32 part_len; /* partition content length */
281  u32 part_status; /* partition status */
283 };
284 
285 /*
286  * flash attributes
287  */
289  u32 status; /* flash overall status */
290  u32 npart; /* num of partitions */
292 };
293 
294 #endif /* __BFA_DEFS_H__ */