Print this page
XXXX introduce drv_sectohz


4104 static int
4105 vgen_handshake(vgen_ldc_t *ldcp)
4106 {
4107         uint32_t        hphase = ldcp->hphase;
4108         vgen_t          *vgenp = LDC_TO_VGEN(ldcp);
4109         int             rv = 0;
4110         timeout_id_t    htid;
4111 
4112         switch (hphase) {
4113 
4114         case VH_PHASE1:
4115 
4116                 /*
4117                  * start timer, for entire handshake process, turn this timer
4118                  * off if all phases of handshake complete successfully and
4119                  * hphase goes to VH_DONE(below) or channel is reset due to
4120                  * errors or vgen_ldc_uninit() is invoked(vgen_stop).
4121                  */
4122                 ASSERT(ldcp->htid == 0);
4123                 ldcp->htid = timeout(vgen_hwatchdog, (caddr_t)ldcp,
4124                     drv_usectohz(vgen_hwd_interval * MICROSEC));
4125 
4126                 /* Phase 1 involves negotiating the version */
4127                 rv = vgen_send_version_negotiate(ldcp);
4128                 break;
4129 
4130         case VH_PHASE2:
4131                 rv = vgen_handshake_phase2(ldcp);
4132                 break;
4133 
4134         case VH_PHASE3:
4135                 rv = vgen_handshake_phase3(ldcp);
4136                 break;
4137 
4138         case VH_PHASE4:
4139                 rv = vgen_send_rdx_info(ldcp);
4140                 break;
4141 
4142         case VH_DONE:
4143 
4144                 ldcp->ldc_reset_count = 0;




4104 static int
4105 vgen_handshake(vgen_ldc_t *ldcp)
4106 {
4107         uint32_t        hphase = ldcp->hphase;
4108         vgen_t          *vgenp = LDC_TO_VGEN(ldcp);
4109         int             rv = 0;
4110         timeout_id_t    htid;
4111 
4112         switch (hphase) {
4113 
4114         case VH_PHASE1:
4115 
4116                 /*
4117                  * start timer, for entire handshake process, turn this timer
4118                  * off if all phases of handshake complete successfully and
4119                  * hphase goes to VH_DONE(below) or channel is reset due to
4120                  * errors or vgen_ldc_uninit() is invoked(vgen_stop).
4121                  */
4122                 ASSERT(ldcp->htid == 0);
4123                 ldcp->htid = timeout(vgen_hwatchdog, (caddr_t)ldcp,
4124                     drv_sectohz(vgen_hwd_interval));
4125 
4126                 /* Phase 1 involves negotiating the version */
4127                 rv = vgen_send_version_negotiate(ldcp);
4128                 break;
4129 
4130         case VH_PHASE2:
4131                 rv = vgen_handshake_phase2(ldcp);
4132                 break;
4133 
4134         case VH_PHASE3:
4135                 rv = vgen_handshake_phase3(ldcp);
4136                 break;
4137 
4138         case VH_PHASE4:
4139                 rv = vgen_send_rdx_info(ldcp);
4140                 break;
4141 
4142         case VH_DONE:
4143 
4144                 ldcp->ldc_reset_count = 0;