forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
....@@ -1,19 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*******************************************************************************
23 This contains the functions to handle the enhanced descriptors.
34
45 Copyright (C) 2007-2014 STMicroelectronics Ltd
56
6
- This program is free software; you can redistribute it and/or modify it
7
- under the terms and conditions of the GNU General Public License,
8
- version 2, as published by the Free Software Foundation.
9
-
10
- This program is distributed in the hope it will be useful, but WITHOUT
11
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- more details.
14
-
15
- The full GNU General Public License is included in this distribution in
16
- the file called "COPYING".
177
188 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
199 *******************************************************************************/
....@@ -427,19 +417,22 @@
427417 }
428418 }
429419
430
-static void enh_desc_display_ring(void *head, unsigned int size, bool rx)
420
+static void enh_desc_display_ring(void *head, unsigned int size, bool rx,
421
+ dma_addr_t dma_rx_phy, unsigned int desc_size)
431422 {
432423 struct dma_extended_desc *ep = (struct dma_extended_desc *)head;
424
+ dma_addr_t dma_addr;
433425 int i;
434426
435427 pr_info("Extended %s descriptor ring:\n", rx ? "RX" : "TX");
436428
437429 for (i = 0; i < size; i++) {
438430 u64 x;
431
+ dma_addr = dma_rx_phy + i * sizeof(*ep);
439432
440433 x = *(u64 *)ep;
441
- pr_info("%03d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
442
- i, (unsigned int)virt_to_phys(ep),
434
+ pr_info("%03d [%pad]: 0x%x 0x%x 0x%x 0x%x\n",
435
+ i, &dma_addr,
443436 (unsigned int)x, (unsigned int)(x >> 32),
444437 ep->basic.des2, ep->basic.des3);
445438 ep++;