Lines Matching refs:vid
46 u16 vid; member
68 unsigned int vid) in ocelot_mact_select() argument
75 mach |= vid << 16; in ocelot_mact_select()
90 unsigned int vid, in ocelot_mact_learn() argument
93 ocelot_mact_select(ocelot, mac, vid); in ocelot_mact_learn()
107 unsigned int vid) in ocelot_mact_forget() argument
109 ocelot_mact_select(ocelot, mac, vid); in ocelot_mact_forget()
159 static int ocelot_vlant_set_mask(struct ocelot *ocelot, u16 vid, u32 mask) in ocelot_vlant_set_mask() argument
162 ocelot_write(ocelot, ANA_TABLES_VLANTIDX_V_INDEX(vid), in ocelot_vlant_set_mask()
208 if (port->vlan_aware && !port->vid) in ocelot_vlan_port_apply()
221 if (port->vid) in ocelot_vlan_port_apply()
235 REW_PORT_VLAN_CFG_PORT_VID(port->vid); in ocelot_vlan_port_apply()
242 static int ocelot_vlan_vid_add(struct net_device *dev, u16 vid, bool pvid, in ocelot_vlan_vid_add() argument
250 ocelot_mact_learn(ocelot, PGID_CPU, dev->dev_addr, vid, in ocelot_vlan_vid_add()
254 ocelot->vlan_mask[vid] |= BIT(port->chip_port); in ocelot_vlan_vid_add()
255 ret = ocelot_vlant_set_mask(ocelot, vid, ocelot->vlan_mask[vid]); in ocelot_vlan_vid_add()
261 port->pvid = vid; in ocelot_vlan_vid_add()
264 if (untagged && port->vid != vid) { in ocelot_vlan_vid_add()
265 if (port->vid) { in ocelot_vlan_vid_add()
268 port->vid); in ocelot_vlan_vid_add()
271 port->vid = vid; in ocelot_vlan_vid_add()
279 static int ocelot_vlan_vid_del(struct net_device *dev, u16 vid) in ocelot_vlan_vid_del() argument
289 if (vid == 0) in ocelot_vlan_vid_del()
293 ocelot_mact_forget(ocelot, dev->dev_addr, vid); in ocelot_vlan_vid_del()
296 ocelot->vlan_mask[vid] &= ~BIT(port->chip_port); in ocelot_vlan_vid_del()
297 ret = ocelot_vlant_set_mask(ocelot, vid, ocelot->vlan_mask[vid]); in ocelot_vlan_vid_del()
302 if (port->pvid == vid) in ocelot_vlan_vid_del()
306 if (port->vid == vid) in ocelot_vlan_vid_del()
307 port->vid = 0; in ocelot_vlan_vid_del()
316 u16 port, vid; in ocelot_vlan_init() local
324 for (vid = 1; vid < VLAN_N_VID; vid++) { in ocelot_vlan_init()
325 ocelot->vlan_mask[vid] = 0; in ocelot_vlan_init()
326 ocelot_vlant_set_mask(ocelot, vid, ocelot->vlan_mask[vid]); in ocelot_vlan_init()
552 ifh[3] = (info->tag_type << 16) | info->vid; in ocelot_gen_ifh()
577 info.vid = skb_vlan_tag_get(skb); in ocelot_port_xmit()
770 u16 vid, u16 flags, in ocelot_fdb_add() argument
776 if (!vid) { in ocelot_fdb_add()
782 vid = port->pvid; in ocelot_fdb_add()
790 return ocelot_mact_learn(ocelot, port->chip_port, addr, vid, in ocelot_fdb_add()
796 const unsigned char *addr, u16 vid) in ocelot_fdb_del() argument
801 return ocelot_mact_forget(ocelot, addr, vid); in ocelot_fdb_del()
839 if (entry->vid && nla_put_u16(dump->skb, NDA_VLAN, entry->vid)) in ocelot_fdb_do_dump()
895 entry->vid = (mach >> 16) & 0xfff; in ocelot_mact_read()
942 u16 vid) in ocelot_vlan_rx_add_vid() argument
944 return ocelot_vlan_vid_add(dev, vid, false, false); in ocelot_vlan_rx_add_vid()
948 u16 vid) in ocelot_vlan_rx_kill_vid() argument
950 return ocelot_vlan_vid_del(dev, vid); in ocelot_vlan_rx_kill_vid()
1339 u16 vid; in ocelot_port_obj_add_vlan() local
1341 for (vid = vlan->vid_begin; vid <= vlan->vid_end; vid++) { in ocelot_port_obj_add_vlan()
1342 ret = ocelot_vlan_vid_add(dev, vid, in ocelot_port_obj_add_vlan()
1356 u16 vid; in ocelot_port_vlan_del_vlan() local
1358 for (vid = vlan->vid_begin; vid <= vlan->vid_end; vid++) { in ocelot_port_vlan_del_vlan()
1359 ret = ocelot_vlan_vid_del(dev, vid); in ocelot_port_vlan_del_vlan()
1370 u16 vid) in ocelot_multicast_get() argument
1375 if (ether_addr_equal(mc->addr, addr) && mc->vid == vid) in ocelot_multicast_get()
1390 u16 vid = mdb->vid; in ocelot_port_obj_add_mdb() local
1393 if (!vid) in ocelot_port_obj_add_mdb()
1394 vid = port->pvid; in ocelot_port_obj_add_mdb()
1396 mc = ocelot_multicast_get(ocelot, mdb->addr, vid); in ocelot_port_obj_add_mdb()
1403 mc->vid = vid; in ocelot_port_obj_add_mdb()
1415 ocelot_mact_forget(ocelot, addr, vid); in ocelot_port_obj_add_mdb()
1422 return ocelot_mact_learn(ocelot, 0, addr, vid, ENTRYTYPE_MACv4); in ocelot_port_obj_add_mdb()
1432 u16 vid = mdb->vid; in ocelot_port_obj_del_mdb() local
1434 if (!vid) in ocelot_port_obj_del_mdb()
1435 vid = port->pvid; in ocelot_port_obj_del_mdb()
1437 mc = ocelot_multicast_get(ocelot, mdb->addr, vid); in ocelot_port_obj_del_mdb()
1445 ocelot_mact_forget(ocelot, addr, vid); in ocelot_port_obj_del_mdb()
1457 return ocelot_mact_learn(ocelot, 0, addr, vid, ENTRYTYPE_MACv4); in ocelot_port_obj_del_mdb()
1536 ocelot_port->vid = 0; in ocelot_port_bridge_leave()