aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-09-06 13:30:24 +0200
committerFelix Fietkau <nbd@nbd.name>2018-11-09 15:05:54 +0100
commit057893024e161d9670e5e2e1a265c3557d8e889f (patch)
treed26677a862c617e771769c631bc55fffe15079fb /package/kernel
parentf9e50a9468d73f2d22c347557040ec158d6ae625 (diff)
downloadupstream-057893024e161d9670e5e2e1a265c3557d8e889f.tar.gz
upstream-057893024e161d9670e5e2e1a265c3557d8e889f.tar.bz2
upstream-057893024e161d9670e5e2e1a265c3557d8e889f.zip
mac80211: backport sg_init_marker()
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel')
-rw-r--r--package/kernel/mac80211/patches/009-backport_sg_init_marker.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/009-backport_sg_init_marker.patch b/package/kernel/mac80211/patches/009-backport_sg_init_marker.patch
new file mode 100644
index 0000000000..d7c20daf16
--- /dev/null
+++ b/package/kernel/mac80211/patches/009-backport_sg_init_marker.patch
@@ -0,0 +1,30 @@
+--- a/backport-include/linux/scatterlist.h
++++ b/backport-include/linux/scatterlist.h
+@@ -102,4 +102,27 @@ size_t sg_pcopy_from_buffer(struct scatt
+
+ #endif /* LINUX_VERSION_IS_LESS(3, 11, 0) */
+
++#if LINUX_VERSION_IS_LESS(4, 17, 0)
++
++#define sg_init_marker LINUX_BACKPORT(sg_init_marker)
++/**
++ * sg_init_marker - Initialize markers in sg table
++ * @sgl: The SG table
++ * @nents: Number of entries in table
++ *
++ **/
++static inline void sg_init_marker(struct scatterlist *sgl,
++ unsigned int nents)
++{
++#ifdef CONFIG_DEBUG_SG
++ unsigned int i;
++
++ for (i = 0; i < nents; i++)
++ sgl[i].sg_magic = SG_MAGIC;
++#endif
++ sg_mark_end(&sgl[nents - 1]);
++}
++
++#endif /* LINUX_VERSION_IS_LESS(4, 17, 0) */
++
+ #endif /* __BACKPORT_SCATTERLIST_H */