Lines Matching refs:ocelot

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