net: fec: don't dump RX FIFO register when not available
authorFugang Duan <fugang.duan@nxp.com>
Mon, 15 Oct 2018 05:19:00 +0000 (05:19 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Oct 2018 05:52:18 +0000 (22:52 -0700)
commitec20a63aa8b8ec3223fb25cdb2a49f9f9dfda88c
tree6eef69aee045c42bdc7c42933dc4f18369d6a4e8
parentfbe1222c63b805e946c3af29b0bfbfee4c2fbeff
net: fec: don't dump RX FIFO register when not available

Commit db65f35f50e0 ("net: fec: add support of ethtool get_regs") introduce
ethool "--register-dump" interface to dump all FEC registers.

But not all silicon implementations of the Freescale FEC hardware module
have the FRBR (FIFO Receive Bound Register) and FRSR (FIFO Receive Start
Register) register, so we should not be trying to dump them on those that
don't.

To fix it we create a quirk flag, FEC_QUIRK_HAS_RFREG, and check it before
dump those RX FIFO registers.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_main.c