Print this page
XXXX introduce drv_sectohz


2413         MUTEX_ENTER(hxgep->genlock);
2414 
2415         if (hxge_init(hxgep) != DDI_SUCCESS) {
2416                 HXGE_ERROR_MSG((hxgep, HXGE_ERR_CTL,
2417                     "<== hxge_m_start: initialization failed"));
2418                 MUTEX_EXIT(hxgep->genlock);
2419                 return (EIO);
2420         }
2421 
2422         if (hxgep->hxge_mac_state != HXGE_MAC_STARTED) {
2423                 /*
2424                  * Start timer to check the system error and tx hangs
2425                  */
2426                 hxgep->hxge_timerid = hxge_start_timer(hxgep,
2427                     hxge_check_hw_state, HXGE_CHECK_TIMER);
2428 
2429                 hxgep->hxge_mac_state = HXGE_MAC_STARTED;
2430 
2431                 hxgep->timeout.link_status = 0;
2432                 hxgep->timeout.report_link_status = B_TRUE;
2433                 hxgep->timeout.ticks = drv_usectohz(2 * 1000000);
2434 
2435                 /* Start the link status timer to check the link status */
2436                 MUTEX_ENTER(&hxgep->timeout.lock);
2437                 hxgep->timeout.id = timeout(hxge_link_poll, (void *)hxgep,
2438                     hxgep->timeout.ticks);
2439                 MUTEX_EXIT(&hxgep->timeout.lock);
2440         }
2441 
2442         MUTEX_EXIT(hxgep->genlock);
2443 
2444         HXGE_DEBUG_MSG((hxgep, NEMO_CTL, "<== hxge_m_start"));
2445 
2446         return (0);
2447 }
2448 
2449 /*
2450  * hxge_m_stop(): stop transmitting and receiving.
2451  */
2452 static void
2453 hxge_m_stop(void *arg)




2413         MUTEX_ENTER(hxgep->genlock);
2414 
2415         if (hxge_init(hxgep) != DDI_SUCCESS) {
2416                 HXGE_ERROR_MSG((hxgep, HXGE_ERR_CTL,
2417                     "<== hxge_m_start: initialization failed"));
2418                 MUTEX_EXIT(hxgep->genlock);
2419                 return (EIO);
2420         }
2421 
2422         if (hxgep->hxge_mac_state != HXGE_MAC_STARTED) {
2423                 /*
2424                  * Start timer to check the system error and tx hangs
2425                  */
2426                 hxgep->hxge_timerid = hxge_start_timer(hxgep,
2427                     hxge_check_hw_state, HXGE_CHECK_TIMER);
2428 
2429                 hxgep->hxge_mac_state = HXGE_MAC_STARTED;
2430 
2431                 hxgep->timeout.link_status = 0;
2432                 hxgep->timeout.report_link_status = B_TRUE;
2433                 hxgep->timeout.ticks = drv_sectohz(2);
2434 
2435                 /* Start the link status timer to check the link status */
2436                 MUTEX_ENTER(&hxgep->timeout.lock);
2437                 hxgep->timeout.id = timeout(hxge_link_poll, (void *)hxgep,
2438                     hxgep->timeout.ticks);
2439                 MUTEX_EXIT(&hxgep->timeout.lock);
2440         }
2441 
2442         MUTEX_EXIT(hxgep->genlock);
2443 
2444         HXGE_DEBUG_MSG((hxgep, NEMO_CTL, "<== hxge_m_start"));
2445 
2446         return (0);
2447 }
2448 
2449 /*
2450  * hxge_m_stop(): stop transmitting and receiving.
2451  */
2452 static void
2453 hxge_m_stop(void *arg)