diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2012-03-13 20:39:36 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-03-28 04:55:22 -0400 |
commit | db9d8a75afd9dbd32c80d12d6033eca3336ef4f2 (patch) | |
tree | e13c0bc9be09b70028a3672f2c666e7dfd7ff8d3 /drivers | |
parent | a6b963db0de3c9aa22db2f872e38c2a12edf09a7 (diff) |
[SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation.
Made changes to the Fabric Assigned Address(FAA) feature implementation.
Introduced the IOCFC state machine, which now handles the FAA logic,
IOC and BFA sub-modules enablement.
Removed un-wanted FAA enable/disable routines; FAA is enabled by default.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/bfa/bfa.h | 9 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_core.c | 680 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_defs_svc.h | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.c | 122 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.h | 17 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_svc.c | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_svc.h | 4 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad_bsg.c | 50 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad_bsg.h | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfi_ms.h | 17 |
10 files changed, 525 insertions, 380 deletions
diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h index a796de935054..4ad7e368bbc2 100644 --- a/drivers/scsi/bfa/bfa.h +++ b/drivers/scsi/bfa/bfa.h | |||
@@ -225,9 +225,9 @@ struct bfa_faa_args_s { | |||
225 | }; | 225 | }; |
226 | 226 | ||
227 | struct bfa_iocfc_s { | 227 | struct bfa_iocfc_s { |
228 | bfa_fsm_t fsm; | ||
228 | struct bfa_s *bfa; | 229 | struct bfa_s *bfa; |
229 | struct bfa_iocfc_cfg_s cfg; | 230 | struct bfa_iocfc_cfg_s cfg; |
230 | int action; | ||
231 | u32 req_cq_pi[BFI_IOC_MAX_CQS]; | 231 | u32 req_cq_pi[BFI_IOC_MAX_CQS]; |
232 | u32 rsp_cq_ci[BFI_IOC_MAX_CQS]; | 232 | u32 rsp_cq_ci[BFI_IOC_MAX_CQS]; |
233 | u8 hw_qid[BFI_IOC_MAX_CQS]; | 233 | u8 hw_qid[BFI_IOC_MAX_CQS]; |
@@ -236,7 +236,9 @@ struct bfa_iocfc_s { | |||
236 | struct bfa_cb_qe_s dis_hcb_qe; | 236 | struct bfa_cb_qe_s dis_hcb_qe; |
237 | struct bfa_cb_qe_s en_hcb_qe; | 237 | struct bfa_cb_qe_s en_hcb_qe; |
238 | struct bfa_cb_qe_s stats_hcb_qe; | 238 | struct bfa_cb_qe_s stats_hcb_qe; |
239 | bfa_boolean_t cfgdone; | 239 | bfa_boolean_t submod_enabled; |
240 | bfa_boolean_t cb_reqd; /* Driver call back reqd */ | ||
241 | bfa_status_t op_status; /* Status of bfa iocfc op */ | ||
240 | 242 | ||
241 | struct bfa_dma_s cfg_info; | 243 | struct bfa_dma_s cfg_info; |
242 | struct bfi_iocfc_cfg_s *cfginfo; | 244 | struct bfi_iocfc_cfg_s *cfginfo; |
@@ -341,8 +343,6 @@ void bfa_hwct_msix_getvecs(struct bfa_s *bfa, u32 *vecmap, u32 *nvecs, | |||
341 | void bfa_hwct_msix_get_rme_range(struct bfa_s *bfa, u32 *start, | 343 | void bfa_hwct_msix_get_rme_range(struct bfa_s *bfa, u32 *start, |
342 | u32 *end); | 344 | u32 *end); |
343 | void bfa_iocfc_get_bootwwns(struct bfa_s *bfa, u8 *nwwns, wwn_t *wwns); | 345 | void bfa_iocfc_get_bootwwns(struct bfa_s *bfa, u8 *nwwns, wwn_t *wwns); |
344 | wwn_t bfa_iocfc_get_pwwn(struct bfa_s *bfa); | ||
345 | wwn_t bfa_iocfc_get_nwwn(struct bfa_s *bfa); | ||
346 | int bfa_iocfc_get_pbc_vports(struct bfa_s *bfa, | 346 | int bfa_iocfc_get_pbc_vports(struct bfa_s *bfa, |
347 | struct bfi_pbc_vport_s *pbc_vport); | 347 | struct bfi_pbc_vport_s *pbc_vport); |
348 | 348 | ||
@@ -428,7 +428,6 @@ bfa_status_t bfa_iocfc_israttr_set(struct bfa_s *bfa, | |||
428 | 428 | ||
429 | void bfa_iocfc_enable(struct bfa_s *bfa); | 429 | void bfa_iocfc_enable(struct bfa_s *bfa); |
430 | void bfa_iocfc_disable(struct bfa_s *bfa); | 430 | void bfa_iocfc_disable(struct bfa_s *bfa); |
431 | void bfa_iocfc_cb_dconf_modinit(struct bfa_s *bfa, bfa_status_t status); | ||
432 | #define bfa_timer_start(_bfa, _timer, _timercb, _arg, _timeout) \ | 431 | #define bfa_timer_start(_bfa, _timer, _timercb, _arg, _timeout) \ |
433 | bfa_timer_begin(&(_bfa)->timer_mod, _timer, _timercb, _arg, _timeout) | 432 | bfa_timer_begin(&(_bfa)->timer_mod, _timer, _timercb, _arg, _timeout) |
434 | 433 | ||
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c index 035c9d5caf01..456e5762977d 100644 --- a/drivers/scsi/bfa/bfa_core.c +++ b/drivers/scsi/bfa/bfa_core.c | |||
@@ -200,13 +200,431 @@ enum { | |||
200 | #define DEF_CFG_NUM_SBOOT_LUNS 16 | 200 | #define DEF_CFG_NUM_SBOOT_LUNS 16 |
201 | 201 | ||
202 | /* | 202 | /* |
203 | * IOCFC state machine definitions/declarations | ||
204 | */ | ||
205 | bfa_fsm_state_decl(bfa_iocfc, stopped, struct bfa_iocfc_s, enum iocfc_event); | ||
206 | bfa_fsm_state_decl(bfa_iocfc, initing, struct bfa_iocfc_s, enum iocfc_event); | ||
207 | bfa_fsm_state_decl(bfa_iocfc, dconf_read, struct bfa_iocfc_s, enum iocfc_event); | ||
208 | bfa_fsm_state_decl(bfa_iocfc, init_cfg_wait, | ||
209 | struct bfa_iocfc_s, enum iocfc_event); | ||
210 | bfa_fsm_state_decl(bfa_iocfc, init_cfg_done, | ||
211 | struct bfa_iocfc_s, enum iocfc_event); | ||
212 | bfa_fsm_state_decl(bfa_iocfc, operational, | ||
213 | struct bfa_iocfc_s, enum iocfc_event); | ||
214 | bfa_fsm_state_decl(bfa_iocfc, dconf_write, | ||
215 | struct bfa_iocfc_s, enum iocfc_event); | ||
216 | bfa_fsm_state_decl(bfa_iocfc, stopping, struct bfa_iocfc_s, enum iocfc_event); | ||
217 | bfa_fsm_state_decl(bfa_iocfc, enabling, struct bfa_iocfc_s, enum iocfc_event); | ||
218 | bfa_fsm_state_decl(bfa_iocfc, cfg_wait, struct bfa_iocfc_s, enum iocfc_event); | ||
219 | bfa_fsm_state_decl(bfa_iocfc, disabling, struct bfa_iocfc_s, enum iocfc_event); | ||
220 | bfa_fsm_state_decl(bfa_iocfc, disabled, struct bfa_iocfc_s, enum iocfc_event); | ||
221 | bfa_fsm_state_decl(bfa_iocfc, failed, struct bfa_iocfc_s, enum iocfc_event); | ||
222 | bfa_fsm_state_decl(bfa_iocfc, init_failed, | ||
223 | struct bfa_iocfc_s, enum iocfc_event); | ||
224 | |||
225 | /* | ||
203 | * forward declaration for IOC FC functions | 226 | * forward declaration for IOC FC functions |
204 | */ | 227 | */ |
228 | static void bfa_iocfc_start_submod(struct bfa_s *bfa); | ||
229 | static void bfa_iocfc_disable_submod(struct bfa_s *bfa); | ||
230 | static void bfa_iocfc_send_cfg(void *bfa_arg); | ||
205 | static void bfa_iocfc_enable_cbfn(void *bfa_arg, enum bfa_status status); | 231 | static void bfa_iocfc_enable_cbfn(void *bfa_arg, enum bfa_status status); |
206 | static void bfa_iocfc_disable_cbfn(void *bfa_arg); | 232 | static void bfa_iocfc_disable_cbfn(void *bfa_arg); |
207 | static void bfa_iocfc_hbfail_cbfn(void *bfa_arg); | 233 | static void bfa_iocfc_hbfail_cbfn(void *bfa_arg); |
208 | static void bfa_iocfc_reset_cbfn(void *bfa_arg); | 234 | static void bfa_iocfc_reset_cbfn(void *bfa_arg); |
209 | static struct bfa_ioc_cbfn_s bfa_iocfc_cbfn; | 235 | static struct bfa_ioc_cbfn_s bfa_iocfc_cbfn; |
236 | static void bfa_iocfc_init_cb(void *bfa_arg, bfa_boolean_t complete); | ||
237 | static void bfa_iocfc_stop_cb(void *bfa_arg, bfa_boolean_t compl); | ||
238 | static void bfa_iocfc_enable_cb(void *bfa_arg, bfa_boolean_t compl); | ||
239 | static void bfa_iocfc_disable_cb(void *bfa_arg, bfa_boolean_t compl); | ||
240 | |||
241 | static void | ||
242 | bfa_iocfc_sm_stopped_entry(struct bfa_iocfc_s *iocfc) | ||
243 | { | ||
244 | } | ||
245 | |||
246 | static void | ||
247 | bfa_iocfc_sm_stopped(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
248 | { | ||
249 | bfa_trc(iocfc->bfa, event); | ||
250 | |||
251 | switch (event) { | ||
252 | case IOCFC_E_INIT: | ||
253 | case IOCFC_E_ENABLE: | ||
254 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_initing); | ||
255 | break; | ||
256 | default: | ||
257 | bfa_sm_fault(iocfc->bfa, event); | ||
258 | break; | ||
259 | } | ||
260 | } | ||
261 | |||
262 | static void | ||
263 | bfa_iocfc_sm_initing_entry(struct bfa_iocfc_s *iocfc) | ||
264 | { | ||
265 | bfa_ioc_enable(&iocfc->bfa->ioc); | ||
266 | } | ||
267 | |||
268 | static void | ||
269 | bfa_iocfc_sm_initing(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
270 | { | ||
271 | bfa_trc(iocfc->bfa, event); | ||
272 | |||
273 | switch (event) { | ||
274 | case IOCFC_E_IOC_ENABLED: | ||
275 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_dconf_read); | ||
276 | break; | ||
277 | case IOCFC_E_IOC_FAILED: | ||
278 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_failed); | ||
279 | break; | ||
280 | default: | ||
281 | bfa_sm_fault(iocfc->bfa, event); | ||
282 | break; | ||
283 | } | ||
284 | } | ||
285 | |||
286 | static void | ||
287 | bfa_iocfc_sm_dconf_read_entry(struct bfa_iocfc_s *iocfc) | ||
288 | { | ||
289 | bfa_dconf_modinit(iocfc->bfa); | ||
290 | } | ||
291 | |||
292 | static void | ||
293 | bfa_iocfc_sm_dconf_read(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
294 | { | ||
295 | bfa_trc(iocfc->bfa, event); | ||
296 | |||
297 | switch (event) { | ||
298 | case IOCFC_E_DCONF_DONE: | ||
299 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_cfg_wait); | ||
300 | break; | ||
301 | case IOCFC_E_IOC_FAILED: | ||
302 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_failed); | ||
303 | break; | ||
304 | default: | ||
305 | bfa_sm_fault(iocfc->bfa, event); | ||
306 | break; | ||
307 | } | ||
308 | } | ||
309 | |||
310 | static void | ||
311 | bfa_iocfc_sm_init_cfg_wait_entry(struct bfa_iocfc_s *iocfc) | ||
312 | { | ||
313 | bfa_iocfc_send_cfg(iocfc->bfa); | ||
314 | } | ||
315 | |||
316 | static void | ||
317 | bfa_iocfc_sm_init_cfg_wait(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
318 | { | ||
319 | bfa_trc(iocfc->bfa, event); | ||
320 | |||
321 | switch (event) { | ||
322 | case IOCFC_E_CFG_DONE: | ||
323 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_cfg_done); | ||
324 | break; | ||
325 | case IOCFC_E_IOC_FAILED: | ||
326 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_failed); | ||
327 | break; | ||
328 | default: | ||
329 | bfa_sm_fault(iocfc->bfa, event); | ||
330 | break; | ||
331 | } | ||
332 | } | ||
333 | |||
334 | static void | ||
335 | bfa_iocfc_sm_init_cfg_done_entry(struct bfa_iocfc_s *iocfc) | ||
336 | { | ||
337 | iocfc->bfa->iocfc.op_status = BFA_STATUS_OK; | ||
338 | bfa_cb_queue(iocfc->bfa, &iocfc->bfa->iocfc.init_hcb_qe, | ||
339 | bfa_iocfc_init_cb, iocfc->bfa); | ||
340 | } | ||
341 | |||
342 | static void | ||
343 | bfa_iocfc_sm_init_cfg_done(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
344 | { | ||
345 | bfa_trc(iocfc->bfa, event); | ||
346 | |||
347 | switch (event) { | ||
348 | case IOCFC_E_START: | ||
349 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_operational); | ||
350 | break; | ||
351 | case IOCFC_E_STOP: | ||
352 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_stopping); | ||
353 | break; | ||
354 | case IOCFC_E_DISABLE: | ||
355 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabling); | ||
356 | break; | ||
357 | case IOCFC_E_IOC_FAILED: | ||
358 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_failed); | ||
359 | break; | ||
360 | default: | ||
361 | bfa_sm_fault(iocfc->bfa, event); | ||
362 | break; | ||
363 | } | ||
364 | } | ||
365 | |||
366 | static void | ||
367 | bfa_iocfc_sm_operational_entry(struct bfa_iocfc_s *iocfc) | ||
368 | { | ||
369 | bfa_fcport_init(iocfc->bfa); | ||
370 | bfa_iocfc_start_submod(iocfc->bfa); | ||
371 | } | ||
372 | |||
373 | static void | ||
374 | bfa_iocfc_sm_operational(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
375 | { | ||
376 | bfa_trc(iocfc->bfa, event); | ||
377 | |||
378 | switch (event) { | ||
379 | case IOCFC_E_STOP: | ||
380 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_dconf_write); | ||
381 | break; | ||
382 | case IOCFC_E_DISABLE: | ||
383 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabling); | ||
384 | break; | ||
385 | case IOCFC_E_IOC_FAILED: | ||
386 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_failed); | ||
387 | break; | ||
388 | default: | ||
389 | bfa_sm_fault(iocfc->bfa, event); | ||
390 | break; | ||
391 | } | ||
392 | } | ||
393 | |||
394 | static void | ||
395 | bfa_iocfc_sm_dconf_write_entry(struct bfa_iocfc_s *iocfc) | ||
396 | { | ||
397 | bfa_dconf_modexit(iocfc->bfa); | ||
398 | } | ||
399 | |||
400 | static void | ||
401 | bfa_iocfc_sm_dconf_write(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
402 | { | ||
403 | bfa_trc(iocfc->bfa, event); | ||
404 | |||
405 | switch (event) { | ||
406 | case IOCFC_E_DCONF_DONE: | ||
407 | case IOCFC_E_IOC_FAILED: | ||
408 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_stopping); | ||
409 | break; | ||
410 | default: | ||
411 | bfa_sm_fault(iocfc->bfa, event); | ||
412 | break; | ||
413 | } | ||
414 | } | ||
415 | |||
416 | static void | ||
417 | bfa_iocfc_sm_stopping_entry(struct bfa_iocfc_s *iocfc) | ||
418 | { | ||
419 | bfa_ioc_disable(&iocfc->bfa->ioc); | ||
420 | } | ||
421 | |||
422 | static void | ||
423 | bfa_iocfc_sm_stopping(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
424 | { | ||
425 | bfa_trc(iocfc->bfa, event); | ||
426 | |||
427 | switch (event) { | ||
428 | case IOCFC_E_IOC_DISABLED: | ||
429 | bfa_isr_disable(iocfc->bfa); | ||
430 | bfa_iocfc_disable_submod(iocfc->bfa); | ||
431 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_stopped); | ||
432 | iocfc->bfa->iocfc.op_status = BFA_STATUS_OK; | ||
433 | bfa_cb_queue(iocfc->bfa, &iocfc->bfa->iocfc.stop_hcb_qe, | ||
434 | bfa_iocfc_stop_cb, iocfc->bfa); | ||
435 | break; | ||
436 | default: | ||
437 | bfa_sm_fault(iocfc->bfa, event); | ||
438 | break; | ||
439 | } | ||
440 | } | ||
441 | |||
442 | static void | ||
443 | bfa_iocfc_sm_enabling_entry(struct bfa_iocfc_s *iocfc) | ||
444 | { | ||
445 | bfa_ioc_enable(&iocfc->bfa->ioc); | ||
446 | } | ||
447 | |||
448 | static void | ||
449 | bfa_iocfc_sm_enabling(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
450 | { | ||
451 | bfa_trc(iocfc->bfa, event); | ||
452 | |||
453 | switch (event) { | ||
454 | case IOCFC_E_IOC_ENABLED: | ||
455 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_cfg_wait); | ||
456 | break; | ||
457 | case IOCFC_E_IOC_FAILED: | ||
458 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_failed); | ||
459 | |||
460 | if (iocfc->bfa->iocfc.cb_reqd == BFA_FALSE) | ||
461 | break; | ||
462 | |||
463 | iocfc->bfa->iocfc.op_status = BFA_STATUS_FAILED; | ||
464 | bfa_cb_queue(iocfc->bfa, &iocfc->bfa->iocfc.en_hcb_qe, | ||
465 | bfa_iocfc_enable_cb, iocfc->bfa); | ||
466 | iocfc->bfa->iocfc.cb_reqd = BFA_FALSE; | ||
467 | break; | ||
468 | default: | ||
469 | bfa_sm_fault(iocfc->bfa, event); | ||
470 | break; | ||
471 | } | ||
472 | } | ||
473 | |||
474 | static void | ||
475 | bfa_iocfc_sm_cfg_wait_entry(struct bfa_iocfc_s *iocfc) | ||
476 | { | ||
477 | bfa_iocfc_send_cfg(iocfc->bfa); | ||
478 | } | ||
479 | |||
480 | static void | ||
481 | bfa_iocfc_sm_cfg_wait(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
482 | { | ||
483 | bfa_trc(iocfc->bfa, event); | ||
484 | |||
485 | switch (event) { | ||
486 | case IOCFC_E_CFG_DONE: | ||
487 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_operational); | ||
488 | if (iocfc->bfa->iocfc.cb_reqd == BFA_FALSE) | ||
489 | break; | ||
490 | |||
491 | iocfc->bfa->iocfc.op_status = BFA_STATUS_OK; | ||
492 | bfa_cb_queue(iocfc->bfa, &iocfc->bfa->iocfc.en_hcb_qe, | ||
493 | bfa_iocfc_enable_cb, iocfc->bfa); | ||
494 | iocfc->bfa->iocfc.cb_reqd = BFA_FALSE; | ||
495 | break; | ||
496 | case IOCFC_E_IOC_FAILED: | ||
497 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_failed); | ||
498 | if (iocfc->bfa->iocfc.cb_reqd == BFA_FALSE) | ||
499 | break; | ||
500 | |||
501 | iocfc->bfa->iocfc.op_status = BFA_STATUS_FAILED; | ||
502 | bfa_cb_queue(iocfc->bfa, &iocfc->bfa->iocfc.en_hcb_qe, | ||
503 | bfa_iocfc_enable_cb, iocfc->bfa); | ||
504 | iocfc->bfa->iocfc.cb_reqd = BFA_FALSE; | ||
505 | break; | ||
506 | default: | ||
507 | bfa_sm_fault(iocfc->bfa, event); | ||
508 | break; | ||
509 | } | ||
510 | } | ||
511 | |||
512 | static void | ||
513 | bfa_iocfc_sm_disabling_entry(struct bfa_iocfc_s *iocfc) | ||
514 | { | ||
515 | bfa_ioc_disable(&iocfc->bfa->ioc); | ||
516 | } | ||
517 | |||
518 | static void | ||
519 | bfa_iocfc_sm_disabling(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
520 | { | ||
521 | bfa_trc(iocfc->bfa, event); | ||
522 | |||
523 | switch (event) { | ||
524 | case IOCFC_E_IOC_DISABLED: | ||
525 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabled); | ||
526 | break; | ||
527 | default: | ||
528 | bfa_sm_fault(iocfc->bfa, event); | ||
529 | break; | ||
530 | } | ||
531 | } | ||
532 | |||
533 | static void | ||
534 | bfa_iocfc_sm_disabled_entry(struct bfa_iocfc_s *iocfc) | ||
535 | { | ||
536 | bfa_isr_disable(iocfc->bfa); | ||
537 | bfa_iocfc_disable_submod(iocfc->bfa); | ||
538 | iocfc->bfa->iocfc.op_status = BFA_STATUS_OK; | ||
539 | bfa_cb_queue(iocfc->bfa, &iocfc->bfa->iocfc.dis_hcb_qe, | ||
540 | bfa_iocfc_disable_cb, iocfc->bfa); | ||
541 | } | ||
542 | |||
543 | static void | ||
544 | bfa_iocfc_sm_disabled(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
545 | { | ||
546 | bfa_trc(iocfc->bfa, event); | ||
547 | |||
548 | switch (event) { | ||
549 | case IOCFC_E_STOP: | ||
550 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_dconf_write); | ||
551 | break; | ||
552 | case IOCFC_E_ENABLE: | ||
553 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_enabling); | ||
554 | break; | ||
555 | default: | ||
556 | bfa_sm_fault(iocfc->bfa, event); | ||
557 | break; | ||
558 | } | ||
559 | } | ||
560 | |||
561 | static void | ||
562 | bfa_iocfc_sm_failed_entry(struct bfa_iocfc_s *iocfc) | ||
563 | { | ||
564 | bfa_isr_disable(iocfc->bfa); | ||
565 | bfa_iocfc_disable_submod(iocfc->bfa); | ||
566 | } | ||
567 | |||
568 | static void | ||
569 | bfa_iocfc_sm_failed(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
570 | { | ||
571 | bfa_trc(iocfc->bfa, event); | ||
572 | |||
573 | switch (event) { | ||
574 | case IOCFC_E_STOP: | ||
575 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_dconf_write); | ||
576 | break; | ||
577 | case IOCFC_E_DISABLE: | ||
578 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabling); | ||
579 | break; | ||
580 | case IOCFC_E_IOC_ENABLED: | ||
581 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_cfg_wait); | ||
582 | break; | ||
583 | case IOCFC_E_IOC_FAILED: | ||
584 | break; | ||
585 | default: | ||
586 | bfa_sm_fault(iocfc->bfa, event); | ||
587 | break; | ||
588 | } | ||
589 | } | ||
590 | |||
591 | static void | ||
592 | bfa_iocfc_sm_init_failed_entry(struct bfa_iocfc_s *iocfc) | ||
593 | { | ||
594 | bfa_isr_disable(iocfc->bfa); | ||
595 | iocfc->bfa->iocfc.op_status = BFA_STATUS_FAILED; | ||
596 | bfa_cb_queue(iocfc->bfa, &iocfc->bfa->iocfc.init_hcb_qe, | ||
597 | bfa_iocfc_init_cb, iocfc->bfa); | ||
598 | } | ||
599 | |||
600 | static void | ||
601 | bfa_iocfc_sm_init_failed(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | ||
602 | { | ||
603 | bfa_trc(iocfc->bfa, event); | ||
604 | |||
605 | switch (event) { | ||
606 | case IOCFC_E_STOP: | ||
607 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_stopping); | ||
608 | break; | ||
609 | case IOCFC_E_DISABLE: | ||
610 | bfa_ioc_disable(&iocfc->bfa->ioc); | ||
611 | break; | ||
612 | case IOCFC_E_IOC_ENABLED: | ||
613 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_dconf_read); | ||
614 | break; | ||
615 | case IOCFC_E_IOC_DISABLED: | ||
616 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_stopped); | ||
617 | iocfc->bfa->iocfc.op_status = BFA_STATUS_OK; | ||
618 | bfa_cb_queue(iocfc->bfa, &iocfc->bfa->iocfc.dis_hcb_qe, | ||
619 | bfa_iocfc_disable_cb, iocfc->bfa); | ||
620 | break; | ||
621 | case IOCFC_E_IOC_FAILED: | ||
622 | break; | ||
623 | default: | ||
624 | bfa_sm_fault(iocfc->bfa, event); | ||
625 | break; | ||
626 | } | ||
627 | } | ||
210 | 628 | ||
211 | /* | 629 | /* |
212 | * BFA Interrupt handling functions | 630 | * BFA Interrupt handling functions |
@@ -532,11 +950,9 @@ bfa_iocfc_send_cfg(void *bfa_arg) | |||
532 | * Enable interrupt coalescing if it is driver init path | 950 | * Enable interrupt coalescing if it is driver init path |
533 | * and not ioc disable/enable path. | 951 | * and not ioc disable/enable path. |
534 | */ | 952 | */ |
535 | if (!iocfc->cfgdone) | 953 | if (bfa_fsm_cmp_state(iocfc, bfa_iocfc_sm_init_cfg_wait)) |
536 | cfg_info->intr_attr.coalesce = BFA_TRUE; | 954 | cfg_info->intr_attr.coalesce = BFA_TRUE; |
537 | 955 | ||
538 | iocfc->cfgdone = BFA_FALSE; | ||
539 | |||
540 | /* | 956 | /* |
541 | * dma map IOC configuration itself | 957 | * dma map IOC configuration itself |
542 | */ | 958 | */ |
@@ -556,8 +972,6 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
556 | 972 | ||
557 | bfa->bfad = bfad; | 973 | bfa->bfad = bfad; |
558 | iocfc->bfa = bfa; | 974 | iocfc->bfa = bfa; |
559 | iocfc->action = BFA_IOCFC_ACT_NONE; | ||
560 | |||
561 | iocfc->cfg = *cfg; | 975 | iocfc->cfg = *cfg; |
562 | 976 | ||
563 | /* | 977 | /* |
@@ -690,6 +1104,8 @@ bfa_iocfc_start_submod(struct bfa_s *bfa) | |||
690 | 1104 | ||
691 | for (i = 0; hal_mods[i]; i++) | 1105 | for (i = 0; hal_mods[i]; i++) |
692 | hal_mods[i]->start(bfa); | 1106 | hal_mods[i]->start(bfa); |
1107 | |||
1108 | bfa->iocfc.submod_enabled = BFA_TRUE; | ||
693 | } | 1109 | } |
694 | 1110 | ||
695 | /* | 1111 | /* |
@@ -700,8 +1116,13 @@ bfa_iocfc_disable_submod(struct bfa_s *bfa) | |||
700 | { | 1116 | { |
701 | int i; | 1117 | int i; |
702 | 1118 | ||
1119 | if (bfa->iocfc.submod_enabled == BFA_FALSE) | ||
1120 | return; | ||
1121 | |||
703 | for (i = 0; hal_mods[i]; i++) | 1122 | for (i = 0; hal_mods[i]; i++) |
704 | hal_mods[i]->iocdisable(bfa); | 1123 | hal_mods[i]->iocdisable(bfa); |
1124 | |||
1125 | bfa->iocfc.submod_enabled = BFA_FALSE; | ||
705 | } | 1126 | } |
706 | 1127 | ||
707 | static void | 1128 | static void |
@@ -709,15 +1130,8 @@ bfa_iocfc_init_cb(void *bfa_arg, bfa_boolean_t complete) | |||
709 | { | 1130 | { |
710 | struct bfa_s *bfa = bfa_arg; | 1131 | struct bfa_s *bfa = bfa_arg; |
711 | 1132 | ||
712 | if (complete) { | 1133 | if (complete) |
713 | if (bfa->iocfc.cfgdone && BFA_DCONF_MOD(bfa)->flashdone) | 1134 | bfa_cb_init(bfa->bfad, bfa->iocfc.op_status); |
714 | bfa_cb_init(bfa->bfad, BFA_STATUS_OK); | ||
715 | else | ||
716 | bfa_cb_init(bfa->bfad, BFA_STATUS_FAILED); | ||
717 | } else { | ||
718 | if (bfa->iocfc.cfgdone) | ||
719 | bfa->iocfc.action = BFA_IOCFC_ACT_NONE; | ||
720 | } | ||
721 | } | 1135 | } |
722 | 1136 | ||
723 | static void | 1137 | static void |
@@ -728,8 +1142,6 @@ bfa_iocfc_stop_cb(void *bfa_arg, bfa_boolean_t compl) | |||
728 | 1142 | ||
729 | if (compl) | 1143 | if (compl) |
730 | complete(&bfad->comp); | 1144 | complete(&bfad->comp); |
731 | else | ||
732 | bfa->iocfc.action = BFA_IOCFC_ACT_NONE; | ||
733 | } | 1145 | } |
734 | 1146 | ||
735 | static void | 1147 | static void |
@@ -801,8 +1213,6 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa) | |||
801 | fwcfg->num_uf_bufs = be16_to_cpu(fwcfg->num_uf_bufs); | 1213 | fwcfg->num_uf_bufs = be16_to_cpu(fwcfg->num_uf_bufs); |
802 | fwcfg->num_rports = be16_to_cpu(fwcfg->num_rports); | 1214 | fwcfg->num_rports = be16_to_cpu(fwcfg->num_rports); |
803 | 1215 | ||
804 | iocfc->cfgdone = BFA_TRUE; | ||
805 | |||
806 | /* | 1216 | /* |
807 | * configure queue register offsets as learnt from firmware | 1217 | * configure queue register offsets as learnt from firmware |
808 | */ | 1218 | */ |
@@ -818,22 +1228,13 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa) | |||
818 | */ | 1228 | */ |
819 | bfa_msix_queue_install(bfa); | 1229 | bfa_msix_queue_install(bfa); |
820 | 1230 | ||
821 | /* | 1231 | if (bfa->iocfc.cfgrsp->pbc_cfg.pbc_pwwn != 0) { |
822 | * Configuration is complete - initialize/start submodules | 1232 | bfa->ioc.attr->pwwn = bfa->iocfc.cfgrsp->pbc_cfg.pbc_pwwn; |
823 | */ | 1233 | bfa->ioc.attr->nwwn = bfa->iocfc.cfgrsp->pbc_cfg.pbc_nwwn; |
824 | bfa_fcport_init(bfa); | 1234 | bfa_fsm_send_event(iocfc, IOCFC_E_CFG_DONE); |
825 | |||
826 | if (iocfc->action == BFA_IOCFC_ACT_INIT) { | ||
827 | if (BFA_DCONF_MOD(bfa)->flashdone == BFA_TRUE) | ||
828 | bfa_cb_queue(bfa, &iocfc->init_hcb_qe, | ||
829 | bfa_iocfc_init_cb, bfa); | ||
830 | } else { | ||
831 | if (bfa->iocfc.action == BFA_IOCFC_ACT_ENABLE) | ||
832 | bfa_cb_queue(bfa, &bfa->iocfc.en_hcb_qe, | ||
833 | bfa_iocfc_enable_cb, bfa); | ||
834 | bfa_iocfc_start_submod(bfa); | ||
835 | } | 1235 | } |
836 | } | 1236 | } |
1237 | |||
837 | void | 1238 | void |
838 | bfa_iocfc_reset_queues(struct bfa_s *bfa) | 1239 | bfa_iocfc_reset_queues(struct bfa_s *bfa) |
839 | { | 1240 | { |
@@ -847,6 +1248,23 @@ bfa_iocfc_reset_queues(struct bfa_s *bfa) | |||
847 | } | 1248 | } |
848 | } | 1249 | } |
849 | 1250 | ||
1251 | /* | ||
1252 | * Process FAA pwwn msg from fw. | ||
1253 | */ | ||
1254 | static void | ||
1255 | bfa_iocfc_process_faa_addr(struct bfa_s *bfa, struct bfi_faa_addr_msg_s *msg) | ||
1256 | { | ||
1257 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; | ||
1258 | struct bfi_iocfc_cfgrsp_s *cfgrsp = iocfc->cfgrsp; | ||
1259 | |||
1260 | cfgrsp->pbc_cfg.pbc_pwwn = msg->pwwn; | ||
1261 | cfgrsp->pbc_cfg.pbc_nwwn = msg->nwwn; | ||
1262 | |||
1263 | bfa->ioc.attr->pwwn = msg->pwwn; | ||
1264 | bfa->ioc.attr->nwwn = msg->nwwn; | ||
1265 | bfa_fsm_send_event(iocfc, IOCFC_E_CFG_DONE); | ||
1266 | } | ||
1267 | |||
850 | /* Fabric Assigned Address specific functions */ | 1268 | /* Fabric Assigned Address specific functions */ |
851 | 1269 | ||
852 | /* | 1270 | /* |
@@ -862,84 +1280,13 @@ bfa_faa_validate_request(struct bfa_s *bfa) | |||
862 | if ((ioc_type != BFA_IOC_TYPE_FC) || bfa_mfg_is_mezz(card_type)) | 1280 | if ((ioc_type != BFA_IOC_TYPE_FC) || bfa_mfg_is_mezz(card_type)) |
863 | return BFA_STATUS_FEATURE_NOT_SUPPORTED; | 1281 | return BFA_STATUS_FEATURE_NOT_SUPPORTED; |
864 | } else { | 1282 | } else { |
865 | if (!bfa_ioc_is_acq_addr(&bfa->ioc)) | 1283 | return BFA_STATUS_IOC_NON_OP; |
866 | return BFA_STATUS_IOC_NON_OP; | ||
867 | } | 1284 | } |
868 | 1285 | ||
869 | return BFA_STATUS_OK; | 1286 | return BFA_STATUS_OK; |
870 | } | 1287 | } |
871 | 1288 | ||
872 | bfa_status_t | 1289 | bfa_status_t |
873 | bfa_faa_enable(struct bfa_s *bfa, bfa_cb_iocfc_t cbfn, void *cbarg) | ||
874 | { | ||
875 | struct bfi_faa_en_dis_s faa_enable_req; | ||
876 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; | ||
877 | bfa_status_t status; | ||
878 | |||
879 | iocfc->faa_args.faa_cb.faa_cbfn = cbfn; | ||
880 | iocfc->faa_args.faa_cb.faa_cbarg = cbarg; | ||
881 | |||
882 | status = bfa_faa_validate_request(bfa); | ||
883 | if (status != BFA_STATUS_OK) | ||
884 | return status; | ||
885 | |||
886 | if (iocfc->faa_args.busy == BFA_TRUE) | ||
887 | return BFA_STATUS_DEVBUSY; | ||
888 | |||
889 | if (iocfc->faa_args.faa_state == BFA_FAA_ENABLED) | ||
890 | return BFA_STATUS_FAA_ENABLED; | ||
891 | |||
892 | if (bfa_fcport_is_trunk_enabled(bfa)) | ||
893 | return BFA_STATUS_ERROR_TRUNK_ENABLED; | ||
894 | |||
895 | bfa_fcport_cfg_faa(bfa, BFA_FAA_ENABLED); | ||
896 | iocfc->faa_args.busy = BFA_TRUE; | ||
897 | |||
898 | memset(&faa_enable_req, 0, sizeof(struct bfi_faa_en_dis_s)); | ||
899 | bfi_h2i_set(faa_enable_req.mh, BFI_MC_IOCFC, | ||
900 | BFI_IOCFC_H2I_FAA_ENABLE_REQ, bfa_fn_lpu(bfa)); | ||
901 | |||
902 | bfa_ioc_mbox_send(&bfa->ioc, &faa_enable_req, | ||
903 | sizeof(struct bfi_faa_en_dis_s)); | ||
904 | |||
905 | return BFA_STATUS_OK; | ||
906 | } | ||
907 | |||
908 | bfa_status_t | ||
909 | bfa_faa_disable(struct bfa_s *bfa, bfa_cb_iocfc_t cbfn, | ||
910 | void *cbarg) | ||
911 | { | ||
912 | struct bfi_faa_en_dis_s faa_disable_req; | ||
913 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; | ||
914 | bfa_status_t status; | ||
915 | |||
916 | iocfc->faa_args.faa_cb.faa_cbfn = cbfn; | ||
917 | iocfc->faa_args.faa_cb.faa_cbarg = cbarg; | ||
918 | |||
919 | status = bfa_faa_validate_request(bfa); | ||
920 | if (status != BFA_STATUS_OK) | ||
921 | return status; | ||
922 | |||
923 | if (iocfc->faa_args.busy == BFA_TRUE) | ||
924 | return BFA_STATUS_DEVBUSY; | ||
925 | |||
926 | if (iocfc->faa_args.faa_state == BFA_FAA_DISABLED) | ||
927 | return BFA_STATUS_FAA_DISABLED; | ||
928 | |||
929 | bfa_fcport_cfg_faa(bfa, BFA_FAA_DISABLED); | ||
930 | iocfc->faa_args.busy = BFA_TRUE; | ||
931 | |||
932 | memset(&faa_disable_req, 0, sizeof(struct bfi_faa_en_dis_s)); | ||
933 | bfi_h2i_set(faa_disable_req.mh, BFI_MC_IOCFC, | ||
934 | BFI_IOCFC_H2I_FAA_DISABLE_REQ, bfa_fn_lpu(bfa)); | ||
935 | |||
936 | bfa_ioc_mbox_send(&bfa->ioc, &faa_disable_req, | ||
937 | sizeof(struct bfi_faa_en_dis_s)); | ||
938 | |||
939 | return BFA_STATUS_OK; | ||
940 | } | ||
941 | |||
942 | bfa_status_t | ||
943 | bfa_faa_query(struct bfa_s *bfa, struct bfa_faa_attr_s *attr, | 1290 | bfa_faa_query(struct bfa_s *bfa, struct bfa_faa_attr_s *attr, |
944 | bfa_cb_iocfc_t cbfn, void *cbarg) | 1291 | bfa_cb_iocfc_t cbfn, void *cbarg) |
945 | { | 1292 | { |
@@ -970,38 +1317,6 @@ bfa_faa_query(struct bfa_s *bfa, struct bfa_faa_attr_s *attr, | |||
970 | } | 1317 | } |
971 | 1318 | ||
972 | /* | 1319 | /* |
973 | * FAA enable response | ||
974 | */ | ||
975 | static void | ||
976 | bfa_faa_enable_reply(struct bfa_iocfc_s *iocfc, | ||
977 | struct bfi_faa_en_dis_rsp_s *rsp) | ||
978 | { | ||
979 | void *cbarg = iocfc->faa_args.faa_cb.faa_cbarg; | ||
980 | bfa_status_t status = rsp->status; | ||
981 | |||
982 | WARN_ON(!iocfc->faa_args.faa_cb.faa_cbfn); | ||
983 | |||
984 | iocfc->faa_args.faa_cb.faa_cbfn(cbarg, status); | ||
985 | iocfc->faa_args.busy = BFA_FALSE; | ||
986 | } | ||
987 | |||
988 | /* | ||
989 | * FAA disable response | ||
990 | */ | ||
991 | static void | ||
992 | bfa_faa_disable_reply(struct bfa_iocfc_s *iocfc, | ||
993 | struct bfi_faa_en_dis_rsp_s *rsp) | ||
994 | { | ||
995 | void *cbarg = iocfc->faa_args.faa_cb.faa_cbarg; | ||
996 | bfa_status_t status = rsp->status; | ||
997 | |||
998 | WARN_ON(!iocfc->faa_args.faa_cb.faa_cbfn); | ||
999 | |||
1000 | iocfc->faa_args.faa_cb.faa_cbfn(cbarg, status); | ||
1001 | iocfc->faa_args.busy = BFA_FALSE; | ||
1002 | } | ||
1003 | |||
1004 | /* | ||
1005 | * FAA query response | 1320 | * FAA query response |
1006 | */ | 1321 | */ |
1007 | static void | 1322 | static void |
@@ -1030,25 +1345,10 @@ bfa_iocfc_enable_cbfn(void *bfa_arg, enum bfa_status status) | |||
1030 | { | 1345 | { |
1031 | struct bfa_s *bfa = bfa_arg; | 1346 | struct bfa_s *bfa = bfa_arg; |
1032 | 1347 | ||
1033 | if (status == BFA_STATUS_FAA_ACQ_ADDR) { | 1348 | if (status == BFA_STATUS_OK) |
1034 | bfa_cb_queue(bfa, &bfa->iocfc.init_hcb_qe, | 1349 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_IOC_ENABLED); |
1035 | bfa_iocfc_init_cb, bfa); | 1350 | else |
1036 | return; | 1351 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_IOC_FAILED); |
1037 | } | ||
1038 | |||
1039 | if (status != BFA_STATUS_OK) { | ||
1040 | bfa_isr_disable(bfa); | ||
1041 | if (bfa->iocfc.action == BFA_IOCFC_ACT_INIT) | ||
1042 | bfa_cb_queue(bfa, &bfa->iocfc.init_hcb_qe, | ||
1043 | bfa_iocfc_init_cb, bfa); | ||
1044 | else if (bfa->iocfc.action == BFA_IOCFC_ACT_ENABLE) | ||
1045 | bfa_cb_queue(bfa, &bfa->iocfc.en_hcb_qe, | ||
1046 | bfa_iocfc_enable_cb, bfa); | ||
1047 | return; | ||
1048 | } | ||
1049 | |||
1050 | bfa_iocfc_send_cfg(bfa); | ||
1051 | bfa_dconf_modinit(bfa); | ||
1052 | } | 1352 | } |
1053 | 1353 | ||
1054 | /* | 1354 | /* |
@@ -1059,17 +1359,7 @@ bfa_iocfc_disable_cbfn(void *bfa_arg) | |||
1059 | { | 1359 | { |
1060 | struct bfa_s *bfa = bfa_arg; | 1360 | struct bfa_s *bfa = bfa_arg; |
1061 | 1361 | ||
1062 | bfa_isr_disable(bfa); | 1362 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_IOC_DISABLED); |
1063 | bfa_iocfc_disable_submod(bfa); | ||
1064 | |||
1065 | if (bfa->iocfc.action == BFA_IOCFC_ACT_STOP) | ||
1066 | bfa_cb_queue(bfa, &bfa->iocfc.stop_hcb_qe, bfa_iocfc_stop_cb, | ||
1067 | bfa); | ||
1068 | else { | ||
1069 | WARN_ON(bfa->iocfc.action != BFA_IOCFC_ACT_DISABLE); | ||
1070 | bfa_cb_queue(bfa, &bfa->iocfc.dis_hcb_qe, bfa_iocfc_disable_cb, | ||
1071 | bfa); | ||
1072 | } | ||
1073 | } | 1363 | } |
1074 | 1364 | ||
1075 | /* | 1365 | /* |
@@ -1081,13 +1371,7 @@ bfa_iocfc_hbfail_cbfn(void *bfa_arg) | |||
1081 | struct bfa_s *bfa = bfa_arg; | 1371 | struct bfa_s *bfa = bfa_arg; |
1082 | 1372 | ||
1083 | bfa->queue_process = BFA_FALSE; | 1373 | bfa->queue_process = BFA_FALSE; |
1084 | 1374 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_IOC_FAILED); | |
1085 | bfa_isr_disable(bfa); | ||
1086 | bfa_iocfc_disable_submod(bfa); | ||
1087 | |||
1088 | if (bfa->iocfc.action == BFA_IOCFC_ACT_INIT) | ||
1089 | bfa_cb_queue(bfa, &bfa->iocfc.init_hcb_qe, bfa_iocfc_init_cb, | ||
1090 | bfa); | ||
1091 | } | 1375 | } |
1092 | 1376 | ||
1093 | /* | 1377 | /* |
@@ -1102,7 +1386,6 @@ bfa_iocfc_reset_cbfn(void *bfa_arg) | |||
1102 | bfa_isr_enable(bfa); | 1386 | bfa_isr_enable(bfa); |
1103 | } | 1387 | } |
1104 | 1388 | ||
1105 | |||
1106 | /* | 1389 | /* |
1107 | * Query IOC memory requirement information. | 1390 | * Query IOC memory requirement information. |
1108 | */ | 1391 | */ |
@@ -1178,6 +1461,12 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
1178 | INIT_LIST_HEAD(&bfa->comp_q); | 1461 | INIT_LIST_HEAD(&bfa->comp_q); |
1179 | for (i = 0; i < BFI_IOC_MAX_CQS; i++) | 1462 | for (i = 0; i < BFI_IOC_MAX_CQS; i++) |
1180 | INIT_LIST_HEAD(&bfa->reqq_waitq[i]); | 1463 | INIT_LIST_HEAD(&bfa->reqq_waitq[i]); |
1464 | |||
1465 | bfa->iocfc.cb_reqd = BFA_FALSE; | ||
1466 | bfa->iocfc.op_status = BFA_STATUS_OK; | ||
1467 | bfa->iocfc.submod_enabled = BFA_FALSE; | ||
1468 | |||
1469 | bfa_fsm_set_state(&bfa->iocfc, bfa_iocfc_sm_stopped); | ||
1181 | } | 1470 | } |
1182 | 1471 | ||
1183 | /* | 1472 | /* |
@@ -1186,8 +1475,7 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
1186 | void | 1475 | void |
1187 | bfa_iocfc_init(struct bfa_s *bfa) | 1476 | bfa_iocfc_init(struct bfa_s *bfa) |
1188 | { | 1477 | { |
1189 | bfa->iocfc.action = BFA_IOCFC_ACT_INIT; | 1478 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_INIT); |
1190 | bfa_ioc_enable(&bfa->ioc); | ||
1191 | } | 1479 | } |
1192 | 1480 | ||
1193 | /* | 1481 | /* |
@@ -1197,8 +1485,7 @@ bfa_iocfc_init(struct bfa_s *bfa) | |||
1197 | void | 1485 | void |
1198 | bfa_iocfc_start(struct bfa_s *bfa) | 1486 | bfa_iocfc_start(struct bfa_s *bfa) |
1199 | { | 1487 | { |
1200 | if (bfa->iocfc.cfgdone) | 1488 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_START); |
1201 | bfa_iocfc_start_submod(bfa); | ||
1202 | } | 1489 | } |
1203 | 1490 | ||
1204 | /* | 1491 | /* |
@@ -1208,12 +1495,8 @@ bfa_iocfc_start(struct bfa_s *bfa) | |||
1208 | void | 1495 | void |
1209 | bfa_iocfc_stop(struct bfa_s *bfa) | 1496 | bfa_iocfc_stop(struct bfa_s *bfa) |
1210 | { | 1497 | { |
1211 | bfa->iocfc.action = BFA_IOCFC_ACT_STOP; | ||
1212 | |||
1213 | bfa->queue_process = BFA_FALSE; | 1498 | bfa->queue_process = BFA_FALSE; |
1214 | bfa_dconf_modexit(bfa); | 1499 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_STOP); |
1215 | if (BFA_DCONF_MOD(bfa)->flashdone == BFA_TRUE) | ||
1216 | bfa_ioc_disable(&bfa->ioc); | ||
1217 | } | 1500 | } |
1218 | 1501 | ||
1219 | void | 1502 | void |
@@ -1233,13 +1516,9 @@ bfa_iocfc_isr(void *bfaarg, struct bfi_mbmsg_s *m) | |||
1233 | case BFI_IOCFC_I2H_UPDATEQ_RSP: | 1516 | case BFI_IOCFC_I2H_UPDATEQ_RSP: |
1234 | iocfc->updateq_cbfn(iocfc->updateq_cbarg, BFA_STATUS_OK); | 1517 | iocfc->updateq_cbfn(iocfc->updateq_cbarg, BFA_STATUS_OK); |
1235 | break; | 1518 | break; |
1236 | case BFI_IOCFC_I2H_FAA_ENABLE_RSP: | 1519 | case BFI_IOCFC_I2H_ADDR_MSG: |
1237 | bfa_faa_enable_reply(iocfc, | 1520 | bfa_iocfc_process_faa_addr(bfa, |
1238 | (struct bfi_faa_en_dis_rsp_s *)msg); | 1521 | (struct bfi_faa_addr_msg_s *)msg); |
1239 | break; | ||
1240 | case BFI_IOCFC_I2H_FAA_DISABLE_RSP: | ||
1241 | bfa_faa_disable_reply(iocfc, | ||
1242 | (struct bfi_faa_en_dis_rsp_s *)msg); | ||
1243 | break; | 1522 | break; |
1244 | case BFI_IOCFC_I2H_FAA_QUERY_RSP: | 1523 | case BFI_IOCFC_I2H_FAA_QUERY_RSP: |
1245 | bfa_faa_query_reply(iocfc, (bfi_faa_query_rsp_t *)msg); | 1524 | bfa_faa_query_reply(iocfc, (bfi_faa_query_rsp_t *)msg); |
@@ -1313,8 +1592,8 @@ bfa_iocfc_enable(struct bfa_s *bfa) | |||
1313 | { | 1592 | { |
1314 | bfa_plog_str(bfa->plog, BFA_PL_MID_HAL, BFA_PL_EID_MISC, 0, | 1593 | bfa_plog_str(bfa->plog, BFA_PL_MID_HAL, BFA_PL_EID_MISC, 0, |
1315 | "IOC Enable"); | 1594 | "IOC Enable"); |
1316 | bfa->iocfc.action = BFA_IOCFC_ACT_ENABLE; | 1595 | bfa->iocfc.cb_reqd = BFA_TRUE; |
1317 | bfa_ioc_enable(&bfa->ioc); | 1596 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_ENABLE); |
1318 | } | 1597 | } |
1319 | 1598 | ||
1320 | void | 1599 | void |
@@ -1322,17 +1601,16 @@ bfa_iocfc_disable(struct bfa_s *bfa) | |||
1322 | { | 1601 | { |
1323 | bfa_plog_str(bfa->plog, BFA_PL_MID_HAL, BFA_PL_EID_MISC, 0, | 1602 | bfa_plog_str(bfa->plog, BFA_PL_MID_HAL, BFA_PL_EID_MISC, 0, |
1324 | "IOC Disable"); | 1603 | "IOC Disable"); |
1325 | bfa->iocfc.action = BFA_IOCFC_ACT_DISABLE; | ||
1326 | 1604 | ||
1327 | bfa->queue_process = BFA_FALSE; | 1605 | bfa->queue_process = BFA_FALSE; |
1328 | bfa_ioc_disable(&bfa->ioc); | 1606 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_DISABLE); |
1329 | } | 1607 | } |
1330 | 1608 | ||
1331 | |||
1332 | bfa_boolean_t | 1609 | bfa_boolean_t |
1333 | bfa_iocfc_is_operational(struct bfa_s *bfa) | 1610 | bfa_iocfc_is_operational(struct bfa_s *bfa) |
1334 | { | 1611 | { |
1335 | return bfa_ioc_is_operational(&bfa->ioc) && bfa->iocfc.cfgdone; | 1612 | return bfa_ioc_is_operational(&bfa->ioc) && |
1613 | bfa_fsm_cmp_state(&bfa->iocfc, bfa_iocfc_sm_operational); | ||
1336 | } | 1614 | } |
1337 | 1615 | ||
1338 | /* | 1616 | /* |
@@ -1574,16 +1852,6 @@ bfa_comp_free(struct bfa_s *bfa, struct list_head *comp_q) | |||
1574 | } | 1852 | } |
1575 | } | 1853 | } |
1576 | 1854 | ||
1577 | void | ||
1578 | bfa_iocfc_cb_dconf_modinit(struct bfa_s *bfa, bfa_status_t status) | ||
1579 | { | ||
1580 | if (bfa->iocfc.action == BFA_IOCFC_ACT_INIT) { | ||
1581 | if (bfa->iocfc.cfgdone == BFA_TRUE) | ||
1582 | bfa_cb_queue(bfa, &bfa->iocfc.init_hcb_qe, | ||
1583 | bfa_iocfc_init_cb, bfa); | ||
1584 | } | ||
1585 | } | ||
1586 | |||
1587 | /* | 1855 | /* |
1588 | * Return the list of PCI vendor/device id lists supported by this | 1856 | * Return the list of PCI vendor/device id lists supported by this |
1589 | * BFA instance. | 1857 | * BFA instance. |
diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h index cb07c628b2f1..36756ce0e58f 100644 --- a/drivers/scsi/bfa/bfa_defs_svc.h +++ b/drivers/scsi/bfa/bfa_defs_svc.h | |||
@@ -52,7 +52,7 @@ struct bfa_iocfc_fwcfg_s { | |||
52 | u16 num_uf_bufs; /* unsolicited recv buffers */ | 52 | u16 num_uf_bufs; /* unsolicited recv buffers */ |
53 | u8 num_cqs; | 53 | u8 num_cqs; |
54 | u8 fw_tick_res; /* FW clock resolution in ms */ | 54 | u8 fw_tick_res; /* FW clock resolution in ms */ |
55 | u8 rsvd[2]; | 55 | u8 rsvd[6]; |
56 | }; | 56 | }; |
57 | #pragma pack() | 57 | #pragma pack() |
58 | 58 | ||
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 3164f7bec475..56cf3f6c6884 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c | |||
@@ -88,7 +88,6 @@ static void bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc); | |||
88 | static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc); | 88 | static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc); |
89 | static void bfa_ioc_mbox_flush(struct bfa_ioc_s *ioc); | 89 | static void bfa_ioc_mbox_flush(struct bfa_ioc_s *ioc); |
90 | static void bfa_ioc_recover(struct bfa_ioc_s *ioc); | 90 | static void bfa_ioc_recover(struct bfa_ioc_s *ioc); |
91 | static void bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc); | ||
92 | static void bfa_ioc_event_notify(struct bfa_ioc_s *ioc , | 91 | static void bfa_ioc_event_notify(struct bfa_ioc_s *ioc , |
93 | enum bfa_ioc_event_e event); | 92 | enum bfa_ioc_event_e event); |
94 | static void bfa_ioc_disable_comp(struct bfa_ioc_s *ioc); | 93 | static void bfa_ioc_disable_comp(struct bfa_ioc_s *ioc); |
@@ -113,7 +112,6 @@ enum ioc_event { | |||
113 | IOC_E_HWERROR = 10, /* hardware error interrupt */ | 112 | IOC_E_HWERROR = 10, /* hardware error interrupt */ |
114 | IOC_E_TIMEOUT = 11, /* timeout */ | 113 | IOC_E_TIMEOUT = 11, /* timeout */ |
115 | IOC_E_HWFAILED = 12, /* PCI mapping failure notice */ | 114 | IOC_E_HWFAILED = 12, /* PCI mapping failure notice */ |
116 | IOC_E_FWRSP_ACQ_ADDR = 13, /* Acquiring address */ | ||
117 | }; | 115 | }; |
118 | 116 | ||
119 | bfa_fsm_state_decl(bfa_ioc, uninit, struct bfa_ioc_s, enum ioc_event); | 117 | bfa_fsm_state_decl(bfa_ioc, uninit, struct bfa_ioc_s, enum ioc_event); |
@@ -126,7 +124,6 @@ bfa_fsm_state_decl(bfa_ioc, fail, struct bfa_ioc_s, enum ioc_event); | |||
126 | bfa_fsm_state_decl(bfa_ioc, disabling, struct bfa_ioc_s, enum ioc_event); | 124 | bfa_fsm_state_decl(bfa_ioc, disabling, struct bfa_ioc_s, enum ioc_event); |
127 | bfa_fsm_state_decl(bfa_ioc, disabled, struct bfa_ioc_s, enum ioc_event); | 125 | bfa_fsm_state_decl(bfa_ioc, disabled, struct bfa_ioc_s, enum ioc_event); |
128 | bfa_fsm_state_decl(bfa_ioc, hwfail, struct bfa_ioc_s, enum ioc_event); | 126 | bfa_fsm_state_decl(bfa_ioc, hwfail, struct bfa_ioc_s, enum ioc_event); |
129 | bfa_fsm_state_decl(bfa_ioc, acq_addr, struct bfa_ioc_s, enum ioc_event); | ||
130 | 127 | ||
131 | static struct bfa_sm_table_s ioc_sm_table[] = { | 128 | static struct bfa_sm_table_s ioc_sm_table[] = { |
132 | {BFA_SM(bfa_ioc_sm_uninit), BFA_IOC_UNINIT}, | 129 | {BFA_SM(bfa_ioc_sm_uninit), BFA_IOC_UNINIT}, |
@@ -139,7 +136,6 @@ static struct bfa_sm_table_s ioc_sm_table[] = { | |||
139 | {BFA_SM(bfa_ioc_sm_disabling), BFA_IOC_DISABLING}, | 136 | {BFA_SM(bfa_ioc_sm_disabling), BFA_IOC_DISABLING}, |
140 | {BFA_SM(bfa_ioc_sm_disabled), BFA_IOC_DISABLED}, | 137 | {BFA_SM(bfa_ioc_sm_disabled), BFA_IOC_DISABLED}, |
141 | {BFA_SM(bfa_ioc_sm_hwfail), BFA_IOC_HWFAIL}, | 138 | {BFA_SM(bfa_ioc_sm_hwfail), BFA_IOC_HWFAIL}, |
142 | {BFA_SM(bfa_ioc_sm_acq_addr), BFA_IOC_ACQ_ADDR}, | ||
143 | }; | 139 | }; |
144 | 140 | ||
145 | /* | 141 | /* |
@@ -370,17 +366,9 @@ bfa_ioc_sm_getattr(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
370 | switch (event) { | 366 | switch (event) { |
371 | case IOC_E_FWRSP_GETATTR: | 367 | case IOC_E_FWRSP_GETATTR: |
372 | bfa_ioc_timer_stop(ioc); | 368 | bfa_ioc_timer_stop(ioc); |
373 | bfa_ioc_check_attr_wwns(ioc); | ||
374 | bfa_ioc_hb_monitor(ioc); | ||
375 | bfa_fsm_set_state(ioc, bfa_ioc_sm_op); | 369 | bfa_fsm_set_state(ioc, bfa_ioc_sm_op); |
376 | break; | 370 | break; |
377 | 371 | ||
378 | case IOC_E_FWRSP_ACQ_ADDR: | ||
379 | bfa_ioc_timer_stop(ioc); | ||
380 | bfa_ioc_hb_monitor(ioc); | ||
381 | bfa_fsm_set_state(ioc, bfa_ioc_sm_acq_addr); | ||
382 | break; | ||
383 | |||
384 | case IOC_E_PFFAILED: | 372 | case IOC_E_PFFAILED: |
385 | case IOC_E_HWERROR: | 373 | case IOC_E_HWERROR: |
386 | bfa_ioc_timer_stop(ioc); | 374 | bfa_ioc_timer_stop(ioc); |
@@ -405,51 +393,6 @@ bfa_ioc_sm_getattr(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
405 | } | 393 | } |
406 | } | 394 | } |
407 | 395 | ||
408 | /* | ||
409 | * Acquiring address from fabric (entry function) | ||
410 | */ | ||
411 | static void | ||
412 | bfa_ioc_sm_acq_addr_entry(struct bfa_ioc_s *ioc) | ||
413 | { | ||
414 | } | ||
415 | |||
416 | /* | ||
417 | * Acquiring address from the fabric | ||
418 | */ | ||
419 | static void | ||
420 | bfa_ioc_sm_acq_addr(struct bfa_ioc_s *ioc, enum ioc_event event) | ||
421 | { | ||
422 | bfa_trc(ioc, event); | ||
423 | |||
424 | switch (event) { | ||
425 | case IOC_E_FWRSP_GETATTR: | ||
426 | bfa_ioc_check_attr_wwns(ioc); | ||
427 | bfa_fsm_set_state(ioc, bfa_ioc_sm_op); | ||
428 | break; | ||
429 | |||
430 | case IOC_E_PFFAILED: | ||
431 | case IOC_E_HWERROR: | ||
432 | bfa_hb_timer_stop(ioc); | ||
433 | case IOC_E_HBFAIL: | ||
434 | ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); | ||
435 | bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); | ||
436 | if (event != IOC_E_PFFAILED) | ||
437 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_GETATTRFAIL); | ||
438 | break; | ||
439 | |||
440 | case IOC_E_DISABLE: | ||
441 | bfa_hb_timer_stop(ioc); | ||
442 | bfa_fsm_set_state(ioc, bfa_ioc_sm_disabling); | ||
443 | break; | ||
444 | |||
445 | case IOC_E_ENABLE: | ||
446 | break; | ||
447 | |||
448 | default: | ||
449 | bfa_sm_fault(ioc, event); | ||
450 | } | ||
451 | } | ||
452 | |||
453 | static void | 396 | static void |
454 | bfa_ioc_sm_op_entry(struct bfa_ioc_s *ioc) | 397 | bfa_ioc_sm_op_entry(struct bfa_ioc_s *ioc) |
455 | { | 398 | { |
@@ -457,6 +400,7 @@ bfa_ioc_sm_op_entry(struct bfa_ioc_s *ioc) | |||
457 | 400 | ||
458 | ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_OK); | 401 | ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_OK); |
459 | bfa_ioc_event_notify(ioc, BFA_IOC_E_ENABLED); | 402 | bfa_ioc_event_notify(ioc, BFA_IOC_E_ENABLED); |
403 | bfa_ioc_hb_monitor(ioc); | ||
460 | BFA_LOG(KERN_INFO, bfad, bfa_log_level, "IOC enabled\n"); | 404 | BFA_LOG(KERN_INFO, bfad, bfa_log_level, "IOC enabled\n"); |
461 | bfa_ioc_aen_post(ioc, BFA_IOC_AEN_ENABLE); | 405 | bfa_ioc_aen_post(ioc, BFA_IOC_AEN_ENABLE); |
462 | } | 406 | } |
@@ -2156,10 +2100,6 @@ bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *m) | |||
2156 | bfa_ioc_getattr_reply(ioc); | 2100 | bfa_ioc_getattr_reply(ioc); |
2157 | break; | 2101 | break; |
2158 | 2102 | ||
2159 | case BFI_IOC_I2H_ACQ_ADDR_REPLY: | ||
2160 | bfa_fsm_send_event(ioc, IOC_E_FWRSP_ACQ_ADDR); | ||
2161 | break; | ||
2162 | |||
2163 | default: | 2103 | default: |
2164 | bfa_trc(ioc, msg->mh.msg_id); | 2104 | bfa_trc(ioc, msg->mh.msg_id); |
2165 | WARN_ON(1); | 2105 | WARN_ON(1); |
@@ -2450,15 +2390,6 @@ bfa_ioc_is_disabled(struct bfa_ioc_s *ioc) | |||
2450 | } | 2390 | } |
2451 | 2391 | ||
2452 | /* | 2392 | /* |
2453 | * Return TRUE if IOC is in acquiring address state | ||
2454 | */ | ||
2455 | bfa_boolean_t | ||
2456 | bfa_ioc_is_acq_addr(struct bfa_ioc_s *ioc) | ||
2457 | { | ||
2458 | return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_acq_addr); | ||
2459 | } | ||
2460 | |||
2461 | /* | ||
2462 | * return true if IOC firmware is different. | 2393 | * return true if IOC firmware is different. |
2463 | */ | 2394 | */ |
2464 | bfa_boolean_t | 2395 | bfa_boolean_t |
@@ -2950,17 +2881,6 @@ bfa_ioc_recover(struct bfa_ioc_s *ioc) | |||
2950 | bfa_fsm_send_event(ioc, IOC_E_HBFAIL); | 2881 | bfa_fsm_send_event(ioc, IOC_E_HBFAIL); |
2951 | } | 2882 | } |
2952 | 2883 | ||
2953 | static void | ||
2954 | bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc) | ||
2955 | { | ||
2956 | if (bfa_ioc_get_type(ioc) == BFA_IOC_TYPE_LL) | ||
2957 | return; | ||
2958 | if (ioc->attr->nwwn == 0) | ||
2959 | bfa_ioc_aen_post(ioc, BFA_IOC_AEN_INVALID_NWWN); | ||
2960 | if (ioc->attr->pwwn == 0) | ||
2961 | bfa_ioc_aen_post(ioc, BFA_IOC_AEN_INVALID_PWWN); | ||
2962 | } | ||
2963 | |||
2964 | /* | 2884 | /* |
2965 | * BFA IOC PF private functions | 2885 | * BFA IOC PF private functions |
2966 | */ | 2886 | */ |
@@ -5675,24 +5595,27 @@ bfa_dconf_sm_uninit(struct bfa_dconf_mod_s *dconf, enum bfa_dconf_event event) | |||
5675 | case BFA_DCONF_SM_INIT: | 5595 | case BFA_DCONF_SM_INIT: |
5676 | if (dconf->min_cfg) { | 5596 | if (dconf->min_cfg) { |
5677 | bfa_trc(dconf->bfa, dconf->min_cfg); | 5597 | bfa_trc(dconf->bfa, dconf->min_cfg); |
5598 | bfa_fsm_send_event(&dconf->bfa->iocfc, | ||
5599 | IOCFC_E_DCONF_DONE); | ||
5678 | return; | 5600 | return; |
5679 | } | 5601 | } |
5680 | bfa_sm_set_state(dconf, bfa_dconf_sm_flash_read); | 5602 | bfa_sm_set_state(dconf, bfa_dconf_sm_flash_read); |
5681 | dconf->flashdone = BFA_FALSE; | 5603 | bfa_timer_start(dconf->bfa, &dconf->timer, |
5682 | bfa_trc(dconf->bfa, dconf->flashdone); | 5604 | bfa_dconf_timer, dconf, BFA_DCONF_UPDATE_TOV); |
5683 | bfa_status = bfa_flash_read_part(BFA_FLASH(dconf->bfa), | 5605 | bfa_status = bfa_flash_read_part(BFA_FLASH(dconf->bfa), |
5684 | BFA_FLASH_PART_DRV, dconf->instance, | 5606 | BFA_FLASH_PART_DRV, dconf->instance, |
5685 | dconf->dconf, | 5607 | dconf->dconf, |
5686 | sizeof(struct bfa_dconf_s), 0, | 5608 | sizeof(struct bfa_dconf_s), 0, |
5687 | bfa_dconf_init_cb, dconf->bfa); | 5609 | bfa_dconf_init_cb, dconf->bfa); |
5688 | if (bfa_status != BFA_STATUS_OK) { | 5610 | if (bfa_status != BFA_STATUS_OK) { |
5611 | bfa_timer_stop(&dconf->timer); | ||
5689 | bfa_dconf_init_cb(dconf->bfa, BFA_STATUS_FAILED); | 5612 | bfa_dconf_init_cb(dconf->bfa, BFA_STATUS_FAILED); |
5690 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); | 5613 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); |
5691 | return; | 5614 | return; |
5692 | } | 5615 | } |
5693 | break; | 5616 | break; |
5694 | case BFA_DCONF_SM_EXIT: | 5617 | case BFA_DCONF_SM_EXIT: |
5695 | dconf->flashdone = BFA_TRUE; | 5618 | bfa_fsm_send_event(&dconf->bfa->iocfc, IOCFC_E_DCONF_DONE); |
5696 | case BFA_DCONF_SM_IOCDISABLE: | 5619 | case BFA_DCONF_SM_IOCDISABLE: |
5697 | case BFA_DCONF_SM_WR: | 5620 | case BFA_DCONF_SM_WR: |
5698 | case BFA_DCONF_SM_FLASH_COMP: | 5621 | case BFA_DCONF_SM_FLASH_COMP: |
@@ -5713,15 +5636,20 @@ bfa_dconf_sm_flash_read(struct bfa_dconf_mod_s *dconf, | |||
5713 | 5636 | ||
5714 | switch (event) { | 5637 | switch (event) { |
5715 | case BFA_DCONF_SM_FLASH_COMP: | 5638 | case BFA_DCONF_SM_FLASH_COMP: |
5639 | bfa_timer_stop(&dconf->timer); | ||
5716 | bfa_sm_set_state(dconf, bfa_dconf_sm_ready); | 5640 | bfa_sm_set_state(dconf, bfa_dconf_sm_ready); |
5717 | break; | 5641 | break; |
5718 | case BFA_DCONF_SM_TIMEOUT: | 5642 | case BFA_DCONF_SM_TIMEOUT: |
5719 | bfa_sm_set_state(dconf, bfa_dconf_sm_ready); | 5643 | bfa_sm_set_state(dconf, bfa_dconf_sm_ready); |
5644 | bfa_fsm_send_event(&dconf->bfa->iocfc, IOCFC_E_IOC_FAILED); | ||
5720 | break; | 5645 | break; |
5721 | case BFA_DCONF_SM_EXIT: | 5646 | case BFA_DCONF_SM_EXIT: |
5722 | dconf->flashdone = BFA_TRUE; | 5647 | bfa_timer_stop(&dconf->timer); |
5723 | bfa_trc(dconf->bfa, dconf->flashdone); | 5648 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); |
5649 | bfa_fsm_send_event(&dconf->bfa->iocfc, IOCFC_E_DCONF_DONE); | ||
5650 | break; | ||
5724 | case BFA_DCONF_SM_IOCDISABLE: | 5651 | case BFA_DCONF_SM_IOCDISABLE: |
5652 | bfa_timer_stop(&dconf->timer); | ||
5725 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); | 5653 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); |
5726 | break; | 5654 | break; |
5727 | default: | 5655 | default: |
@@ -5744,9 +5672,8 @@ bfa_dconf_sm_ready(struct bfa_dconf_mod_s *dconf, enum bfa_dconf_event event) | |||
5744 | bfa_sm_set_state(dconf, bfa_dconf_sm_dirty); | 5672 | bfa_sm_set_state(dconf, bfa_dconf_sm_dirty); |
5745 | break; | 5673 | break; |
5746 | case BFA_DCONF_SM_EXIT: | 5674 | case BFA_DCONF_SM_EXIT: |
5747 | dconf->flashdone = BFA_TRUE; | ||
5748 | bfa_trc(dconf->bfa, dconf->flashdone); | ||
5749 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); | 5675 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); |
5676 | bfa_fsm_send_event(&dconf->bfa->iocfc, IOCFC_E_DCONF_DONE); | ||
5750 | break; | 5677 | break; |
5751 | case BFA_DCONF_SM_INIT: | 5678 | case BFA_DCONF_SM_INIT: |
5752 | case BFA_DCONF_SM_IOCDISABLE: | 5679 | case BFA_DCONF_SM_IOCDISABLE: |
@@ -5808,9 +5735,7 @@ bfa_dconf_sm_final_sync(struct bfa_dconf_mod_s *dconf, | |||
5808 | bfa_timer_stop(&dconf->timer); | 5735 | bfa_timer_stop(&dconf->timer); |
5809 | case BFA_DCONF_SM_TIMEOUT: | 5736 | case BFA_DCONF_SM_TIMEOUT: |
5810 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); | 5737 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); |
5811 | dconf->flashdone = BFA_TRUE; | 5738 | bfa_fsm_send_event(&dconf->bfa->iocfc, IOCFC_E_DCONF_DONE); |
5812 | bfa_trc(dconf->bfa, dconf->flashdone); | ||
5813 | bfa_ioc_disable(&dconf->bfa->ioc); | ||
5814 | break; | 5739 | break; |
5815 | default: | 5740 | default: |
5816 | bfa_sm_fault(dconf->bfa, event); | 5741 | bfa_sm_fault(dconf->bfa, event); |
@@ -5857,8 +5782,8 @@ bfa_dconf_sm_iocdown_dirty(struct bfa_dconf_mod_s *dconf, | |||
5857 | bfa_sm_set_state(dconf, bfa_dconf_sm_dirty); | 5782 | bfa_sm_set_state(dconf, bfa_dconf_sm_dirty); |
5858 | break; | 5783 | break; |
5859 | case BFA_DCONF_SM_EXIT: | 5784 | case BFA_DCONF_SM_EXIT: |
5860 | dconf->flashdone = BFA_TRUE; | ||
5861 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); | 5785 | bfa_sm_set_state(dconf, bfa_dconf_sm_uninit); |
5786 | bfa_fsm_send_event(&dconf->bfa->iocfc, IOCFC_E_DCONF_DONE); | ||
5862 | break; | 5787 | break; |
5863 | case BFA_DCONF_SM_IOCDISABLE: | 5788 | case BFA_DCONF_SM_IOCDISABLE: |
5864 | break; | 5789 | break; |
@@ -5899,11 +5824,6 @@ bfa_dconf_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
5899 | if (cfg->drvcfg.min_cfg) { | 5824 | if (cfg->drvcfg.min_cfg) { |
5900 | bfa_mem_kva_curp(dconf) += sizeof(struct bfa_dconf_hdr_s); | 5825 | bfa_mem_kva_curp(dconf) += sizeof(struct bfa_dconf_hdr_s); |
5901 | dconf->min_cfg = BFA_TRUE; | 5826 | dconf->min_cfg = BFA_TRUE; |
5902 | /* | ||
5903 | * Set the flashdone flag to TRUE explicitly as no flash | ||
5904 | * write will happen in min_cfg mode. | ||
5905 | */ | ||
5906 | dconf->flashdone = BFA_TRUE; | ||
5907 | } else { | 5827 | } else { |
5908 | dconf->min_cfg = BFA_FALSE; | 5828 | dconf->min_cfg = BFA_FALSE; |
5909 | bfa_mem_kva_curp(dconf) += sizeof(struct bfa_dconf_s); | 5829 | bfa_mem_kva_curp(dconf) += sizeof(struct bfa_dconf_s); |
@@ -5919,9 +5839,7 @@ bfa_dconf_init_cb(void *arg, bfa_status_t status) | |||
5919 | struct bfa_s *bfa = arg; | 5839 | struct bfa_s *bfa = arg; |
5920 | struct bfa_dconf_mod_s *dconf = BFA_DCONF_MOD(bfa); | 5840 | struct bfa_dconf_mod_s *dconf = BFA_DCONF_MOD(bfa); |
5921 | 5841 | ||
5922 | dconf->flashdone = BFA_TRUE; | 5842 | bfa_sm_send_event(dconf, BFA_DCONF_SM_FLASH_COMP); |
5923 | bfa_trc(bfa, dconf->flashdone); | ||
5924 | bfa_iocfc_cb_dconf_modinit(bfa, status); | ||
5925 | if (status == BFA_STATUS_OK) { | 5843 | if (status == BFA_STATUS_OK) { |
5926 | bfa_dconf_read_data_valid(bfa) = BFA_TRUE; | 5844 | bfa_dconf_read_data_valid(bfa) = BFA_TRUE; |
5927 | if (dconf->dconf->hdr.signature != BFI_DCONF_SIGNATURE) | 5845 | if (dconf->dconf->hdr.signature != BFI_DCONF_SIGNATURE) |
@@ -5929,7 +5847,7 @@ bfa_dconf_init_cb(void *arg, bfa_status_t status) | |||
5929 | if (dconf->dconf->hdr.version != BFI_DCONF_VERSION) | 5847 | if (dconf->dconf->hdr.version != BFI_DCONF_VERSION) |
5930 | dconf->dconf->hdr.version = BFI_DCONF_VERSION; | 5848 | dconf->dconf->hdr.version = BFI_DCONF_VERSION; |
5931 | } | 5849 | } |
5932 | bfa_sm_send_event(dconf, BFA_DCONF_SM_FLASH_COMP); | 5850 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_DCONF_DONE); |
5933 | } | 5851 | } |
5934 | 5852 | ||
5935 | void | 5853 | void |
@@ -6011,7 +5929,5 @@ void | |||
6011 | bfa_dconf_modexit(struct bfa_s *bfa) | 5929 | bfa_dconf_modexit(struct bfa_s *bfa) |
6012 | { | 5930 | { |
6013 | struct bfa_dconf_mod_s *dconf = BFA_DCONF_MOD(bfa); | 5931 | struct bfa_dconf_mod_s *dconf = BFA_DCONF_MOD(bfa); |
6014 | BFA_DCONF_MOD(bfa)->flashdone = BFA_FALSE; | ||
6015 | bfa_trc(bfa, BFA_DCONF_MOD(bfa)->flashdone); | ||
6016 | bfa_sm_send_event(dconf, BFA_DCONF_SM_EXIT); | 5932 | bfa_sm_send_event(dconf, BFA_DCONF_SM_EXIT); |
6017 | } | 5933 | } |
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index 546d46b37101..1a99d4b5b50f 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h | |||
@@ -373,6 +373,22 @@ struct bfa_cb_qe_s { | |||
373 | }; | 373 | }; |
374 | 374 | ||
375 | /* | 375 | /* |
376 | * IOCFC state machine definitions/declarations | ||
377 | */ | ||
378 | enum iocfc_event { | ||
379 | IOCFC_E_INIT = 1, /* IOCFC init request */ | ||
380 | IOCFC_E_START = 2, /* IOCFC mod start request */ | ||
381 | IOCFC_E_STOP = 3, /* IOCFC stop request */ | ||
382 | IOCFC_E_ENABLE = 4, /* IOCFC enable request */ | ||
383 | IOCFC_E_DISABLE = 5, /* IOCFC disable request */ | ||
384 | IOCFC_E_IOC_ENABLED = 6, /* IOC enabled message */ | ||
385 | IOCFC_E_IOC_DISABLED = 7, /* IOC disabled message */ | ||
386 | IOCFC_E_IOC_FAILED = 8, /* failure notice by IOC sm */ | ||
387 | IOCFC_E_DCONF_DONE = 9, /* dconf read/write done */ | ||
388 | IOCFC_E_CFG_DONE = 10, /* IOCFC config complete */ | ||
389 | }; | ||
390 | |||
391 | /* | ||
376 | * ASIC block configurtion related | 392 | * ASIC block configurtion related |
377 | */ | 393 | */ |
378 | 394 | ||
@@ -706,7 +722,6 @@ struct bfa_dconf_s { | |||
706 | struct bfa_dconf_mod_s { | 722 | struct bfa_dconf_mod_s { |
707 | bfa_sm_t sm; | 723 | bfa_sm_t sm; |
708 | u8 instance; | 724 | u8 instance; |
709 | bfa_boolean_t flashdone; | ||
710 | bfa_boolean_t read_data_valid; | 725 | bfa_boolean_t read_data_valid; |
711 | bfa_boolean_t min_cfg; | 726 | bfa_boolean_t min_cfg; |
712 | struct bfa_timer_s timer; | 727 | struct bfa_timer_s timer; |
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c index aa8a0eaf91f9..f92a85f037a3 100644 --- a/drivers/scsi/bfa/bfa_svc.c +++ b/drivers/scsi/bfa/bfa_svc.c | |||
@@ -3825,8 +3825,6 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr) | |||
3825 | attr->port_state = BFA_PORT_ST_IOCDIS; | 3825 | attr->port_state = BFA_PORT_ST_IOCDIS; |
3826 | else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc)) | 3826 | else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc)) |
3827 | attr->port_state = BFA_PORT_ST_FWMISMATCH; | 3827 | attr->port_state = BFA_PORT_ST_FWMISMATCH; |
3828 | else if (bfa_ioc_is_acq_addr(&fcport->bfa->ioc)) | ||
3829 | attr->port_state = BFA_PORT_ST_ACQ_ADDR; | ||
3830 | } | 3828 | } |
3831 | 3829 | ||
3832 | /* FCoE vlan */ | 3830 | /* FCoE vlan */ |
diff --git a/drivers/scsi/bfa/bfa_svc.h b/drivers/scsi/bfa/bfa_svc.h index b52cbb6bcd5a..f30067564639 100644 --- a/drivers/scsi/bfa/bfa_svc.h +++ b/drivers/scsi/bfa/bfa_svc.h | |||
@@ -663,10 +663,6 @@ void bfa_cb_lps_fdisclogo_comp(void *bfad, void *uarg); | |||
663 | void bfa_cb_lps_cvl_event(void *bfad, void *uarg); | 663 | void bfa_cb_lps_cvl_event(void *bfad, void *uarg); |
664 | 664 | ||
665 | /* FAA specific APIs */ | 665 | /* FAA specific APIs */ |
666 | bfa_status_t bfa_faa_enable(struct bfa_s *bfa, | ||
667 | bfa_cb_iocfc_t cbfn, void *cbarg); | ||
668 | bfa_status_t bfa_faa_disable(struct bfa_s *bfa, | ||
669 | bfa_cb_iocfc_t cbfn, void *cbarg); | ||
670 | bfa_status_t bfa_faa_query(struct bfa_s *bfa, struct bfa_faa_attr_s *attr, | 666 | bfa_status_t bfa_faa_query(struct bfa_s *bfa, struct bfa_faa_attr_s *attr, |
671 | bfa_cb_iocfc_t cbfn, void *cbarg); | 667 | bfa_cb_iocfc_t cbfn, void *cbarg); |
672 | 668 | ||
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index f62cf4981473..31a1d8a027b8 100644 --- a/drivers/scsi/bfa/bfad_bsg.c +++ b/drivers/scsi/bfa/bfad_bsg.c | |||
@@ -1288,50 +1288,6 @@ out: | |||
1288 | } | 1288 | } |
1289 | 1289 | ||
1290 | int | 1290 | int |
1291 | bfad_iocmd_faa_enable(struct bfad_s *bfad, void *cmd) | ||
1292 | { | ||
1293 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | ||
1294 | unsigned long flags; | ||
1295 | struct bfad_hal_comp fcomp; | ||
1296 | |||
1297 | init_completion(&fcomp.comp); | ||
1298 | iocmd->status = BFA_STATUS_OK; | ||
1299 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
1300 | iocmd->status = bfa_faa_enable(&bfad->bfa, bfad_hcb_comp, &fcomp); | ||
1301 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
1302 | |||
1303 | if (iocmd->status != BFA_STATUS_OK) | ||
1304 | goto out; | ||
1305 | |||
1306 | wait_for_completion(&fcomp.comp); | ||
1307 | iocmd->status = fcomp.status; | ||
1308 | out: | ||
1309 | return 0; | ||
1310 | } | ||
1311 | |||
1312 | int | ||
1313 | bfad_iocmd_faa_disable(struct bfad_s *bfad, void *cmd) | ||
1314 | { | ||
1315 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | ||
1316 | unsigned long flags; | ||
1317 | struct bfad_hal_comp fcomp; | ||
1318 | |||
1319 | init_completion(&fcomp.comp); | ||
1320 | iocmd->status = BFA_STATUS_OK; | ||
1321 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
1322 | iocmd->status = bfa_faa_disable(&bfad->bfa, bfad_hcb_comp, &fcomp); | ||
1323 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
1324 | |||
1325 | if (iocmd->status != BFA_STATUS_OK) | ||
1326 | goto out; | ||
1327 | |||
1328 | wait_for_completion(&fcomp.comp); | ||
1329 | iocmd->status = fcomp.status; | ||
1330 | out: | ||
1331 | return 0; | ||
1332 | } | ||
1333 | |||
1334 | int | ||
1335 | bfad_iocmd_faa_query(struct bfad_s *bfad, void *cmd) | 1291 | bfad_iocmd_faa_query(struct bfad_s *bfad, void *cmd) |
1336 | { | 1292 | { |
1337 | struct bfa_bsg_faa_attr_s *iocmd = (struct bfa_bsg_faa_attr_s *)cmd; | 1293 | struct bfa_bsg_faa_attr_s *iocmd = (struct bfa_bsg_faa_attr_s *)cmd; |
@@ -2636,12 +2592,6 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, | |||
2636 | case IOCMD_FLASH_DISABLE_OPTROM: | 2592 | case IOCMD_FLASH_DISABLE_OPTROM: |
2637 | rc = bfad_iocmd_ablk_optrom(bfad, cmd, iocmd); | 2593 | rc = bfad_iocmd_ablk_optrom(bfad, cmd, iocmd); |
2638 | break; | 2594 | break; |
2639 | case IOCMD_FAA_ENABLE: | ||
2640 | rc = bfad_iocmd_faa_enable(bfad, iocmd); | ||
2641 | break; | ||
2642 | case IOCMD_FAA_DISABLE: | ||
2643 | rc = bfad_iocmd_faa_disable(bfad, iocmd); | ||
2644 | break; | ||
2645 | case IOCMD_FAA_QUERY: | 2595 | case IOCMD_FAA_QUERY: |
2646 | rc = bfad_iocmd_faa_query(bfad, iocmd); | 2596 | rc = bfad_iocmd_faa_query(bfad, iocmd); |
2647 | break; | 2597 | break; |
diff --git a/drivers/scsi/bfa/bfad_bsg.h b/drivers/scsi/bfa/bfad_bsg.h index e859adb9aa9e..17ad67283130 100644 --- a/drivers/scsi/bfa/bfad_bsg.h +++ b/drivers/scsi/bfa/bfad_bsg.h | |||
@@ -83,8 +83,6 @@ enum { | |||
83 | IOCMD_PORT_CFG_MODE, | 83 | IOCMD_PORT_CFG_MODE, |
84 | IOCMD_FLASH_ENABLE_OPTROM, | 84 | IOCMD_FLASH_ENABLE_OPTROM, |
85 | IOCMD_FLASH_DISABLE_OPTROM, | 85 | IOCMD_FLASH_DISABLE_OPTROM, |
86 | IOCMD_FAA_ENABLE, | ||
87 | IOCMD_FAA_DISABLE, | ||
88 | IOCMD_FAA_QUERY, | 86 | IOCMD_FAA_QUERY, |
89 | IOCMD_CEE_GET_ATTR, | 87 | IOCMD_CEE_GET_ATTR, |
90 | IOCMD_CEE_GET_STATS, | 88 | IOCMD_CEE_GET_STATS, |
diff --git a/drivers/scsi/bfa/bfi_ms.h b/drivers/scsi/bfa/bfi_ms.h index 0d9f1fb50db0..d4220e13cafa 100644 --- a/drivers/scsi/bfa/bfi_ms.h +++ b/drivers/scsi/bfa/bfi_ms.h | |||
@@ -28,17 +28,15 @@ enum bfi_iocfc_h2i_msgs { | |||
28 | BFI_IOCFC_H2I_CFG_REQ = 1, | 28 | BFI_IOCFC_H2I_CFG_REQ = 1, |
29 | BFI_IOCFC_H2I_SET_INTR_REQ = 2, | 29 | BFI_IOCFC_H2I_SET_INTR_REQ = 2, |
30 | BFI_IOCFC_H2I_UPDATEQ_REQ = 3, | 30 | BFI_IOCFC_H2I_UPDATEQ_REQ = 3, |
31 | BFI_IOCFC_H2I_FAA_ENABLE_REQ = 4, | 31 | BFI_IOCFC_H2I_FAA_QUERY_REQ = 4, |
32 | BFI_IOCFC_H2I_FAA_DISABLE_REQ = 5, | 32 | BFI_IOCFC_H2I_ADDR_REQ = 5, |
33 | BFI_IOCFC_H2I_FAA_QUERY_REQ = 6, | ||
34 | }; | 33 | }; |
35 | 34 | ||
36 | enum bfi_iocfc_i2h_msgs { | 35 | enum bfi_iocfc_i2h_msgs { |
37 | BFI_IOCFC_I2H_CFG_REPLY = BFA_I2HM(1), | 36 | BFI_IOCFC_I2H_CFG_REPLY = BFA_I2HM(1), |
38 | BFI_IOCFC_I2H_UPDATEQ_RSP = BFA_I2HM(3), | 37 | BFI_IOCFC_I2H_UPDATEQ_RSP = BFA_I2HM(3), |
39 | BFI_IOCFC_I2H_FAA_ENABLE_RSP = BFA_I2HM(4), | 38 | BFI_IOCFC_I2H_FAA_QUERY_RSP = BFA_I2HM(4), |
40 | BFI_IOCFC_I2H_FAA_DISABLE_RSP = BFA_I2HM(5), | 39 | BFI_IOCFC_I2H_ADDR_MSG = BFA_I2HM(5), |
41 | BFI_IOCFC_I2H_FAA_QUERY_RSP = BFA_I2HM(6), | ||
42 | }; | 40 | }; |
43 | 41 | ||
44 | struct bfi_iocfc_cfg_s { | 42 | struct bfi_iocfc_cfg_s { |
@@ -184,6 +182,13 @@ struct bfi_faa_en_dis_s { | |||
184 | struct bfi_mhdr_s mh; /* common msg header */ | 182 | struct bfi_mhdr_s mh; /* common msg header */ |
185 | }; | 183 | }; |
186 | 184 | ||
185 | struct bfi_faa_addr_msg_s { | ||
186 | struct bfi_mhdr_s mh; /* common msg header */ | ||
187 | u8 rsvd[4]; | ||
188 | wwn_t pwwn; /* Fabric acquired PWWN */ | ||
189 | wwn_t nwwn; /* Fabric acquired PWWN */ | ||
190 | }; | ||
191 | |||
187 | /* | 192 | /* |
188 | * BFI_IOCFC_H2I_FAA_QUERY_REQ message | 193 | * BFI_IOCFC_H2I_FAA_QUERY_REQ message |
189 | */ | 194 | */ |