aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2022-02-09 11:37:37 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2022-02-14 00:09:57 +0000
commit2e818fbcfc03f9416593d5fe5bc860c1829f5366 (patch)
treec020848be785c8efe94f268e3d1b505a35314098
parent232d323ef227109acce37f5a0d62492673666ee2 (diff)
downloadsrc-2e818fbcfc03f9416593d5fe5bc860c1829f5366.tar.gz
src-2e818fbcfc03f9416593d5fe5bc860c1829f5366.zip
LinuxKPI: add get_unaligned_le16()
Add get_unaligned_le16() to asm/unaligned.h needed by a driver. MFC after: 3 days Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D34224
-rw-r--r--sys/compat/linuxkpi/common/include/asm/unaligned.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/asm/unaligned.h b/sys/compat/linuxkpi/common/include/asm/unaligned.h
index 9a788c965653..8a001ec38c3d 100644
--- a/sys/compat/linuxkpi/common/include/asm/unaligned.h
+++ b/sys/compat/linuxkpi/common/include/asm/unaligned.h
@@ -36,6 +36,13 @@
#include <linux/types.h>
#include <asm/byteorder.h>
+static __inline uint16_t
+get_unaligned_le16(const void *p)
+{
+
+ return (le16_to_cpup((const __le16 *)p));
+}
+
static __inline uint32_t
get_unaligned_le32(const void *p)
{