Lines Matching full:ocelot
2 /* Microsemi Ocelot Switch driver
12 #include "ocelot.h"
18 static int ocelot_mrp_find_partner_port(struct ocelot *ocelot, in ocelot_mrp_find_partner_port() argument
23 for (i = 0; i < ocelot->num_phys_ports; ++i) { in ocelot_mrp_find_partner_port()
24 struct ocelot_port *ocelot_port = ocelot->ports[i]; in ocelot_mrp_find_partner_port()
36 static int ocelot_mrp_del_vcap(struct ocelot *ocelot, int id) in ocelot_mrp_del_vcap() argument
41 block_vcap_is2 = &ocelot->block[VCAP_IS2]; in ocelot_mrp_del_vcap()
47 return ocelot_vcap_filter_del(ocelot, filter); in ocelot_mrp_del_vcap()
50 static int ocelot_mrp_redirect_add_vcap(struct ocelot *ocelot, int src_port, in ocelot_mrp_redirect_add_vcap() argument
63 filter->id.cookie = OCELOT_VCAP_IS2_MRP_REDIRECT(ocelot, src_port); in ocelot_mrp_redirect_add_vcap()
73 err = ocelot_vcap_filter_add(ocelot, filter, NULL); in ocelot_mrp_redirect_add_vcap()
91 static int ocelot_mrp_trap_add(struct ocelot *ocelot, int port) in ocelot_mrp_trap_add() argument
93 unsigned long cookie = OCELOT_VCAP_IS2_MRP_TRAP(ocelot); in ocelot_mrp_trap_add()
95 return ocelot_trap_add(ocelot, port, cookie, false, in ocelot_mrp_trap_add()
99 static int ocelot_mrp_trap_del(struct ocelot *ocelot, int port) in ocelot_mrp_trap_del() argument
101 unsigned long cookie = OCELOT_VCAP_IS2_MRP_TRAP(ocelot); in ocelot_mrp_trap_del()
103 return ocelot_trap_del(ocelot, port, cookie); in ocelot_mrp_trap_del()
106 static void ocelot_mrp_save_mac(struct ocelot *ocelot, in ocelot_mrp_save_mac() argument
109 ocelot_mact_learn(ocelot, PGID_BLACKHOLE, mrp_test_dmac, in ocelot_mrp_save_mac()
111 ocelot_mact_learn(ocelot, PGID_BLACKHOLE, mrp_control_dmac, in ocelot_mrp_save_mac()
115 static void ocelot_mrp_del_mac(struct ocelot *ocelot, in ocelot_mrp_del_mac() argument
118 ocelot_mact_forget(ocelot, mrp_test_dmac, OCELOT_STANDALONE_PVID); in ocelot_mrp_del_mac()
119 ocelot_mact_forget(ocelot, mrp_control_dmac, OCELOT_STANDALONE_PVID); in ocelot_mrp_del_mac()
122 int ocelot_mrp_add(struct ocelot *ocelot, int port, in ocelot_mrp_add() argument
125 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_mrp_add()
144 int ocelot_mrp_del(struct ocelot *ocelot, int port, in ocelot_mrp_del() argument
147 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_mrp_del()
161 int ocelot_mrp_add_ring_role(struct ocelot *ocelot, int port, in ocelot_mrp_add_ring_role() argument
164 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_mrp_add_ring_role()
177 ocelot_mrp_save_mac(ocelot, ocelot_port); in ocelot_mrp_add_ring_role()
180 return ocelot_mrp_trap_add(ocelot, port); in ocelot_mrp_add_ring_role()
182 dst_port = ocelot_mrp_find_partner_port(ocelot, ocelot_port); in ocelot_mrp_add_ring_role()
186 err = ocelot_mrp_redirect_add_vcap(ocelot, port, dst_port); in ocelot_mrp_add_ring_role()
190 err = ocelot_mrp_trap_add(ocelot, port); in ocelot_mrp_add_ring_role()
192 ocelot_mrp_del_vcap(ocelot, in ocelot_mrp_add_ring_role()
193 OCELOT_VCAP_IS2_MRP_REDIRECT(ocelot, port)); in ocelot_mrp_add_ring_role()
201 int ocelot_mrp_del_ring_role(struct ocelot *ocelot, int port, in ocelot_mrp_del_ring_role() argument
204 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_mrp_del_ring_role()
216 err = ocelot_mrp_trap_del(ocelot, port); in ocelot_mrp_del_ring_role()
220 ocelot_mrp_del_vcap(ocelot, OCELOT_VCAP_IS2_MRP_REDIRECT(ocelot, port)); in ocelot_mrp_del_ring_role()
222 for (i = 0; i < ocelot->num_phys_ports; ++i) { in ocelot_mrp_del_ring_role()
223 ocelot_port = ocelot->ports[i]; in ocelot_mrp_del_ring_role()
232 ocelot_mrp_del_mac(ocelot, ocelot->ports[port]); in ocelot_mrp_del_ring_role()