]> git.baikalelectronics.ru Git - kernel.git/commit
dpaa2-mac: export MAC counters even when in TYPE_FIXED
authorIoana Ciornei <ioana.ciornei@nxp.com>
Fri, 8 Jan 2021 09:07:23 +0000 (11:07 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sun, 10 Jan 2021 00:21:30 +0000 (16:21 -0800)
commitd9a1acbf1c71d3456b9d5bd3b89fefd6f1109a4b
tree8a2cc01d7f822b2fb1025bbcca2bebe8b80b61b4
parent89238c9c993f7508212bc208ede59f7525d1ecf8
dpaa2-mac: export MAC counters even when in TYPE_FIXED

If the network interface object is connected to a MAC of TYPE_FIXED, the
link status management is handled exclusively by the firmware. This does
not mean that the driver cannot access the MAC counters and export them
in ethtool.

For this to happen, we open the attached dpmac device and keep a pointer
to it in priv->mac. Because of this, all the checks in the driver of the
following form 'if (priv->mac)' have to be updated to actually check
the dpmac attribute and not rely on the presence of a non-NULL value.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c