>From c8fa99f5afe595348dd578c450681c056abb7bcc Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <01e33a3f6c46db63ba90f1db3b99eaf62c7071d1.1338026442.git.romieu@fr.zoreil.com> References: <01e33a3f6c46db63ba90f1db3b99eaf62c7071d1.1338026442.git.romieu@fr.zoreil.com> From: Francois Romieu Date: Fri, 25 May 2012 11:29:26 +0200 Subject: [PATCH 3/6] r8169: ring debug helper. X-Organisation: Land of Sunshine Inc. Signed-off-by: Francois Romieu --- drivers/net/ethernet/realtek/r8169.c | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 655b293..3feb374 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -5382,6 +5382,30 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp) netdev_reset_queue(tp->dev); } +static void rtl_print_ring(struct rtl8169_private *tp) +{ + struct net_device *dev = tp->dev; + int i; + + netif_info(tp, drv, dev, "Rx ring: dirty=%08x current=%08x\n", + tp->dirty_rx, tp->cur_rx); + for (i = 0; i < NUM_RX_DESC; i++) { + struct RxDesc *desc = tp->RxDescArray + i; + + netif_info(tp, drv, dev, "[%03d] %08x %08x %0llx\n", i, + desc->opts1, desc->opts2, (u64)desc->addr); + } + + netif_info(tp, drv, dev, "Tx ring: dirty=%08x current=%08x\n", + tp->dirty_tx, tp->cur_tx); + for (i = 0; i < NUM_TX_DESC; i++) { + struct TxDesc *desc = tp->TxDescArray + i; + + netif_info(tp, drv, dev, "[%03d] %08x %08x %0llx\n", i, + desc->opts1, desc->opts2, (u64)desc->addr); + } +} + static void rtl_reset_work(struct rtl8169_private *tp) { struct net_device *dev = tp->dev; @@ -5391,6 +5415,8 @@ static void rtl_reset_work(struct rtl8169_private *tp) netif_stop_queue(dev); synchronize_sched(); + rtl_print_ring(tp); + rtl8169_hw_reset(tp); for (i = 0; i < NUM_RX_DESC; i++) -- 1.7.7.6