Print this page
XXXX introduce drv_sectohz


 724         }
 725         mutex_exit(&tglobal_mutex);
 726 }
 727 
 728 /* ************************************************************************ */
 729 
 730         /* these are the externally callable routines */
 731 
 732 
 733 void
 734 ghd_timer_init(tmr_t *tmrp, long ticks)
 735 {
 736         int     indx;
 737 
 738         mutex_init(&tglobal_mutex, NULL, MUTEX_DRIVER, NULL);
 739         mutex_init(&tmrp->t_mutex, NULL, MUTEX_DRIVER, NULL);
 740 
 741         /*
 742          * determine default timeout value
 743          */
 744         ghd_HZ = drv_usectohz(1000000);
 745         if (ticks == 0)
 746                 ticks = scsi_watchdog_tick * ghd_HZ;
 747         tmrp->t_ticks = ticks;
 748 
 749 
 750         /*
 751          * Initialize the table of abort timer values using an
 752          * indirect lookup table so that this code isn't dependant
 753          * on the cmdstate_t enum values or order.
 754          */
 755         for (indx = 0; indx < ghd_ntime_inits; indx++) {
 756                 int     state;
 757                 ulong_t value;
 758 
 759                 if (!ghd_time_inits[indx].valid)
 760                         continue;
 761                 state = ghd_time_inits[indx].state;
 762                 value = ghd_time_inits[indx].value;
 763                 ghd_timeout_table[state] = (cmdstate_t)value;
 764         }




 724         }
 725         mutex_exit(&tglobal_mutex);
 726 }
 727 
 728 /* ************************************************************************ */
 729 
 730         /* these are the externally callable routines */
 731 
 732 
 733 void
 734 ghd_timer_init(tmr_t *tmrp, long ticks)
 735 {
 736         int     indx;
 737 
 738         mutex_init(&tglobal_mutex, NULL, MUTEX_DRIVER, NULL);
 739         mutex_init(&tmrp->t_mutex, NULL, MUTEX_DRIVER, NULL);
 740 
 741         /*
 742          * determine default timeout value
 743          */
 744         ghd_HZ = drv_sectohz(1);
 745         if (ticks == 0)
 746                 ticks = scsi_watchdog_tick * ghd_HZ;
 747         tmrp->t_ticks = ticks;
 748 
 749 
 750         /*
 751          * Initialize the table of abort timer values using an
 752          * indirect lookup table so that this code isn't dependant
 753          * on the cmdstate_t enum values or order.
 754          */
 755         for (indx = 0; indx < ghd_ntime_inits; indx++) {
 756                 int     state;
 757                 ulong_t value;
 758 
 759                 if (!ghd_time_inits[indx].valid)
 760                         continue;
 761                 state = ghd_time_inits[indx].state;
 762                 value = ghd_time_inits[indx].value;
 763                 ghd_timeout_table[state] = (cmdstate_t)value;
 764         }