diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2011-06-13 18:54:31 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-06-29 16:56:05 -0400 |
commit | 75332a70a84908810ab5f525b03f230be9e31753 (patch) | |
tree | f15001807ccaf2b9857e6de82640faff160c7bb1 /drivers/scsi/bfa/bfa_fcs.c | |
parent | e2187d7f38967aeaf4148cdbe3498f76f4f71bca (diff) |
[SCSI] bfa: Driver initialization and model description fix
- Moved FCS initialization, which internally does the im_port creation
as well as the scsi_host creation before bfa_init.
Once the bfa_init is complete & successful:
- Reset the FCS base port cfg params such as pwwn/nwwn and setup fc host
params - based on the values learned during the ioc getattr request.
- Change needed to support BSG commands even on bfa init failure.
- Model description fixes for Brocade adapters.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcs.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c index 6c8a27e78974..b9f9e15a02a1 100644 --- a/drivers/scsi/bfa/bfa_fcs.c +++ b/drivers/scsi/bfa/bfa_fcs.c | |||
@@ -92,25 +92,49 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad, | |||
92 | void | 92 | void |
93 | bfa_fcs_init(struct bfa_fcs_s *fcs) | 93 | bfa_fcs_init(struct bfa_fcs_s *fcs) |
94 | { | 94 | { |
95 | int i, npbc_vports; | 95 | int i; |
96 | struct bfa_fcs_mod_s *mod; | 96 | struct bfa_fcs_mod_s *mod; |
97 | struct bfi_pbc_vport_s pbc_vports[BFI_PBC_MAX_VPORTS]; | ||
98 | 97 | ||
99 | for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) { | 98 | for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) { |
100 | mod = &fcs_modules[i]; | 99 | mod = &fcs_modules[i]; |
101 | if (mod->modinit) | 100 | if (mod->modinit) |
102 | mod->modinit(fcs); | 101 | mod->modinit(fcs); |
103 | } | 102 | } |
103 | } | ||
104 | |||
105 | /* | ||
106 | * FCS update cfg - reset the pwwn/nwwn of fabric base logical port | ||
107 | * with values learned during bfa_init firmware GETATTR REQ. | ||
108 | */ | ||
109 | void | ||
110 | bfa_fcs_update_cfg(struct bfa_fcs_s *fcs) | ||
111 | { | ||
112 | struct bfa_fcs_fabric_s *fabric = &fcs->fabric; | ||
113 | struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; | ||
114 | struct bfa_ioc_s *ioc = &fabric->fcs->bfa->ioc; | ||
115 | |||
116 | port_cfg->nwwn = ioc->attr->nwwn; | ||
117 | port_cfg->pwwn = ioc->attr->pwwn; | ||
118 | } | ||
119 | |||
120 | /* | ||
121 | * fcs pbc vport initialization | ||
122 | */ | ||
123 | void | ||
124 | bfa_fcs_pbc_vport_init(struct bfa_fcs_s *fcs) | ||
125 | { | ||
126 | int i, npbc_vports; | ||
127 | struct bfi_pbc_vport_s pbc_vports[BFI_PBC_MAX_VPORTS]; | ||
128 | |||
104 | /* Initialize pbc vports */ | 129 | /* Initialize pbc vports */ |
105 | if (!fcs->min_cfg) { | 130 | if (!fcs->min_cfg) { |
106 | npbc_vports = | 131 | npbc_vports = |
107 | bfa_iocfc_get_pbc_vports(fcs->bfa, pbc_vports); | 132 | bfa_iocfc_get_pbc_vports(fcs->bfa, pbc_vports); |
108 | for (i = 0; i < npbc_vports; i++) | 133 | for (i = 0; i < npbc_vports; i++) |
109 | bfa_fcb_pbc_vport_create(fcs->bfa->bfad, pbc_vports[i]); | 134 | bfa_fcb_pbc_vport_create(fcs->bfa->bfad, pbc_vports[i]); |
110 | } | 135 | } |
111 | } | 136 | } |
112 | 137 | ||
113 | |||
114 | /* | 138 | /* |
115 | * brief | 139 | * brief |
116 | * FCS driver details initialization. | 140 | * FCS driver details initialization. |