diff options
author | Jing Huang <huangj@brocade.com> | 2010-07-08 22:45:56 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:04:04 -0400 |
commit | ed96932470e4ca3aab29518a748dc1162853b456 (patch) | |
tree | 7585615e2cd952edbbd7c1bec1e414c699656ff3 /drivers/scsi/bfa/include | |
parent | 293f82d59ed8b6d61d242e40ee7a6a146fae5eaa (diff) |
[SCSI] bfa: enable basic PBC support
The patch includes the driver side changes to enable basic PBC (PreBoot
Configuration) feature.
- Data structure changes and new definitions for PBC.
- APIs to access PBC info.
- Remove unused code.
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/include')
-rw-r--r-- | drivers/scsi/bfa/include/bfi/bfi_iocfc.h | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/bfi/bfi_pbc.h | 62 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/defs/bfa_defs_adapter.h | 3 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/defs/bfa_defs_boot.h | 10 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/defs/bfa_defs_mfg.h | 38 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/defs/bfa_defs_pport.h | 3 |
6 files changed, 97 insertions, 21 deletions
diff --git a/drivers/scsi/bfa/include/bfi/bfi_iocfc.h b/drivers/scsi/bfa/include/bfi/bfi_iocfc.h index c3760df72575..ccdfcc5d7e0b 100644 --- a/drivers/scsi/bfa/include/bfi/bfi_iocfc.h +++ b/drivers/scsi/bfa/include/bfi/bfi_iocfc.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #define __BFI_IOCFC_H__ | 19 | #define __BFI_IOCFC_H__ |
20 | 20 | ||
21 | #include "bfi.h" | 21 | #include "bfi.h" |
22 | #include <bfi/bfi_pbc.h> | ||
22 | #include <defs/bfa_defs_ioc.h> | 23 | #include <defs/bfa_defs_ioc.h> |
23 | #include <defs/bfa_defs_iocfc.h> | 24 | #include <defs/bfa_defs_iocfc.h> |
24 | #include <defs/bfa_defs_boot.h> | 25 | #include <defs/bfa_defs_boot.h> |
@@ -78,6 +79,7 @@ struct bfi_iocfc_cfgrsp_s { | |||
78 | struct bfa_iocfc_fwcfg_s fwcfg; | 79 | struct bfa_iocfc_fwcfg_s fwcfg; |
79 | struct bfa_iocfc_intr_attr_s intr_attr; | 80 | struct bfa_iocfc_intr_attr_s intr_attr; |
80 | struct bfi_iocfc_bootwwns bootwwns; | 81 | struct bfi_iocfc_bootwwns bootwwns; |
82 | struct bfi_pbc_s pbc_cfg; | ||
81 | }; | 83 | }; |
82 | 84 | ||
83 | /** | 85 | /** |
diff --git a/drivers/scsi/bfa/include/bfi/bfi_pbc.h b/drivers/scsi/bfa/include/bfi/bfi_pbc.h new file mode 100644 index 000000000000..88a4154c30c0 --- /dev/null +++ b/drivers/scsi/bfa/include/bfi/bfi_pbc.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
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 __BFI_PBC_H__ | ||
19 | #define __BFI_PBC_H__ | ||
20 | |||
21 | #pragma pack(1) | ||
22 | |||
23 | #define BFI_PBC_MAX_BLUNS 8 | ||
24 | #define BFI_PBC_MAX_VPORTS 16 | ||
25 | |||
26 | #define BFI_PBC_PORT_DISABLED 2 | ||
27 | /** | ||
28 | * PBC boot lun configuration | ||
29 | */ | ||
30 | struct bfi_pbc_blun_s { | ||
31 | wwn_t tgt_pwwn; | ||
32 | lun_t tgt_lun; | ||
33 | }; | ||
34 | |||
35 | /** | ||
36 | * PBC virtual port configuration | ||
37 | */ | ||
38 | struct bfi_pbc_vport_s { | ||
39 | wwn_t vp_pwwn; | ||
40 | wwn_t vp_nwwn; | ||
41 | }; | ||
42 | |||
43 | /** | ||
44 | * BFI pre-boot configuration information | ||
45 | */ | ||
46 | struct bfi_pbc_s { | ||
47 | u8 port_enabled; | ||
48 | u8 boot_enabled; | ||
49 | u8 nbluns; | ||
50 | u8 nvports; | ||
51 | u8 port_speed; | ||
52 | u8 rsvd_a; | ||
53 | u16 hss; | ||
54 | wwn_t pbc_pwwn; | ||
55 | wwn_t pbc_nwwn; | ||
56 | struct bfi_pbc_blun_s blun[BFI_PBC_MAX_BLUNS]; | ||
57 | struct bfi_pbc_vport_s vport[BFI_PBC_MAX_VPORTS]; | ||
58 | }; | ||
59 | |||
60 | #pragma pack() | ||
61 | |||
62 | #endif /* __BFI_PBC_H__ */ | ||
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_adapter.h b/drivers/scsi/bfa/include/defs/bfa_defs_adapter.h index 8c208fc8e329..aea0360d67d5 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_adapter.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_adapter.h | |||
@@ -39,7 +39,7 @@ enum { | |||
39 | struct bfa_adapter_attr_s { | 39 | struct bfa_adapter_attr_s { |
40 | char manufacturer[BFA_ADAPTER_MFG_NAME_LEN]; | 40 | char manufacturer[BFA_ADAPTER_MFG_NAME_LEN]; |
41 | char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN]; | 41 | char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN]; |
42 | u32 rsvd1; | 42 | u32 card_type; |
43 | char model[BFA_ADAPTER_MODEL_NAME_LEN]; | 43 | char model[BFA_ADAPTER_MODEL_NAME_LEN]; |
44 | char model_descr[BFA_ADAPTER_MODEL_DESCR_LEN]; | 44 | char model_descr[BFA_ADAPTER_MODEL_DESCR_LEN]; |
45 | wwn_t pwwn; | 45 | wwn_t pwwn; |
@@ -60,6 +60,7 @@ struct bfa_adapter_attr_s { | |||
60 | u8 pcie_lanes_orig; | 60 | u8 pcie_lanes_orig; |
61 | u8 pcie_lanes; | 61 | u8 pcie_lanes; |
62 | u8 cna_capable; | 62 | u8 cna_capable; |
63 | u8 is_mezz; | ||
63 | }; | 64 | }; |
64 | 65 | ||
65 | /** | 66 | /** |
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_boot.h b/drivers/scsi/bfa/include/defs/bfa_defs_boot.h index 6f4aa5283545..0fca10b6ad10 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_boot.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_boot.h | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | enum { | 25 | enum { |
26 | BFA_BOOT_BOOTLUN_MAX = 4, /* maximum boot lun per IOC */ | 26 | BFA_BOOT_BOOTLUN_MAX = 4, /* maximum boot lun per IOC */ |
27 | BFA_PREBOOT_BOOTLUN_MAX = 8, /* maximum preboot lun per IOC */ | ||
28 | |||
27 | }; | 29 | }; |
28 | 30 | ||
29 | #define BOOT_CFG_REV1 1 | 31 | #define BOOT_CFG_REV1 1 |
@@ -67,5 +69,13 @@ struct bfa_boot_cfg_s { | |||
67 | struct bfa_boot_bootlun_s blun_disc[BFA_BOOT_BOOTLUN_MAX]; | 69 | struct bfa_boot_bootlun_s blun_disc[BFA_BOOT_BOOTLUN_MAX]; |
68 | }; | 70 | }; |
69 | 71 | ||
72 | struct bfa_boot_pbc_s { | ||
73 | u8 enable; /* enable/disable SAN boot */ | ||
74 | u8 speed; /* boot speed settings */ | ||
75 | u8 topology; /* boot topology setting */ | ||
76 | u8 rsvd1; | ||
77 | u32 nbluns; /* number of boot luns */ | ||
78 | struct bfa_boot_bootlun_s pblun[BFA_PREBOOT_BOOTLUN_MAX]; | ||
79 | }; | ||
70 | 80 | ||
71 | #endif /* __BFA_DEFS_BOOT_H__ */ | 81 | #endif /* __BFA_DEFS_BOOT_H__ */ |
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h b/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h index bfb50eb2124d..d22fb7909643 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h | |||
@@ -45,26 +45,6 @@ | |||
45 | #define BFA_MFG_CHKSUM_SIZE 16 | 45 | #define BFA_MFG_CHKSUM_SIZE 16 |
46 | 46 | ||
47 | /** | 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 | ||
66 | |||
67 | /** | ||
68 | * Manufacturing block format | 48 | * Manufacturing block format |
69 | */ | 49 | */ |
70 | #define BFA_MFG_SERIALNUM_SIZE 11 | 50 | #define BFA_MFG_SERIALNUM_SIZE 11 |
@@ -98,6 +78,24 @@ enum { | |||
98 | */ | 78 | */ |
99 | #define bfa_mfg_type2port_num(card_type) (((card_type) / 10) % 10) | 79 | #define bfa_mfg_type2port_num(card_type) (((card_type) / 10) % 10) |
100 | 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))) | ||
101 | 99 | ||
102 | /** | 100 | /** |
103 | * All numerical fields are in big-endian format. | 101 | * All numerical fields are in big-endian format. |
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h index 26e5cc78095d..de6181cf9677 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h | |||
@@ -38,6 +38,7 @@ enum bfa_pport_states { | |||
38 | BFA_PPORT_ST_IOCDOWN = 10, | 38 | BFA_PPORT_ST_IOCDOWN = 10, |
39 | BFA_PPORT_ST_IOCDIS = 11, | 39 | BFA_PPORT_ST_IOCDIS = 11, |
40 | BFA_PPORT_ST_FWMISMATCH = 12, | 40 | BFA_PPORT_ST_FWMISMATCH = 12, |
41 | BFA_PPORT_ST_PREBOOT_DISABLED = 13, | ||
41 | BFA_PPORT_ST_MAX_STATE, | 42 | BFA_PPORT_ST_MAX_STATE, |
42 | }; | 43 | }; |
43 | 44 | ||
@@ -203,6 +204,8 @@ struct bfa_pport_attr_s { | |||
203 | */ | 204 | */ |
204 | wwn_t nwwn; /* node wwn */ | 205 | wwn_t nwwn; /* node wwn */ |
205 | wwn_t pwwn; /* port wwn */ | 206 | wwn_t pwwn; /* port wwn */ |
207 | wwn_t factorynwwn; /* factory node wwn */ | ||
208 | wwn_t factorypwwn; /* factory port wwn */ | ||
206 | enum fc_cos cos_supported; /* supported class of services */ | 209 | enum fc_cos cos_supported; /* supported class of services */ |
207 | u32 rsvd; | 210 | u32 rsvd; |
208 | struct fc_symname_s port_symname; /* port symbolic name */ | 211 | struct fc_symname_s port_symname; /* port symbolic name */ |