Lines Matching refs:sup
160 softmac_upper_t *sup = buf; in softmac_upper_constructor() local
164 mutex_init(&sup->su_mutex, NULL, MUTEX_DEFAULT, NULL); in softmac_upper_constructor()
165 cv_init(&sup->su_cv, NULL, CV_DEFAULT, NULL); in softmac_upper_constructor()
166 mutex_init(&sup->su_disp_mutex, NULL, MUTEX_DEFAULT, NULL); in softmac_upper_constructor()
167 cv_init(&sup->su_disp_cv, NULL, CV_DEFAULT, NULL); in softmac_upper_constructor()
168 list_create(&sup->su_req_list, sizeof (softmac_switch_req_t), in softmac_upper_constructor()
177 softmac_upper_t *sup = buf; in softmac_upper_destructor() local
179 ASSERT(sup->su_slp == NULL); in softmac_upper_destructor()
180 ASSERT(sup->su_pending_head == NULL && sup->su_pending_tail == NULL); in softmac_upper_destructor()
181 ASSERT(!sup->su_dlpi_pending); in softmac_upper_destructor()
182 ASSERT(!sup->su_active); in softmac_upper_destructor()
183 ASSERT(!sup->su_closing); in softmac_upper_destructor()
184 ASSERT(sup->su_tx_flow_mp == NULL); in softmac_upper_destructor()
185 ASSERT(sup->su_tx_inprocess == 0); in softmac_upper_destructor()
186 ASSERT(sup->su_mode == SOFTMAC_UNKNOWN); in softmac_upper_destructor()
187 ASSERT(!sup->su_tx_busy); in softmac_upper_destructor()
188 ASSERT(!sup->su_bound); in softmac_upper_destructor()
189 ASSERT(!sup->su_taskq_scheduled); in softmac_upper_destructor()
190 ASSERT(sup->su_tx_notify_func == NULL); in softmac_upper_destructor()
191 ASSERT(sup->su_tx_notify_arg == NULL); in softmac_upper_destructor()
192 ASSERT(list_is_empty(&sup->su_req_list)); in softmac_upper_destructor()
194 list_destroy(&sup->su_req_list); in softmac_upper_destructor()
195 mutex_destroy(&sup->su_mutex); in softmac_upper_destructor()
196 cv_destroy(&sup->su_cv); in softmac_upper_destructor()
197 mutex_destroy(&sup->su_disp_mutex); in softmac_upper_destructor()
198 cv_destroy(&sup->su_disp_cv); in softmac_upper_destructor()
524 softmac_upper_t *sup = NULL; in softmac_drv_open() local
535 sup = kmem_cache_alloc(softmac_upper_cachep, KM_NOSLEEP); in softmac_drv_open()
536 if (sup == NULL) { in softmac_drv_open()
541 ASSERT(list_is_empty(&sup->su_req_list)); in softmac_drv_open()
543 if ((sup->su_tx_flow_mp = allocb(1, BPRI_HI)) == NULL) { in softmac_drv_open()
548 sup->su_rq = rq; in softmac_drv_open()
549 sup->su_wq = WR(rq); in softmac_drv_open()
550 sup->su_softmac = softmac; in softmac_drv_open()
551 sup->su_mode = SOFTMAC_UNKNOWN; in softmac_drv_open()
553 sup->su_rxinfo.slr_arg = sup; in softmac_drv_open()
554 sup->su_rxinfo.slr_rx = softmac_dedicated_rx; in softmac_drv_open()
555 sup->su_direct_rxinfo.slr_arg = sup; in softmac_drv_open()
556 sup->su_direct_rxinfo.slr_rx = softmac_dedicated_rx; in softmac_drv_open()
558 if ((err = dld_str_open(rq, devp, sup)) != 0) { in softmac_drv_open()
559 freeb(sup->su_tx_flow_mp); in softmac_drv_open()
560 sup->su_tx_flow_mp = NULL; in softmac_drv_open()
567 if (sup != NULL) in softmac_drv_open()
568 kmem_cache_free(softmac_upper_cachep, sup); in softmac_drv_open()
577 softmac_upper_t *sup = dld_str_private(rq); in softmac_drv_close() local
578 softmac_t *softmac = sup->su_softmac; in softmac_drv_close()
584 ASSERT(sup->su_tx_inprocess == 0); in softmac_drv_close()
589 mutex_enter(&sup->su_disp_mutex); in softmac_drv_close()
590 sup->su_closing = B_TRUE; in softmac_drv_close()
591 while (sup->su_dlpi_pending) in softmac_drv_close()
592 cv_wait(&sup->su_disp_cv, &sup->su_disp_mutex); in softmac_drv_close()
593 mutex_exit(&sup->su_disp_mutex); in softmac_drv_close()
595 softmac_upperstream_close(sup); in softmac_drv_close()
597 if (sup->su_tx_flow_mp != NULL) { in softmac_drv_close()
598 freeb(sup->su_tx_flow_mp); in softmac_drv_close()
599 sup->su_tx_flow_mp = NULL; in softmac_drv_close()
602 if (sup->su_active) { in softmac_drv_close()
606 sup->su_active = B_FALSE; in softmac_drv_close()
609 sup->su_bound = B_FALSE; in softmac_drv_close()
610 sup->su_softmac = NULL; in softmac_drv_close()
611 sup->su_closing = B_FALSE; in softmac_drv_close()
613 kmem_cache_free(softmac_upper_cachep, sup); in softmac_drv_close()
622 softmac_upper_t *sup = dld_str_private(wq); in softmac_drv_wput() local
629 softmac_wput_data(sup, mp); in softmac_drv_wput()
641 softmac_wput_data(sup, mp); in softmac_drv_wput()
645 softmac_wput_nondata(sup, mp); in softmac_drv_wput()
648 softmac_wput_nondata(sup, mp); in softmac_drv_wput()
657 softmac_upper_t *sup = dld_str_private(wq); in softmac_drv_wsrv() local
661 mutex_enter(&sup->su_mutex); in softmac_drv_wsrv()
662 if (sup->su_mode != SOFTMAC_FASTPATH) { in softmac_drv_wsrv()
666 sup->su_tx_inprocess++; in softmac_drv_wsrv()
667 mutex_exit(&sup->su_mutex); in softmac_drv_wsrv()
669 mutex_enter(&sup->su_mutex); in softmac_drv_wsrv()
670 if (--sup->su_tx_inprocess == 0) in softmac_drv_wsrv()
671 cv_signal(&sup->su_cv); in softmac_drv_wsrv()
672 } else if (sup->su_tx_busy && SOFTMAC_CANPUTNEXT(sup->su_slp->sl_wq)) { in softmac_drv_wsrv()
680 if (sup->su_tx_notify_func != NULL) { in softmac_drv_wsrv()
681 sup->su_tx_inprocess++; in softmac_drv_wsrv()
682 mutex_exit(&sup->su_mutex); in softmac_drv_wsrv()
683 sup->su_tx_notify_func(sup->su_tx_notify_arg, in softmac_drv_wsrv()
684 (mac_tx_cookie_t)sup); in softmac_drv_wsrv()
685 mutex_enter(&sup->su_mutex); in softmac_drv_wsrv()
686 if (--sup->su_tx_inprocess == 0) in softmac_drv_wsrv()
687 cv_signal(&sup->su_cv); in softmac_drv_wsrv()
689 ASSERT(sup->su_tx_flow_mp == NULL); in softmac_drv_wsrv()
690 VERIFY((sup->su_tx_flow_mp = getq(wq)) != NULL); in softmac_drv_wsrv()
691 sup->su_tx_busy = B_FALSE; in softmac_drv_wsrv()
693 mutex_exit(&sup->su_mutex); in softmac_drv_wsrv()