2011-10-04 11:11:57

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 1/3] compat: add ETH_P_TDLS


Signed-off-by: Hauke Mehrtens <[email protected]>
---
include/linux/compat-3.2.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-3.2.h b/include/linux/compat-3.2.h
index 009e341..859a2e3 100644
--- a/include/linux/compat-3.2.h
+++ b/include/linux/compat-3.2.h
@@ -58,6 +58,8 @@ static inline dma_addr_t skb_frag_dma_map(struct device *dev,
frag->page_offset + offset, size, dir);
}

+#define ETH_P_TDLS 0x890D /* TDLS */
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) */

#endif /* LINUX_3_2_COMPAT_H */
--
1.7.4.1



2011-10-04 11:12:00

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 3/3] compat: add linux/of.h just when CONFIG_OF is set.

In kernel < 2.6.34 linux/of.h unconditionally includes asm/prom.h which
is not available on all architectures. In newer kernel versions this is
just included if CONFIG_OF is set. For these old kernel just include
linux/of.h when CONFIG_OF is set. This fixes a compile problem with
ath6kl as it uses linux/of.h only when CONFIG_OF is set.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
include/linux/of.h | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
create mode 100644 include/linux/of.h

diff --git a/include/linux/of.h b/include/linux/of.h
new file mode 100644
index 0000000..c5dc87c
--- /dev/null
+++ b/include/linux/of.h
@@ -0,0 +1,16 @@
+#ifndef _COMPAT_LINUX_OF_H
+#define _COMPAT_LINUX_OF_H 1
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+#include_next <linux/of.h>
+#else
+
+#ifdef CONFIG_OF
+#include_next <linux/of.h>
+#endif /* CONFIG_OF */
+
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
+
+#endif /* _COMPAT_LINUX_OF_H */
--
1.7.4.1


2011-10-05 00:42:23

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 3/3] compat: add linux/of.h just when CONFIG_OF is set.

On Tue, Oct 4, 2011 at 4:11 AM, Hauke Mehrtens <[email protected]> wrote:
> In kernel < 2.6.34 linux/of.h unconditionally includes asm/prom.h which
> is not available on all architectures. In newer kernel versions this is
> just included if CONFIG_OF is set. For these old kernel just include
> linux/of.h when CONFIG_OF is set. This fixes a compile problem with
> ath6kl as it uses linux/of.h only when CONFIG_OF is set.
>
> Signed-off-by: Hauke Mehrtens <[email protected]>

Applied and pushed all 5 patches, thanks!

Luis

2011-10-04 11:11:55

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 2/3] compat: add is_unicast_ether_addr


Signed-off-by: Hauke Mehrtens <[email protected]>
---
include/linux/compat-2.6.38.h | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-2.6.38.h b/include/linux/compat-2.6.38.h
index 1f9ab52..ad04ebc 100644
--- a/include/linux/compat-2.6.38.h
+++ b/include/linux/compat-2.6.38.h
@@ -7,6 +7,7 @@

#include <linux/kernel.h>
#include <linux/skbuff.h>
+#include <linux/etherdevice.h>

/* rename member in struct mmc_host in include/linux/mmc/host.h */
#define max_segs max_hw_segs
@@ -77,6 +78,17 @@ static inline int skb_checksum_start_offset(const struct sk_buff *skb)

#define ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */

+/**
+ * is_unicast_ether_addr - Determine if the Ethernet address is unicast
+ * @addr: Pointer to a six-byte array containing the Ethernet address
+ *
+ * Return true if the address is a unicast address.
+ */
+static inline int is_unicast_ether_addr(const u8 *addr)
+{
+ return !is_multicast_ether_addr(addr);
+}
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) */

#endif /* LINUX_26_38_COMPAT_H */
--
1.7.4.1