Skip to content

Commit c8a2a01

Browse files
vladimirolteandavem330
authored andcommitted
net: dsa: sja1105: fix broken connection with the sja1110 tagger
The driver was incorrectly converted assuming that "sja1105" is the only tagger supported by this driver. This results in SJA1110 switches failing to probe: sja1105 spi1.0: Unable to connect to tag protocol "sja1110": -EPROTONOSUPPORT sja1105: probe of spi1.2 failed with error -93 Add DSA_TAG_PROTO_SJA1110 to the list of supported taggers by the sja1105 driver. The sja1105_tagger_data structure format is common for the two tagging protocols. Fixes: c79e848 ("net: dsa: tag_sja1105: convert to tagger-owned data") Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e2f01bf commit c8a2a01

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

drivers/net/dsa/sja1105/sja1105_main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,17 +2708,17 @@ static void sja1105_port_deferred_xmit(struct kthread_work *work)
27082708
static int sja1105_connect_tag_protocol(struct dsa_switch *ds,
27092709
enum dsa_tag_protocol proto)
27102710
{
2711+
struct sja1105_private *priv = ds->priv;
27112712
struct sja1105_tagger_data *tagger_data;
27122713

2713-
switch (proto) {
2714-
case DSA_TAG_PROTO_SJA1105:
2715-
tagger_data = sja1105_tagger_data(ds);
2716-
tagger_data->xmit_work_fn = sja1105_port_deferred_xmit;
2717-
tagger_data->meta_tstamp_handler = sja1110_process_meta_tstamp;
2718-
return 0;
2719-
default:
2714+
if (proto != priv->info->tag_proto)
27202715
return -EPROTONOSUPPORT;
2721-
}
2716+
2717+
tagger_data = sja1105_tagger_data(ds);
2718+
tagger_data->xmit_work_fn = sja1105_port_deferred_xmit;
2719+
tagger_data->meta_tstamp_handler = sja1110_process_meta_tstamp;
2720+
2721+
return 0;
27222722
}
27232723

27242724
/* The MAXAGE setting belongs to the L2 Forwarding Parameters table,

include/linux/dsa/sja1105.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ struct sja1105_skb_cb {
7070
static inline struct sja1105_tagger_data *
7171
sja1105_tagger_data(struct dsa_switch *ds)
7272
{
73-
BUG_ON(ds->dst->tag_ops->proto != DSA_TAG_PROTO_SJA1105);
73+
BUG_ON(ds->dst->tag_ops->proto != DSA_TAG_PROTO_SJA1105 &&
74+
ds->dst->tag_ops->proto != DSA_TAG_PROTO_SJA1110);
7475

7576
return ds->tagger_data;
7677
}

0 commit comments

Comments
 (0)