FreeBSD/sys/dev/ixl/if_ixlv.c
/*
** This routine is run via an vlan config EVENT,
** it enables us to use the HW Filter table since
** we can get the vlan id. This just creates the
** entry in the soft version of the VFTA, init will
** repopulate the real table.
*/
This routine is run via an vlan config EVENT,
it enables us to use the HW Filter table since
we can get the vlan id. This just creates the
entry in the soft version of the VFTA, init will
repopulate the real table.
This routine is run via an vlan config EVENT it enables us to use the HW Filter table since we can get the vlan id . This just creates the entry in the soft version of the VFTA init will repopulate the real table .
static void
ixlv_register_vlan(void *arg, struct ifnet *ifp, u16 vtag)
{
	struct ixl_vsi		*vsi = arg;
	struct ixlv_sc		*sc = vsi->back;
	struct ixlv_vlan_filter	*v;
	if (ifp->if_softc != arg)   
		return;
	if ((vtag == 0) || (vtag > 4095))	
		return;
	SLIST_FOREACH(v, sc->vlan_filters, next) {
		if (v->vlan == vtag)
			return;
	}
	mtx_lock(&sc->mtx);
	++vsi->num_vlans;
	v = malloc(sizeof(struct ixlv_vlan_filter), M_DEVBUF, M_NOWAIT | M_ZERO);
	SLIST_INSERT_HEAD(sc->vlan_filters, v, next);
	v->vlan = vtag;
	v->flags = IXL_FILTER_ADD;
	ixl_vc_enqueue(&sc->vc_mgr, &sc->add_vlan_cmd,
	    IXLV_FLAG_AQ_ADD_VLAN_FILTER, ixl_init_cmd_complete, sc);
	mtx_unlock(&sc->mtx);
	return;
}
static void ixlv_register_vlan ( void * arg , struct ifnet * ifp , u16 vtag ) { struct ixl_vsi * vsi = arg ; struct ixlv_sc * sc = vsi -> back ; struct ixlv_vlan_filter * v ; if ( ifp -> if_softc != arg ) return ; if ( ( vtag == 0 ) || ( vtag > 4095 ) ) return ; SLIST_FOREACH ( v , sc -> vlan_filters , next ) { if ( v -> vlan == vtag ) return ; } mtx_lock ( & sc -> mtx ) ; ++ vsi -> num_vlans ; v = malloc ( sizeof ( struct ixlv_vlan_filter ) , M_DEVBUF , M_NOWAIT | M_ZERO ) ; SLIST_INSERT_HEAD ( sc -> vlan_filters , v , next ) ; v -> vlan = vtag ; v -> flags = IXL_FILTER_ADD ; ixl_vc_enqueue ( & sc -> vc_mgr , & sc -> add_vlan_cmd , IXLV_FLAG_AQ_ADD_VLAN_FILTER , ixl_init_cmd_complete , sc ) ; mtx_unlock ( & sc -> mtx ) ; return ; }
This routine is run via an vlan config EVENT,
it enables us to use the HW Filter table since
we can get the vlan id.
This routine is run via an vlan config EVENT it enables us to use the HW Filter table since we can get the vlan id .
/* Not our event */ /* Invalid */ /* Sanity check - make sure it doesn't already exist */