git: 5c6eeda0489a - stable/13 - linuxkpi: Implement dma_max_mapping_size

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Wed, 27 Apr 2022 15:16:24 UTC
The branch stable/13 has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=5c6eeda0489a268de6df65a935c0987c5c302c15

commit 5c6eeda0489a268de6df65a935c0987c5c302c15
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-03-29 11:01:31 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-04-27 16:38:06 +0000

    linuxkpi: Implement dma_max_mapping_size
    
    Simply returns SCATTERLIST_MAX_SEGMENT.
    Needed by drm v5.10
    
    MFC after:      1 week
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
    
    (cherry picked from commit 1acf9b27704cebfcf14cd896264be29c1d27c4c3)
---
 sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
index fcb50f4b5217..dd3bbc094dfb 100644
--- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
@@ -313,6 +313,13 @@ _dma_unmap_single_attrs(struct device *dev, dma_addr_t dma, size_t size,
 	linux_dma_unmap(dev, dma, size);
 }
 
+static inline size_t
+dma_max_mapping_size(struct device *dev)
+{
+
+	return (SCATTERLIST_MAX_SEGMENT);
+}
+
 #define	dma_map_single_attrs(dev, ptr, size, dir, attrs)	\
 	_dma_map_single_attrs(dev, ptr, size, dir, 0)