Print this page
XXXX introduce drv_sectohz


3353                                         rw_enter(&iport->iport_lock, RW_READER);
3354                                         irp = fct_lookup_irp_by_portwwn(iport,
3355                                             ct->ct_req_payload + 16);
3356 
3357                                         if (irp) {
3358                                                 atomic_and_32(&irp->irp_flags,
3359                                                     ~IRP_RSCN_QUEUED);
3360                                         }
3361                                         rw_exit(&iport->iport_lock);
3362                                 }
3363                         } else {
3364                                 ASSERT(0);
3365                         }
3366                 } else {
3367                         clock_t timeout_ticks;
3368                         if (port->port_fca_abort_timeout)
3369                                 timeout_ticks = drv_usectohz(
3370                                     port->port_fca_abort_timeout*1000);
3371                         else
3372                                 /* 10 seconds by default */
3373                                 timeout_ticks = drv_usectohz(10 * 1000000);
3374                         if ((ddi_get_lbolt() >
3375                             (icmd->icmd_start_time+timeout_ticks)) &&
3376                             iport->iport_state == FCT_STATE_ONLINE) {
3377                                 /* timeout, reset the port */
3378                                 char cmd_type[10];
3379                                 if (cmd->cmd_type == FCT_CMD_RCVD_ELS ||
3380                                     cmd->cmd_type == FCT_CMD_SOL_ELS) {
3381                                         fct_els_t *els = cmd->cmd_specific;
3382                                         (void) snprintf(cmd_type,
3383                                             sizeof (cmd_type), "%x.%x",
3384                                             cmd->cmd_type,
3385                                             els->els_req_payload[0]);
3386                                 } else if (cmd->cmd_type == FCT_CMD_SOL_CT) {
3387                                         fct_sol_ct_t *ct = cmd->cmd_specific;
3388                                         (void) snprintf(cmd_type,
3389                                             sizeof (cmd_type), "%x.%02x%02x",
3390                                             cmd->cmd_type,
3391                                             ct->ct_req_payload[8],
3392                                             ct->ct_req_payload[9]);
3393                                 } else {




3353                                         rw_enter(&iport->iport_lock, RW_READER);
3354                                         irp = fct_lookup_irp_by_portwwn(iport,
3355                                             ct->ct_req_payload + 16);
3356 
3357                                         if (irp) {
3358                                                 atomic_and_32(&irp->irp_flags,
3359                                                     ~IRP_RSCN_QUEUED);
3360                                         }
3361                                         rw_exit(&iport->iport_lock);
3362                                 }
3363                         } else {
3364                                 ASSERT(0);
3365                         }
3366                 } else {
3367                         clock_t timeout_ticks;
3368                         if (port->port_fca_abort_timeout)
3369                                 timeout_ticks = drv_usectohz(
3370                                     port->port_fca_abort_timeout*1000);
3371                         else
3372                                 /* 10 seconds by default */
3373                                 timeout_ticks = drv_sectohz(10);
3374                         if ((ddi_get_lbolt() >
3375                             (icmd->icmd_start_time+timeout_ticks)) &&
3376                             iport->iport_state == FCT_STATE_ONLINE) {
3377                                 /* timeout, reset the port */
3378                                 char cmd_type[10];
3379                                 if (cmd->cmd_type == FCT_CMD_RCVD_ELS ||
3380                                     cmd->cmd_type == FCT_CMD_SOL_ELS) {
3381                                         fct_els_t *els = cmd->cmd_specific;
3382                                         (void) snprintf(cmd_type,
3383                                             sizeof (cmd_type), "%x.%x",
3384                                             cmd->cmd_type,
3385                                             els->els_req_payload[0]);
3386                                 } else if (cmd->cmd_type == FCT_CMD_SOL_CT) {
3387                                         fct_sol_ct_t *ct = cmd->cmd_specific;
3388                                         (void) snprintf(cmd_type,
3389                                             sizeof (cmd_type), "%x.%02x%02x",
3390                                             cmd->cmd_type,
3391                                             ct->ct_req_payload[8],
3392                                             ct->ct_req_payload[9]);
3393                                 } else {