Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 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 | */ |
Krishna Gudipati | 7af074d | 2010-03-05 19:35:45 -0800 | [diff] [blame^] | 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 encrypted version |
| 49 | */ |
| 50 | #define BFA_MFG_ENC_VER 2 |
| 51 | |
| 52 | /** |
| 53 | * Manufacturing block version 1 length |
| 54 | */ |
| 55 | #define BFA_MFG_VER1_LEN 128 |
| 56 | |
| 57 | /** |
| 58 | * Manufacturing block header length |
| 59 | */ |
| 60 | #define BFA_MFG_HDR_LEN 4 |
| 61 | |
| 62 | /** |
| 63 | * Checksum size |
| 64 | */ |
| 65 | #define BFA_MFG_CHKSUM_SIZE 16 |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 66 | |
| 67 | /** |
| 68 | * Manufacturing block format |
| 69 | */ |
| 70 | #define BFA_MFG_SERIALNUM_SIZE 11 |
| 71 | #define BFA_MFG_PARTNUM_SIZE 14 |
| 72 | #define BFA_MFG_SUPPLIER_ID_SIZE 10 |
Krishna Gudipati | 7af074d | 2010-03-05 19:35:45 -0800 | [diff] [blame^] | 73 | #define BFA_MFG_SUPPLIER_PARTNUM_SIZE 20 |
| 74 | #define BFA_MFG_SUPPLIER_SERIALNUM_SIZE 20 |
| 75 | #define BFA_MFG_SUPPLIER_REVISION_SIZE 4 |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 76 | #define STRSZ(_n) (((_n) + 4) & ~3) |
| 77 | |
| 78 | /** |
Krishna Gudipati | 7af074d | 2010-03-05 19:35:45 -0800 | [diff] [blame^] | 79 | * Manufacturing card type |
| 80 | */ |
| 81 | enum { |
| 82 | BFA_MFG_TYPE_CB_MAX = 825, /* Crossbow card type max */ |
| 83 | BFA_MFG_TYPE_FC8P2 = 825, /* 8G 2port FC card */ |
| 84 | BFA_MFG_TYPE_FC8P1 = 815, /* 8G 1port FC card */ |
| 85 | BFA_MFG_TYPE_FC4P2 = 425, /* 4G 2port FC card */ |
| 86 | BFA_MFG_TYPE_FC4P1 = 415, /* 4G 1port FC card */ |
| 87 | BFA_MFG_TYPE_CNA10P2 = 1020, /* 10G 2port CNA card */ |
| 88 | BFA_MFG_TYPE_CNA10P1 = 1010, /* 10G 1port CNA card */ |
| 89 | }; |
| 90 | |
| 91 | #pragma pack(1) |
| 92 | |
| 93 | /** |
| 94 | * Card type to port number conversion |
| 95 | */ |
| 96 | #define bfa_mfg_type2port_num(card_type) (((card_type) / 10) % 10) |
| 97 | |
| 98 | |
| 99 | /** |
| 100 | * All numerical fields are in big-endian format. |
| 101 | */ |
| 102 | struct bfa_mfg_block_s { |
| 103 | }; |
| 104 | |
| 105 | /** |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 106 | * VPD data length |
| 107 | */ |
Krishna Gudipati | 7af074d | 2010-03-05 19:35:45 -0800 | [diff] [blame^] | 108 | #define BFA_MFG_VPD_LEN 512 |
| 109 | |
| 110 | #define BFA_MFG_VPD_PCI_HDR_OFF 137 |
| 111 | #define BFA_MFG_VPD_PCI_VER_MASK 0x07 /* version mask 3 bits */ |
| 112 | #define BFA_MFG_VPD_PCI_VDR_MASK 0xf8 /* vendor mask 5 bits */ |
| 113 | |
| 114 | /** |
| 115 | * VPD vendor tag |
| 116 | */ |
| 117 | enum { |
| 118 | BFA_MFG_VPD_UNKNOWN = 0, /* vendor unknown */ |
| 119 | BFA_MFG_VPD_IBM = 1, /* vendor IBM */ |
| 120 | BFA_MFG_VPD_HP = 2, /* vendor HP */ |
| 121 | BFA_MFG_VPD_DELL = 3, /* vendor DELL */ |
| 122 | BFA_MFG_VPD_PCI_IBM = 0x08, /* PCI VPD IBM */ |
| 123 | BFA_MFG_VPD_PCI_HP = 0x10, /* PCI VPD HP */ |
| 124 | BFA_MFG_VPD_PCI_DELL = 0x20, /* PCI VPD DELL */ |
| 125 | BFA_MFG_VPD_PCI_BRCD = 0xf8, /* PCI VPD Brocade */ |
| 126 | }; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 127 | |
| 128 | /** |
| 129 | * All numerical fields are in big-endian format. |
| 130 | */ |
| 131 | struct bfa_mfg_vpd_s { |
Krishna Gudipati | 7af074d | 2010-03-05 19:35:45 -0800 | [diff] [blame^] | 132 | u8 version; /* vpd data version */ |
| 133 | u8 vpd_sig[3]; /* characters 'V', 'P', 'D' */ |
| 134 | u8 chksum; /* u8 checksum */ |
| 135 | u8 vendor; /* vendor */ |
| 136 | u8 len; /* vpd data length excluding header */ |
| 137 | u8 rsv; |
| 138 | u8 data[BFA_MFG_VPD_LEN]; /* vpd data */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 139 | }; |
| 140 | |
Krishna Gudipati | 7af074d | 2010-03-05 19:35:45 -0800 | [diff] [blame^] | 141 | #pragma pack() |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 142 | |
| 143 | #endif /* __BFA_DEFS_MFG_H__ */ |