2013-01-24 10:43:05

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] compat: backport nla_put_be{16,32,64}()

From: Johannes Berg <[email protected]>

I intend to use these in nl80211.

Signed-off-by: Johannes Berg <[email protected]>
---
include/linux/compat-3.5.h | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/include/linux/compat-3.5.h b/include/linux/compat-3.5.h
index 9cffead..892f00c 100644
--- a/include/linux/compat-3.5.h
+++ b/include/linux/compat-3.5.h
@@ -10,6 +10,30 @@

/*
* This backports:
+ * commit 569a8fc38367dfafd87454f27ac646c8e6b54bca
+ * Author: David S. Miller <[email protected]>
+ * Date: Thu Mar 29 23:18:53 2012 -0400
+
+ * netlink: Add nla_put_be{16,32,64}() helpers.
+ */
+
+static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
+{
+ return nla_put(skb, attrtype, sizeof(__be16), &value);
+}
+
+static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
+{
+ return nla_put(skb, attrtype, sizeof(__be32), &value);
+}
+
+static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
+{
+ return nla_put(skb, attrtype, sizeof(__be64), &value);
+}
+
+/*
+ * This backports:
*
* commit f56f821feb7b36223f309e0ec05986bb137ce418
* Author: Daniel Vetter <[email protected]>
--
1.8.0