Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_clock.c
          +++ new/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_clock.c
↓ open down ↓ 59 lines elided ↑ open up ↑
  60   60  
  61   61  extern clock_t
  62   62  emlxs_timeout(emlxs_hba_t *hba, uint32_t timeout)
  63   63  {
  64   64          emlxs_config_t *cfg = &CFG;
  65   65          clock_t time;
  66   66  
  67   67          /* Set thread timeout */
  68   68          if (cfg[CFG_TIMEOUT_ENABLE].current) {
  69   69                  (void) drv_getparm(LBOLT, &time);
  70      -                time += (timeout * drv_usectohz(1000000));
       70 +                time += drv_sectohz(timeout);
  71   71          } else {
  72   72                  time = -1;
  73   73          }
  74   74  
  75   75          return (time);
  76   76  
  77   77  } /* emlxs_timeout() */
  78   78  
  79   79  
  80   80  static void
↓ open down ↓ 43 lines elided ↑ open up ↑
 124  124  
 125  125          /* Restart the timer */
 126  126          mutex_enter(&EMLXS_TIMER_LOCK);
 127  127  
 128  128          hba->timer_flags &= ~EMLXS_TIMER_BUSY;
 129  129  
 130  130          /* If timer is still enabled, restart it */
 131  131          if (!(hba->timer_flags & EMLXS_TIMER_KILL)) {
 132  132                  hba->timer_id =
 133  133                      timeout(emlxs_timer, (void *)hba,
 134      -                    (EMLXS_TIMER_PERIOD * drv_usectohz(1000000)));
      134 +                    drv_sectohz(EMLXS_TIMER_PERIOD));
 135  135          } else {
 136  136                  hba->timer_id = 0;
 137  137                  hba->timer_flags |= EMLXS_TIMER_ENDED;
 138  138          }
 139  139  
 140  140          mutex_exit(&EMLXS_TIMER_LOCK);
 141  141  
 142  142          return;
 143  143  
 144  144  } /* emlxs_timer() */
↓ open down ↓ 88 lines elided ↑ open up ↑
 233  233  {
 234  234          if (hba->timer_id) {
 235  235                  return;
 236  236          }
 237  237  
 238  238          /* Restart the timer */
 239  239          mutex_enter(&EMLXS_TIMER_LOCK);
 240  240          if (!hba->timer_id) {
 241  241                  hba->timer_flags = 0;
 242  242                  hba->timer_id =
 243      -                    timeout(emlxs_timer, (void *)hba, drv_usectohz(1000000));
      243 +                    timeout(emlxs_timer, (void *)hba, drv_sectohz(1));
 244  244          }
 245  245          mutex_exit(&EMLXS_TIMER_LOCK);
 246  246  
 247  247  } /* emlxs_timer_start() */
 248  248  
 249  249  
 250  250  extern void
 251  251  emlxs_timer_stop(emlxs_hba_t *hba)
 252  252  {
 253  253          if (!hba->timer_id) {
↓ open down ↓ 1218 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX