Lines Matching refs:tskim
203 static bfa_boolean_t bfa_tskim_match_scope(struct bfa_tskim_s *tskim,
205 static void bfa_tskim_gather_ios(struct bfa_tskim_s *tskim);
207 static void bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim);
208 static bfa_boolean_t bfa_tskim_send(struct bfa_tskim_s *tskim);
209 static bfa_boolean_t bfa_tskim_send_abort(struct bfa_tskim_s *tskim);
210 static void bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim);
215 static void bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim,
217 static void bfa_tskim_sm_active(struct bfa_tskim_s *tskim,
219 static void bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim,
221 static void bfa_tskim_sm_iocleanup(struct bfa_tskim_s *tskim,
223 static void bfa_tskim_sm_qfull(struct bfa_tskim_s *tskim,
225 static void bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
227 static void bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim,
916 struct bfa_tskim_s *tskim; in bfa_itnim_iocdisable_cleanup() local
921 tskim = (struct bfa_tskim_s *) qe; in bfa_itnim_iocdisable_cleanup()
922 bfa_tskim_iocdisable(tskim); in bfa_itnim_iocdisable_cleanup()
963 struct bfa_tskim_s *tskim; in bfa_itnim_cleanup() local
983 tskim = (struct bfa_tskim_s *) qe; in bfa_itnim_cleanup()
985 bfa_tskim_cleanup(tskim); in bfa_itnim_cleanup()
2627 if (!ioim->iosp->tskim) { in bfa_ioim_notify_cleanup()
2635 bfa_wc_down(&ioim->iosp->tskim->wc); in bfa_ioim_notify_cleanup()
2839 ioim->iosp->tskim = NULL; in bfa_ioim_cleanup()
2844 bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim, struct bfa_tskim_s *tskim) in bfa_ioim_cleanup_tm() argument
2849 ioim->iosp->tskim = tskim; in bfa_ioim_cleanup_tm()
2976 bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_uninit() argument
2978 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_uninit()
2982 bfa_sm_set_state(tskim, bfa_tskim_sm_active); in bfa_tskim_sm_uninit()
2983 bfa_tskim_gather_ios(tskim); in bfa_tskim_sm_uninit()
2989 if (!bfa_itnim_is_online(tskim->itnim)) { in bfa_tskim_sm_uninit()
2990 bfa_sm_set_state(tskim, bfa_tskim_sm_iocleanup); in bfa_tskim_sm_uninit()
2991 tskim->tsk_status = BFI_TSKIM_STS_OK; in bfa_tskim_sm_uninit()
2992 bfa_tskim_cleanup_ios(tskim); in bfa_tskim_sm_uninit()
2996 if (!bfa_tskim_send(tskim)) { in bfa_tskim_sm_uninit()
2997 bfa_sm_set_state(tskim, bfa_tskim_sm_qfull); in bfa_tskim_sm_uninit()
2998 bfa_stats(tskim->itnim, tm_qwait); in bfa_tskim_sm_uninit()
2999 bfa_reqq_wait(tskim->bfa, tskim->itnim->reqq, in bfa_tskim_sm_uninit()
3000 &tskim->reqq_wait); in bfa_tskim_sm_uninit()
3005 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_uninit()
3014 bfa_tskim_sm_active(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_active() argument
3016 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_active()
3020 bfa_sm_set_state(tskim, bfa_tskim_sm_iocleanup); in bfa_tskim_sm_active()
3021 bfa_tskim_cleanup_ios(tskim); in bfa_tskim_sm_active()
3025 bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup); in bfa_tskim_sm_active()
3026 if (!bfa_tskim_send_abort(tskim)) { in bfa_tskim_sm_active()
3027 bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup_qfull); in bfa_tskim_sm_active()
3028 bfa_stats(tskim->itnim, tm_qwait); in bfa_tskim_sm_active()
3029 bfa_reqq_wait(tskim->bfa, tskim->itnim->reqq, in bfa_tskim_sm_active()
3030 &tskim->reqq_wait); in bfa_tskim_sm_active()
3035 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_active()
3036 bfa_tskim_iocdisable_ios(tskim); in bfa_tskim_sm_active()
3037 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_failed); in bfa_tskim_sm_active()
3041 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_active()
3050 bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_cleanup() argument
3052 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_cleanup()
3063 bfa_sm_set_state(tskim, bfa_tskim_sm_iocleanup); in bfa_tskim_sm_cleanup()
3064 bfa_tskim_cleanup_ios(tskim); in bfa_tskim_sm_cleanup()
3068 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_cleanup()
3069 bfa_tskim_iocdisable_ios(tskim); in bfa_tskim_sm_cleanup()
3070 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_failed); in bfa_tskim_sm_cleanup()
3074 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_cleanup()
3079 bfa_tskim_sm_iocleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_iocleanup() argument
3081 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_iocleanup()
3085 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_iocleanup()
3086 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_done); in bfa_tskim_sm_iocleanup()
3097 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_iocleanup()
3098 bfa_tskim_iocdisable_ios(tskim); in bfa_tskim_sm_iocleanup()
3099 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_failed); in bfa_tskim_sm_iocleanup()
3103 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_iocleanup()
3111 bfa_tskim_sm_qfull(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_qfull() argument
3113 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_qfull()
3117 bfa_sm_set_state(tskim, bfa_tskim_sm_active); in bfa_tskim_sm_qfull()
3118 bfa_tskim_send(tskim); in bfa_tskim_sm_qfull()
3125 bfa_sm_set_state(tskim, bfa_tskim_sm_iocleanup); in bfa_tskim_sm_qfull()
3126 bfa_reqq_wcancel(&tskim->reqq_wait); in bfa_tskim_sm_qfull()
3127 bfa_tskim_cleanup_ios(tskim); in bfa_tskim_sm_qfull()
3131 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_qfull()
3132 bfa_reqq_wcancel(&tskim->reqq_wait); in bfa_tskim_sm_qfull()
3133 bfa_tskim_iocdisable_ios(tskim); in bfa_tskim_sm_qfull()
3134 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_failed); in bfa_tskim_sm_qfull()
3138 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_qfull()
3147 bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim, in bfa_tskim_sm_cleanup_qfull() argument
3150 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_cleanup_qfull()
3154 bfa_reqq_wcancel(&tskim->reqq_wait); in bfa_tskim_sm_cleanup_qfull()
3157 bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup); in bfa_tskim_sm_cleanup_qfull()
3158 bfa_tskim_send_abort(tskim); in bfa_tskim_sm_cleanup_qfull()
3162 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_cleanup_qfull()
3163 bfa_reqq_wcancel(&tskim->reqq_wait); in bfa_tskim_sm_cleanup_qfull()
3164 bfa_tskim_iocdisable_ios(tskim); in bfa_tskim_sm_cleanup_qfull()
3165 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_failed); in bfa_tskim_sm_cleanup_qfull()
3169 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_cleanup_qfull()
3177 bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_hcb() argument
3179 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_hcb()
3183 bfa_sm_set_state(tskim, bfa_tskim_sm_uninit); in bfa_tskim_sm_hcb()
3184 bfa_tskim_free(tskim); in bfa_tskim_sm_hcb()
3188 bfa_tskim_notify_comp(tskim); in bfa_tskim_sm_hcb()
3195 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_hcb()
3202 struct bfa_tskim_s *tskim = cbarg; in __bfa_cb_tskim_done() local
3205 bfa_sm_send_event(tskim, BFA_TSKIM_SM_HCB); in __bfa_cb_tskim_done()
3209 bfa_stats(tskim->itnim, tm_success); in __bfa_cb_tskim_done()
3210 bfa_cb_tskim_done(tskim->bfa->bfad, tskim->dtsk, tskim->tsk_status); in __bfa_cb_tskim_done()
3216 struct bfa_tskim_s *tskim = cbarg; in __bfa_cb_tskim_failed() local
3219 bfa_sm_send_event(tskim, BFA_TSKIM_SM_HCB); in __bfa_cb_tskim_failed()
3223 bfa_stats(tskim->itnim, tm_failures); in __bfa_cb_tskim_failed()
3224 bfa_cb_tskim_done(tskim->bfa->bfad, tskim->dtsk, in __bfa_cb_tskim_failed()
3229 bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun) in bfa_tskim_match_scope() argument
3231 switch (tskim->tm_cmnd) { in bfa_tskim_match_scope()
3239 return !memcmp(&tskim->lun, &lun, sizeof(lun)); in bfa_tskim_match_scope()
3252 bfa_tskim_gather_ios(struct bfa_tskim_s *tskim) in bfa_tskim_gather_ios() argument
3254 struct bfa_itnim_s *itnim = tskim->itnim; in bfa_tskim_gather_ios()
3260 INIT_LIST_HEAD(&tskim->io_q); in bfa_tskim_gather_ios()
3269 if (bfa_tskim_match_scope(tskim, scsilun)) { in bfa_tskim_gather_ios()
3271 list_add_tail(&ioim->qe, &tskim->io_q); in bfa_tskim_gather_ios()
3282 if (bfa_tskim_match_scope(tskim, scsilun)) { in bfa_tskim_gather_ios()
3296 struct bfa_tskim_s *tskim = tskim_cbarg; in bfa_tskim_cleanp_comp() local
3298 bfa_stats(tskim->itnim, tm_io_comps); in bfa_tskim_cleanp_comp()
3299 bfa_sm_send_event(tskim, BFA_TSKIM_SM_IOS_DONE); in bfa_tskim_cleanp_comp()
3306 bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim) in bfa_tskim_cleanup_ios() argument
3311 bfa_wc_init(&tskim->wc, bfa_tskim_cleanp_comp, tskim); in bfa_tskim_cleanup_ios()
3313 list_for_each_safe(qe, qen, &tskim->io_q) { in bfa_tskim_cleanup_ios()
3315 bfa_wc_up(&tskim->wc); in bfa_tskim_cleanup_ios()
3316 bfa_ioim_cleanup_tm(ioim, tskim); in bfa_tskim_cleanup_ios()
3319 bfa_wc_wait(&tskim->wc); in bfa_tskim_cleanup_ios()
3326 bfa_tskim_send(struct bfa_tskim_s *tskim) in bfa_tskim_send() argument
3328 struct bfa_itnim_s *itnim = tskim->itnim; in bfa_tskim_send()
3334 m = bfa_reqq_next(tskim->bfa, itnim->reqq); in bfa_tskim_send()
3342 bfa_fn_lpu(tskim->bfa)); in bfa_tskim_send()
3344 m->tsk_tag = cpu_to_be16(tskim->tsk_tag); in bfa_tskim_send()
3345 m->itn_fhdl = tskim->itnim->rport->fw_handle; in bfa_tskim_send()
3346 m->t_secs = tskim->tsecs; in bfa_tskim_send()
3347 m->lun = tskim->lun; in bfa_tskim_send()
3348 m->tm_flags = tskim->tm_cmnd; in bfa_tskim_send()
3353 bfa_reqq_produce(tskim->bfa, itnim->reqq, m->mh); in bfa_tskim_send()
3361 bfa_tskim_send_abort(struct bfa_tskim_s *tskim) in bfa_tskim_send_abort() argument
3363 struct bfa_itnim_s *itnim = tskim->itnim; in bfa_tskim_send_abort()
3369 m = bfa_reqq_next(tskim->bfa, itnim->reqq); in bfa_tskim_send_abort()
3377 bfa_fn_lpu(tskim->bfa)); in bfa_tskim_send_abort()
3379 m->tsk_tag = cpu_to_be16(tskim->tsk_tag); in bfa_tskim_send_abort()
3384 bfa_reqq_produce(tskim->bfa, itnim->reqq, m->mh); in bfa_tskim_send_abort()
3394 struct bfa_tskim_s *tskim = cbarg; in bfa_tskim_qresume() local
3396 bfa_stats(tskim->itnim, tm_qresumes); in bfa_tskim_qresume()
3397 bfa_sm_send_event(tskim, BFA_TSKIM_SM_QRESUME); in bfa_tskim_qresume()
3404 bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim) in bfa_tskim_iocdisable_ios() argument
3409 list_for_each_safe(qe, qen, &tskim->io_q) { in bfa_tskim_iocdisable_ios()
3419 bfa_tskim_iodone(struct bfa_tskim_s *tskim) in bfa_tskim_iodone() argument
3421 bfa_wc_down(&tskim->wc); in bfa_tskim_iodone()
3428 bfa_tskim_iocdisable(struct bfa_tskim_s *tskim) in bfa_tskim_iocdisable() argument
3430 tskim->notify = BFA_FALSE; in bfa_tskim_iocdisable()
3431 bfa_stats(tskim->itnim, tm_iocdowns); in bfa_tskim_iocdisable()
3432 bfa_sm_send_event(tskim, BFA_TSKIM_SM_HWFAIL); in bfa_tskim_iocdisable()
3439 bfa_tskim_cleanup(struct bfa_tskim_s *tskim) in bfa_tskim_cleanup() argument
3441 tskim->notify = BFA_TRUE; in bfa_tskim_cleanup()
3442 bfa_stats(tskim->itnim, tm_cleanups); in bfa_tskim_cleanup()
3443 bfa_sm_send_event(tskim, BFA_TSKIM_SM_CLEANUP); in bfa_tskim_cleanup()
3452 struct bfa_tskim_s *tskim; in bfa_tskim_attach() local
3459 tskim = (struct bfa_tskim_s *) bfa_mem_kva_curp(fcp); in bfa_tskim_attach()
3460 fcpim->tskim_arr = tskim; in bfa_tskim_attach()
3462 for (i = 0; i < fcpim->num_tskim_reqs; i++, tskim++) { in bfa_tskim_attach()
3466 memset(tskim, 0, sizeof(struct bfa_tskim_s)); in bfa_tskim_attach()
3467 tskim->tsk_tag = i; in bfa_tskim_attach()
3468 tskim->bfa = fcpim->bfa; in bfa_tskim_attach()
3469 tskim->fcpim = fcpim; in bfa_tskim_attach()
3470 tskim->notify = BFA_FALSE; in bfa_tskim_attach()
3471 bfa_reqq_winit(&tskim->reqq_wait, bfa_tskim_qresume, in bfa_tskim_attach()
3472 tskim); in bfa_tskim_attach()
3473 bfa_sm_set_state(tskim, bfa_tskim_sm_uninit); in bfa_tskim_attach()
3475 list_add_tail(&tskim->qe, &fcpim->tskim_free_q); in bfa_tskim_attach()
3478 bfa_mem_kva_curp(fcp) = (u8 *) tskim; in bfa_tskim_attach()
3486 struct bfa_tskim_s *tskim; in bfa_tskim_isr() local
3489 tskim = BFA_TSKIM_FROM_TAG(fcpim, tsk_tag); in bfa_tskim_isr()
3490 WARN_ON(tskim->tsk_tag != tsk_tag); in bfa_tskim_isr()
3492 tskim->tsk_status = rsp->tsk_status; in bfa_tskim_isr()
3499 bfa_stats(tskim->itnim, tm_cleanup_comps); in bfa_tskim_isr()
3500 bfa_sm_send_event(tskim, BFA_TSKIM_SM_CLEANUP_DONE); in bfa_tskim_isr()
3502 bfa_sm_send_event(tskim, BFA_TSKIM_SM_UTAG); in bfa_tskim_isr()
3504 bfa_stats(tskim->itnim, tm_fw_rsps); in bfa_tskim_isr()
3505 bfa_sm_send_event(tskim, BFA_TSKIM_SM_DONE); in bfa_tskim_isr()
3514 struct bfa_tskim_s *tskim; in bfa_tskim_alloc() local
3516 bfa_q_deq(&fcpim->tskim_free_q, &tskim); in bfa_tskim_alloc()
3518 if (tskim) in bfa_tskim_alloc()
3519 tskim->dtsk = dtsk; in bfa_tskim_alloc()
3521 return tskim; in bfa_tskim_alloc()
3525 bfa_tskim_free(struct bfa_tskim_s *tskim) in bfa_tskim_free() argument
3527 WARN_ON(!bfa_q_is_on_q_func(&tskim->itnim->tsk_q, &tskim->qe)); in bfa_tskim_free()
3528 list_del(&tskim->qe); in bfa_tskim_free()
3529 list_add_tail(&tskim->qe, &tskim->fcpim->tskim_free_q); in bfa_tskim_free()
3544 bfa_tskim_start(struct bfa_tskim_s *tskim, struct bfa_itnim_s *itnim, in bfa_tskim_start() argument
3548 tskim->itnim = itnim; in bfa_tskim_start()
3549 tskim->lun = lun; in bfa_tskim_start()
3550 tskim->tm_cmnd = tm_cmnd; in bfa_tskim_start()
3551 tskim->tsecs = tsecs; in bfa_tskim_start()
3552 tskim->notify = BFA_FALSE; in bfa_tskim_start()
3555 list_add_tail(&tskim->qe, &itnim->tsk_q); in bfa_tskim_start()
3556 bfa_sm_send_event(tskim, BFA_TSKIM_SM_START); in bfa_tskim_start()