Lines Matching refs:emac

22 	struct prueth_emac *emac;  member
26 static int prueth_switchdev_stp_state_set(struct prueth_emac *emac, in prueth_switchdev_stp_state_set() argument
47 icssg_set_port_state(emac, emac_state); in prueth_switchdev_stp_state_set()
48 netdev_dbg(emac->ndev, "STP state: %u\n", emac_state); in prueth_switchdev_stp_state_set()
53 static int prueth_switchdev_attr_br_flags_set(struct prueth_emac *emac, in prueth_switchdev_attr_br_flags_set() argument
64 netdev_dbg(emac->ndev, "BR_MCAST_FLOOD: %d port %u\n", in prueth_switchdev_attr_br_flags_set()
65 emac_state, emac->port_id); in prueth_switchdev_attr_br_flags_set()
67 icssg_set_port_state(emac, emac_state); in prueth_switchdev_attr_br_flags_set()
85 struct prueth_emac *emac = netdev_priv(ndev); in prueth_switchdev_attr_set() local
88 netdev_dbg(ndev, "attr: id %u port: %u\n", attr->id, emac->port_id); in prueth_switchdev_attr_set()
96 ret = prueth_switchdev_stp_state_set(emac, in prueth_switchdev_attr_set()
101 ret = prueth_switchdev_attr_br_flags_set(emac, attr->orig_dev, in prueth_switchdev_attr_set()
129 struct prueth_emac *emac = switchdev_work->emac; in prueth_switchdev_event_work() local
131 int port_id = emac->port_id; in prueth_switchdev_event_work()
139 netdev_dbg(emac->ndev, "prueth_fdb_add: MACID = %pM vid = %u flags = %u %u -- port %d\n", in prueth_switchdev_event_work()
145 if (!ether_addr_equal(emac->mac_addr, fdb->addr)) in prueth_switchdev_event_work()
148 ret = icssg_fdb_add_del(emac, fdb->addr, fdb->vid, in prueth_switchdev_event_work()
151 prueth_switchdev_fdb_offload_notify(emac->ndev, fdb); in prueth_switchdev_event_work()
156 netdev_dbg(emac->ndev, "prueth_fdb_del: MACID = %pM vid = %u flags = %u %u -- port %d\n", in prueth_switchdev_event_work()
162 if (!ether_addr_equal(emac->mac_addr, fdb->addr)) in prueth_switchdev_event_work()
164 icssg_fdb_add_del(emac, fdb->addr, fdb->vid, in prueth_switchdev_event_work()
174 dev_put(emac->ndev); in prueth_switchdev_event_work()
183 struct prueth_emac *emac = netdev_priv(ndev); in prueth_switchdev_event() local
201 switchdev_work->emac = emac; in prueth_switchdev_event()
230 static int prueth_switchdev_vlan_add(struct prueth_emac *emac, bool untag, bool pvid, in prueth_switchdev_vlan_add() argument
241 port_mask = BIT(emac->port_id); in prueth_switchdev_vlan_add()
246 icssg_vtbl_modify(emac, vid, port_mask, untag_mask, true); in prueth_switchdev_vlan_add()
248 netdev_dbg(emac->ndev, "VID add vid:%u port_mask:%X untag_mask %X PVID %d\n", in prueth_switchdev_vlan_add()
254 icssg_set_pvid(emac->prueth, vid, emac->port_id); in prueth_switchdev_vlan_add()
259 static int prueth_switchdev_vlan_del(struct prueth_emac *emac, u16 vid, in prueth_switchdev_vlan_del() argument
269 port_mask = BIT(emac->port_id); in prueth_switchdev_vlan_del()
271 icssg_vtbl_modify(emac, vid, port_mask, 0, false); in prueth_switchdev_vlan_del()
274 icssg_fdb_add_del(emac, emac->mac_addr, vid, in prueth_switchdev_vlan_del()
277 if (vid == icssg_get_pvid(emac)) in prueth_switchdev_vlan_del()
278 icssg_set_pvid(emac->prueth, 0, emac->port_id); in prueth_switchdev_vlan_del()
280 netdev_dbg(emac->ndev, "VID del vid:%u port_mask:%X\n", in prueth_switchdev_vlan_del()
286 static int prueth_switchdev_vlans_add(struct prueth_emac *emac, in prueth_switchdev_vlans_add() argument
294 netdev_dbg(emac->ndev, "VID add vid:%u flags:%X\n", in prueth_switchdev_vlans_add()
303 return prueth_switchdev_vlan_add(emac, untag, pvid, vlan->vid, in prueth_switchdev_vlans_add()
307 static int prueth_switchdev_vlans_del(struct prueth_emac *emac, in prueth_switchdev_vlans_del() argument
313 return prueth_switchdev_vlan_del(emac, vlan->vid, in prueth_switchdev_vlans_del()
317 static int prueth_switchdev_mdb_add(struct prueth_emac *emac, in prueth_switchdev_mdb_add() argument
330 port_mask = BIT(emac->port_id); in prueth_switchdev_mdb_add()
332 fid_c2 = icssg_fdb_lookup(emac, mdb->addr, mdb->vid); in prueth_switchdev_mdb_add()
334 err = icssg_fdb_add_del(emac, mdb->addr, mdb->vid, fid_c2 | port_mask, true); in prueth_switchdev_mdb_add()
335 netdev_dbg(emac->ndev, "MDB add vid %u:%pM ports: %X\n", in prueth_switchdev_mdb_add()
341 static int prueth_switchdev_mdb_del(struct prueth_emac *emac, in prueth_switchdev_mdb_del() argument
353 del_mask = BIT(emac->port_id); in prueth_switchdev_mdb_del()
355 fid_c2 = icssg_fdb_lookup(emac, mdb->addr, mdb->vid); in prueth_switchdev_mdb_del()
358 ret = icssg_fdb_add_del(emac, mdb->addr, mdb->vid, fid_c2 & ~del_mask, true); in prueth_switchdev_mdb_del()
360 ret = icssg_fdb_add_del(emac, mdb->addr, mdb->vid, 0, false); in prueth_switchdev_mdb_del()
362 netdev_dbg(emac->ndev, "MDB del vid %u:%pM ports: %X\n", in prueth_switchdev_mdb_del()
374 struct prueth_emac *emac = netdev_priv(ndev); in prueth_switchdev_obj_add() local
377 netdev_dbg(ndev, "obj_add: id %u port: %u\n", obj->id, emac->port_id); in prueth_switchdev_obj_add()
381 err = prueth_switchdev_vlans_add(emac, vlan); in prueth_switchdev_obj_add()
385 err = prueth_switchdev_mdb_add(emac, mdb); in prueth_switchdev_obj_add()
400 struct prueth_emac *emac = netdev_priv(ndev); in prueth_switchdev_obj_del() local
403 netdev_dbg(ndev, "obj_del: id %u port: %u\n", obj->id, emac->port_id); in prueth_switchdev_obj_del()
407 err = prueth_switchdev_vlans_del(emac, vlan); in prueth_switchdev_obj_del()
411 err = prueth_switchdev_mdb_del(emac, mdb); in prueth_switchdev_obj_del()