Lines Matching full:vid

17 	u16 vid;  member
39 unsigned int vid) in ocelot_mact_select() argument
46 mach |= vid << 16; in ocelot_mact_select()
61 unsigned int vid, enum macaccess_entry_type type) in ocelot_mact_learn() argument
63 ocelot_mact_select(ocelot, mac, vid); in ocelot_mact_learn()
77 const unsigned char mac[ETH_ALEN], unsigned int vid) in ocelot_mact_forget() argument
79 ocelot_mact_select(ocelot, mac, vid); in ocelot_mact_forget()
137 static int ocelot_vlant_set_mask(struct ocelot *ocelot, u16 vid, u32 mask) in ocelot_vlant_set_mask() argument
139 /* Select the VID to configure */ in ocelot_vlant_set_mask()
140 ocelot_write(ocelot, ANA_TABLES_VLANTIDX_V_INDEX(vid), in ocelot_vlant_set_mask()
151 u16 vid) in ocelot_port_set_native_vlan() argument
156 if (ocelot_port->vid != vid) { in ocelot_port_set_native_vlan()
157 /* Always permit deleting the native VLAN (vid = 0) */ in ocelot_port_set_native_vlan()
158 if (ocelot_port->vid && vid) { in ocelot_port_set_native_vlan()
161 ocelot_port->vid); in ocelot_port_set_native_vlan()
164 ocelot_port->vid = vid; in ocelot_port_set_native_vlan()
167 ocelot_rmw_gix(ocelot, REW_PORT_VLAN_CFG_PORT_VID(vid), in ocelot_port_set_native_vlan()
171 if (ocelot_port->vlan_aware && !ocelot_port->vid) in ocelot_port_set_native_vlan()
185 if (ocelot_port->vid) in ocelot_port_set_native_vlan()
186 /* Tag all frames except when VID == DEFAULT_VLAN */ in ocelot_port_set_native_vlan()
236 ocelot_port_set_native_vlan(ocelot, port, ocelot_port->vid); in ocelot_port_vlan_filtering()
255 int ocelot_vlan_add(struct ocelot *ocelot, int port, u16 vid, bool pvid, in ocelot_vlan_add() argument
261 ocelot->vlan_mask[vid] |= BIT(port); in ocelot_vlan_add()
262 ret = ocelot_vlant_set_mask(ocelot, vid, ocelot->vlan_mask[vid]); in ocelot_vlan_add()
268 ocelot_port_set_pvid(ocelot, port, vid); in ocelot_vlan_add()
272 ret = ocelot_port_set_native_vlan(ocelot, port, vid); in ocelot_vlan_add()
281 int ocelot_vlan_del(struct ocelot *ocelot, int port, u16 vid) in ocelot_vlan_del() argument
287 ocelot->vlan_mask[vid] &= ~BIT(port); in ocelot_vlan_del()
288 ret = ocelot_vlant_set_mask(ocelot, vid, ocelot->vlan_mask[vid]); in ocelot_vlan_del()
293 if (ocelot_port->pvid == vid) in ocelot_vlan_del()
297 if (ocelot_port->vid == vid) in ocelot_vlan_del()
306 u16 port, vid; in ocelot_vlan_init() local
314 for (vid = 1; vid < VLAN_N_VID; vid++) { in ocelot_vlan_init()
315 ocelot->vlan_mask[vid] = 0; in ocelot_vlan_init()
316 ocelot_vlant_set_mask(ocelot, vid, ocelot->vlan_mask[vid]); in ocelot_vlan_init()
319 /* Because VLAN filtering is enabled, we need VID 0 to get untagged in ocelot_vlan_init()
543 const unsigned char *addr, u16 vid) in ocelot_fdb_add() argument
551 if (!vid) { in ocelot_fdb_add()
553 /* If the bridge is not VLAN aware and no VID was in ocelot_fdb_add()
557 vid = ocelot_port->pvid; in ocelot_fdb_add()
559 /* If the bridge is VLAN aware a VID must be provided as in ocelot_fdb_add()
565 return ocelot_mact_learn(ocelot, pgid, addr, vid, ENTRYTYPE_LOCKED); in ocelot_fdb_add()
570 const unsigned char *addr, u16 vid) in ocelot_fdb_del() argument
572 return ocelot_mact_forget(ocelot, addr, vid); in ocelot_fdb_del()
576 int ocelot_port_fdb_do_dump(const unsigned char *addr, u16 vid, in ocelot_port_fdb_do_dump() argument
605 if (vid && nla_put_u16(dump->skb, NDA_VLAN, vid)) in ocelot_port_fdb_do_dump()
661 entry->vid = (mach >> 16) & 0xfff; in ocelot_mact_read()
690 ret = cb(entry.mac, entry.vid, is_static, data); in ocelot_fdb_dump()
943 u16 vid) in ocelot_multicast_get() argument
948 if (ether_addr_equal(mc->addr, addr) && mc->vid == vid) in ocelot_multicast_get()
1019 u16 vid = mdb->vid; in ocelot_port_mdb_add() local
1025 if (!vid) in ocelot_port_mdb_add()
1026 vid = ocelot_port->pvid; in ocelot_port_mdb_add()
1030 mc = ocelot_multicast_get(ocelot, mdb->addr, vid); in ocelot_port_mdb_add()
1036 "No more PGIDs available for mdb %pM vid %d\n", in ocelot_port_mdb_add()
1037 mdb->addr, vid); in ocelot_port_mdb_add()
1046 mc->vid = vid; in ocelot_port_mdb_add()
1055 ocelot_mact_forget(ocelot, addr, vid); in ocelot_port_mdb_add()
1061 return ocelot_mact_learn(ocelot, mc->pgid, addr, vid, entry_type); in ocelot_port_mdb_add()
1072 u16 vid = mdb->vid; in ocelot_port_mdb_del() local
1077 if (!vid) in ocelot_port_mdb_del()
1078 vid = ocelot_port->pvid; in ocelot_port_mdb_del()
1080 mc = ocelot_multicast_get(ocelot, mdb->addr, vid); in ocelot_port_mdb_del()
1087 ocelot_mact_forget(ocelot, addr, vid); in ocelot_port_mdb_del()
1098 return ocelot_mact_learn(ocelot, mc->pgid, addr, vid, entry_type); in ocelot_port_mdb_del()