Print this page
XXXX introduce drv_sectohz


 636                 ASSERT(0);
 637         }
 638 }
 639 
 640 
 641 static void
 642 iscsit_tgt_dereg_retry(void *arg)
 643 {
 644         iscsit_tgt_t *tgt = arg;
 645 
 646         /*
 647          * Rather than guaranteeing the target state machine code will not
 648          * block for long periods of time (tying up this callout thread)
 649          * we will queue a task on the taskq to send the retry event.
 650          * If it fails we'll setup another timeout and try again later.
 651          */
 652         if (taskq_dispatch(iscsit_global.global_dispatch_taskq,
 653             iscsit_tgt_dereg_task, tgt, DDI_NOSLEEP) == NULL) {
 654                 /* Dispatch failed, try again later */
 655                 (void) timeout(iscsit_tgt_dereg_retry, tgt,
 656                     drv_usectohz(TGT_DEREG_RETRY_SECONDS * 1000000));
 657         }
 658 }
 659 
 660 static void
 661 iscsit_tgt_dereg_task(void *arg)
 662 {
 663         iscsit_tgt_t *tgt = arg;
 664 
 665         iscsit_tgt_sm_event(tgt, TE_STMF_DEREG_RETRY);
 666 }
 667 
 668 static void
 669 tgt_sm_new_state(iscsit_tgt_t *tgt, tgt_event_ctx_t *ctx,
 670     iscsit_tgt_state_t new_state)
 671 {
 672         stmf_local_port_t               *lport = tgt->target_stmf_lport;
 673         stmf_change_status_t            scs;
 674         stmf_state_change_info_t        sci;
 675         idm_status_t                    idmrc;
 676         stmf_status_t                   stmfrc;




 636                 ASSERT(0);
 637         }
 638 }
 639 
 640 
 641 static void
 642 iscsit_tgt_dereg_retry(void *arg)
 643 {
 644         iscsit_tgt_t *tgt = arg;
 645 
 646         /*
 647          * Rather than guaranteeing the target state machine code will not
 648          * block for long periods of time (tying up this callout thread)
 649          * we will queue a task on the taskq to send the retry event.
 650          * If it fails we'll setup another timeout and try again later.
 651          */
 652         if (taskq_dispatch(iscsit_global.global_dispatch_taskq,
 653             iscsit_tgt_dereg_task, tgt, DDI_NOSLEEP) == NULL) {
 654                 /* Dispatch failed, try again later */
 655                 (void) timeout(iscsit_tgt_dereg_retry, tgt,
 656                     drv_sectohz(TGT_DEREG_RETRY_SECONDS));
 657         }
 658 }
 659 
 660 static void
 661 iscsit_tgt_dereg_task(void *arg)
 662 {
 663         iscsit_tgt_t *tgt = arg;
 664 
 665         iscsit_tgt_sm_event(tgt, TE_STMF_DEREG_RETRY);
 666 }
 667 
 668 static void
 669 tgt_sm_new_state(iscsit_tgt_t *tgt, tgt_event_ctx_t *ctx,
 670     iscsit_tgt_state_t new_state)
 671 {
 672         stmf_local_port_t               *lport = tgt->target_stmf_lport;
 673         stmf_change_status_t            scs;
 674         stmf_state_change_info_t        sci;
 675         idm_status_t                    idmrc;
 676         stmf_status_t                   stmfrc;