Lines Matching full:md
35 init_medium(struct wtap_medium *md) in init_medium() argument
39 STAILQ_INIT(&md->md_pktbuf); in init_medium()
40 mtx_init(&md->md_mtx, "wtap_medium mtx", NULL, MTX_DEF | MTX_RECURSE); in init_medium()
48 md->tx_handler = eh; in init_medium()
50 md->open = 0; in init_medium()
54 deinit_medium(struct wtap_medium *md) in deinit_medium() argument
58 taskqueue_free(md->tx_handler->tq); in deinit_medium()
59 free(md->tx_handler, M_WTAP); in deinit_medium()
63 medium_transmit(struct wtap_medium *md, int id, struct mbuf*m) in medium_transmit() argument
66 mtx_lock(&md->md_mtx); in medium_transmit()
67 if (md->open == 0){ in medium_transmit()
70 mtx_unlock(&md->md_mtx); in medium_transmit()
80 STAILQ_INSERT_TAIL(&md->md_pktbuf, p, pf_list); in medium_transmit()
81 taskqueue_enqueue(md->tx_handler->tq, &md->tx_handler->proc); in medium_transmit()
82 mtx_unlock(&md->md_mtx); in medium_transmit()
88 medium_get_next_packet(struct wtap_medium *md) in medium_get_next_packet() argument
92 mtx_lock(&md->md_mtx); in medium_get_next_packet()
93 p = STAILQ_FIRST(&md->md_pktbuf); in medium_get_next_packet()
95 mtx_unlock(&md->md_mtx); in medium_get_next_packet()
99 STAILQ_REMOVE_HEAD(&md->md_pktbuf, pf_list); in medium_get_next_packet()
100 mtx_unlock(&md->md_mtx); in medium_get_next_packet()
105 medium_open(struct wtap_medium *md) in medium_open() argument
108 mtx_lock(&md->md_mtx); in medium_open()
109 md->open = 1; in medium_open()
110 mtx_unlock(&md->md_mtx); in medium_open()
114 medium_close(struct wtap_medium *md) in medium_close() argument
117 mtx_lock(&md->md_mtx); in medium_close()
118 md->open = 0; in medium_close()
119 mtx_unlock(&md->md_mtx); in medium_close()