RE: [PATCH net-next 07/17] net: dsa: mv88e6xxx: Add connect_tag_protocol handler

From: Jagielski, Jedrzej

Date: Fri Jul 03 2026 - 09:27:51 EST


From: Luke Howard <lukeh@xxxxxxxx>
Sent: Friday, July 3, 2026 9:47 AM

>From: Andrew Lunn <andrew@xxxxxxx>
>
>When the tagging protocol handler is attached to the DSA driver, it
>can validate it is a supported tagging protocol. It can also setup
>data shared between the tagger and the switch driver. Ensure a Mavell

s/Mavell/Marvell ?

>DSA tagger is being connected, and setup the handler from RMU in the
>shared data. At this point, the handler is just an empty stub, but
>later patches will add the needed functionality.
>
>Signed-off-by: Andrew Lunn <andrew@xxxxxxx>
>---
> drivers/net/dsa/mv88e6xxx/chip.c | 18 ++++++++++++++++++
> drivers/net/dsa/mv88e6xxx/rmu.c | 6 ++++++
> drivers/net/dsa/mv88e6xxx/rmu.h | 3 +++
> 3 files changed, 27 insertions(+)
>
>diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
>index 72c93cb84b7e1..fe0d0eb8f0813 100644
>--- a/drivers/net/dsa/mv88e6xxx/chip.c
>+++ b/drivers/net/dsa/mv88e6xxx/chip.c
>@@ -7183,6 +7183,23 @@ static int mv88e6xxx_crosschip_lag_leave(struct dsa_switch *ds, int sw_index,
> return err_sync ? : err_pvt;
> }
>
>+static int mv88e6xxx_connect_tag_protocol(struct dsa_switch *ds,
>+ enum dsa_tag_protocol proto)
>+{
>+ struct dsa_tagger_data *tagger_data = ds->tagger_data;
>+
>+ switch (proto) {
>+ case DSA_TAG_PROTO_DSA:
>+ case DSA_TAG_PROTO_EDSA:
>+ tagger_data->rmu_frame2reg = mv88e6xxx_rmu_frame2reg_handler;
>+ break;
>+ default:
>+ return -EPROTONOSUPPORT;
>+ }

do we really need to use switch for 0/1 cases?

>+
>+ return 0;
>+}
>+