Print this page
XXXX introduce drv_sectohz


 788             tgt->target_stmf_lport, &scs);
 789 
 790         stmf_trace("pppt", "pppt_tgt_offline complete %p", (void *)tgt);
 791 }
 792 
 793 static void
 794 pppt_tgt_dereg_retry(void *arg)
 795 {
 796         pppt_tgt_t *tgt = arg;
 797 
 798         /*
 799          * Rather than guaranteeing the target state machine code will not
 800          * block for long periods of time (tying up this callout thread)
 801          * we will queue a task on the taskq to send the retry event.
 802          * If it fails we'll setup another timeout and try again later.
 803          */
 804         if (taskq_dispatch(pppt_global.global_dispatch_taskq,
 805             pppt_tgt_dereg_task, tgt, KM_NOSLEEP) == NULL) {
 806                 /* Dispatch failed, try again later */
 807                 (void) timeout(pppt_tgt_dereg_retry, tgt,
 808                     drv_usectohz(TGT_DEREG_RETRY_SECONDS * 1000000));
 809         }
 810 }
 811 
 812 static void
 813 pppt_tgt_dereg_task(void *arg)
 814 {
 815         pppt_tgt_t *tgt = arg;
 816 
 817         pppt_tgt_sm_event(tgt, TE_STMF_DEREG_RETRY);
 818 }
 819 
 820 /*ARGSUSED*/
 821 static void
 822 tgt_sm_new_state(pppt_tgt_t *tgt, tgt_event_ctx_t *ctx,
 823     pppt_tgt_state_t new_state)
 824 {
 825         stmf_local_port_t               *lport = tgt->target_stmf_lport;
 826         stmf_change_status_t            scs;
 827         stmf_state_change_info_t        sci;
 828         stmf_status_t                   stmfrc;




 788             tgt->target_stmf_lport, &scs);
 789 
 790         stmf_trace("pppt", "pppt_tgt_offline complete %p", (void *)tgt);
 791 }
 792 
 793 static void
 794 pppt_tgt_dereg_retry(void *arg)
 795 {
 796         pppt_tgt_t *tgt = arg;
 797 
 798         /*
 799          * Rather than guaranteeing the target state machine code will not
 800          * block for long periods of time (tying up this callout thread)
 801          * we will queue a task on the taskq to send the retry event.
 802          * If it fails we'll setup another timeout and try again later.
 803          */
 804         if (taskq_dispatch(pppt_global.global_dispatch_taskq,
 805             pppt_tgt_dereg_task, tgt, KM_NOSLEEP) == NULL) {
 806                 /* Dispatch failed, try again later */
 807                 (void) timeout(pppt_tgt_dereg_retry, tgt,
 808                     drv_sectohz(TGT_DEREG_RETRY_SECONDS));
 809         }
 810 }
 811 
 812 static void
 813 pppt_tgt_dereg_task(void *arg)
 814 {
 815         pppt_tgt_t *tgt = arg;
 816 
 817         pppt_tgt_sm_event(tgt, TE_STMF_DEREG_RETRY);
 818 }
 819 
 820 /*ARGSUSED*/
 821 static void
 822 tgt_sm_new_state(pppt_tgt_t *tgt, tgt_event_ctx_t *ctx,
 823     pppt_tgt_state_t new_state)
 824 {
 825         stmf_local_port_t               *lport = tgt->target_stmf_lport;
 826         stmf_change_status_t            scs;
 827         stmf_state_change_info_t        sci;
 828         stmf_status_t                   stmfrc;