From: Johannes Berg Date: Thu, 24 Jan 2013 10:44:56 +0000 (+0100) Subject: compat: backport nla_put_be{16,32,64}() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5c165fc37dcff3d04251dea04eace34a2650b696;p=openwrt%2Fstaging%2Fblogic.git compat: backport nla_put_be{16,32,64}() I intend to use these in nl80211. Signed-off-by: Johannes Berg Signed-off-by: Hauke Mehrtens --- diff --git a/include/linux/compat-3.5.h b/include/linux/compat-3.5.h index 9cffead22222..28a120902e0c 100644 --- a/include/linux/compat-3.5.h +++ b/include/linux/compat-3.5.h @@ -8,6 +8,32 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) +#include + +/* + * This backports: + * commit 569a8fc38367dfafd87454f27ac646c8e6b54bca + * Author: David S. Miller + * 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: *