Skip to content

Commit

Permalink
net: mscc: ocelot: fix build error due to missing IEEE_8021QAZ_MAX_TCS
Browse files Browse the repository at this point in the history
IEEE_8021QAZ_MAX_TCS is defined in include/uapi/linux/dcbnl.h, which is
included by net/dcbnl.h. Then, linux/netdevice.h conditionally includes
net/dcbnl.h if CONFIG_DCB is enabled.

Therefore, when CONFIG_DCB is disabled, this indirect dependency is
broken.

There isn't a good reason to include net/dcbnl.h headers into the ocelot
switch library which exports low-level hardware API, so replace
IEEE_8021QAZ_MAX_TCS with OCELOT_NUM_TC which has the same value.

Fixes: 978777d ("net: dsa: felix: configure default-prio and dscp priorities")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20220315131215.273450-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Vladimir Oltean authored and Jakub Kicinski committed Mar 15, 2022
1 parent c24f657 commit 72f56fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mscc/ocelot.c
Original file line number Diff line number Diff line change
Expand Up @@ -2917,7 +2917,7 @@ EXPORT_SYMBOL_GPL(ocelot_port_get_default_prio);

int ocelot_port_set_default_prio(struct ocelot *ocelot, int port, u8 prio)
{
if (prio >= IEEE_8021QAZ_MAX_TCS)
if (prio >= OCELOT_NUM_TC)
return -ERANGE;

ocelot_rmw_gix(ocelot,
Expand Down Expand Up @@ -2959,7 +2959,7 @@ int ocelot_port_add_dscp_prio(struct ocelot *ocelot, int port, u8 dscp, u8 prio)
{
int mask, val;

if (prio >= IEEE_8021QAZ_MAX_TCS)
if (prio >= OCELOT_NUM_TC)
return -ERANGE;

/* There is at least one app table priority (this one), so we need to
Expand Down

0 comments on commit 72f56fd

Please sign in to comment.