Lines Matching refs:ioc
90 static void bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc);
91 static void bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force);
92 static void bfa_ioc_timeout(void *ioc);
93 static void bfa_ioc_poll_fwinit(struct bfa_ioc_s *ioc);
94 static void bfa_ioc_send_enable(struct bfa_ioc_s *ioc);
95 static void bfa_ioc_send_disable(struct bfa_ioc_s *ioc);
96 static void bfa_ioc_send_getattr(struct bfa_ioc_s *ioc);
97 static void bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc);
98 static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc);
99 static void bfa_ioc_mbox_flush(struct bfa_ioc_s *ioc);
100 static void bfa_ioc_recover(struct bfa_ioc_s *ioc);
101 static void bfa_ioc_event_notify(struct bfa_ioc_s *ioc ,
103 static void bfa_ioc_disable_comp(struct bfa_ioc_s *ioc);
104 static void bfa_ioc_lpu_stop(struct bfa_ioc_s *ioc);
105 static void bfa_ioc_fail_notify(struct bfa_ioc_s *ioc);
106 static void bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc);
111 struct bfa_ioc_s *ioc,
257 bfa_ioc_sm_uninit_entry(struct bfa_ioc_s *ioc) in bfa_ioc_sm_uninit_entry() argument
265 bfa_ioc_sm_uninit(struct bfa_ioc_s *ioc, enum ioc_event event) in bfa_ioc_sm_uninit() argument
267 bfa_trc(ioc, event); in bfa_ioc_sm_uninit()
271 bfa_fsm_set_state(ioc, bfa_ioc_sm_reset); in bfa_ioc_sm_uninit()
275 bfa_sm_fault(ioc, event); in bfa_ioc_sm_uninit()
282 bfa_ioc_sm_reset_entry(struct bfa_ioc_s *ioc) in bfa_ioc_sm_reset_entry() argument
284 bfa_fsm_set_state(&ioc->iocpf, bfa_iocpf_sm_reset); in bfa_ioc_sm_reset_entry()
291 bfa_ioc_sm_reset(struct bfa_ioc_s *ioc, enum ioc_event event) in bfa_ioc_sm_reset() argument
293 bfa_trc(ioc, event); in bfa_ioc_sm_reset()
297 bfa_fsm_set_state(ioc, bfa_ioc_sm_enabling); in bfa_ioc_sm_reset()
301 bfa_ioc_disable_comp(ioc); in bfa_ioc_sm_reset()
305 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); in bfa_ioc_sm_reset()
309 bfa_sm_fault(ioc, event); in bfa_ioc_sm_reset()
315 bfa_ioc_sm_enabling_entry(struct bfa_ioc_s *ioc) in bfa_ioc_sm_enabling_entry() argument
317 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_ENABLE); in bfa_ioc_sm_enabling_entry()
325 bfa_ioc_sm_enabling(struct bfa_ioc_s *ioc, enum ioc_event event) in bfa_ioc_sm_enabling() argument
327 bfa_trc(ioc, event); in bfa_ioc_sm_enabling()
331 bfa_fsm_set_state(ioc, bfa_ioc_sm_getattr); in bfa_ioc_sm_enabling()
337 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_enabling()
338 bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); in bfa_ioc_sm_enabling()
340 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_INITFAIL); in bfa_ioc_sm_enabling()
344 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_enabling()
345 bfa_fsm_set_state(ioc, bfa_ioc_sm_hwfail); in bfa_ioc_sm_enabling()
349 bfa_fsm_set_state(ioc, bfa_ioc_sm_disabling); in bfa_ioc_sm_enabling()
353 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); in bfa_ioc_sm_enabling()
354 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); in bfa_ioc_sm_enabling()
361 bfa_sm_fault(ioc, event); in bfa_ioc_sm_enabling()
367 bfa_ioc_sm_getattr_entry(struct bfa_ioc_s *ioc) in bfa_ioc_sm_getattr_entry() argument
369 bfa_ioc_timer_start(ioc); in bfa_ioc_sm_getattr_entry()
370 bfa_ioc_send_getattr(ioc); in bfa_ioc_sm_getattr_entry()
377 bfa_ioc_sm_getattr(struct bfa_ioc_s *ioc, enum ioc_event event) in bfa_ioc_sm_getattr() argument
379 bfa_trc(ioc, event); in bfa_ioc_sm_getattr()
383 bfa_ioc_timer_stop(ioc); in bfa_ioc_sm_getattr()
384 bfa_fsm_set_state(ioc, bfa_ioc_sm_op); in bfa_ioc_sm_getattr()
389 bfa_ioc_timer_stop(ioc); in bfa_ioc_sm_getattr()
392 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_getattr()
393 bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); in bfa_ioc_sm_getattr()
395 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_GETATTRFAIL); in bfa_ioc_sm_getattr()
399 bfa_ioc_timer_stop(ioc); in bfa_ioc_sm_getattr()
400 bfa_fsm_set_state(ioc, bfa_ioc_sm_disabling); in bfa_ioc_sm_getattr()
407 bfa_sm_fault(ioc, event); in bfa_ioc_sm_getattr()
412 bfa_ioc_sm_op_entry(struct bfa_ioc_s *ioc) in bfa_ioc_sm_op_entry() argument
414 struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad; in bfa_ioc_sm_op_entry()
416 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_OK); in bfa_ioc_sm_op_entry()
417 bfa_ioc_event_notify(ioc, BFA_IOC_E_ENABLED); in bfa_ioc_sm_op_entry()
418 bfa_ioc_hb_monitor(ioc); in bfa_ioc_sm_op_entry()
420 bfa_ioc_aen_post(ioc, BFA_IOC_AEN_ENABLE); in bfa_ioc_sm_op_entry()
424 bfa_ioc_sm_op(struct bfa_ioc_s *ioc, enum ioc_event event) in bfa_ioc_sm_op() argument
426 bfa_trc(ioc, event); in bfa_ioc_sm_op()
433 bfa_hb_timer_stop(ioc); in bfa_ioc_sm_op()
434 bfa_fsm_set_state(ioc, bfa_ioc_sm_disabling); in bfa_ioc_sm_op()
439 bfa_hb_timer_stop(ioc); in bfa_ioc_sm_op()
442 if (ioc->iocpf.auto_recover) in bfa_ioc_sm_op()
443 bfa_fsm_set_state(ioc, bfa_ioc_sm_fail_retry); in bfa_ioc_sm_op()
445 bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); in bfa_ioc_sm_op()
447 bfa_ioc_fail_notify(ioc); in bfa_ioc_sm_op()
450 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FAIL); in bfa_ioc_sm_op()
454 bfa_sm_fault(ioc, event); in bfa_ioc_sm_op()
460 bfa_ioc_sm_disabling_entry(struct bfa_ioc_s *ioc) in bfa_ioc_sm_disabling_entry() argument
462 struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad; in bfa_ioc_sm_disabling_entry()
463 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_DISABLE); in bfa_ioc_sm_disabling_entry()
465 bfa_ioc_aen_post(ioc, BFA_IOC_AEN_DISABLE); in bfa_ioc_sm_disabling_entry()
472 bfa_ioc_sm_disabling(struct bfa_ioc_s *ioc, enum ioc_event event) in bfa_ioc_sm_disabling() argument
474 bfa_trc(ioc, event); in bfa_ioc_sm_disabling()
478 bfa_fsm_set_state(ioc, bfa_ioc_sm_disabled); in bfa_ioc_sm_disabling()
487 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FAIL); in bfa_ioc_sm_disabling()
491 bfa_fsm_set_state(ioc, bfa_ioc_sm_hwfail); in bfa_ioc_sm_disabling()
492 bfa_ioc_disable_comp(ioc); in bfa_ioc_sm_disabling()
496 bfa_sm_fault(ioc, event); in bfa_ioc_sm_disabling()
504 bfa_ioc_sm_disabled_entry(struct bfa_ioc_s *ioc) in bfa_ioc_sm_disabled_entry() argument
506 bfa_ioc_disable_comp(ioc); in bfa_ioc_sm_disabled_entry()
510 bfa_ioc_sm_disabled(struct bfa_ioc_s *ioc, enum ioc_event event) in bfa_ioc_sm_disabled() argument
512 bfa_trc(ioc, event); in bfa_ioc_sm_disabled()
516 bfa_fsm_set_state(ioc, bfa_ioc_sm_enabling); in bfa_ioc_sm_disabled()
520 ioc->cbfn->disable_cbfn(ioc->bfa); in bfa_ioc_sm_disabled()
524 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); in bfa_ioc_sm_disabled()
525 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); in bfa_ioc_sm_disabled()
529 bfa_sm_fault(ioc, event); in bfa_ioc_sm_disabled()
535 bfa_ioc_sm_fail_retry_entry(struct bfa_ioc_s *ioc) in bfa_ioc_sm_fail_retry_entry() argument
537 bfa_trc(ioc, 0); in bfa_ioc_sm_fail_retry_entry()
544 bfa_ioc_sm_fail_retry(struct bfa_ioc_s *ioc, enum ioc_event event) in bfa_ioc_sm_fail_retry() argument
546 bfa_trc(ioc, event); in bfa_ioc_sm_fail_retry()
550 bfa_fsm_set_state(ioc, bfa_ioc_sm_getattr); in bfa_ioc_sm_fail_retry()
558 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_fail_retry()
559 bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); in bfa_ioc_sm_fail_retry()
561 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_INITFAIL); in bfa_ioc_sm_fail_retry()
565 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_fail_retry()
566 bfa_fsm_set_state(ioc, bfa_ioc_sm_hwfail); in bfa_ioc_sm_fail_retry()
573 bfa_fsm_set_state(ioc, bfa_ioc_sm_disabling); in bfa_ioc_sm_fail_retry()
577 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); in bfa_ioc_sm_fail_retry()
578 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); in bfa_ioc_sm_fail_retry()
582 bfa_sm_fault(ioc, event); in bfa_ioc_sm_fail_retry()
588 bfa_ioc_sm_fail_entry(struct bfa_ioc_s *ioc) in bfa_ioc_sm_fail_entry() argument
590 bfa_trc(ioc, 0); in bfa_ioc_sm_fail_entry()
597 bfa_ioc_sm_fail(struct bfa_ioc_s *ioc, enum ioc_event event) in bfa_ioc_sm_fail() argument
599 bfa_trc(ioc, event); in bfa_ioc_sm_fail()
604 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_fail()
608 bfa_fsm_set_state(ioc, bfa_ioc_sm_disabling); in bfa_ioc_sm_fail()
612 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); in bfa_ioc_sm_fail()
613 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); in bfa_ioc_sm_fail()
623 bfa_sm_fault(ioc, event); in bfa_ioc_sm_fail()
628 bfa_ioc_sm_hwfail_entry(struct bfa_ioc_s *ioc) in bfa_ioc_sm_hwfail_entry() argument
630 bfa_trc(ioc, 0); in bfa_ioc_sm_hwfail_entry()
634 bfa_ioc_sm_hwfail(struct bfa_ioc_s *ioc, enum ioc_event event) in bfa_ioc_sm_hwfail() argument
636 bfa_trc(ioc, event); in bfa_ioc_sm_hwfail()
640 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_hwfail()
644 ioc->cbfn->disable_cbfn(ioc->bfa); in bfa_ioc_sm_hwfail()
648 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); in bfa_ioc_sm_hwfail()
656 bfa_sm_fault(ioc, event); in bfa_ioc_sm_hwfail()
680 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_reset() local
682 bfa_trc(ioc, event); in bfa_iocpf_sm_reset()
693 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_reset()
710 r32 = readl(iocpf->ioc->ioc_regs.ioc_init_sem_reg); in bfa_iocpf_sm_fwcheck_entry()
713 r32 = readl(iocpf->ioc->ioc_regs.ioc_init_sem_reg); in bfa_iocpf_sm_fwcheck_entry()
717 fwstate = bfa_ioc_get_cur_ioc_fwstate(iocpf->ioc); in bfa_iocpf_sm_fwcheck_entry()
719 writel(1, iocpf->ioc->ioc_regs.ioc_init_sem_reg); in bfa_iocpf_sm_fwcheck_entry()
723 bfa_ioc_fwver_get(iocpf->ioc, &fwhdr); in bfa_iocpf_sm_fwcheck_entry()
726 writel(1, iocpf->ioc->ioc_regs.ioc_init_sem_reg); in bfa_iocpf_sm_fwcheck_entry()
733 pgnum = PSS_SMEM_PGNUM(iocpf->ioc->ioc_regs.smem_pg0, loff); in bfa_iocpf_sm_fwcheck_entry()
734 writel(pgnum, iocpf->ioc->ioc_regs.host_page_num_fn); in bfa_iocpf_sm_fwcheck_entry()
737 bfa_mem_write(iocpf->ioc->ioc_regs.smem_page_start, loff, 0); in bfa_iocpf_sm_fwcheck_entry()
741 bfa_trc(iocpf->ioc, fwstate); in bfa_iocpf_sm_fwcheck_entry()
742 bfa_trc(iocpf->ioc, swab32(fwhdr.exec)); in bfa_iocpf_sm_fwcheck_entry()
743 bfa_ioc_set_cur_ioc_fwstate(iocpf->ioc, BFI_IOC_UNINIT); in bfa_iocpf_sm_fwcheck_entry()
744 bfa_ioc_set_alt_ioc_fwstate(iocpf->ioc, BFI_IOC_UNINIT); in bfa_iocpf_sm_fwcheck_entry()
749 bfa_ioc_ownership_reset(iocpf->ioc); in bfa_iocpf_sm_fwcheck_entry()
754 writel(1, iocpf->ioc->ioc_regs.ioc_init_sem_reg); in bfa_iocpf_sm_fwcheck_entry()
757 bfa_ioc_hw_sem_get(iocpf->ioc); in bfa_iocpf_sm_fwcheck_entry()
766 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_fwcheck() local
768 bfa_trc(ioc, event); in bfa_iocpf_sm_fwcheck()
772 if (bfa_ioc_firmware_lock(ioc)) { in bfa_iocpf_sm_fwcheck()
773 if (bfa_ioc_sync_start(ioc)) { in bfa_iocpf_sm_fwcheck()
774 bfa_ioc_sync_join(ioc); in bfa_iocpf_sm_fwcheck()
777 bfa_ioc_firmware_unlock(ioc); in bfa_iocpf_sm_fwcheck()
778 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_fwcheck()
779 bfa_sem_timer_start(ioc); in bfa_iocpf_sm_fwcheck()
782 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_fwcheck()
789 bfa_fsm_send_event(ioc, IOC_E_HWFAILED); in bfa_iocpf_sm_fwcheck()
793 bfa_sem_timer_stop(ioc); in bfa_iocpf_sm_fwcheck()
795 bfa_fsm_send_event(ioc, IOC_E_DISABLED); in bfa_iocpf_sm_fwcheck()
799 bfa_sem_timer_stop(ioc); in bfa_iocpf_sm_fwcheck()
804 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_fwcheck()
818 bfa_ioc_pf_fwmismatch(iocpf->ioc); in bfa_iocpf_sm_mismatch_entry()
821 bfa_iocpf_timer_start(iocpf->ioc); in bfa_iocpf_sm_mismatch_entry()
830 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_mismatch() local
832 bfa_trc(ioc, event); in bfa_iocpf_sm_mismatch()
840 bfa_iocpf_timer_stop(ioc); in bfa_iocpf_sm_mismatch()
842 bfa_fsm_send_event(ioc, IOC_E_DISABLED); in bfa_iocpf_sm_mismatch()
846 bfa_iocpf_timer_stop(ioc); in bfa_iocpf_sm_mismatch()
851 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_mismatch()
861 bfa_ioc_hw_sem_get(iocpf->ioc); in bfa_iocpf_sm_semwait_entry()
870 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_semwait() local
872 bfa_trc(ioc, event); in bfa_iocpf_sm_semwait()
876 if (bfa_ioc_sync_complete(ioc)) { in bfa_iocpf_sm_semwait()
877 bfa_ioc_sync_join(ioc); in bfa_iocpf_sm_semwait()
880 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_semwait()
881 bfa_sem_timer_start(ioc); in bfa_iocpf_sm_semwait()
887 bfa_fsm_send_event(ioc, IOC_E_HWFAILED); in bfa_iocpf_sm_semwait()
891 bfa_sem_timer_stop(ioc); in bfa_iocpf_sm_semwait()
896 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_semwait()
904 bfa_ioc_hwinit(iocpf->ioc, BFA_FALSE); in bfa_iocpf_sm_hwinit_entry()
914 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_hwinit() local
916 bfa_trc(ioc, event); in bfa_iocpf_sm_hwinit()
924 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_hwinit()
925 bfa_fsm_send_event(ioc, IOC_E_PFFAILED); in bfa_iocpf_sm_hwinit()
930 bfa_iocpf_timer_stop(ioc); in bfa_iocpf_sm_hwinit()
931 bfa_ioc_sync_leave(ioc); in bfa_iocpf_sm_hwinit()
932 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_hwinit()
937 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_hwinit()
944 bfa_iocpf_timer_start(iocpf->ioc); in bfa_iocpf_sm_enabling_entry()
948 iocpf->ioc->cbfn->reset_cbfn(iocpf->ioc->bfa); in bfa_iocpf_sm_enabling_entry()
949 bfa_ioc_send_enable(iocpf->ioc); in bfa_iocpf_sm_enabling_entry()
959 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_enabling() local
961 bfa_trc(ioc, event); in bfa_iocpf_sm_enabling()
965 bfa_iocpf_timer_stop(ioc); in bfa_iocpf_sm_enabling()
966 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_enabling()
971 bfa_iocpf_timer_stop(ioc); in bfa_iocpf_sm_enabling()
975 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_enabling()
977 bfa_fsm_send_event(ioc, IOC_E_PFFAILED); in bfa_iocpf_sm_enabling()
982 bfa_iocpf_timer_stop(ioc); in bfa_iocpf_sm_enabling()
983 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_enabling()
988 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_enabling()
995 bfa_fsm_send_event(iocpf->ioc, IOC_E_ENABLED); in bfa_iocpf_sm_ready_entry()
1001 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_ready() local
1003 bfa_trc(ioc, event); in bfa_iocpf_sm_ready()
1019 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_ready()
1026 bfa_iocpf_timer_start(iocpf->ioc); in bfa_iocpf_sm_disabling_entry()
1027 bfa_ioc_send_disable(iocpf->ioc); in bfa_iocpf_sm_disabling_entry()
1036 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_disabling() local
1038 bfa_trc(ioc, event); in bfa_iocpf_sm_disabling()
1042 bfa_iocpf_timer_stop(ioc); in bfa_iocpf_sm_disabling()
1047 bfa_iocpf_timer_stop(ioc); in bfa_iocpf_sm_disabling()
1051 bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_FAIL); in bfa_iocpf_sm_disabling()
1059 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_disabling()
1066 bfa_ioc_hw_sem_get(iocpf->ioc); in bfa_iocpf_sm_disabling_sync_entry()
1075 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_disabling_sync() local
1077 bfa_trc(ioc, event); in bfa_iocpf_sm_disabling_sync()
1081 bfa_ioc_sync_leave(ioc); in bfa_iocpf_sm_disabling_sync()
1082 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_disabling_sync()
1088 bfa_fsm_send_event(ioc, IOC_E_HWFAILED); in bfa_iocpf_sm_disabling_sync()
1095 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_disabling_sync()
1105 bfa_ioc_mbox_flush(iocpf->ioc); in bfa_iocpf_sm_disabled_entry()
1106 bfa_fsm_send_event(iocpf->ioc, IOC_E_DISABLED); in bfa_iocpf_sm_disabled_entry()
1112 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_disabled() local
1114 bfa_trc(ioc, event); in bfa_iocpf_sm_disabled()
1122 bfa_ioc_firmware_unlock(ioc); in bfa_iocpf_sm_disabled()
1127 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_disabled()
1134 bfa_ioc_debug_save_ftrc(iocpf->ioc); in bfa_iocpf_sm_initfail_sync_entry()
1135 bfa_ioc_hw_sem_get(iocpf->ioc); in bfa_iocpf_sm_initfail_sync_entry()
1144 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_initfail_sync() local
1146 bfa_trc(ioc, event); in bfa_iocpf_sm_initfail_sync()
1150 bfa_ioc_notify_fail(ioc); in bfa_iocpf_sm_initfail_sync()
1151 bfa_ioc_sync_leave(ioc); in bfa_iocpf_sm_initfail_sync()
1152 bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_FAIL); in bfa_iocpf_sm_initfail_sync()
1153 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_initfail_sync()
1159 bfa_fsm_send_event(ioc, IOC_E_HWFAILED); in bfa_iocpf_sm_initfail_sync()
1163 bfa_sem_timer_stop(ioc); in bfa_iocpf_sm_initfail_sync()
1168 bfa_sem_timer_stop(ioc); in bfa_iocpf_sm_initfail_sync()
1169 bfa_ioc_firmware_unlock(ioc); in bfa_iocpf_sm_initfail_sync()
1177 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_initfail_sync()
1184 bfa_trc(iocpf->ioc, 0); in bfa_iocpf_sm_initfail_entry()
1193 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_initfail() local
1195 bfa_trc(ioc, event); in bfa_iocpf_sm_initfail()
1203 bfa_ioc_firmware_unlock(ioc); in bfa_iocpf_sm_initfail()
1208 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_initfail()
1218 bfa_ioc_lpu_stop(iocpf->ioc); in bfa_iocpf_sm_fail_sync_entry()
1223 bfa_ioc_mbox_flush(iocpf->ioc); in bfa_iocpf_sm_fail_sync_entry()
1225 bfa_ioc_hw_sem_get(iocpf->ioc); in bfa_iocpf_sm_fail_sync_entry()
1231 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_fail_sync() local
1233 bfa_trc(ioc, event); in bfa_iocpf_sm_fail_sync()
1237 bfa_ioc_sync_ack(ioc); in bfa_iocpf_sm_fail_sync()
1238 bfa_ioc_notify_fail(ioc); in bfa_iocpf_sm_fail_sync()
1240 bfa_ioc_sync_leave(ioc); in bfa_iocpf_sm_fail_sync()
1241 bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_FAIL); in bfa_iocpf_sm_fail_sync()
1242 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_fail_sync()
1245 if (bfa_ioc_sync_complete(ioc)) in bfa_iocpf_sm_fail_sync()
1248 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_iocpf_sm_fail_sync()
1256 bfa_fsm_send_event(ioc, IOC_E_HWFAILED); in bfa_iocpf_sm_fail_sync()
1260 bfa_sem_timer_stop(ioc); in bfa_iocpf_sm_fail_sync()
1268 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_fail_sync()
1275 bfa_trc(iocpf->ioc, 0); in bfa_iocpf_sm_fail_entry()
1284 struct bfa_ioc_s *ioc = iocpf->ioc; in bfa_iocpf_sm_fail() local
1286 bfa_trc(ioc, event); in bfa_iocpf_sm_fail()
1294 bfa_sm_fault(ioc, event); in bfa_iocpf_sm_fail()
1306 bfa_ioc_event_notify(struct bfa_ioc_s *ioc, enum bfa_ioc_event_e event) in bfa_ioc_event_notify() argument
1311 list_for_each(qe, &ioc->notify_q) { in bfa_ioc_event_notify()
1318 bfa_ioc_disable_comp(struct bfa_ioc_s *ioc) in bfa_ioc_disable_comp() argument
1320 ioc->cbfn->disable_cbfn(ioc->bfa); in bfa_ioc_disable_comp()
1321 bfa_ioc_event_notify(ioc, BFA_IOC_E_DISABLED); in bfa_ioc_disable_comp()
1346 bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc) in bfa_ioc_hw_sem_get() argument
1354 r32 = readl(ioc->ioc_regs.ioc_sem_reg); in bfa_ioc_hw_sem_get()
1357 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_SEM_ERROR); in bfa_ioc_hw_sem_get()
1361 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_SEMLOCKED); in bfa_ioc_hw_sem_get()
1365 bfa_sem_timer_start(ioc); in bfa_ioc_hw_sem_get()
1372 bfa_ioc_lmem_init(struct bfa_ioc_s *ioc) in bfa_ioc_lmem_init() argument
1378 pss_ctl = readl(ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lmem_init()
1386 writel(pss_ctl, ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lmem_init()
1393 pss_ctl = readl(ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lmem_init()
1402 bfa_trc(ioc, pss_ctl); in bfa_ioc_lmem_init()
1405 writel(pss_ctl, ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lmem_init()
1409 bfa_ioc_lpu_start(struct bfa_ioc_s *ioc) in bfa_ioc_lpu_start() argument
1416 pss_ctl = readl(ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lpu_start()
1419 writel(pss_ctl, ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lpu_start()
1423 bfa_ioc_lpu_stop(struct bfa_ioc_s *ioc) in bfa_ioc_lpu_stop() argument
1430 pss_ctl = readl(ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lpu_stop()
1433 writel(pss_ctl, ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lpu_stop()
1440 bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, struct bfi_ioc_image_hdr_s *fwhdr) in bfa_ioc_fwver_get() argument
1447 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff); in bfa_ioc_fwver_get()
1448 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_ioc_fwver_get()
1453 bfa_mem_read(ioc->ioc_regs.smem_page_start, loff); in bfa_ioc_fwver_get()
1462 bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc, in bfa_ioc_fwver_cmp() argument
1469 bfa_cb_image_get_chunk(bfa_ioc_asic_gen(ioc), 0); in bfa_ioc_fwver_cmp()
1485 smem_flash_cmp = bfa_ioc_flash_fwver_cmp(ioc, smem_fwhdr); in bfa_ioc_fwver_cmp()
1502 bfa_ioc_fwver_valid(struct bfa_ioc_s *ioc, u32 boot_env) in bfa_ioc_fwver_valid() argument
1506 bfa_ioc_fwver_get(ioc, &fwhdr); in bfa_ioc_fwver_valid()
1509 bfa_trc(ioc, fwhdr.bootenv); in bfa_ioc_fwver_valid()
1510 bfa_trc(ioc, boot_env); in bfa_ioc_fwver_valid()
1514 return bfa_ioc_fwver_cmp(ioc, &fwhdr); in bfa_ioc_fwver_valid()
1628 bfa_ioc_flash_img_get_chnk(struct bfa_ioc_s *ioc, u32 off, in bfa_ioc_flash_img_get_chnk() argument
1631 return bfa_flash_raw_read(ioc->pcidev.pci_bar_kva, in bfa_ioc_flash_img_get_chnk()
1637 bfa_ioc_flash_fwver_cmp(struct bfa_ioc_s *ioc, in bfa_ioc_flash_fwver_cmp() argument
1644 status = bfa_ioc_flash_img_get_chnk(ioc, 0, fwimg); in bfa_ioc_flash_fwver_cmp()
1660 bfa_ioc_fwsig_invalidate(struct bfa_ioc_s *ioc) in bfa_ioc_fwsig_invalidate() argument
1667 ioc_fwstate = bfa_ioc_get_cur_ioc_fwstate(ioc); in bfa_ioc_fwsig_invalidate()
1671 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff); in bfa_ioc_fwsig_invalidate()
1672 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_ioc_fwsig_invalidate()
1673 bfa_mem_write(ioc->ioc_regs.smem_page_start, loff, BFA_IOC_FW_INV_SIGN); in bfa_ioc_fwsig_invalidate()
1682 bfa_ioc_msgflush(struct bfa_ioc_s *ioc) in bfa_ioc_msgflush() argument
1686 r32 = readl(ioc->ioc_regs.lpu_mbox_cmd); in bfa_ioc_msgflush()
1688 writel(1, ioc->ioc_regs.lpu_mbox_cmd); in bfa_ioc_msgflush()
1692 bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force) in bfa_ioc_hwinit() argument
1699 ioc_fwstate = bfa_ioc_get_cur_ioc_fwstate(ioc); in bfa_ioc_hwinit()
1704 bfa_trc(ioc, ioc_fwstate); in bfa_ioc_hwinit()
1713 BFA_FALSE : bfa_ioc_fwver_valid(ioc, boot_env); in bfa_ioc_hwinit()
1716 if (bfa_ioc_boot(ioc, boot_type, boot_env) == BFA_STATUS_OK) in bfa_ioc_hwinit()
1717 bfa_ioc_poll_fwinit(ioc); in bfa_ioc_hwinit()
1726 bfa_ioc_poll_fwinit(ioc); in bfa_ioc_hwinit()
1744 bfa_ioc_msgflush(ioc); in bfa_ioc_hwinit()
1745 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FWREADY); in bfa_ioc_hwinit()
1752 if (bfa_ioc_boot(ioc, boot_type, boot_env) == BFA_STATUS_OK) in bfa_ioc_hwinit()
1753 bfa_ioc_poll_fwinit(ioc); in bfa_ioc_hwinit()
1759 struct bfa_ioc_s *ioc = (struct bfa_ioc_s *) ioc_arg; in bfa_ioc_timeout() local
1761 bfa_trc(ioc, 0); in bfa_ioc_timeout()
1762 bfa_fsm_send_event(ioc, IOC_E_TIMEOUT); in bfa_ioc_timeout()
1766 bfa_ioc_mbox_send(struct bfa_ioc_s *ioc, void *ioc_msg, int len) in bfa_ioc_mbox_send() argument
1771 bfa_trc(ioc, msgp[0]); in bfa_ioc_mbox_send()
1772 bfa_trc(ioc, len); in bfa_ioc_mbox_send()
1781 ioc->ioc_regs.hfn_mbox + i * sizeof(u32)); in bfa_ioc_mbox_send()
1784 writel(0, ioc->ioc_regs.hfn_mbox + i * sizeof(u32)); in bfa_ioc_mbox_send()
1789 writel(1, ioc->ioc_regs.hfn_mbox_cmd); in bfa_ioc_mbox_send()
1790 (void) readl(ioc->ioc_regs.hfn_mbox_cmd); in bfa_ioc_mbox_send()
1794 bfa_ioc_send_enable(struct bfa_ioc_s *ioc) in bfa_ioc_send_enable() argument
1799 bfa_ioc_portid(ioc)); in bfa_ioc_send_enable()
1800 enable_req.clscode = cpu_to_be16(ioc->clscode); in bfa_ioc_send_enable()
1803 bfa_ioc_mbox_send(ioc, &enable_req, sizeof(struct bfi_ioc_ctrl_req_s)); in bfa_ioc_send_enable()
1807 bfa_ioc_send_disable(struct bfa_ioc_s *ioc) in bfa_ioc_send_disable() argument
1812 bfa_ioc_portid(ioc)); in bfa_ioc_send_disable()
1813 disable_req.clscode = cpu_to_be16(ioc->clscode); in bfa_ioc_send_disable()
1816 bfa_ioc_mbox_send(ioc, &disable_req, sizeof(struct bfi_ioc_ctrl_req_s)); in bfa_ioc_send_disable()
1820 bfa_ioc_send_getattr(struct bfa_ioc_s *ioc) in bfa_ioc_send_getattr() argument
1825 bfa_ioc_portid(ioc)); in bfa_ioc_send_getattr()
1826 bfa_dma_be_addr_set(attr_req.attr_addr, ioc->attr_dma.pa); in bfa_ioc_send_getattr()
1827 bfa_ioc_mbox_send(ioc, &attr_req, sizeof(attr_req)); in bfa_ioc_send_getattr()
1833 struct bfa_ioc_s *ioc = cbarg; in bfa_ioc_hb_check() local
1836 hb_count = readl(ioc->ioc_regs.heartbeat); in bfa_ioc_hb_check()
1837 if (ioc->hb_count == hb_count) { in bfa_ioc_hb_check()
1838 bfa_ioc_recover(ioc); in bfa_ioc_hb_check()
1841 ioc->hb_count = hb_count; in bfa_ioc_hb_check()
1844 bfa_ioc_mbox_poll(ioc); in bfa_ioc_hb_check()
1845 bfa_hb_timer_start(ioc); in bfa_ioc_hb_check()
1849 bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc) in bfa_ioc_hb_monitor() argument
1851 ioc->hb_count = readl(ioc->ioc_regs.heartbeat); in bfa_ioc_hb_monitor()
1852 bfa_hb_timer_start(ioc); in bfa_ioc_hb_monitor()
1859 bfa_ioc_download_fw(struct bfa_ioc_s *ioc, u32 boot_type, in bfa_ioc_download_fw() argument
1876 status = bfa_ioc_flash_img_get_chnk(ioc, in bfa_ioc_download_fw()
1883 fwimg_size = bfa_cb_image_get_size(bfa_ioc_asic_gen(ioc)); in bfa_ioc_download_fw()
1884 fwimg = bfa_cb_image_get_chunk(bfa_ioc_asic_gen(ioc), in bfa_ioc_download_fw()
1888 bfa_trc(ioc, fwimg_size); in bfa_ioc_download_fw()
1891 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff); in bfa_ioc_download_fw()
1892 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_ioc_download_fw()
1901 status = bfa_ioc_flash_img_get_chnk(ioc, in bfa_ioc_download_fw()
1910 bfa_ioc_asic_gen(ioc), in bfa_ioc_download_fw()
1918 bfa_mem_write(ioc->ioc_regs.smem_page_start, loff, in bfa_ioc_download_fw()
1929 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_ioc_download_fw()
1933 writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0), in bfa_ioc_download_fw()
1934 ioc->ioc_regs.host_page_num_fn); in bfa_ioc_download_fw()
1943 asicmode = BFI_FWBOOT_DEVMODE(ioc->asic_gen, ioc->asic_mode, in bfa_ioc_download_fw()
1944 ioc->port0_mode, ioc->port1_mode); in bfa_ioc_download_fw()
1945 bfa_mem_write(ioc->ioc_regs.smem_page_start, BFI_FWBOOT_DEVMODE_OFF, in bfa_ioc_download_fw()
1947 bfa_mem_write(ioc->ioc_regs.smem_page_start, BFI_FWBOOT_TYPE_OFF, in bfa_ioc_download_fw()
1949 bfa_mem_write(ioc->ioc_regs.smem_page_start, BFI_FWBOOT_ENV_OFF, in bfa_ioc_download_fw()
1959 bfa_ioc_getattr_reply(struct bfa_ioc_s *ioc) in bfa_ioc_getattr_reply() argument
1961 struct bfi_ioc_attr_s *attr = ioc->attr; in bfa_ioc_getattr_reply()
1966 ioc->fcmode = (attr->port_mode == BFI_PORT_MODE_FC); in bfa_ioc_getattr_reply()
1969 bfa_fsm_send_event(ioc, IOC_E_FWRSP_GETATTR); in bfa_ioc_getattr_reply()
1976 bfa_ioc_mbox_attach(struct bfa_ioc_s *ioc) in bfa_ioc_mbox_attach() argument
1978 struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod; in bfa_ioc_mbox_attach()
1984 mod->mbhdlr[mc].cbarg = ioc->bfa; in bfa_ioc_mbox_attach()
1992 bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc) in bfa_ioc_mbox_poll() argument
1994 struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod; in bfa_ioc_mbox_poll()
2007 stat = readl(ioc->ioc_regs.hfn_mbox_cmd); in bfa_ioc_mbox_poll()
2015 bfa_ioc_mbox_send(ioc, cmd->msg, sizeof(cmd->msg)); in bfa_ioc_mbox_poll()
2022 bfa_ioc_mbox_flush(struct bfa_ioc_s *ioc) in bfa_ioc_mbox_flush() argument
2024 struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod; in bfa_ioc_mbox_flush()
2040 bfa_ioc_smem_read(struct bfa_ioc_s *ioc, void *tbuf, u32 soff, u32 sz) in bfa_ioc_smem_read() argument
2047 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, soff); in bfa_ioc_smem_read()
2049 bfa_trc(ioc, pgnum); in bfa_ioc_smem_read()
2050 bfa_trc(ioc, loff); in bfa_ioc_smem_read()
2051 bfa_trc(ioc, sz); in bfa_ioc_smem_read()
2056 if (BFA_FALSE == bfa_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg)) { in bfa_ioc_smem_read()
2057 bfa_trc(ioc, 0); in bfa_ioc_smem_read()
2061 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_ioc_smem_read()
2064 bfa_trc(ioc, len); in bfa_ioc_smem_read()
2066 r32 = bfa_mem_read(ioc->ioc_regs.smem_page_start, loff); in bfa_ioc_smem_read()
2076 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_ioc_smem_read()
2079 writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0), in bfa_ioc_smem_read()
2080 ioc->ioc_regs.host_page_num_fn); in bfa_ioc_smem_read()
2084 readl(ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_smem_read()
2085 writel(1, ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_smem_read()
2087 bfa_trc(ioc, pgnum); in bfa_ioc_smem_read()
2099 bfa_ioc_smem_clr(struct bfa_ioc_s *ioc, u32 soff, u32 sz) in bfa_ioc_smem_clr() argument
2104 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, soff); in bfa_ioc_smem_clr()
2106 bfa_trc(ioc, pgnum); in bfa_ioc_smem_clr()
2107 bfa_trc(ioc, loff); in bfa_ioc_smem_clr()
2108 bfa_trc(ioc, sz); in bfa_ioc_smem_clr()
2113 if (BFA_FALSE == bfa_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg)) { in bfa_ioc_smem_clr()
2114 bfa_trc(ioc, 0); in bfa_ioc_smem_clr()
2118 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_ioc_smem_clr()
2121 bfa_trc(ioc, len); in bfa_ioc_smem_clr()
2123 bfa_mem_write(ioc->ioc_regs.smem_page_start, loff, 0); in bfa_ioc_smem_clr()
2132 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_ioc_smem_clr()
2135 writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0), in bfa_ioc_smem_clr()
2136 ioc->ioc_regs.host_page_num_fn); in bfa_ioc_smem_clr()
2141 readl(ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_smem_clr()
2142 writel(1, ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_smem_clr()
2143 bfa_trc(ioc, pgnum); in bfa_ioc_smem_clr()
2148 bfa_ioc_fail_notify(struct bfa_ioc_s *ioc) in bfa_ioc_fail_notify() argument
2150 struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad; in bfa_ioc_fail_notify()
2155 ioc->cbfn->hbfail_cbfn(ioc->bfa); in bfa_ioc_fail_notify()
2156 bfa_ioc_event_notify(ioc, BFA_IOC_E_FAILED); in bfa_ioc_fail_notify()
2158 bfa_ioc_debug_save_ftrc(ioc); in bfa_ioc_fail_notify()
2162 bfa_ioc_aen_post(ioc, BFA_IOC_AEN_HBFAIL); in bfa_ioc_fail_notify()
2167 bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc) in bfa_ioc_pf_fwmismatch() argument
2169 struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad; in bfa_ioc_pf_fwmismatch()
2173 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_pf_fwmismatch()
2177 bfa_ioc_aen_post(ioc, BFA_IOC_AEN_FWMISMATCH); in bfa_ioc_pf_fwmismatch()
2181 bfa_ioc_pll_init(struct bfa_ioc_s *ioc) in bfa_ioc_pll_init() argument
2187 bfa_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_pll_init()
2189 bfa_ioc_pll_init_asic(ioc); in bfa_ioc_pll_init()
2191 ioc->pllinit = BFA_TRUE; in bfa_ioc_pll_init()
2196 bfa_ioc_lmem_init(ioc); in bfa_ioc_pll_init()
2201 readl(ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_pll_init()
2202 writel(1, ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_pll_init()
2212 bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type, u32 boot_env) in bfa_ioc_boot() argument
2216 bfa_ioc_stats(ioc, ioc_boots); in bfa_ioc_boot()
2218 if (bfa_ioc_pll_init(ioc) != BFA_STATUS_OK) in bfa_ioc_boot()
2225 bfa_cb_image_get_chunk(bfa_ioc_asic_gen(ioc), 0); in bfa_ioc_boot()
2231 if (bfa_ioc_flash_fwver_cmp(ioc, drv_fwhdr) == in bfa_ioc_boot()
2240 bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_MEMTEST); in bfa_ioc_boot()
2241 bfa_ioc_set_alt_ioc_fwstate(ioc, BFI_IOC_MEMTEST); in bfa_ioc_boot()
2243 bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_INITING); in bfa_ioc_boot()
2244 bfa_ioc_set_alt_ioc_fwstate(ioc, BFI_IOC_INITING); in bfa_ioc_boot()
2247 bfa_ioc_msgflush(ioc); in bfa_ioc_boot()
2248 status = bfa_ioc_download_fw(ioc, boot_type, boot_env); in bfa_ioc_boot()
2250 bfa_ioc_lpu_start(ioc); in bfa_ioc_boot()
2253 bfa_iocpf_timeout(ioc); in bfa_ioc_boot()
2270 bfa_ioc_is_operational(struct bfa_ioc_s *ioc) in bfa_ioc_is_operational() argument
2272 return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_op); in bfa_ioc_is_operational()
2276 bfa_ioc_is_initialized(struct bfa_ioc_s *ioc) in bfa_ioc_is_initialized() argument
2278 u32 r32 = bfa_ioc_get_cur_ioc_fwstate(ioc); in bfa_ioc_is_initialized()
2286 bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg) in bfa_ioc_msgget() argument
2292 r32 = readl(ioc->ioc_regs.lpu_mbox_cmd); in bfa_ioc_msgget()
2301 r32 = readl(ioc->ioc_regs.lpu_mbox + in bfa_ioc_msgget()
2309 writel(1, ioc->ioc_regs.lpu_mbox_cmd); in bfa_ioc_msgget()
2310 readl(ioc->ioc_regs.lpu_mbox_cmd); in bfa_ioc_msgget()
2316 bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *m) in bfa_ioc_isr() argument
2319 struct bfa_iocpf_s *iocpf = &ioc->iocpf; in bfa_ioc_isr()
2323 bfa_ioc_stats(ioc, ioc_isrs); in bfa_ioc_isr()
2330 ioc->port_mode = ioc->port_mode_cfg = in bfa_ioc_isr()
2332 ioc->ad_cap_bm = msg->fw_event.cap_bm; in bfa_ioc_isr()
2341 bfa_ioc_getattr_reply(ioc); in bfa_ioc_isr()
2345 bfa_trc(ioc, msg->mh.msg_id); in bfa_ioc_isr()
2357 bfa_ioc_attach(struct bfa_ioc_s *ioc, void *bfa, struct bfa_ioc_cbfn_s *cbfn, in bfa_ioc_attach() argument
2360 ioc->bfa = bfa; in bfa_ioc_attach()
2361 ioc->cbfn = cbfn; in bfa_ioc_attach()
2362 ioc->timer_mod = timer_mod; in bfa_ioc_attach()
2363 ioc->fcmode = BFA_FALSE; in bfa_ioc_attach()
2364 ioc->pllinit = BFA_FALSE; in bfa_ioc_attach()
2365 ioc->dbg_fwsave_once = BFA_TRUE; in bfa_ioc_attach()
2366 ioc->iocpf.ioc = ioc; in bfa_ioc_attach()
2368 bfa_ioc_mbox_attach(ioc); in bfa_ioc_attach()
2369 INIT_LIST_HEAD(&ioc->notify_q); in bfa_ioc_attach()
2371 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); in bfa_ioc_attach()
2372 bfa_fsm_send_event(ioc, IOC_E_RESET); in bfa_ioc_attach()
2379 bfa_ioc_detach(struct bfa_ioc_s *ioc) in bfa_ioc_detach() argument
2381 bfa_fsm_send_event(ioc, IOC_E_DETACH); in bfa_ioc_detach()
2382 INIT_LIST_HEAD(&ioc->notify_q); in bfa_ioc_detach()
2391 bfa_ioc_pci_init(struct bfa_ioc_s *ioc, struct bfa_pcidev_s *pcidev, in bfa_ioc_pci_init() argument
2394 ioc->clscode = clscode; in bfa_ioc_pci_init()
2395 ioc->pcidev = *pcidev; in bfa_ioc_pci_init()
2400 ioc->port0_mode = ioc->port1_mode = BFI_PORT_MODE_FC; in bfa_ioc_pci_init()
2401 ioc->asic_mode = BFI_ASIC_MODE_FC; in bfa_ioc_pci_init()
2406 ioc->asic_gen = BFI_ASIC_GEN_CB; in bfa_ioc_pci_init()
2407 ioc->fcmode = BFA_TRUE; in bfa_ioc_pci_init()
2408 ioc->port_mode = ioc->port_mode_cfg = BFA_MODE_HBA; in bfa_ioc_pci_init()
2409 ioc->ad_cap_bm = BFA_CM_HBA; in bfa_ioc_pci_init()
2413 ioc->asic_gen = BFI_ASIC_GEN_CT; in bfa_ioc_pci_init()
2414 ioc->port0_mode = ioc->port1_mode = BFI_PORT_MODE_ETH; in bfa_ioc_pci_init()
2415 ioc->asic_mode = BFI_ASIC_MODE_ETH; in bfa_ioc_pci_init()
2416 ioc->port_mode = ioc->port_mode_cfg = BFA_MODE_CNA; in bfa_ioc_pci_init()
2417 ioc->ad_cap_bm = BFA_CM_CNA; in bfa_ioc_pci_init()
2421 ioc->asic_gen = BFI_ASIC_GEN_CT; in bfa_ioc_pci_init()
2422 ioc->fcmode = BFA_TRUE; in bfa_ioc_pci_init()
2423 ioc->port_mode = ioc->port_mode_cfg = BFA_MODE_HBA; in bfa_ioc_pci_init()
2424 ioc->ad_cap_bm = BFA_CM_HBA; in bfa_ioc_pci_init()
2429 ioc->asic_gen = BFI_ASIC_GEN_CT2; in bfa_ioc_pci_init()
2432 ioc->asic_mode = BFI_ASIC_MODE_FC16; in bfa_ioc_pci_init()
2433 ioc->fcmode = BFA_TRUE; in bfa_ioc_pci_init()
2434 ioc->port_mode = ioc->port_mode_cfg = BFA_MODE_HBA; in bfa_ioc_pci_init()
2435 ioc->ad_cap_bm = BFA_CM_HBA; in bfa_ioc_pci_init()
2437 ioc->port0_mode = ioc->port1_mode = BFI_PORT_MODE_ETH; in bfa_ioc_pci_init()
2438 ioc->asic_mode = BFI_ASIC_MODE_ETH; in bfa_ioc_pci_init()
2440 ioc->port_mode = in bfa_ioc_pci_init()
2441 ioc->port_mode_cfg = BFA_MODE_CNA; in bfa_ioc_pci_init()
2442 ioc->ad_cap_bm = BFA_CM_CNA; in bfa_ioc_pci_init()
2444 ioc->port_mode = in bfa_ioc_pci_init()
2445 ioc->port_mode_cfg = BFA_MODE_NIC; in bfa_ioc_pci_init()
2446 ioc->ad_cap_bm = BFA_CM_NIC; in bfa_ioc_pci_init()
2458 if (ioc->asic_gen == BFI_ASIC_GEN_CB) in bfa_ioc_pci_init()
2459 bfa_ioc_set_cb_hwif(ioc); in bfa_ioc_pci_init()
2460 else if (ioc->asic_gen == BFI_ASIC_GEN_CT) in bfa_ioc_pci_init()
2461 bfa_ioc_set_ct_hwif(ioc); in bfa_ioc_pci_init()
2463 WARN_ON(ioc->asic_gen != BFI_ASIC_GEN_CT2); in bfa_ioc_pci_init()
2464 bfa_ioc_set_ct2_hwif(ioc); in bfa_ioc_pci_init()
2465 bfa_ioc_ct2_poweron(ioc); in bfa_ioc_pci_init()
2468 bfa_ioc_map_port(ioc); in bfa_ioc_pci_init()
2469 bfa_ioc_reg_init(ioc); in bfa_ioc_pci_init()
2479 bfa_ioc_mem_claim(struct bfa_ioc_s *ioc, u8 *dm_kva, u64 dm_pa) in bfa_ioc_mem_claim() argument
2484 ioc->attr_dma.kva = dm_kva; in bfa_ioc_mem_claim()
2485 ioc->attr_dma.pa = dm_pa; in bfa_ioc_mem_claim()
2486 ioc->attr = (struct bfi_ioc_attr_s *) dm_kva; in bfa_ioc_mem_claim()
2490 bfa_ioc_enable(struct bfa_ioc_s *ioc) in bfa_ioc_enable() argument
2492 bfa_ioc_stats(ioc, ioc_enables); in bfa_ioc_enable()
2493 ioc->dbg_fwsave_once = BFA_TRUE; in bfa_ioc_enable()
2495 bfa_fsm_send_event(ioc, IOC_E_ENABLE); in bfa_ioc_enable()
2499 bfa_ioc_disable(struct bfa_ioc_s *ioc) in bfa_ioc_disable() argument
2501 bfa_ioc_stats(ioc, ioc_disables); in bfa_ioc_disable()
2502 bfa_fsm_send_event(ioc, IOC_E_DISABLE); in bfa_ioc_disable()
2506 bfa_ioc_suspend(struct bfa_ioc_s *ioc) in bfa_ioc_suspend() argument
2508 ioc->dbg_fwsave_once = BFA_TRUE; in bfa_ioc_suspend()
2509 bfa_fsm_send_event(ioc, IOC_E_HWERROR); in bfa_ioc_suspend()
2517 bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave) in bfa_ioc_debug_memclaim() argument
2519 ioc->dbg_fwsave = dbg_fwsave; in bfa_ioc_debug_memclaim()
2520 ioc->dbg_fwsave_len = BFA_DBG_FWTRC_LEN; in bfa_ioc_debug_memclaim()
2530 bfa_ioc_mbox_register(struct bfa_ioc_s *ioc, bfa_ioc_mbox_mcfunc_t *mcfuncs) in bfa_ioc_mbox_register() argument
2532 struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod; in bfa_ioc_mbox_register()
2543 bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc, in bfa_ioc_mbox_regisr() argument
2546 struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod; in bfa_ioc_mbox_regisr()
2560 bfa_ioc_mbox_queue(struct bfa_ioc_s *ioc, struct bfa_mbox_cmd_s *cmd) in bfa_ioc_mbox_queue() argument
2562 struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod; in bfa_ioc_mbox_queue()
2576 stat = readl(ioc->ioc_regs.hfn_mbox_cmd); in bfa_ioc_mbox_queue()
2585 bfa_ioc_mbox_send(ioc, cmd->msg, sizeof(cmd->msg)); in bfa_ioc_mbox_queue()
2592 bfa_ioc_mbox_isr(struct bfa_ioc_s *ioc) in bfa_ioc_mbox_isr() argument
2594 struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod; in bfa_ioc_mbox_isr()
2598 if (bfa_ioc_msgget(ioc, &m)) { in bfa_ioc_mbox_isr()
2604 bfa_ioc_isr(ioc, &m); in bfa_ioc_mbox_isr()
2614 bfa_ioc_lpu_read_stat(ioc); in bfa_ioc_mbox_isr()
2619 bfa_ioc_mbox_poll(ioc); in bfa_ioc_mbox_isr()
2623 bfa_ioc_error_isr(struct bfa_ioc_s *ioc) in bfa_ioc_error_isr() argument
2625 bfa_ioc_stats(ioc, ioc_hbfails); in bfa_ioc_error_isr()
2626 ioc->stats.hb_count = ioc->hb_count; in bfa_ioc_error_isr()
2627 bfa_fsm_send_event(ioc, IOC_E_HWERROR); in bfa_ioc_error_isr()
2634 bfa_ioc_is_disabled(struct bfa_ioc_s *ioc) in bfa_ioc_is_disabled() argument
2636 return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabling) || in bfa_ioc_is_disabled()
2637 bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabled); in bfa_ioc_is_disabled()
2644 bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc) in bfa_ioc_fw_mismatch() argument
2646 return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_reset) || in bfa_ioc_fw_mismatch()
2647 bfa_fsm_cmp_state(&ioc->iocpf, bfa_iocpf_sm_fwcheck) || in bfa_ioc_fw_mismatch()
2648 bfa_fsm_cmp_state(&ioc->iocpf, bfa_iocpf_sm_mismatch); in bfa_ioc_fw_mismatch()
2656 bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc) in bfa_ioc_adapter_is_disabled() argument
2660 if (!bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabled)) in bfa_ioc_adapter_is_disabled()
2663 ioc_state = bfa_ioc_get_cur_ioc_fwstate(ioc); in bfa_ioc_adapter_is_disabled()
2667 if (ioc->pcidev.device_id != BFA_PCI_DEVICE_ID_FC_8G1P) { in bfa_ioc_adapter_is_disabled()
2668 ioc_state = bfa_ioc_get_cur_ioc_fwstate(ioc); in bfa_ioc_adapter_is_disabled()
2680 bfa_ioc_reset_fwstate(struct bfa_ioc_s *ioc) in bfa_ioc_reset_fwstate() argument
2682 bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_UNINIT); in bfa_ioc_reset_fwstate()
2683 bfa_ioc_set_alt_ioc_fwstate(ioc, BFI_IOC_UNINIT); in bfa_ioc_reset_fwstate()
2688 bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, in bfa_ioc_get_adapter_attr() argument
2693 ioc_attr = ioc->attr; in bfa_ioc_get_adapter_attr()
2695 bfa_ioc_get_adapter_serial_num(ioc, ad_attr->serial_num); in bfa_ioc_get_adapter_attr()
2696 bfa_ioc_get_adapter_fw_ver(ioc, ad_attr->fw_ver); in bfa_ioc_get_adapter_attr()
2697 bfa_ioc_get_adapter_optrom_ver(ioc, ad_attr->optrom_ver); in bfa_ioc_get_adapter_attr()
2698 bfa_ioc_get_adapter_manufacturer(ioc, ad_attr->manufacturer); in bfa_ioc_get_adapter_attr()
2702 ad_attr->nports = bfa_ioc_get_nports(ioc); in bfa_ioc_get_adapter_attr()
2703 ad_attr->max_speed = bfa_ioc_speed_sup(ioc); in bfa_ioc_get_adapter_attr()
2705 bfa_ioc_get_adapter_model(ioc, ad_attr->model); in bfa_ioc_get_adapter_attr()
2707 bfa_ioc_get_adapter_model(ioc, ad_attr->model_descr); in bfa_ioc_get_adapter_attr()
2717 ad_attr->pwwn = ioc->attr->pwwn; in bfa_ioc_get_adapter_attr()
2718 ad_attr->mac = bfa_ioc_get_mac(ioc); in bfa_ioc_get_adapter_attr()
2725 bfa_ioc_get_pci_chip_rev(ioc, ad_attr->hw_ver); in bfa_ioc_get_adapter_attr()
2727 ad_attr->cna_capable = bfa_ioc_is_cna(ioc); in bfa_ioc_get_adapter_attr()
2729 !bfa_ioc_is_cna(ioc) && !ad_attr->is_mezz; in bfa_ioc_get_adapter_attr()
2737 bfa_ioc_get_type(struct bfa_ioc_s *ioc) in bfa_ioc_get_type() argument
2739 if (ioc->clscode == BFI_PCIFN_CLASS_ETH) in bfa_ioc_get_type()
2742 WARN_ON(ioc->clscode != BFI_PCIFN_CLASS_FC); in bfa_ioc_get_type()
2744 return (ioc->attr->port_mode == BFI_PORT_MODE_FC) in bfa_ioc_get_type()
2749 bfa_ioc_get_adapter_serial_num(struct bfa_ioc_s *ioc, char *serial_num) in bfa_ioc_get_adapter_serial_num() argument
2753 (void *)ioc->attr->brcd_serialnum, in bfa_ioc_get_adapter_serial_num()
2758 bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver) in bfa_ioc_get_adapter_fw_ver() argument
2761 memcpy(fw_ver, ioc->attr->fw_version, BFA_VERSION_LEN); in bfa_ioc_get_adapter_fw_ver()
2765 bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev) in bfa_ioc_get_pci_chip_rev() argument
2775 chip_rev[4] = ioc->attr->asic_rev; in bfa_ioc_get_pci_chip_rev()
2780 bfa_ioc_get_adapter_optrom_ver(struct bfa_ioc_s *ioc, char *optrom_ver) in bfa_ioc_get_adapter_optrom_ver() argument
2783 memcpy(optrom_ver, ioc->attr->optrom_version, in bfa_ioc_get_adapter_optrom_ver()
2788 bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc, char *manufacturer) in bfa_ioc_get_adapter_manufacturer() argument
2795 bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model) in bfa_ioc_get_adapter_model() argument
2798 u8 nports = bfa_ioc_get_nports(ioc); in bfa_ioc_get_adapter_model()
2803 ioc_attr = ioc->attr; in bfa_ioc_get_adapter_model()
2805 if (bfa_asic_id_ct2(ioc->pcidev.device_id) && in bfa_ioc_get_adapter_model()
2815 bfa_ioc_get_state(struct bfa_ioc_s *ioc) in bfa_ioc_get_state() argument
2818 enum bfa_ioc_state ioc_st = bfa_sm_to_state(ioc_sm_table, ioc->fsm); in bfa_ioc_get_state()
2823 iocpf_st = bfa_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm); in bfa_ioc_get_state()
2855 bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr) in bfa_ioc_get_attr() argument
2859 ioc_attr->state = bfa_ioc_get_state(ioc); in bfa_ioc_get_attr()
2860 ioc_attr->port_id = bfa_ioc_portid(ioc); in bfa_ioc_get_attr()
2861 ioc_attr->port_mode = ioc->port_mode; in bfa_ioc_get_attr()
2862 ioc_attr->port_mode_cfg = ioc->port_mode_cfg; in bfa_ioc_get_attr()
2863 ioc_attr->cap_bm = ioc->ad_cap_bm; in bfa_ioc_get_attr()
2865 ioc_attr->ioc_type = bfa_ioc_get_type(ioc); in bfa_ioc_get_attr()
2867 bfa_ioc_get_adapter_attr(ioc, &ioc_attr->adapter_attr); in bfa_ioc_get_attr()
2869 ioc_attr->pci_attr.device_id = bfa_ioc_devid(ioc); in bfa_ioc_get_attr()
2870 ioc_attr->pci_attr.pcifn = bfa_ioc_pcifn(ioc); in bfa_ioc_get_attr()
2871 ioc_attr->def_fn = (bfa_ioc_pcifn(ioc) == bfa_ioc_portid(ioc)); in bfa_ioc_get_attr()
2872 bfa_ioc_get_pci_chip_rev(ioc, ioc_attr->pci_attr.chip_rev); in bfa_ioc_get_attr()
2876 bfa_ioc_get_mac(struct bfa_ioc_s *ioc) in bfa_ioc_get_mac() argument
2881 if (bfa_ioc_get_type(ioc) == BFA_IOC_TYPE_FCoE) in bfa_ioc_get_mac()
2882 return ioc->attr->fcoe_mac; in bfa_ioc_get_mac()
2884 return ioc->attr->mac; in bfa_ioc_get_mac()
2888 bfa_ioc_get_mfg_mac(struct bfa_ioc_s *ioc) in bfa_ioc_get_mfg_mac() argument
2892 m = ioc->attr->mfg_mac; in bfa_ioc_get_mfg_mac()
2893 if (bfa_mfg_is_old_wwn_mac_model(ioc->attr->card_type)) in bfa_ioc_get_mfg_mac()
2894 m.mac[MAC_ADDRLEN - 1] += bfa_ioc_pcifn(ioc); in bfa_ioc_get_mfg_mac()
2897 bfa_ioc_pcifn(ioc)); in bfa_ioc_get_mfg_mac()
2906 bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event) in bfa_ioc_aen_post() argument
2908 struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad; in bfa_ioc_aen_post()
2916 ioc_type = bfa_ioc_get_type(ioc); in bfa_ioc_aen_post()
2919 aen_entry->aen_data.ioc.pwwn = ioc->attr->pwwn; in bfa_ioc_aen_post()
2922 aen_entry->aen_data.ioc.pwwn = ioc->attr->pwwn; in bfa_ioc_aen_post()
2923 aen_entry->aen_data.ioc.mac = bfa_ioc_get_mac(ioc); in bfa_ioc_aen_post()
2926 aen_entry->aen_data.ioc.mac = bfa_ioc_get_mac(ioc); in bfa_ioc_aen_post()
2934 aen_entry->aen_data.ioc.ioc_type = ioc_type; in bfa_ioc_aen_post()
2935 bfad_im_post_vendor_event(aen_entry, bfad, ++ioc->ioc_aen_seq, in bfa_ioc_aen_post()
2943 bfa_ioc_debug_fwsave(struct bfa_ioc_s *ioc, void *trcdata, int *trclen) in bfa_ioc_debug_fwsave() argument
2947 if (ioc->dbg_fwsave_len == 0) in bfa_ioc_debug_fwsave()
2951 if (tlen > ioc->dbg_fwsave_len) in bfa_ioc_debug_fwsave()
2952 tlen = ioc->dbg_fwsave_len; in bfa_ioc_debug_fwsave()
2954 memcpy(trcdata, ioc->dbg_fwsave, tlen); in bfa_ioc_debug_fwsave()
2964 bfa_ioc_debug_fwtrc(struct bfa_ioc_s *ioc, void *trcdata, int *trclen) in bfa_ioc_debug_fwtrc() argument
2966 u32 loff = BFA_DBG_FWTRC_OFF(bfa_ioc_portid(ioc)); in bfa_ioc_debug_fwtrc()
2970 bfa_trc(ioc, *trclen); in bfa_ioc_debug_fwtrc()
2976 status = bfa_ioc_smem_read(ioc, trcdata, loff, tlen); in bfa_ioc_debug_fwtrc()
2982 bfa_ioc_send_fwsync(struct bfa_ioc_s *ioc) in bfa_ioc_send_fwsync() argument
2988 bfa_ioc_portid(ioc)); in bfa_ioc_send_fwsync()
2989 req->clscode = cpu_to_be16(ioc->clscode); in bfa_ioc_send_fwsync()
2990 bfa_ioc_mbox_queue(ioc, &cmd); in bfa_ioc_send_fwsync()
2994 bfa_ioc_fwsync(struct bfa_ioc_s *ioc) in bfa_ioc_fwsync() argument
2998 bfa_ioc_send_fwsync(ioc); in bfa_ioc_fwsync()
3011 while (bfa_ioc_mbox_cmd_pending(ioc) && fwsync_iter > 0) in bfa_ioc_fwsync()
3019 bfa_ioc_debug_fwcore(struct bfa_ioc_s *ioc, void *buf, in bfa_ioc_debug_fwcore() argument
3025 u32 smem_len = BFA_IOC_FW_SMEM_SIZE(ioc); in bfa_ioc_debug_fwcore()
3040 bfa_ioc_fwsync(ioc); in bfa_ioc_debug_fwcore()
3045 status = bfa_ioc_smem_read(ioc, buf, loff, dlen); in bfa_ioc_debug_fwcore()
3066 bfa_ioc_fw_stats_get(struct bfa_ioc_s *ioc, void *stats) in bfa_ioc_fw_stats_get() argument
3069 BFI_IOC_FWSTATS_SZ * (bfa_ioc_portid(ioc)); in bfa_ioc_fw_stats_get()
3073 if (ioc->stats_busy) { in bfa_ioc_fw_stats_get()
3074 bfa_trc(ioc, ioc->stats_busy); in bfa_ioc_fw_stats_get()
3077 ioc->stats_busy = BFA_TRUE; in bfa_ioc_fw_stats_get()
3080 status = bfa_ioc_smem_read(ioc, stats, loff, tlen); in bfa_ioc_fw_stats_get()
3082 ioc->stats_busy = BFA_FALSE; in bfa_ioc_fw_stats_get()
3087 bfa_ioc_fw_stats_clear(struct bfa_ioc_s *ioc) in bfa_ioc_fw_stats_clear() argument
3090 BFI_IOC_FWSTATS_SZ * (bfa_ioc_portid(ioc)); in bfa_ioc_fw_stats_clear()
3094 if (ioc->stats_busy) { in bfa_ioc_fw_stats_clear()
3095 bfa_trc(ioc, ioc->stats_busy); in bfa_ioc_fw_stats_clear()
3098 ioc->stats_busy = BFA_TRUE; in bfa_ioc_fw_stats_clear()
3101 status = bfa_ioc_smem_clr(ioc, loff, tlen); in bfa_ioc_fw_stats_clear()
3103 ioc->stats_busy = BFA_FALSE; in bfa_ioc_fw_stats_clear()
3111 bfa_ioc_debug_save_ftrc(struct bfa_ioc_s *ioc) in bfa_ioc_debug_save_ftrc() argument
3115 if (ioc->dbg_fwsave_once) { in bfa_ioc_debug_save_ftrc()
3116 ioc->dbg_fwsave_once = BFA_FALSE; in bfa_ioc_debug_save_ftrc()
3117 if (ioc->dbg_fwsave_len) { in bfa_ioc_debug_save_ftrc()
3118 tlen = ioc->dbg_fwsave_len; in bfa_ioc_debug_save_ftrc()
3119 bfa_ioc_debug_fwtrc(ioc, ioc->dbg_fwsave, &tlen); in bfa_ioc_debug_save_ftrc()
3128 bfa_ioc_recover(struct bfa_ioc_s *ioc) in bfa_ioc_recover() argument
3130 bfa_ioc_stats(ioc, ioc_hbfails); in bfa_ioc_recover()
3131 ioc->stats.hb_count = ioc->hb_count; in bfa_ioc_recover()
3132 bfa_fsm_send_event(ioc, IOC_E_HBFAIL); in bfa_ioc_recover()
3141 struct bfa_ioc_s *ioc = (struct bfa_ioc_s *) ioc_arg; in bfa_iocpf_timeout() local
3143 bfa_trc(ioc, 0); in bfa_iocpf_timeout()
3144 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_TIMEOUT); in bfa_iocpf_timeout()
3150 struct bfa_ioc_s *ioc = (struct bfa_ioc_s *) ioc_arg; in bfa_iocpf_sem_timeout() local
3152 bfa_ioc_hw_sem_get(ioc); in bfa_iocpf_sem_timeout()
3156 bfa_ioc_poll_fwinit(struct bfa_ioc_s *ioc) in bfa_ioc_poll_fwinit() argument
3158 u32 fwstate = bfa_ioc_get_cur_ioc_fwstate(ioc); in bfa_ioc_poll_fwinit()
3160 bfa_trc(ioc, fwstate); in bfa_ioc_poll_fwinit()
3163 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FWREADY); in bfa_ioc_poll_fwinit()
3167 if (ioc->iocpf.poll_time >= (3 * BFA_IOC_TOV)) in bfa_ioc_poll_fwinit()
3168 bfa_iocpf_timeout(ioc); in bfa_ioc_poll_fwinit()
3170 ioc->iocpf.poll_time += BFA_IOC_POLL_TOV; in bfa_ioc_poll_fwinit()
3171 bfa_iocpf_poll_timer_start(ioc); in bfa_ioc_poll_fwinit()
3178 struct bfa_ioc_s *ioc = (struct bfa_ioc_s *) ioc_arg; in bfa_iocpf_poll_timeout() local
3180 bfa_ioc_poll_fwinit(ioc); in bfa_iocpf_poll_timeout()
3286 bfa_trc(ablk->ioc, msg->mh.msg_id); in bfa_ablk_isr()
3301 ablk->ioc->port_mode_cfg = rsp->port_mode; in bfa_ablk_isr()
3332 bfa_trc(ablk->ioc, event); in bfa_ablk_notify()
3371 bfa_ablk_attach(struct bfa_ablk_s *ablk, struct bfa_ioc_s *ioc) in bfa_ablk_attach() argument
3373 ablk->ioc = ioc; in bfa_ablk_attach()
3375 bfa_ioc_mbox_regisr(ablk->ioc, BFI_MC_ABLK, bfa_ablk_isr, ablk); in bfa_ablk_attach()
3378 list_add_tail(&ablk->ioc_notify.qe, &ablk->ioc->notify_q); in bfa_ablk_attach()
3389 if (!bfa_ioc_is_operational(ablk->ioc)) { in bfa_ablk_query()
3390 bfa_trc(ablk->ioc, BFA_STATUS_IOC_FAILURE); in bfa_ablk_query()
3395 bfa_trc(ablk->ioc, BFA_STATUS_DEVBUSY); in bfa_ablk_query()
3406 bfa_ioc_portid(ablk->ioc)); in bfa_ablk_query()
3408 bfa_ioc_mbox_queue(ablk->ioc, &ablk->mb); in bfa_ablk_query()
3421 if (!bfa_ioc_is_operational(ablk->ioc)) { in bfa_ablk_pf_create()
3422 bfa_trc(ablk->ioc, BFA_STATUS_IOC_FAILURE); in bfa_ablk_pf_create()
3427 bfa_trc(ablk->ioc, BFA_STATUS_DEVBUSY); in bfa_ablk_pf_create()
3438 bfa_ioc_portid(ablk->ioc)); in bfa_ablk_pf_create()
3443 bfa_ioc_mbox_queue(ablk->ioc, &ablk->mb); in bfa_ablk_pf_create()
3454 if (!bfa_ioc_is_operational(ablk->ioc)) { in bfa_ablk_pf_delete()
3455 bfa_trc(ablk->ioc, BFA_STATUS_IOC_FAILURE); in bfa_ablk_pf_delete()
3460 bfa_trc(ablk->ioc, BFA_STATUS_DEVBUSY); in bfa_ablk_pf_delete()
3470 bfa_ioc_portid(ablk->ioc)); in bfa_ablk_pf_delete()
3472 bfa_ioc_mbox_queue(ablk->ioc, &ablk->mb); in bfa_ablk_pf_delete()
3483 if (!bfa_ioc_is_operational(ablk->ioc)) { in bfa_ablk_adapter_config()
3484 bfa_trc(ablk->ioc, BFA_STATUS_IOC_FAILURE); in bfa_ablk_adapter_config()
3489 bfa_trc(ablk->ioc, BFA_STATUS_DEVBUSY); in bfa_ablk_adapter_config()
3499 bfa_ioc_portid(ablk->ioc)); in bfa_ablk_adapter_config()
3503 bfa_ioc_mbox_queue(ablk->ioc, &ablk->mb); in bfa_ablk_adapter_config()
3514 if (!bfa_ioc_is_operational(ablk->ioc)) { in bfa_ablk_port_config()
3515 bfa_trc(ablk->ioc, BFA_STATUS_IOC_FAILURE); in bfa_ablk_port_config()
3520 bfa_trc(ablk->ioc, BFA_STATUS_DEVBUSY); in bfa_ablk_port_config()
3530 bfa_ioc_portid(ablk->ioc)); in bfa_ablk_port_config()
3535 bfa_ioc_mbox_queue(ablk->ioc, &ablk->mb); in bfa_ablk_port_config()
3546 if (!bfa_ioc_is_operational(ablk->ioc)) { in bfa_ablk_pf_update()
3547 bfa_trc(ablk->ioc, BFA_STATUS_IOC_FAILURE); in bfa_ablk_pf_update()
3552 bfa_trc(ablk->ioc, BFA_STATUS_DEVBUSY); in bfa_ablk_pf_update()
3562 bfa_ioc_portid(ablk->ioc)); in bfa_ablk_pf_update()
3566 bfa_ioc_mbox_queue(ablk->ioc, &ablk->mb); in bfa_ablk_pf_update()
3576 if (!bfa_ioc_is_operational(ablk->ioc)) { in bfa_ablk_optrom_en()
3577 bfa_trc(ablk->ioc, BFA_STATUS_IOC_FAILURE); in bfa_ablk_optrom_en()
3582 bfa_trc(ablk->ioc, BFA_STATUS_DEVBUSY); in bfa_ablk_optrom_en()
3592 bfa_ioc_portid(ablk->ioc)); in bfa_ablk_optrom_en()
3593 bfa_ioc_mbox_queue(ablk->ioc, &ablk->mb); in bfa_ablk_optrom_en()
3603 if (!bfa_ioc_is_operational(ablk->ioc)) { in bfa_ablk_optrom_dis()
3604 bfa_trc(ablk->ioc, BFA_STATUS_IOC_FAILURE); in bfa_ablk_optrom_dis()
3609 bfa_trc(ablk->ioc, BFA_STATUS_DEVBUSY); in bfa_ablk_optrom_dis()
3619 bfa_ioc_portid(ablk->ioc)); in bfa_ablk_optrom_dis()
3620 bfa_ioc_mbox_queue(ablk->ioc, &ablk->mb); in bfa_ablk_optrom_dis()
3706 struct bfad_s *bfad = (struct bfad_s *)sfp->ioc->bfa->bfad; in bfa_sfp_scn_aen_post()
3717 aen_entry->aen_data.port.ioc_type = bfa_ioc_get_type(sfp->ioc); in bfa_sfp_scn_aen_post()
3718 aen_entry->aen_data.port.pwwn = sfp->ioc->attr->pwwn; in bfa_sfp_scn_aen_post()
3719 aen_entry->aen_data.port.mac = bfa_ioc_get_mac(sfp->ioc); in bfa_sfp_scn_aen_post()
3744 bfad_im_post_vendor_event(aen_entry, bfad, ++sfp->ioc->ioc_aen_seq, in bfa_sfp_scn_aen_post()
3760 bfa_ioc_portid(sfp->ioc)); in bfa_sfp_getdata_send()
3763 bfa_ioc_mbox_queue(sfp->ioc, &sfp->mbcmd); in bfa_sfp_getdata_send()
4017 bfa_sfp_attach(struct bfa_sfp_s *sfp, struct bfa_ioc_s *ioc, void *dev, in bfa_sfp_attach() argument
4021 sfp->ioc = ioc; in bfa_sfp_attach()
4037 bfa_ioc_mbox_regisr(sfp->ioc, BFI_MC_SFP, bfa_sfp_intr, sfp); in bfa_sfp_attach()
4040 list_add_tail(&sfp->ioc_notify.qe, &sfp->ioc->notify_q); in bfa_sfp_attach()
4070 if (!bfa_ioc_is_operational(sfp->ioc)) { in bfa_sfp_show()
4100 if (!bfa_ioc_is_operational(sfp->ioc)) { in bfa_sfp_media()
4135 if (!bfa_ioc_is_operational(sfp->ioc)) in bfa_sfp_speed()
4139 if (bfa_mfg_is_mezz(sfp->ioc->attr->card_type)) in bfa_sfp_speed()
4188 bfa_flash_aen_audit_post(struct bfa_ioc_s *ioc, enum bfa_audit_aen_event event, in bfa_flash_aen_audit_post() argument
4191 struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad; in bfa_flash_aen_audit_post()
4198 aen_entry->aen_data.audit.pwwn = ioc->attr->pwwn; in bfa_flash_aen_audit_post()
4203 bfad_im_post_vendor_event(aen_entry, bfad, ++ioc->ioc_aen_seq, in bfa_flash_aen_audit_post()
4249 bfa_ioc_portid(flash->ioc)); in bfa_flash_query_send()
4252 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_query_send()
4278 bfa_ioc_portid(flash->ioc)); in bfa_flash_write_send()
4281 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_write_send()
4307 bfa_ioc_portid(flash->ioc)); in bfa_flash_read_send()
4309 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_read_send()
4327 bfa_ioc_portid(flash->ioc)); in bfa_flash_erase_send()
4328 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_erase_send()
4437 bfa_ioc_aen_post(flash->ioc, BFA_IOC_AEN_FWCFG_ERROR); in bfa_flash_intr()
4442 bfa_ioc_aen_post(flash->ioc, in bfa_flash_intr()
4476 bfa_flash_attach(struct bfa_flash_s *flash, struct bfa_ioc_s *ioc, void *dev, in bfa_flash_attach() argument
4479 flash->ioc = ioc; in bfa_flash_attach()
4485 bfa_ioc_mbox_regisr(flash->ioc, BFI_MC_FLASH, bfa_flash_intr, flash); in bfa_flash_attach()
4488 list_add_tail(&flash->ioc_notify.qe, &flash->ioc->notify_q); in bfa_flash_attach()
4535 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_get_attr()
4571 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_erase_part()
4586 bfa_flash_aen_audit_post(flash->ioc, BFA_AUDIT_AEN_FLASH_ERASE, in bfa_flash_erase_part()
4616 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_update_part()
4673 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_read_part()
4758 struct bfa_ioc_s *ioc = diag->ioc; in bfa_diag_memtest_done() local
4763 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff); in bfa_diag_memtest_done()
4764 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_diag_memtest_done()
4770 bfa_mem_read(ioc->ioc_regs.smem_page_start, loff); in bfa_diag_memtest_done()
4775 bfa_ioc_reset_fwstate(ioc); in bfa_diag_memtest_done()
4834 bfa_ioc_portid(diag->ioc)); in diag_fwping_send()
4837 bfa_ioc_mbox_queue(diag->ioc, &diag->fwping.mbcmd); in diag_fwping_send()
4905 bfa_ioc_portid(diag->ioc)); in diag_tempsensor_send()
4907 bfa_ioc_mbox_queue(diag->ioc, &diag->tsensor.mbcmd); in diag_tempsensor_send()
4960 bfa_ioc_portid(diag->ioc)); in diag_ledtest_send()
4976 msg->portid = bfa_ioc_portid(diag->ioc); in diag_ledtest_send()
4981 bfa_ioc_mbox_queue(diag->ioc, &diag->ledtest.mbcmd); in diag_ledtest_send()
5003 bfa_ioc_portid(diag->ioc)); in diag_portbeacon_send()
5007 bfa_ioc_mbox_queue(diag->ioc, &diag->beacon.mbcmd); in diag_portbeacon_send()
5067 if (!bfa_ioc_adapter_is_disabled(diag->ioc)) in bfa_diag_memtest()
5082 bfa_ioc_boot(diag->ioc, BFI_FWBOOT_TYPE_MEMTEST, BFI_FWBOOT_ENV_OS); in bfa_diag_memtest()
5084 memtest_tov = (bfa_ioc_asic_gen(diag->ioc) == BFI_ASIC_GEN_CT2) ? in bfa_diag_memtest()
5086 bfa_timer_begin(diag->ioc->timer_mod, &diag->timer, in bfa_diag_memtest()
5112 if (!bfa_ioc_is_operational(diag->ioc)) in bfa_diag_fwping()
5115 if (bfa_asic_id_ct2(bfa_ioc_devid((diag->ioc))) && in bfa_diag_fwping()
5116 ((diag->ioc)->clscode == BFI_PCIFN_CLASS_ETH)) in bfa_diag_fwping()
5165 if (!bfa_ioc_is_operational(diag->ioc)) in bfa_diag_tsensor_query()
5194 if (!bfa_ioc_is_operational(diag->ioc)) in bfa_diag_ledtest()
5228 if (!bfa_ioc_is_operational(diag->ioc)) in bfa_diag_beacon_port()
5261 bfa_diag_attach(struct bfa_diag_s *diag, struct bfa_ioc_s *ioc, void *dev, in bfa_diag_attach() argument
5265 diag->ioc = ioc; in bfa_diag_attach()
5274 bfa_ioc_mbox_regisr(diag->ioc, BFI_MC_DIAG, bfa_diag_intr, diag); in bfa_diag_attach()
5277 list_add_tail(&diag->ioc_notify.qe, &diag->ioc->notify_q); in bfa_diag_attach()
5306 return (phy->ioc->attr->card_type == BFA_MFG_TYPE_LIGHTNING); in bfa_phy_present()
5345 bfa_ioc_portid(phy->ioc)); in bfa_phy_query_send()
5347 bfa_ioc_mbox_queue(phy->ioc, &phy->mb); in bfa_phy_query_send()
5375 bfa_ioc_portid(phy->ioc)); in bfa_phy_write_send()
5384 bfa_ioc_mbox_queue(phy->ioc, &phy->mb); in bfa_phy_write_send()
5409 bfa_ioc_portid(phy->ioc)); in bfa_phy_read_send()
5411 bfa_ioc_mbox_queue(phy->ioc, &phy->mb); in bfa_phy_read_send()
5428 bfa_ioc_portid(phy->ioc)); in bfa_phy_stats_send()
5430 bfa_ioc_mbox_queue(phy->ioc, &phy->mb); in bfa_phy_stats_send()
5458 bfa_phy_attach(struct bfa_phy_s *phy, struct bfa_ioc_s *ioc, void *dev, in bfa_phy_attach() argument
5461 phy->ioc = ioc; in bfa_phy_attach()
5467 bfa_ioc_mbox_regisr(phy->ioc, BFI_MC_PHY, bfa_phy_intr, phy); in bfa_phy_attach()
5470 list_add_tail(&phy->ioc_notify.qe, &phy->ioc->notify_q); in bfa_phy_attach()
5502 bfa_phy_busy(struct bfa_ioc_s *ioc) in bfa_phy_busy() argument
5506 rb = bfa_ioc_bar0(ioc); in bfa_phy_busy()
5530 if (!bfa_ioc_is_operational(phy->ioc)) in bfa_phy_get_attr()
5533 if (phy->op_busy || bfa_phy_busy(phy->ioc)) { in bfa_phy_get_attr()
5570 if (!bfa_ioc_is_operational(phy->ioc)) in bfa_phy_get_stats()
5573 if (phy->op_busy || bfa_phy_busy(phy->ioc)) { in bfa_phy_get_stats()
5614 if (!bfa_ioc_is_operational(phy->ioc)) in bfa_phy_update()
5621 if (phy->op_busy || bfa_phy_busy(phy->ioc)) { in bfa_phy_update()
5665 if (!bfa_ioc_is_operational(phy->ioc)) in bfa_phy_read()
5672 if (phy->op_busy || bfa_phy_busy(phy->ioc)) { in bfa_phy_read()
5899 bfa_ioc_suspend(&dconf->bfa->ioc); in bfa_dconf_sm_flash_read()
6075 dconf->instance = bfa->ioc.port_id; in bfa_dconf_attach()
6231 bfi_h2i_set(msg->mh, BFI_MC_FRU, msg_type, bfa_ioc_portid(fru->ioc)); in bfa_fru_write_send()
6235 bfa_ioc_mbox_queue(fru->ioc, &fru->mb); in bfa_fru_write_send()
6258 bfi_h2i_set(msg->mh, BFI_MC_FRU, msg_type, bfa_ioc_portid(fru->ioc)); in bfa_fru_read_send()
6260 bfa_ioc_mbox_queue(fru->ioc, &fru->mb); in bfa_fru_read_send()
6288 bfa_fru_attach(struct bfa_fru_s *fru, struct bfa_ioc_s *ioc, void *dev, in bfa_fru_attach() argument
6291 fru->ioc = ioc; in bfa_fru_attach()
6297 bfa_ioc_mbox_regisr(fru->ioc, BFI_MC_FRU, bfa_fru_intr, fru); in bfa_fru_attach()
6300 list_add_tail(&fru->ioc_notify.qe, &fru->ioc->notify_q); in bfa_fru_attach()
6351 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2 && in bfa_fruvpd_update()
6352 fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK2) in bfa_fruvpd_update()
6355 if (fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK) in bfa_fruvpd_update()
6358 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_fruvpd_update()
6401 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_fruvpd_read()
6404 if (fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK && in bfa_fruvpd_read()
6405 fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK2) in bfa_fruvpd_read()
6408 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_fruvpd_read()
6440 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_fruvpd_get_max_size()
6443 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_fruvpd_get_max_size()
6446 if (fru->ioc->attr->card_type == BFA_MFG_TYPE_CHINOOK || in bfa_fruvpd_get_max_size()
6447 fru->ioc->attr->card_type == BFA_MFG_TYPE_CHINOOK2) in bfa_fruvpd_get_max_size()
6474 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_tfru_write()
6477 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_tfru_write()
6519 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_tfru_read()
6522 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_tfru_read()