net: lan966x: use the FDMA library for allocation of tx buffers
authorDaniel Machon <daniel.machon@microchip.com>
Thu, 5 Sep 2024 08:06:35 +0000 (10:06 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 Sep 2024 09:04:16 +0000 (11:04 +0200)
commitdf2ddc1458c39eacb8678333bea668a76de540de
treeac222a26ec367c30c21a202042d4b31c52312d77
parentf51293b3ea89b3028745d8f0c9206df4bdc16905
net: lan966x: use the FDMA library for allocation of tx buffers

Use the two functions: fdma_alloc_phys() and fdma_dcb_init() for rx
buffer allocation and use the new buffers throughout.

In order to replace the old buffers with the new ones, we have to do the
following refactoring:

    - use fdma_alloc_phys() and fdma_dcb_init()

    - replace the variables: tx->dma, tx->dcbs and tx->curr_entry
      with the equivalents from the FDMA struct.

    - add lan966x_fdma_tx_dataptr_cb callback for obtaining the dataptr.

    - Initialize FDMA struct values.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
drivers/net/ethernet/microchip/lan966x/lan966x_main.h