]> 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)
commita112eb6935cd9c0a9fca20efc148f22129381318
tree8a2cc01d7f822b2fb1025bbcca2bebe8b80b61b4
parentc137c4b73210f1c902a61ddd5e78459940167ca5
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