MCPcopy Create free account
hub / github.com/F-Stack/f-stack / iflib_vlan_register

Function iflib_vlan_register

freebsd/net/iflib.c:4427–4450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4425 **********************************************************************/
4426
4427static void
4428iflib_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
4452static void
4453iflib_vlan_unregister(void *arg, if_t ifp, uint16_t vtag)

Callers

nothing calls this directly

Calls 4

if_getsoftcFunction · 0.85
iflib_in_detachFunction · 0.85
iflib_stopFunction · 0.85
iflib_init_lockedFunction · 0.85

Tested by

no test coverage detected