Print this page
XXXX introduce drv_sectohz


 294  */
 295 void
 296 ieee80211_media_init(ieee80211com_t *ic)
 297 {
 298         /*
 299          * Do late attach work that must wait for any subclass
 300          * (i.e. driver) work such as overriding methods.
 301          */
 302         ieee80211_node_lateattach(ic);
 303 }
 304 
 305 /*
 306  * Start Watchdog timer. After count down timer(s), ic_watchdog
 307  * will be called
 308  */
 309 void
 310 ieee80211_start_watchdog(ieee80211com_t *ic, uint32_t timer)
 311 {
 312         if (ic->ic_watchdog_timer == 0 && ic->ic_watchdog != NULL) {
 313                 ic->ic_watchdog_timer = timeout(ic->ic_watchdog, ic,
 314                     drv_usectohz(1000000 * timer));
 315         }
 316 }
 317 
 318 /*
 319  * Stop watchdog timer.
 320  */
 321 void
 322 ieee80211_stop_watchdog(ieee80211com_t *ic)
 323 {
 324         if (ic->ic_watchdog_timer != 0) {
 325                 if (ic->ic_watchdog != NULL)
 326                         (void) untimeout(ic->ic_watchdog_timer);
 327                 ic->ic_watchdog_timer = 0;
 328         }
 329 }
 330 
 331 /*
 332  * Called from a driver's xxx_watchdog routine. It is used to
 333  * perform periodic cleanup of state for net80211, as well as
 334  * timeout scans.




 294  */
 295 void
 296 ieee80211_media_init(ieee80211com_t *ic)
 297 {
 298         /*
 299          * Do late attach work that must wait for any subclass
 300          * (i.e. driver) work such as overriding methods.
 301          */
 302         ieee80211_node_lateattach(ic);
 303 }
 304 
 305 /*
 306  * Start Watchdog timer. After count down timer(s), ic_watchdog
 307  * will be called
 308  */
 309 void
 310 ieee80211_start_watchdog(ieee80211com_t *ic, uint32_t timer)
 311 {
 312         if (ic->ic_watchdog_timer == 0 && ic->ic_watchdog != NULL) {
 313                 ic->ic_watchdog_timer = timeout(ic->ic_watchdog, ic,
 314                     drv_sectohz(timer));
 315         }
 316 }
 317 
 318 /*
 319  * Stop watchdog timer.
 320  */
 321 void
 322 ieee80211_stop_watchdog(ieee80211com_t *ic)
 323 {
 324         if (ic->ic_watchdog_timer != 0) {
 325                 if (ic->ic_watchdog != NULL)
 326                         (void) untimeout(ic->ic_watchdog_timer);
 327                 ic->ic_watchdog_timer = 0;
 328         }
 329 }
 330 
 331 /*
 332  * Called from a driver's xxx_watchdog routine. It is used to
 333  * perform periodic cleanup of state for net80211, as well as
 334  * timeout scans.