mac80211: backport sg_init_marker()
authorFelix Fietkau <nbd@nbd.name>
Thu, 6 Sep 2018 11:30:24 +0000 (13:30 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 9 Nov 2018 14:05:54 +0000 (15:05 +0100)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/kernel/mac80211/patches/009-backport_sg_init_marker.patch [new file with mode: 0644]

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 (file)
index 0000000..d7c20da
--- /dev/null
@@ -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 */