Lines Matching refs:id
54 DWTAP_PRINTF("[%d] freeing m=%p\n", p->id, p->m);
104 new_wtap(struct wtap_hal *hal, int32_t id)
174 uint8_t const *macaddr = mac_pool[id];
175 if(hal->hal_devs[id] != NULL){
176 printf("error, wtap_id=%d already created\n", id);
180 hal->hal_devs[id] = (struct wtap_softc *)malloc(
182 bzero(hal->hal_devs[id], sizeof(struct wtap_softc));
183 hal->hal_devs[id]->sc_md = hal->hal_md;
184 hal->hal_devs[id]->id = id;
185 mtx_init(&hal->hal_devs[id]->sc_mtx, "wtap_softc mtx", NULL,
188 if(wtap_attach(hal->hal_devs[id], macaddr)){
197 free_wtap(struct wtap_hal *hal, int32_t id)
201 if(hal->hal_devs[id] == NULL){
202 printf("error, wtap_id=%d never created\n", id);
206 if(wtap_detach(hal->hal_devs[id]))
208 mtx_destroy(&hal->hal_devs[id]->sc_mtx);
209 free(hal->hal_devs[id], M_WTAP);
210 hal->hal_devs[id] = NULL;