blob: 08ab60c4760f4f8e8f6573a962f2f225849f0d35 [file] [log] [blame]
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001/*
2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
3 * All rights reserved
4 * www.brocade.com
5 *
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 */
17
18#ifndef __BFA_DEFS_H__
19#define __BFA_DEFS_H__
20
21#include "bfa_fc.h"
Maggie Zhangf16a1752010-12-09 19:12:32 -080022#include "bfad_drv.h"
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070023
24#define BFA_MFG_SERIALNUM_SIZE 11
25#define STRSZ(_n) (((_n) + 4) & ~3)
26
Jing Huangacdc79a2010-10-18 17:15:55 -070027/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070028 * Manufacturing card type
29 */
30enum {
31 BFA_MFG_TYPE_CB_MAX = 825, /* Crossbow card type max */
32 BFA_MFG_TYPE_FC8P2 = 825, /* 8G 2port FC card */
33 BFA_MFG_TYPE_FC8P1 = 815, /* 8G 1port FC card */
34 BFA_MFG_TYPE_FC4P2 = 425, /* 4G 2port FC card */
35 BFA_MFG_TYPE_FC4P1 = 415, /* 4G 1port FC card */
36 BFA_MFG_TYPE_CNA10P2 = 1020, /* 10G 2port CNA card */
37 BFA_MFG_TYPE_CNA10P1 = 1010, /* 10G 1port CNA card */
38 BFA_MFG_TYPE_JAYHAWK = 804, /* Jayhawk mezz card */
39 BFA_MFG_TYPE_WANCHESE = 1007, /* Wanchese mezz card */
40 BFA_MFG_TYPE_ASTRA = 807, /* Astra mezz card */
41 BFA_MFG_TYPE_LIGHTNING_P0 = 902, /* Lightning mezz card - old */
42 BFA_MFG_TYPE_LIGHTNING = 1741, /* Lightning mezz card */
Krishna Gudipati8b070b42011-06-13 15:52:40 -070043 BFA_MFG_TYPE_PROWLER_F = 1560, /* Prowler FC only cards */
44 BFA_MFG_TYPE_PROWLER_N = 1410, /* Prowler NIC only cards */
45 BFA_MFG_TYPE_PROWLER_C = 1710, /* Prowler CNA only cards */
46 BFA_MFG_TYPE_PROWLER_D = 1860, /* Prowler Dual cards */
47 BFA_MFG_TYPE_CHINOOK = 1867, /* Chinook cards */
48 BFA_MFG_TYPE_INVALID = 0, /* Invalid card type */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070049};
50
51#pragma pack(1)
52
Jing Huangacdc79a2010-10-18 17:15:55 -070053/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070054 * Check if Mezz card
55 */
56#define bfa_mfg_is_mezz(type) (( \
57 (type) == BFA_MFG_TYPE_JAYHAWK || \
58 (type) == BFA_MFG_TYPE_WANCHESE || \
59 (type) == BFA_MFG_TYPE_ASTRA || \
60 (type) == BFA_MFG_TYPE_LIGHTNING_P0 || \
Krishna Gudipati8b070b42011-06-13 15:52:40 -070061 (type) == BFA_MFG_TYPE_LIGHTNING || \
62 (type) == BFA_MFG_TYPE_CHINOOK))
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070063
Jing Huangacdc79a2010-10-18 17:15:55 -070064/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070065 * Check if the card having old wwn/mac handling
66 */
67#define bfa_mfg_is_old_wwn_mac_model(type) (( \
68 (type) == BFA_MFG_TYPE_FC8P2 || \
69 (type) == BFA_MFG_TYPE_FC8P1 || \
70 (type) == BFA_MFG_TYPE_FC4P2 || \
71 (type) == BFA_MFG_TYPE_FC4P1 || \
72 (type) == BFA_MFG_TYPE_CNA10P2 || \
73 (type) == BFA_MFG_TYPE_CNA10P1 || \
74 (type) == BFA_MFG_TYPE_JAYHAWK || \
75 (type) == BFA_MFG_TYPE_WANCHESE))
76
77#define bfa_mfg_increment_wwn_mac(m, i) \
78do { \
79 u32 t = ((u32)(m)[0] << 16) | ((u32)(m)[1] << 8) | \
80 (u32)(m)[2]; \
81 t += (i); \
82 (m)[0] = (t >> 16) & 0xFF; \
83 (m)[1] = (t >> 8) & 0xFF; \
84 (m)[2] = t & 0xFF; \
85} while (0)
86
Jing Huangacdc79a2010-10-18 17:15:55 -070087/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070088 * VPD data length
89 */
90#define BFA_MFG_VPD_LEN 512
91
Jing Huangacdc79a2010-10-18 17:15:55 -070092/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070093 * VPD vendor tag
94 */
95enum {
96 BFA_MFG_VPD_UNKNOWN = 0, /* vendor unknown */
97 BFA_MFG_VPD_IBM = 1, /* vendor IBM */
98 BFA_MFG_VPD_HP = 2, /* vendor HP */
99 BFA_MFG_VPD_DELL = 3, /* vendor DELL */
100 BFA_MFG_VPD_PCI_IBM = 0x08, /* PCI VPD IBM */
101 BFA_MFG_VPD_PCI_HP = 0x10, /* PCI VPD HP */
102 BFA_MFG_VPD_PCI_DELL = 0x20, /* PCI VPD DELL */
103 BFA_MFG_VPD_PCI_BRCD = 0xf8, /* PCI VPD Brocade */
104};
105
Jing Huangacdc79a2010-10-18 17:15:55 -0700106/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700107 * All numerical fields are in big-endian format.
108 */
109struct bfa_mfg_vpd_s {
110 u8 version; /* vpd data version */
111 u8 vpd_sig[3]; /* characters 'V', 'P', 'D' */
112 u8 chksum; /* u8 checksum */
113 u8 vendor; /* vendor */
114 u8 len; /* vpd data length excluding header */
115 u8 rsv;
116 u8 data[BFA_MFG_VPD_LEN]; /* vpd data */
117};
118
119#pragma pack()
120
Jing Huangacdc79a2010-10-18 17:15:55 -0700121/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700122 * Status return values
123 */
124enum bfa_status {
125 BFA_STATUS_OK = 0, /* Success */
126 BFA_STATUS_FAILED = 1, /* Operation failed */
127 BFA_STATUS_EINVAL = 2, /* Invalid params Check input
128 * parameters */
129 BFA_STATUS_ENOMEM = 3, /* Out of resources */
130 BFA_STATUS_ETIMER = 5, /* Timer expired - Retry, if persists,
131 * contact support */
132 BFA_STATUS_EPROTOCOL = 6, /* Protocol error */
Krishna Gudipatib85daaf2011-06-13 15:55:11 -0700133 BFA_STATUS_UNKNOWN_VFID = 11, /* VF_ID not found */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700134 BFA_STATUS_DEVBUSY = 13, /* Device busy - Retry operation */
135 BFA_STATUS_UNKNOWN_LWWN = 18, /* LPORT PWWN not found */
136 BFA_STATUS_UNKNOWN_RWWN = 19, /* RPORT PWWN not found */
137 BFA_STATUS_VPORT_EXISTS = 21, /* VPORT already exists */
138 BFA_STATUS_VPORT_MAX = 22, /* Reached max VPORT supported limit */
139 BFA_STATUS_UNSUPP_SPEED = 23, /* Invalid Speed Check speed setting */
140 BFA_STATUS_INVLD_DFSZ = 24, /* Invalid Max data field size */
141 BFA_STATUS_FABRIC_RJT = 29, /* Reject from attached fabric */
Krishna Gudipatib85daaf2011-06-13 15:55:11 -0700142 BFA_STATUS_PORT_OFFLINE = 34, /* Port is not online */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700143 BFA_STATUS_VPORT_WWN_BP = 46, /* WWN is same as base port's WWN */
144 BFA_STATUS_NO_FCPIM_NEXUS = 52, /* No FCP Nexus exists with the rport */
145 BFA_STATUS_IOC_FAILURE = 56, /* IOC failure - Retry, if persists
146 * contact support */
147 BFA_STATUS_INVALID_WWN = 57, /* Invalid WWN */
Krishna Gudipatib85daaf2011-06-13 15:55:11 -0700148 BFA_STATUS_VERSION_FAIL = 70, /* Application/Driver version mismatch */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700149 BFA_STATUS_DIAG_BUSY = 71, /* diag busy */
150 BFA_STATUS_ENOFSAVE = 78, /* No saved firmware trace */
151 BFA_STATUS_IOC_DISABLED = 82, /* IOC is already disabled */
152 BFA_STATUS_INVALID_MAC = 134, /* Invalid MAC address */
153 BFA_STATUS_PBC = 154, /* Operation not allowed for pre-boot
154 * configuration */
155 BFA_STATUS_TRUNK_ENABLED = 164, /* Trunk is already enabled on
156 * this adapter */
157 BFA_STATUS_TRUNK_DISABLED = 165, /* Trunking is disabled on
158 * the adapter */
159 BFA_STATUS_IOPROFILE_OFF = 175, /* IO profile OFF */
160 BFA_STATUS_MAX_VAL /* Unknown error code */
161};
162#define bfa_status_t enum bfa_status
163
164enum bfa_eproto_status {
165 BFA_EPROTO_BAD_ACCEPT = 0,
166 BFA_EPROTO_UNKNOWN_RSP = 1
167};
168#define bfa_eproto_status_t enum bfa_eproto_status
169
170enum bfa_boolean {
171 BFA_FALSE = 0,
172 BFA_TRUE = 1
173};
174#define bfa_boolean_t enum bfa_boolean
175
176#define BFA_STRING_32 32
177#define BFA_VERSION_LEN 64
178
Jing Huangacdc79a2010-10-18 17:15:55 -0700179/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700180 * ---------------------- adapter definitions ------------
181 */
182
Jing Huangacdc79a2010-10-18 17:15:55 -0700183/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700184 * BFA adapter level attributes.
185 */
186enum {
187 BFA_ADAPTER_SERIAL_NUM_LEN = STRSZ(BFA_MFG_SERIALNUM_SIZE),
188 /*
189 *!< adapter serial num length
190 */
191 BFA_ADAPTER_MODEL_NAME_LEN = 16, /* model name length */
192 BFA_ADAPTER_MODEL_DESCR_LEN = 128, /* model description length */
193 BFA_ADAPTER_MFG_NAME_LEN = 8, /* manufacturer name length */
194 BFA_ADAPTER_SYM_NAME_LEN = 64, /* adapter symbolic name length */
195 BFA_ADAPTER_OS_TYPE_LEN = 64, /* adapter os type length */
196};
197
198struct bfa_adapter_attr_s {
199 char manufacturer[BFA_ADAPTER_MFG_NAME_LEN];
200 char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN];
201 u32 card_type;
202 char model[BFA_ADAPTER_MODEL_NAME_LEN];
203 char model_descr[BFA_ADAPTER_MODEL_DESCR_LEN];
204 wwn_t pwwn;
205 char node_symname[FC_SYMNAME_MAX];
206 char hw_ver[BFA_VERSION_LEN];
207 char fw_ver[BFA_VERSION_LEN];
208 char optrom_ver[BFA_VERSION_LEN];
209 char os_type[BFA_ADAPTER_OS_TYPE_LEN];
210 struct bfa_mfg_vpd_s vpd;
211 struct mac_s mac;
212
213 u8 nports;
214 u8 max_speed;
215 u8 prototype;
216 char asic_rev;
217
218 u8 pcie_gen;
219 u8 pcie_lanes_orig;
220 u8 pcie_lanes;
221 u8 cna_capable;
222
223 u8 is_mezz;
224 u8 trunk_capable;
225};
226
Jing Huangacdc79a2010-10-18 17:15:55 -0700227/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700228 * ---------------------- IOC definitions ------------
229 */
230
231enum {
232 BFA_IOC_DRIVER_LEN = 16,
233 BFA_IOC_CHIP_REV_LEN = 8,
234};
235
Jing Huangacdc79a2010-10-18 17:15:55 -0700236/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700237 * Driver and firmware versions.
238 */
239struct bfa_ioc_driver_attr_s {
240 char driver[BFA_IOC_DRIVER_LEN]; /* driver name */
241 char driver_ver[BFA_VERSION_LEN]; /* driver version */
242 char fw_ver[BFA_VERSION_LEN]; /* firmware version */
243 char bios_ver[BFA_VERSION_LEN]; /* bios version */
244 char efi_ver[BFA_VERSION_LEN]; /* EFI version */
245 char ob_ver[BFA_VERSION_LEN]; /* openboot version */
246};
247
Jing Huangacdc79a2010-10-18 17:15:55 -0700248/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700249 * IOC PCI device attributes
250 */
251struct bfa_ioc_pci_attr_s {
252 u16 vendor_id; /* PCI vendor ID */
253 u16 device_id; /* PCI device ID */
254 u16 ssid; /* subsystem ID */
255 u16 ssvid; /* subsystem vendor ID */
256 u32 pcifn; /* PCI device function */
257 u32 rsvd; /* padding */
258 char chip_rev[BFA_IOC_CHIP_REV_LEN]; /* chip revision */
259};
260
Jing Huangacdc79a2010-10-18 17:15:55 -0700261/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700262 * IOC states
263 */
264enum bfa_ioc_state {
265 BFA_IOC_UNINIT = 1, /* IOC is in uninit state */
266 BFA_IOC_RESET = 2, /* IOC is in reset state */
267 BFA_IOC_SEMWAIT = 3, /* Waiting for IOC h/w semaphore */
268 BFA_IOC_HWINIT = 4, /* IOC h/w is being initialized */
269 BFA_IOC_GETATTR = 5, /* IOC is being configured */
270 BFA_IOC_OPERATIONAL = 6, /* IOC is operational */
271 BFA_IOC_INITFAIL = 7, /* IOC hardware failure */
272 BFA_IOC_FAIL = 8, /* IOC heart-beat failure */
273 BFA_IOC_DISABLING = 9, /* IOC is being disabled */
274 BFA_IOC_DISABLED = 10, /* IOC is disabled */
275 BFA_IOC_FWMISMATCH = 11, /* IOC f/w different from drivers */
276 BFA_IOC_ENABLING = 12, /* IOC is being enabled */
277};
278
Jing Huangacdc79a2010-10-18 17:15:55 -0700279/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700280 * IOC firmware stats
281 */
282struct bfa_fw_ioc_stats_s {
283 u32 enable_reqs;
284 u32 disable_reqs;
285 u32 get_attr_reqs;
286 u32 dbg_sync;
287 u32 dbg_dump;
288 u32 unknown_reqs;
289};
290
Jing Huangacdc79a2010-10-18 17:15:55 -0700291/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700292 * IOC driver stats
293 */
294struct bfa_ioc_drv_stats_s {
295 u32 ioc_isrs;
296 u32 ioc_enables;
297 u32 ioc_disables;
298 u32 ioc_hbfails;
299 u32 ioc_boots;
300 u32 stats_tmos;
301 u32 hb_count;
302 u32 disable_reqs;
303 u32 enable_reqs;
304 u32 disable_replies;
305 u32 enable_replies;
306};
307
Jing Huangacdc79a2010-10-18 17:15:55 -0700308/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700309 * IOC statistics
310 */
311struct bfa_ioc_stats_s {
312 struct bfa_ioc_drv_stats_s drv_stats; /* driver IOC stats */
313 struct bfa_fw_ioc_stats_s fw_stats; /* firmware IOC stats */
314};
315
316enum bfa_ioc_type_e {
317 BFA_IOC_TYPE_FC = 1,
318 BFA_IOC_TYPE_FCoE = 2,
319 BFA_IOC_TYPE_LL = 3,
320};
321
Jing Huangacdc79a2010-10-18 17:15:55 -0700322/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700323 * IOC attributes returned in queries
324 */
325struct bfa_ioc_attr_s {
326 enum bfa_ioc_type_e ioc_type;
327 enum bfa_ioc_state state; /* IOC state */
328 struct bfa_adapter_attr_s adapter_attr; /* HBA attributes */
329 struct bfa_ioc_driver_attr_s driver_attr; /* driver attr */
330 struct bfa_ioc_pci_attr_s pci_attr;
331 u8 port_id; /* port number */
332 u8 rsvd[7]; /* 64bit align */
333};
334
Jing Huangacdc79a2010-10-18 17:15:55 -0700335/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700336 * ---------------------- mfg definitions ------------
337 */
338
Jing Huangacdc79a2010-10-18 17:15:55 -0700339/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700340 * Checksum size
341 */
342#define BFA_MFG_CHKSUM_SIZE 16
343
344#define BFA_MFG_PARTNUM_SIZE 14
345#define BFA_MFG_SUPPLIER_ID_SIZE 10
346#define BFA_MFG_SUPPLIER_PARTNUM_SIZE 20
347#define BFA_MFG_SUPPLIER_SERIALNUM_SIZE 20
348#define BFA_MFG_SUPPLIER_REVISION_SIZE 4
Krishna Gudipati8b070b42011-06-13 15:52:40 -0700349/*
350 * Initial capability definition
351 */
352#define BFA_MFG_IC_FC 0x01
353#define BFA_MFG_IC_ETH 0x02
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700354
355#pragma pack(1)
356
Jing Huangacdc79a2010-10-18 17:15:55 -0700357/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700358 * All numerical fields are in big-endian format.
359 */
360struct bfa_mfg_block_s {
361 u8 version; /* manufacturing block version */
362 u8 mfg_sig[3]; /* characters 'M', 'F', 'G' */
363 u16 mfgsize; /* mfg block size */
364 u16 u16_chksum; /* old u16 checksum */
365 char brcd_serialnum[STRSZ(BFA_MFG_SERIALNUM_SIZE)];
366 char brcd_partnum[STRSZ(BFA_MFG_PARTNUM_SIZE)];
367 u8 mfg_day; /* manufacturing day */
368 u8 mfg_month; /* manufacturing month */
369 u16 mfg_year; /* manufacturing year */
370 wwn_t mfg_wwn; /* wwn base for this adapter */
371 u8 num_wwn; /* number of wwns assigned */
372 u8 mfg_speeds; /* speeds allowed for this adapter */
373 u8 rsv[2];
374 char supplier_id[STRSZ(BFA_MFG_SUPPLIER_ID_SIZE)];
375 char supplier_partnum[STRSZ(BFA_MFG_SUPPLIER_PARTNUM_SIZE)];
376 char
377 supplier_serialnum[STRSZ(BFA_MFG_SUPPLIER_SERIALNUM_SIZE)];
378 char
379 supplier_revision[STRSZ(BFA_MFG_SUPPLIER_REVISION_SIZE)];
380 mac_t mfg_mac; /* mac address */
381 u8 num_mac; /* number of mac addresses */
382 u8 rsv2;
383 u32 mfg_type; /* card type */
384 u8 rsv3[108];
385 u8 md5_chksum[BFA_MFG_CHKSUM_SIZE]; /* md5 checksum */
386};
387
388#pragma pack()
389
Jing Huangacdc79a2010-10-18 17:15:55 -0700390/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700391 * ---------------------- pci definitions ------------
392 */
393
Jing Huangacdc79a2010-10-18 17:15:55 -0700394/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700395 * PCI device and vendor ID information
396 */
397enum {
398 BFA_PCI_VENDOR_ID_BROCADE = 0x1657,
399 BFA_PCI_DEVICE_ID_FC_8G2P = 0x13,
400 BFA_PCI_DEVICE_ID_FC_8G1P = 0x17,
401 BFA_PCI_DEVICE_ID_CT = 0x14,
402 BFA_PCI_DEVICE_ID_CT_FC = 0x21,
Krishna Gudipati11189202011-06-13 15:50:35 -0700403 BFA_PCI_DEVICE_ID_CT2 = 0x22,
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700404};
405
Krishna Gudipati11189202011-06-13 15:50:35 -0700406#define bfa_asic_id_cb(__d) \
407 ((__d) == BFA_PCI_DEVICE_ID_FC_8G2P || \
408 (__d) == BFA_PCI_DEVICE_ID_FC_8G1P)
409#define bfa_asic_id_ct(__d) \
410 ((__d) == BFA_PCI_DEVICE_ID_CT || \
411 (__d) == BFA_PCI_DEVICE_ID_CT_FC)
412#define bfa_asic_id_ct2(__d) ((__d) == BFA_PCI_DEVICE_ID_CT2)
413#define bfa_asic_id_ctc(__d) \
414 (bfa_asic_id_ct(__d) || bfa_asic_id_ct2(__d))
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700415
Jing Huangacdc79a2010-10-18 17:15:55 -0700416/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700417 * PCI sub-system device and vendor ID information
418 */
419enum {
420 BFA_PCI_FCOE_SSDEVICE_ID = 0x14,
421};
422
Jing Huangacdc79a2010-10-18 17:15:55 -0700423/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700424 * Maximum number of device address ranges mapped through different BAR(s)
425 */
426#define BFA_PCI_ACCESS_RANGES 1
427
428/*
429 * Port speed settings. Each specific speed is a bit field. Use multiple
430 * bits to specify speeds to be selected for auto-negotiation.
431 */
432enum bfa_port_speed {
433 BFA_PORT_SPEED_UNKNOWN = 0,
434 BFA_PORT_SPEED_1GBPS = 1,
435 BFA_PORT_SPEED_2GBPS = 2,
436 BFA_PORT_SPEED_4GBPS = 4,
437 BFA_PORT_SPEED_8GBPS = 8,
438 BFA_PORT_SPEED_10GBPS = 10,
439 BFA_PORT_SPEED_16GBPS = 16,
440 BFA_PORT_SPEED_AUTO =
441 (BFA_PORT_SPEED_1GBPS | BFA_PORT_SPEED_2GBPS |
Krishna Gudipati8b070b42011-06-13 15:52:40 -0700442 BFA_PORT_SPEED_4GBPS | BFA_PORT_SPEED_8GBPS |
443 BFA_PORT_SPEED_16GBPS),
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700444};
445#define bfa_port_speed_t enum bfa_port_speed
446
447enum {
448 BFA_BOOT_BOOTLUN_MAX = 4, /* maximum boot lun per IOC */
449 BFA_PREBOOT_BOOTLUN_MAX = 8, /* maximum preboot lun per IOC */
450};
451
452#define BOOT_CFG_REV1 1
453#define BOOT_CFG_VLAN 1
454
Jing Huangacdc79a2010-10-18 17:15:55 -0700455/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700456 * Boot options setting. Boot options setting determines from where
457 * to get the boot lun information
458 */
459enum bfa_boot_bootopt {
460 BFA_BOOT_AUTO_DISCOVER = 0, /* Boot from blun provided by fabric */
461 BFA_BOOT_STORED_BLUN = 1, /* Boot from bluns stored in flash */
462 BFA_BOOT_FIRST_LUN = 2, /* Boot from first discovered blun */
463 BFA_BOOT_PBC = 3, /* Boot from pbc configured blun */
464};
465
466#pragma pack(1)
Jing Huangacdc79a2010-10-18 17:15:55 -0700467/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700468 * Boot lun information.
469 */
470struct bfa_boot_bootlun_s {
Maggie Zhangf3148782010-12-09 19:11:39 -0800471 wwn_t pwwn; /* port wwn of target */
472 struct scsi_lun lun; /* 64-bit lun */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700473};
474#pragma pack()
475
Jing Huangacdc79a2010-10-18 17:15:55 -0700476/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700477 * BOOT boot configuraton
478 */
479struct bfa_boot_pbc_s {
480 u8 enable; /* enable/disable SAN boot */
481 u8 speed; /* boot speed settings */
482 u8 topology; /* boot topology setting */
483 u8 rsvd1;
484 u32 nbluns; /* number of boot luns */
485 struct bfa_boot_bootlun_s pblun[BFA_PREBOOT_BOOTLUN_MAX];
486};
487
488#endif /* __BFA_DEFS_H__ */