| 5152 | } |
| 5153 | |
| 5154 | int |
| 5155 | iflib_pseudo_deregister(if_ctx_t ctx) |
| 5156 | { |
| 5157 | if_t ifp = ctx->ifc_ifp; |
| 5158 | if_shared_ctx_t sctx = ctx->ifc_sctx; |
| 5159 | |
| 5160 | /* Unregister VLAN event handlers early */ |
| 5161 | iflib_unregister_vlan_handlers(ctx); |
| 5162 | |
| 5163 | if ((sctx->isc_flags & IFLIB_PSEUDO) && |
| 5164 | (sctx->isc_flags & IFLIB_PSEUDO_ETHER) == 0) { |
| 5165 | bpfdetach(ifp); |
| 5166 | if_detach(ifp); |
| 5167 | } else { |
| 5168 | ether_ifdetach(ifp); |
| 5169 | } |
| 5170 | |
| 5171 | iflib_tqg_detach(ctx); |
| 5172 | iflib_tx_structures_free(ctx); |
| 5173 | iflib_rx_structures_free(ctx); |
| 5174 | |
| 5175 | iflib_deregister(ctx); |
| 5176 | |
| 5177 | if (ctx->ifc_flags & IFC_SC_ALLOCATED) |
| 5178 | free(ctx->ifc_softc, M_IFLIB); |
| 5179 | free(ctx, M_IFLIB); |
| 5180 | return (0); |
| 5181 | } |
| 5182 | |
| 5183 | int |
| 5184 | iflib_device_attach(device_t dev) |
no test coverage detected