| 4425 | **********************************************************************/ |
| 4426 | |
| 4427 | static void |
| 4428 | iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag) |
| 4429 | { |
| 4430 | if_ctx_t ctx = if_getsoftc(ifp); |
| 4431 | |
| 4432 | if ((void *)ctx != arg) |
| 4433 | return; |
| 4434 | |
| 4435 | if ((vtag == 0) || (vtag > 4095)) |
| 4436 | return; |
| 4437 | |
| 4438 | if (iflib_in_detach(ctx)) |
| 4439 | return; |
| 4440 | |
| 4441 | CTX_LOCK(ctx); |
| 4442 | /* Driver may need all untagged packets to be flushed */ |
| 4443 | if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) |
| 4444 | iflib_stop(ctx); |
| 4445 | IFDI_VLAN_REGISTER(ctx, vtag); |
| 4446 | /* Re-init to load the changes, if required */ |
| 4447 | if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) |
| 4448 | iflib_init_locked(ctx); |
| 4449 | CTX_UNLOCK(ctx); |
| 4450 | } |
| 4451 | |
| 4452 | static void |
| 4453 | iflib_vlan_unregister(void *arg, if_t ifp, uint16_t vtag) |
nothing calls this directly
no test coverage detected