Print this page
XXXX introduce drv_sectohz


3312                 if (*mp->b_rptr & FLUSHW)
3313                         *mp->b_rptr &= ~FLUSHW;
3314                 if (*mp->b_rptr & FLUSHR)
3315                         qreply(wq, mp);
3316                 else
3317                         freemsg(mp);
3318                 break;
3319         default:
3320                 freemsg(mp);
3321                 break;
3322         }
3323 }
3324 
3325 /*
3326  * This function allocates the main data structures for the bridge driver and
3327  * connects us into devfs.
3328  */
3329 static void
3330 bridge_inst_init(void)
3331 {
3332         bridge_scan_interval = 5 * drv_usectohz(1000000);
3333         bridge_fwd_age = 25 * drv_usectohz(1000000);
3334 
3335         rw_init(&bmac_rwlock, NULL, RW_DRIVER, NULL);
3336         list_create(&bmac_list, sizeof (bridge_mac_t),
3337             offsetof(bridge_mac_t, bm_node));
3338         list_create(&inst_list, sizeof (bridge_inst_t),
3339             offsetof(bridge_inst_t, bi_node));
3340         cv_init(&inst_cv, NULL, CV_DRIVER, NULL);
3341         mutex_init(&inst_lock, NULL, MUTEX_DRIVER, NULL);
3342         cv_init(&stream_ref_cv, NULL, CV_DRIVER, NULL);
3343         mutex_init(&stream_ref_lock, NULL, MUTEX_DRIVER, NULL);
3344 
3345         mac_bridge_vectors(bridge_xmit_cb, bridge_recv_cb, bridge_ref_cb,
3346             bridge_ls_cb);
3347 }
3348 
3349 /*
3350  * This function disconnects from devfs and destroys all data structures in
3351  * preparation for unload.  It's assumed that there are no active bridge
3352  * references left at this point.
3353  */




3312                 if (*mp->b_rptr & FLUSHW)
3313                         *mp->b_rptr &= ~FLUSHW;
3314                 if (*mp->b_rptr & FLUSHR)
3315                         qreply(wq, mp);
3316                 else
3317                         freemsg(mp);
3318                 break;
3319         default:
3320                 freemsg(mp);
3321                 break;
3322         }
3323 }
3324 
3325 /*
3326  * This function allocates the main data structures for the bridge driver and
3327  * connects us into devfs.
3328  */
3329 static void
3330 bridge_inst_init(void)
3331 {
3332         bridge_scan_interval = drv_sectohz(5);
3333         bridge_fwd_age = drv_sectohz(25);
3334 
3335         rw_init(&bmac_rwlock, NULL, RW_DRIVER, NULL);
3336         list_create(&bmac_list, sizeof (bridge_mac_t),
3337             offsetof(bridge_mac_t, bm_node));
3338         list_create(&inst_list, sizeof (bridge_inst_t),
3339             offsetof(bridge_inst_t, bi_node));
3340         cv_init(&inst_cv, NULL, CV_DRIVER, NULL);
3341         mutex_init(&inst_lock, NULL, MUTEX_DRIVER, NULL);
3342         cv_init(&stream_ref_cv, NULL, CV_DRIVER, NULL);
3343         mutex_init(&stream_ref_lock, NULL, MUTEX_DRIVER, NULL);
3344 
3345         mac_bridge_vectors(bridge_xmit_cb, bridge_recv_cb, bridge_ref_cb,
3346             bridge_ls_cb);
3347 }
3348 
3349 /*
3350  * This function disconnects from devfs and destroys all data structures in
3351  * preparation for unload.  It's assumed that there are no active bridge
3352  * references left at this point.
3353  */