Lines Matching refs:hal

40 	struct wtap_hal *hal = (struct wtap_hal *)arg;  in hal_tx_proc()  local
47 hal = (struct wtap_hal *)arg; in hal_tx_proc()
49 p = medium_get_next_packet(hal->hal_md); in hal_tx_proc()
53 hal->plugin->work(hal->plugin, p); in hal_tx_proc()
64 init_hal(struct wtap_hal *hal) in init_hal() argument
68 mtx_init(&hal->hal_mtx, "wtap_hal mtx", NULL, MTX_DEF | MTX_RECURSE); in init_hal()
70 hal->hal_md = (struct wtap_medium *)malloc(sizeof(struct wtap_medium), in init_hal()
72 bzero(hal->hal_md, sizeof(struct wtap_medium)); in init_hal()
74 init_medium(hal->hal_md); in init_hal()
76 TASK_INIT(&hal->hal_md->tx_handler->proc, 0, hal_tx_proc, hal); in init_hal()
80 register_plugin(struct wtap_hal *hal, struct wtap_plugin *plugin) in register_plugin() argument
84 hal->plugin = plugin; in register_plugin()
88 deregister_plugin(struct wtap_hal *hal) in deregister_plugin() argument
91 hal->plugin->deinit(hal->plugin); in deregister_plugin()
92 hal->plugin = NULL; /* catch illegal usages */ in deregister_plugin()
96 deinit_hal(struct wtap_hal *hal) in deinit_hal() argument
100 deinit_medium(hal->hal_md); in deinit_hal()
101 free(hal->hal_md, M_WTAP); in deinit_hal()
102 mtx_destroy(&hal->hal_mtx); in deinit_hal()
106 new_wtap(struct wtap_hal *hal, int32_t id) in new_wtap() argument
177 if(hal->hal_devs[id] != NULL){ in new_wtap()
182 hal->hal_devs[id] = (struct wtap_softc *)malloc( in new_wtap()
184 bzero(hal->hal_devs[id], sizeof(struct wtap_softc)); in new_wtap()
185 hal->hal_devs[id]->sc_md = hal->hal_md; in new_wtap()
186 hal->hal_devs[id]->id = id; in new_wtap()
187 snprintf(hal->hal_devs[id]->name, sizeof(hal->hal_devs[id]->name), in new_wtap()
189 mtx_init(&hal->hal_devs[id]->sc_mtx, "wtap_softc mtx", NULL, in new_wtap()
192 if(wtap_attach(hal->hal_devs[id], macaddr)){ in new_wtap()
201 free_wtap(struct wtap_hal *hal, int32_t id) in free_wtap() argument
205 if(hal->hal_devs[id] == NULL){ in free_wtap()
210 if(wtap_detach(hal->hal_devs[id])) in free_wtap()
212 mtx_destroy(&hal->hal_devs[id]->sc_mtx); in free_wtap()
213 free(hal->hal_devs[id], M_WTAP); in free_wtap()
214 hal->hal_devs[id] = NULL; in free_wtap()