net: dsa: Allow default tag protocol to be overridden from DT

Some combinations of tag protocols and Ethernet controllers are
incompatible, and it is hard for the driver to keep track of these.

Therefore, allow the device tree author (typically the board vendor)
to inform the driver of this fact by selecting an alternate protocol
that is known to work.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Tobias Waldekranz
2021-04-20 20:53:10 +02:00
committed by David S. Miller
parent 21e0b508c8
commit deff710703
2 changed files with 92 additions and 18 deletions

View File

@ -149,6 +149,11 @@ struct dsa_switch_tree {
/* Tagging protocol operations */
const struct dsa_device_ops *tag_ops;
/* Default tagging protocol preferred by the switches in this
* tree.
*/
enum dsa_tag_protocol default_proto;
/*
* Configuration data for the platform device that owns
* this dsa switch tree instance.