Skip to content

Commit

Permalink
r6040: define and use MLSR register bits
Browse files Browse the repository at this point in the history
Define the MLSR (MAC Last Status Register bits) for:
- tx fifo under-run
- tx exceed collision
- tx late collision

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Apr 12, 2012
1 parent 3440ecc commit 8dd87a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/ethernet/rdc/r6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
#define MR_BSR 0x18 /* RX buffer size */
#define MR_DCR 0x1A /* RX descriptor control */
#define MLSR 0x1C /* Last status */
#define TX_FIFO_UNDR 0x0200 /* TX FIFO under-run */
#define TX_EXCEEDC 0x2000 /* Transmit exceed collision */
#define TX_LATEC 0x4000 /* Transmit late collision */
#define MMDIO 0x20 /* MDIO control register */
#define MDIO_WRITE 0x4000 /* MDIO write */
#define MDIO_READ 0x2000 /* MDIO read */
Expand Down Expand Up @@ -604,9 +607,9 @@ static void r6040_tx(struct net_device *dev)
/* Check for errors */
err = ioread16(ioaddr + MLSR);

if (err & 0x0200)
if (err & TX_FIFO_UNDR)
dev->stats.tx_fifo_errors++;
if (err & (0x2000 | 0x4000))
if (err & (TX_EXCEEDC | TX_LATEC))
dev->stats.tx_carrier_errors++;

if (descptr->status & DSC_OWNER_MAC)
Expand Down

0 comments on commit 8dd87a2

Please sign in to comment.