diff options
| author | Serge Semin <fancer.lancer@gmail.com> | 2023-07-29 03:04:04 +0300 |
|---|---|---|
| committer | Serge Semin <fancer.lancer@gmail.com> | 2026-08-13 20:38:43 +0300 |
| commit | 91706ab69f5ee4ca615bb0dc9bf577ac482cc477 (patch) | |
| tree | a5155bdc546a775d7296e1546e6b03c1e69a46ad | |
| parent | 01e194d68f64c7ecb72e46a32f35c9b726d996ee (diff) | |
| download | linux-91706ab69f5ee4ca615bb0dc9bf577ac482cc477.tar.gz linux-91706ab69f5ee4ca615bb0dc9bf577ac482cc477.zip | |
net: stmmac: xgmac: Add display_ring() desc operation
It might get to be handy to print out the DMA descriptors content during
the initial DMA interface initialization. Thus let's add the
display_ring() callback then in the similar way as it's done for the rest
of the DW {XG}MAC controllers.
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
| -rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c index d39462402dc9..8a4b9a09310d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c @@ -505,6 +505,25 @@ static void dwxgmac2_set_tbs(struct dma_edesc *p, u32 sec, u32 nsec) p->des7 = 0; } +static void dwxgmac2_display_ring(void *head, unsigned int size, bool rx, + dma_addr_t dma_rx_phy, unsigned int desc_size) +{ + struct dma_desc *p = (struct dma_desc *)head; + dma_addr_t dma_addr; + int i; + + pr_info("%s descriptor ring:\n", rx ? "RX" : "TX"); + + for (i = 0; i < size; i++) { + dma_addr = dma_rx_phy + i * sizeof(*p); + pr_info("%03d [%pad]: 0x%x 0x%x 0x%x 0x%x\n", + i, &dma_addr, + le32_to_cpu(p->des0), le32_to_cpu(p->des1), + le32_to_cpu(p->des2), le32_to_cpu(p->des3)); + p++; + } +} + const struct stmmac_desc_ops dwxgmac210_desc_ops = { .tx_status = dwxgmac2_get_tx_status, .rx_status = dwxgmac2_get_rx_status, @@ -539,4 +558,5 @@ const struct stmmac_desc_ops dwxgmac210_desc_ops = { .set_vlan_tag = dwxgmac2_set_vlan_tag, .set_vlan = dwxgmac2_set_vlan, .set_tbs = dwxgmac2_set_tbs, + .display_ring = dwxgmac2_display_ring, }; |
