[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/31] tests/qtest/libqos/e1000e: Remove duplicate register defin
From: |
Akihiko Odaki |
Subject: |
[PATCH 18/31] tests/qtest/libqos/e1000e: Remove duplicate register definitions |
Date: |
Thu, 12 Jan 2023 18:57:30 +0900 |
The register definitions in tests/qtest/libqos/e1000e.h had names
different from hw/net/e1000_regs.h, which made it hard to understand
what test codes corresponds to the implementation. Use
hw/net/e1000_regs.h from tests/qtest/libqos/e1000e.c to remove
these duplications.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
tests/qtest/libqos/e1000e.c | 20 ++++++++++----------
tests/qtest/libqos/e1000e.h | 5 -----
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c
index b90eb2d5e0..28fb3052aa 100644
--- a/tests/qtest/libqos/e1000e.c
+++ b/tests/qtest/libqos/e1000e.c
@@ -51,13 +51,13 @@ static uint32_t e1000e_macreg_read(QE1000E *d, uint32_t reg)
void e1000e_tx_ring_push(QE1000E *d, void *descr)
{
QE1000E_PCI *d_pci = container_of(d, QE1000E_PCI, e1000e);
- uint32_t tail = e1000e_macreg_read(d, E1000E_TDT);
- uint32_t len = e1000e_macreg_read(d, E1000E_TDLEN) / E1000_RING_DESC_LEN;
+ uint32_t tail = e1000e_macreg_read(d, E1000_TDT);
+ uint32_t len = e1000e_macreg_read(d, E1000_TDLEN) / E1000_RING_DESC_LEN;
qtest_memwrite(d_pci->pci_dev.bus->qts,
d->tx_ring + tail * E1000_RING_DESC_LEN,
descr, E1000_RING_DESC_LEN);
- e1000e_macreg_write(d, E1000E_TDT, (tail + 1) % len);
+ e1000e_macreg_write(d, E1000_TDT, (tail + 1) % len);
/* Read WB data for the packet transmitted */
qtest_memread(d_pci->pci_dev.bus->qts,
@@ -68,13 +68,13 @@ void e1000e_tx_ring_push(QE1000E *d, void *descr)
void e1000e_rx_ring_push(QE1000E *d, void *descr)
{
QE1000E_PCI *d_pci = container_of(d, QE1000E_PCI, e1000e);
- uint32_t tail = e1000e_macreg_read(d, E1000E_RDT);
- uint32_t len = e1000e_macreg_read(d, E1000E_RDLEN) / E1000_RING_DESC_LEN;
+ uint32_t tail = e1000e_macreg_read(d, E1000_RDT);
+ uint32_t len = e1000e_macreg_read(d, E1000_RDLEN) / E1000_RING_DESC_LEN;
qtest_memwrite(d_pci->pci_dev.bus->qts,
d->rx_ring + tail * E1000_RING_DESC_LEN,
descr, E1000_RING_DESC_LEN);
- e1000e_macreg_write(d, E1000E_RDT, (tail + 1) % len);
+ e1000e_macreg_write(d, E1000_RDT, (tail + 1) % len);
/* Read WB data for the packet received */
qtest_memread(d_pci->pci_dev.bus->qts,
@@ -145,8 +145,8 @@ static void e1000e_pci_start_hw(QOSGraphObject *obj)
(uint32_t) d->e1000e.tx_ring);
e1000e_macreg_write(&d->e1000e, E1000_TDBAH,
(uint32_t) (d->e1000e.tx_ring >> 32));
- e1000e_macreg_write(&d->e1000e, E1000E_TDLEN, E1000E_RING_LEN);
- e1000e_macreg_write(&d->e1000e, E1000E_TDT, 0);
+ e1000e_macreg_write(&d->e1000e, E1000_TDLEN, E1000E_RING_LEN);
+ e1000e_macreg_write(&d->e1000e, E1000_TDT, 0);
e1000e_macreg_write(&d->e1000e, E1000_TDH, 0);
/* Enable transmit */
@@ -156,8 +156,8 @@ static void e1000e_pci_start_hw(QOSGraphObject *obj)
(uint32_t)d->e1000e.rx_ring);
e1000e_macreg_write(&d->e1000e, E1000_RDBAH,
(uint32_t)(d->e1000e.rx_ring >> 32));
- e1000e_macreg_write(&d->e1000e, E1000E_RDLEN, E1000E_RING_LEN);
- e1000e_macreg_write(&d->e1000e, E1000E_RDT, 0);
+ e1000e_macreg_write(&d->e1000e, E1000_RDLEN, E1000E_RING_LEN);
+ e1000e_macreg_write(&d->e1000e, E1000_RDT, 0);
e1000e_macreg_write(&d->e1000e, E1000_RDH, 0);
/* Enable receive */
diff --git a/tests/qtest/libqos/e1000e.h b/tests/qtest/libqos/e1000e.h
index 3bf285af42..091ce139da 100644
--- a/tests/qtest/libqos/e1000e.h
+++ b/tests/qtest/libqos/e1000e.h
@@ -25,11 +25,6 @@
#define E1000E_RX0_MSG_ID (0)
#define E1000E_TX0_MSG_ID (1)
-#define E1000E_TDLEN (0x3808)
-#define E1000E_TDT (0x3818)
-#define E1000E_RDLEN (0x2808)
-#define E1000E_RDT (0x2818)
-
typedef struct QE1000E QE1000E;
typedef struct QE1000E_PCI QE1000E_PCI;
--
2.39.0
- [PATCH 05/31] e1000: Mask registers when writing, (continued)
- [PATCH 05/31] e1000: Mask registers when writing, Akihiko Odaki, 2023/01/12
- [PATCH 06/31] e1000e: Mask registers when writing, Akihiko Odaki, 2023/01/12
- [PATCH 07/31] e1000: Use more constant definitions, Akihiko Odaki, 2023/01/12
- [PATCH 11/31] e1000e: Remove pending interrupt flags, Akihiko Odaki, 2023/01/12
- [PATCH 19/31] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr, Akihiko Odaki, 2023/01/12
- [PATCH 21/31] e1000: Split header files, Akihiko Odaki, 2023/01/12
- [PATCH 22/31] igb: Copy e1000e code, Akihiko Odaki, 2023/01/12
- [PATCH 18/31] tests/qtest/libqos/e1000e: Remove duplicate register definitions,
Akihiko Odaki <=
- [PATCH 31/31] docs/system/devices/igb: Add igb documentation, Akihiko Odaki, 2023/01/12
- [PATCH 24/31] igb: Build igb, Akihiko Odaki, 2023/01/12
- [PATCH 03/31] fsl_etsec: Use hw/net/mii.h, Akihiko Odaki, 2023/01/12
- [PATCH 25/31] igb: Transform to 82576 implementation, Akihiko Odaki, 2023/01/12
- [PATCH 09/31] e1000: Use memcpy to intialize registers, Akihiko Odaki, 2023/01/12
- [PATCH 10/31] e1000e: Use memcpy to intialize registers, Akihiko Odaki, 2023/01/12
- [PATCH 13/31] e1000: Configure ResettableClass, Akihiko Odaki, 2023/01/12