GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / scsi / bfa / include / defs / bfa_defs_mfg.h
blobd22fb7909643faeae46055648491799fdc9b8002
1 /*
2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
3 * All rights reserved
4 * www.brocade.com
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
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
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.
17 #ifndef __BFA_DEFS_MFG_H__
18 #define __BFA_DEFS_MFG_H__
20 #include <bfa_os_inc.h>
22 /**
23 * Manufacturing block version
25 #define BFA_MFG_VERSION 2
27 /**
28 * Manufacturing block encrypted version
30 #define BFA_MFG_ENC_VER 2
32 /**
33 * Manufacturing block version 1 length
35 #define BFA_MFG_VER1_LEN 128
37 /**
38 * Manufacturing block header length
40 #define BFA_MFG_HDR_LEN 4
42 /**
43 * Checksum size
45 #define BFA_MFG_CHKSUM_SIZE 16
47 /**
48 * Manufacturing block format
50 #define BFA_MFG_SERIALNUM_SIZE 11
51 #define BFA_MFG_PARTNUM_SIZE 14
52 #define BFA_MFG_SUPPLIER_ID_SIZE 10
53 #define BFA_MFG_SUPPLIER_PARTNUM_SIZE 20
54 #define BFA_MFG_SUPPLIER_SERIALNUM_SIZE 20
55 #define BFA_MFG_SUPPLIER_REVISION_SIZE 4
56 #define STRSZ(_n) (((_n) + 4) & ~3)
58 /**
59 * Manufacturing card type
61 enum {
62 BFA_MFG_TYPE_CB_MAX = 825, /* Crossbow card type max */
63 BFA_MFG_TYPE_FC8P2 = 825, /* 8G 2port FC card */
64 BFA_MFG_TYPE_FC8P1 = 815, /* 8G 1port FC card */
65 BFA_MFG_TYPE_FC4P2 = 425, /* 4G 2port FC card */
66 BFA_MFG_TYPE_FC4P1 = 415, /* 4G 1port FC card */
67 BFA_MFG_TYPE_CNA10P2 = 1020, /* 10G 2port CNA card */
68 BFA_MFG_TYPE_CNA10P1 = 1010, /* 10G 1port CNA card */
69 BFA_MFG_TYPE_JAYHAWK = 804, /* Jayhawk mezz card */
70 BFA_MFG_TYPE_WANCHESE = 1007, /* Wanchese mezz card */
71 BFA_MFG_TYPE_INVALID = 0, /* Invalid card type */
74 #pragma pack(1)
76 /**
77 * Card type to port number conversion
79 #define bfa_mfg_type2port_num(card_type) (((card_type) / 10) % 10)
81 /**
82 * Check if Mezz card
84 #define bfa_mfg_is_mezz(type) (( \
85 (type) == BFA_MFG_TYPE_JAYHAWK || \
86 (type) == BFA_MFG_TYPE_WANCHESE))
88 /**
89 * Check if card type valid
91 #define bfa_mfg_is_card_type_valid(type) (( \
92 (type) == BFA_MFG_TYPE_FC8P2 || \
93 (type) == BFA_MFG_TYPE_FC8P1 || \
94 (type) == BFA_MFG_TYPE_FC4P2 || \
95 (type) == BFA_MFG_TYPE_FC4P1 || \
96 (type) == BFA_MFG_TYPE_CNA10P2 || \
97 (type) == BFA_MFG_TYPE_CNA10P1 || \
98 bfa_mfg_is_mezz(type)))
101 * All numerical fields are in big-endian format.
103 struct bfa_mfg_block_s {
107 * VPD data length
109 #define BFA_MFG_VPD_LEN 512
111 #define BFA_MFG_VPD_PCI_HDR_OFF 137
112 #define BFA_MFG_VPD_PCI_VER_MASK 0x07 /* version mask 3 bits */
113 #define BFA_MFG_VPD_PCI_VDR_MASK 0xf8 /* vendor mask 5 bits */
116 * VPD vendor tag
118 enum {
119 BFA_MFG_VPD_UNKNOWN = 0, /* vendor unknown */
120 BFA_MFG_VPD_IBM = 1, /* vendor IBM */
121 BFA_MFG_VPD_HP = 2, /* vendor HP */
122 BFA_MFG_VPD_DELL = 3, /* vendor DELL */
123 BFA_MFG_VPD_PCI_IBM = 0x08, /* PCI VPD IBM */
124 BFA_MFG_VPD_PCI_HP = 0x10, /* PCI VPD HP */
125 BFA_MFG_VPD_PCI_DELL = 0x20, /* PCI VPD DELL */
126 BFA_MFG_VPD_PCI_BRCD = 0xf8, /* PCI VPD Brocade */
130 * All numerical fields are in big-endian format.
132 struct bfa_mfg_vpd_s {
133 u8 version; /* vpd data version */
134 u8 vpd_sig[3]; /* characters 'V', 'P', 'D' */
135 u8 chksum; /* u8 checksum */
136 u8 vendor; /* vendor */
137 u8 len; /* vpd data length excluding header */
138 u8 rsv;
139 u8 data[BFA_MFG_VPD_LEN]; /* vpd data */
142 #pragma pack()
144 #endif /* __BFA_DEFS_MFG_H__ */