]> git.karo-electronics.de Git - mv-sheeva.git/blob - drivers/scsi/bfa/include/defs/bfa_defs_mfg.h
x86, numa: Assign CPUs to nodes in round-robin manner on fake NUMA
[mv-sheeva.git] / drivers / scsi / bfa / include / defs / bfa_defs_mfg.h
1 /*
2  * Copyright (c) 2005-2009 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 #ifndef __BFA_DEFS_MFG_H__
18 #define __BFA_DEFS_MFG_H__
19
20 #include <bfa_os_inc.h>
21
22 /**
23  * Manufacturing block version
24  */
25 #define BFA_MFG_VERSION                         2
26
27 /**
28  * Manufacturing block encrypted version
29  */
30 #define BFA_MFG_ENC_VER                         2
31
32 /**
33  * Manufacturing block version 1 length
34  */
35 #define BFA_MFG_VER1_LEN                        128
36
37 /**
38  * Manufacturing block header length
39  */
40 #define BFA_MFG_HDR_LEN                         4
41
42 /**
43  * Checksum size
44  */
45 #define BFA_MFG_CHKSUM_SIZE                     16
46
47 /**
48  * Manufacturing block format
49  */
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)
57
58 /**
59  * Manufacturing card type
60  */
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 */
72 };
73
74 #pragma pack(1)
75
76 /**
77  * Card type to port number conversion
78  */
79 #define bfa_mfg_type2port_num(card_type) (((card_type) / 10) % 10)
80
81 /**
82  * Check if Mezz card
83  */
84 #define bfa_mfg_is_mezz(type) (( \
85         (type) == BFA_MFG_TYPE_JAYHAWK || \
86         (type) == BFA_MFG_TYPE_WANCHESE))
87
88 /**
89  * Check if card type valid
90  */
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)))
99
100 /**
101  * All numerical fields are in big-endian format.
102  */
103 struct bfa_mfg_block_s {
104 };
105
106 /**
107  * VPD data length
108  */
109 #define BFA_MFG_VPD_LEN         512
110
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 */
114
115 /**
116  * VPD vendor tag
117  */
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            */
127 };
128
129 /**
130  * All numerical fields are in big-endian format.
131  */
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 */
140 };
141
142 #pragma pack()
143
144 #endif /* __BFA_DEFS_MFG_H__ */