OSDN Git Service

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)
commitd87e606373f641c58d5e8e4c48b3216fd9d1c78a
tree8a2cc01d7f822b2fb1025bbcca2bebe8b80b61b4
parent095dca16d92f32150314ef47ea150ed83c5aacd9
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