| 219 | } |
| 220 | |
| 221 | static void |
| 222 | iflib_clone_destroy(if_t ifp) |
| 223 | { |
| 224 | if_ctx_t ctx; |
| 225 | device_t dev; |
| 226 | struct sx *ctx_lock; |
| 227 | int rc; |
| 228 | |
| 229 | /* |
| 230 | * Detach device / free / free unit |
| 231 | */ |
| 232 | ctx = if_getsoftc(ifp); |
| 233 | dev = iflib_get_dev(ctx); |
| 234 | ctx_lock = iflib_ctx_lock_get(ctx); |
| 235 | sx_xlock(ctx_lock); |
| 236 | iflib_set_detach(ctx); |
| 237 | iflib_stop(ctx); |
| 238 | sx_xunlock(ctx_lock); |
| 239 | |
| 240 | mtx_lock(&Giant); |
| 241 | rc = device_delete_child(iflib_pseudodev, dev); |
| 242 | mtx_unlock(&Giant); |
| 243 | if (rc == 0) |
| 244 | iflib_pseudo_deregister(ctx); |
| 245 | } |
| 246 | |
| 247 | if_pseudo_t |
| 248 | iflib_clone_register(if_shared_ctx_t sctx) |
nothing calls this directly
no test coverage detected