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)
committerIoana Ciornei <ciorneiioana@gmail.com>
Mon, 26 Apr 2021 09:22:46 +0000 (12:22 +0300)
commitcd210ea553c75d07b68d23ab97fdc5aebcdebd71
treeab6d822e5081ec3ce70656f28c0de02bc5833e5e
parent7e472f7c9ab4751791cfb0f29f3d7e3e545a9b8a
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