All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] backports: include rhashtable
@ 2015-04-01 15:31 Johannes Berg
  2015-04-01 15:31 ` [PATCH 2/5] backports: backport netlink IP/IPv6 address accessors Johannes Berg
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Johannes Berg @ 2015-04-01 15:31 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

As mac80211 now needs rhashtable, include it in backports.
For now, it actually depends on mac80211 and is selected
for kernels < 4.1 -- it existed in previous kernels but
with different API, so cannot be used from there easily.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/compat/Kconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index aadf246896e9..8fcdb8a96bb3 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -135,3 +135,12 @@ config BPAUTO_BUILD_WANT_DEV_COREDUMP
 	default y if BPAUTO_WANT_DEV_COREDUMP
 	#h-file linux/devcoredump.h
 	#c-file drivers/base/devcoredump.c
+
+config BPAUTO_RHASHTABLE
+	bool
+	# current API of rhashtable was introduced in version 4.1
+	depends on KERNEL_4_1
+	# not very nice - but better than always having it
+	default y if MAC80211
+	#h-file linux/rhashtable.h
+	#c-file lib/rhashtable.c
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] backports: backport netlink IP/IPv6 address accessors
  2015-04-01 15:31 [PATCH 1/5] backports: include rhashtable Johannes Berg
@ 2015-04-01 15:31 ` Johannes Berg
  2015-04-01 15:31 ` [PATCH 3/5] backports: backport NET_NAME_* definitions Johannes Berg
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2015-04-01 15:31 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

These were introduced upstream in commits 67b61f6c130a
and 930345ea6304.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/net/netlink.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h
index 9324d02d2c86..35d9260ff29b 100644
--- a/backport/backport-include/net/netlink.h
+++ b/backport/backport-include/net/netlink.h
@@ -2,6 +2,7 @@
 #define __BACKPORT_NET_NETLINK_H
 #include_next <net/netlink.h>
 #include <linux/version.h>
+#include <linux/in6.h>
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
 /**
@@ -137,4 +138,33 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
 #define NLA_TYPE_MAX (__NLA_TYPE_MAX - 1)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
+#define nla_put_in_addr LINUX_BACKPORT(nla_put_in_addr)
+static inline int nla_put_in_addr(struct sk_buff *skb, int attrtype,
+				  __be32 addr)
+{
+	return nla_put_be32(skb, attrtype, addr);
+}
+
+#define nla_put_in6_addr LINUX_BACKPORT(nla_put_in6_addr)
+static inline int nla_put_in6_addr(struct sk_buff *skb, int attrtype,
+				   const struct in6_addr *addr)
+{
+	return nla_put(skb, attrtype, sizeof(*addr), addr);
+}
+
+static inline __be32 nla_get_in_addr(const struct nlattr *nla)
+{
+	return *(__be32 *) nla_data(nla);
+}
+
+static inline struct in6_addr nla_get_in6_addr(const struct nlattr *nla)
+{
+	struct in6_addr tmp;
+
+	nla_memcpy(&tmp, nla, sizeof(tmp));
+	return tmp;
+}
+#endif /* < 4.1 */
+
 #endif /* __BACKPORT_NET_NETLINK_H */
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] backports: backport NET_NAME_* definitions
  2015-04-01 15:31 [PATCH 1/5] backports: include rhashtable Johannes Berg
  2015-04-01 15:31 ` [PATCH 2/5] backports: backport netlink IP/IPv6 address accessors Johannes Berg
