Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/comstar/port/fct/discovery.c
          +++ new/usr/src/uts/common/io/comstar/port/fct/discovery.c
↓ open down ↓ 94 lines elided ↑ open up ↑
  95   95  fct_port_worker(void *arg)
  96   96  {
  97   97          fct_local_port_t        *port = (fct_local_port_t *)arg;
  98   98          fct_i_local_port_t      *iport = (fct_i_local_port_t *)
  99   99              port->port_fct_private;
 100  100          disc_action_t           suggested_action;
 101  101          clock_t                 dl, short_delay, long_delay;
 102  102          int64_t                 tmp_delay;
 103  103  
 104  104          iport->iport_cmdcheck_clock = ddi_get_lbolt() +
 105      -            drv_usectohz(FCT_CMDLIST_CHECK_SECONDS * 1000000);
      105 +            drv_sectohz(FCT_CMDLIST_CHECK_SECONDS);
 106  106          short_delay = drv_usectohz(10000);
 107      -        long_delay = drv_usectohz(1000000);
      107 +        long_delay = drv_sectohz(1);
 108  108  
 109  109          stmf_trace(iport->iport_alias, "iport is %p", iport);
 110  110          /* Discovery loop */
 111  111          mutex_enter(&iport->iport_worker_lock);
 112  112          atomic_or_32(&iport->iport_flags, IPORT_WORKER_RUNNING);
 113  113          while ((iport->iport_flags & IPORT_TERMINATE_WORKER) == 0) {
 114  114                  suggested_action = DISC_ACTION_NO_WORK;
 115  115                  /*
 116  116                   * Local port events are of the highest prioriy
 117  117                   */
↓ open down ↓ 31 lines elided ↑ open up ↑
 149  149                  if (iport->iport_abort_queue) {
 150  150                          suggested_action |= fct_cmd_terminator(iport);
 151  151                  }
 152  152  
 153  153                  /*
 154  154                   * Check cmd max/free
 155  155                   */
 156  156                  if (iport->iport_cmdcheck_clock <= ddi_get_lbolt()) {
 157  157                          suggested_action |= fct_check_cmdlist(iport);
 158  158                          iport->iport_cmdcheck_clock = ddi_get_lbolt() +
 159      -                            drv_usectohz(FCT_CMDLIST_CHECK_SECONDS * 1000000);
      159 +                            drv_sectohz(FCT_CMDLIST_CHECK_SECONDS);
 160  160                          iport->iport_max_active_ncmds = 0;
 161  161                  }
 162  162  
 163  163                  if (iport->iport_offline_prstate != FCT_OPR_DONE) {
 164  164                          suggested_action |= fct_handle_port_offline(iport);
 165  165                  }
 166  166  
 167  167                  if (suggested_action & DISC_ACTION_RESCAN) {
 168  168                          continue;
 169  169                  } else if (suggested_action & DISC_ACTION_DELAY_RESCAN) {
↓ open down ↓ 419 lines elided ↑ open up ↑
 589  589                  }
 590  590                  /* Skip next level if topo is not N2N */
 591  591                  if (li->port_topology != PORT_TOPOLOGY_PT_TO_PT) {
 592  592                          iport->iport_li_state += 2;
 593  593                          atomic_and_32(&iport->iport_flags,
 594  594                              ~IPORT_ALLOW_UNSOL_FLOGI);
 595  595                  } else {
 596  596                          iport->iport_li_state++;
 597  597                          iport->iport_login_retry = 0;
 598  598                          iport->iport_li_cmd_timeout = ddi_get_lbolt() +
 599      -                            drv_usectohz(25 * 1000000);
      599 +                            drv_sectohz(25);
 600  600                  }
 601  601                  goto check_state_again;
 602  602  
 603  603          case LI_STATE_N2N_PLOGI:
 604  604                  ASSERT(IPORT_FLOGI_DONE(iport));
 605  605                  ASSERT(iport->iport_link_info.port_topology ==
 606  606                      PORT_TOPOLOGY_PT_TO_PT);
 607  607                  if (iport->iport_li_state & LI_STATE_FLAG_CMD_RETCHECK) {
 608  608                          iport->iport_li_state &= ~LI_STATE_FLAG_CMD_RETCHECK;
 609  609                          if (iport->iport_li_comp_status != FCT_SUCCESS) {
↓ open down ↓ 2238 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX