]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: macb: introduce DMA descriptor helpers (is 64bit? is PTP?)
authorThéo Lebrun <theo.lebrun@bootlin.com>
Tue, 14 Oct 2025 15:25:10 +0000 (17:25 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Oct 2025 23:59:26 +0000 (16:59 -0700)
commit02d11c610555657f8524a56bab6856fa8d6ace71
tree93610a3bb5f333e0a20fc83de957c73dad669301
parent731e991afb75c3b49da1e781e68a7c710e1d9e92
net: macb: introduce DMA descriptor helpers (is 64bit? is PTP?)

Introduce macb_dma64() and macb_dma_ptp() helper functions.
Many codepaths are made simpler by dropping conditional compilation.

This implies two additional changes:
 - Always compile related structure definitions inside <macb.h>.
 - MACB_EXT_DESC can be dropped as it is useless now.

The common case:

#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
struct macb_dma_desc_64 *desc_64;
if (bp->hw_dma_cap & HW_DMA_CAP_64B) {
desc_64 = macb_64b_desc(bp, desc);
// ...
}
#endif

Is replaced by:

if (macb_dma64(bp)) {
struct macb_dma_desc_64 *desc_64 = macb_64b_desc(bp, desc);
// ...
}

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://patch.msgid.link/20251014-macb-cleanup-v1-9-31cd266e22cd@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb.h
drivers/net/ethernet/cadence/macb_main.c
drivers/net/ethernet/cadence/macb_ptp.c