@ 2015-04-01 15:31 ` Johannes Berg
  2015-04-01 15:31 ` [PATCH 4/5] backport: backport NULLS_MARKER Johannes Berg
  2015-04-01 15:31 ` [PATCH 5/5] backports: backport kvfree Johannes Berg
  3 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2015-04-01 15:31 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

These were added upstream a long time ago in commit 685343fc3ba61,
but not needed until implemented in the wireless stack recently.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/netdevice.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 27bce84c468a..abbfe1d43b7e 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -163,6 +163,22 @@ static inline void netdev_reset_queue(struct net_device *dev_queue)
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+#ifndef NET_NAME_UNKNOWN
+#define NET_NAME_UNKNOWN	0
+#endif
+#ifndef NET_NAME_ENUM
+#define NET_NAME_ENUM		1
+#endif
+#ifndef NET_NAME_PREDICTABLE
+#define NET_NAME_PREDICTABLE	2
+#endif
+#ifndef NET_NAME_USER
+#define NET_NAME_USER		3
+#endif
+#ifndef NET_NAME_RENAMED
+#define NET_NAME_RENAMED	4
+#endif
+
 #define alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, txqs, rxqs) \
 	alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] backport: backport NULLS_MARKER
  2015-04-01 15:31 [PATCH 1/5] backports: include rhashtable Johannes Berg
  2015-04-01 15:31 ` [PATCH 2/5] backports: backport netlink IP/IPv6 address accessors Johannes Berg
  2015-04-01 15:31 ` [PATCH 3/5] backports: backport NET_NAME_* definitions Johannes Berg
@ 2015-04-01 15:31 ` Johannes Berg
  2015-04-01 15:31 ` [PATCH 5/5] backports: backport kvfree Johannes Berg
  3 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2015-04-01 15:31 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This was added to list_nulls.h fairly recently in commit f89bd6f87a53.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/list_nulls.h | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 backport/backport-include/linux/list_nulls.h

diff --git a/backport/backport-include/linux/list_nulls.h b/backport/backport-include/linux/list_nulls.h
new file mode 100644
index 000000000000..ba28834f7900
--- /dev/null
+++ b/backport/backport-include/linux/list_nulls.h
@@ -0,0 +1,9 @@
+#ifndef __BACKPORT_LIST_NULLS
+#define __BACKPORT_LIST_NULLS
+#include_next <linux/list_nulls.h>
+
+#ifndef NULLS_MARKER
+#define NULLS_MARKER(value) (1UL | (((long)value) << 1))
+#endif
+
+#endif /* __BACKPORT_LIST_NULLS */
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] backports: backport kvfree
  2015-04-01 15:31 [PATCH 1/5] backports: include rhashtable Johannes Berg
                   ` (2 preceding siblings ...)
  2015-04-01 15:31 ` [PATCH 4/5] backport: backport NULLS_MARKER Johannes Berg
@ 2015-04-01 15:31 ` Johannes Berg
  2015-04-03 21:41   ` Hauke Mehrtens
  3 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2015-04-01 15:31 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This has been in the kernel for a long time, but wasn't
used by anyone. Now it's used by rhashtable, so add it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/mm.h |  5 +++++
 backport/compat/backport-3.15.c      | 11 +++++++++++
 2 files changed, 16 insertions(+)

diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h
index efb2ca70aca0..d6cbffebc84d 100644
--- a/backport/backport-include/linux/mm.h
+++ b/backport/backport-include/linux/mm.h
@@ -25,6 +25,11 @@
 int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
+#define kvfree LINUX_BACKPORT(kvfree)
+void kvfree(const void *addr);
+#endif /* < 3.15 */
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,20,0))
 #define get_user_pages_unlocked LINUX_BACKPORT(get_user_pages_unlocked)
 static inline long
diff --git a/backport/compat/backport-3.15.c b/backport/compat/backport-3.15.c
index 75216eb990b2..c6f9d43813a5 100644
--- a/backport/compat/backport-3.15.c
+++ b/backport/compat/backport-3.15.c
@@ -13,6 +13,8 @@
 #include <linux/device.h>
 #include <linux/of.h>
 #include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
 #include <net/net_namespace.h>
 
 #if IS_ENABLED(CPTCFG_IEEE802154_6LOWPAN)
@@ -88,3 +90,12 @@ int of_property_count_elems_of_size(const struct device_node *np,
 }
 EXPORT_SYMBOL_GPL(of_property_count_elems_of_size);
 #endif
+
+void kvfree(const void *addr)
+{
+	if (is_vmalloc_addr(addr))
+		vfree(addr);
+	else
+		kfree(addr);
+}
+EXPORT_SYMBOL_GPL(kvfree);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 5/5] backports: backport kvfree
  2015-04-01 15:31 ` [PATCH 5/5] backports: backport kvfree Johannes Berg
@ 2015-04-03 21:41   ` Hauke Mehrtens
  2015-04-25 14:03     ` Hauke Mehrtens
  0 siblings, 1 reply; 7+ messages in thread
From: Hauke Mehrtens @ 2015-04-03 21:41 UTC (permalink / raw)
  To: Johannes Berg, backports; +Cc: Johannes Berg

On 04/01/2015 05:31 PM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> This has been in the kernel for a long time, but wasn't
> used by anyone. Now it's used by rhashtable, so add it.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  backport/backport-include/linux/mm.h |  5 +++++
>  backport/compat/backport-3.15.c      | 11 +++++++++++
>  2 files changed, 16 insertions(+)
> 

Thank you for the patches. I applied the patch 3, 4 and 5, the other
patches will be applied for the next version.

Hauke

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 5/5] backports: backport kvfree
  2015-04-03 21:41   ` Hauke Mehrtens
@ 2015-04-25 14:03     ` Hauke Mehrtens
  0 siblings, 0 replies; 7+ messages in thread
From: Hauke Mehrtens @ 2015-04-25 14:03 UTC (permalink / raw)
  To: Johannes Berg, backports; +Cc: Johannes Berg

On 04/03/2015 11:41 PM, Hauke Mehrtens wrote:
> On 04/01/2015 05:31 PM, Johannes Berg wrote:
>> From: Johannes Berg <johannes.berg@intel.com>
>>
>> This has been in the kernel for a long time, but wasn't
>> used by anyone. Now it's used by rhashtable, so add it.
>>
>> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>> ---
>>  backport/backport-include/linux/mm.h |  5 +++++
>>  backport/compat/backport-3.15.c      | 11 +++++++++++
>>  2 files changed, 16 insertions(+)
>>
> 
> Thank you for the patches. I applied the patch 3, 4 and 5, the other
> patches will be applied for the next version.
> 
> Hauke

Thank you for the patches, I now also applied and pushed the remaining
patches.

Hauke

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-25 14:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-01 15:31 [PATCH 1/5] backports: include rhashtable Johannes Berg
2015-04-01 15:31 ` [PATCH 2/5] backports: backport netlink IP/IPv6 address accessors Johannes Berg
2015-04-01 15:31 ` [PATCH 3/5] backports: backport NET_NAME_* definitions Johannes Berg
2015-04-01 15:31 ` [PATCH 4/5] backport: backport NULLS_MARKER Johannes Berg
2015-04-01 15:31 ` [PATCH 5/5] backports: backport kvfree Johannes Berg
2015-04-03 21:41   ` Hauke Mehrtens
2015-04-25 14:03     ` Hauke Mehrtens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.