From: Arnaud Lacombe <lacombar@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: lrodriguez@atheros.com, Arnaud Lacombe <lacombar@gmail.com>
Subject: [PATCH 36/44] compat/2.6.26: move unaligned backport to its own header
Date: Tue, 9 Nov 2010 21:20:18 -0500 [thread overview]
Message-ID: <1289355626-25373-37-git-send-email-lacombar@gmail.com> (raw)
In-Reply-To: <1289355626-25373-1-git-send-email-lacombar@gmail.com>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
---
include/linux/asm/unaligned.h | 194 +++++++++++++++++++++++++++++++++++++
include/linux/compat-2.6.26.h | 214 +----------------------------------------
2 files changed, 197 insertions(+), 211 deletions(-)
create mode 100644 include/linux/asm/unaligned.h
diff --git a/include/linux/asm/unaligned.h b/include/linux/asm/unaligned.h
new file mode 100644
index 0000000..7175e92
--- /dev/null
+++ b/include/linux/asm/unaligned.h
@@ -0,0 +1,194 @@
+#ifndef _COMPAT_ASM_UNALIGNED_H
+#define _COMPAT_ASM_UNALIGNED_H
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
+
+/*
+ * 2.6.26 added its own unaligned API which the
+ * new drivers can use. Lets port it here by including it in older
+ * kernels and also deal with the architecture handling here.
+ */
+
+#ifdef CONFIG_ALPHA
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+#endif /* alpha */
+
+#ifdef CONFIG_ARM
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+#endif /* arm */
+
+#ifdef CONFIG_AVR32
+/*
+ * AVR32 can handle some unaligned accesses, depending on the
+ * implementation. The AVR32 AP implementation can handle unaligned
+ * words, but halfwords must be halfword-aligned, and doublewords must
+ * be word-aligned.
+ *
+ * However, swapped word loads must be word-aligned so we can't
+ * optimize word loads in general.
+ */
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+#endif
+
+#ifdef CONFIG_BLACKFIN
+#include <linux/unaligned/le_struct.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+#endif /* blackfin */
+
+#ifdef CONFIG_CRIS
+/*
+ * CRIS can do unaligned accesses itself.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+#endif /* cris */
+
+#ifdef CONFIG_FRV
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+#endif /* frv */
+
+#ifdef CONFIG_H8300
+#include <linux/unaligned/be_memmove.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+#endif /* h8300 */
+
+#ifdef CONFIG_IA64
+#include <linux/unaligned/le_struct.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+#endif /* ia64 */
+
+#ifdef CONFIG_M32R
+#if defined(__LITTLE_ENDIAN__)
+# include <linux/unaligned/le_memmove.h>
+# include <linux/unaligned/be_byteshift.h>
+# include <linux/unaligned/generic.h>
+#else
+# include <linux/unaligned/be_memmove.h>
+# include <linux/unaligned/le_byteshift.h>
+# include <linux/unaligned/generic.h>
+#endif
+#endif /* m32r */
+
+#ifdef CONFIG_M68K /* this handles both m68k and m68knommu */
+#ifdef CONFIG_COLDFIRE
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+#else
+/*
+ * The m68k can do unaligned accesses itself.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+#endif
+#endif /* m68k and m68knommu */
+
+#ifdef CONFIG_MIPS
+#if defined(__MIPSEB__)
+# include <linux/unaligned/be_struct.h>
+# include <linux/unaligned/le_byteshift.h>
+# include <linux/unaligned/generic.h>
+# define get_unaligned __get_unaligned_be
+# define put_unaligned __put_unaligned_be
+#elif defined(__MIPSEL__)
+# include <linux/unaligned/le_struct.h>
+# include <linux/unaligned/be_byteshift.h>
+# include <linux/unaligned/generic.h>
+#endif
+#endif /* mips */
+
+#ifdef CONFIG_MN10300
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+#endif /* mn10300 */
+
+#ifdef CONFIG_PARISC
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+#endif /* parisc */
+
+#ifdef CONFIG_PPC
+/*
+ * The PowerPC can do unaligned accesses itself in big endian mode.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+#endif /* ppc */
+
+#ifdef CONFIG_S390
+/*
+ * The S390 can do unaligned accesses itself.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+#endif /* s390 */
+
+#ifdef CONFIG_SUPERH
+/* SH can't handle unaligned accesses. */
+#ifdef __LITTLE_ENDIAN__
+# include <linux/unaligned/le_struct.h>
+# include <linux/unaligned/be_byteshift.h>
+# include <linux/unaligned/generic.h>
+#else
+# include <linux/unaligned/be_struct.h>
+# include <linux/unaligned/le_byteshift.h>
+# include <linux/unaligned/generic.h>
+#endif
+#endif /* sh - SUPERH */
+
+#ifdef CONFIG_SPARC
+/* sparc and sparc64 */
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+#endif /* sparc */
+
+#ifdef CONFIG_UML
+#include "asm/arch/unaligned.h"
+#endif /* um - uml */
+
+#ifdef CONFIG_V850
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+#endif /* v850 */
+
+#ifdef CONFIG_X86
+/*
+ * The x86 can do unaligned accesses itself.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+#endif /* x86 */
+
+#ifdef CONFIG_XTENSA
+#ifdef __XTENSA_EL__
+# include <linux/unaligned/le_memmove.h>
+# include <linux/unaligned/be_byteshift.h>
+# include <linux/unaligned/generic.h>
+#elif defined(__XTENSA_EB__)
+# include <linux/unaligned/be_memmove.h>
+# include <linux/unaligned/le_byteshift.h>
+# include <linux/unaligned/generic.h>
+#else
+# error processor byte order undefined!
+#endif
+#endif /* xtensa */
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) */
+
+#endif /* _COMPAT_ASM_UNALIGNED_H */
diff --git a/include/linux/compat-2.6.26.h b/include/linux/compat-2.6.26.h
index 38e1d8d..9178e49 100644
--- a/include/linux/compat-2.6.26.h
+++ b/include/linux/compat-2.6.26.h
@@ -181,217 +181,9 @@ struct net *dev_net(const struct net_device *dev)
#endif
}
-
-/*
- * 2.6.26 added its own unaligned API which the
- * new drivers can use. Lets port it here by including it in older
- * kernels and also deal with the architecture handling here.
- */
-
-#ifdef CONFIG_ALPHA
-
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* alpha */
-#ifdef CONFIG_ARM
-
-/* arm */
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* arm */
-#ifdef CONFIG_AVR32
-
-/*
- * AVR32 can handle some unaligned accesses, depending on the
- * implementation. The AVR32 AP implementation can handle unaligned
- * words, but halfwords must be halfword-aligned, and doublewords must
- * be word-aligned.
- *
- * However, swapped word loads must be word-aligned so we can't
- * optimize word loads in general.
- */
-
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif
-#ifdef CONFIG_BLACKFIN
-
-#include <linux/unaligned/le_struct.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* blackfin */
-#ifdef CONFIG_CRIS
-
-/*
- * CRIS can do unaligned accesses itself.
- */
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* cris */
-#ifdef CONFIG_FRV
-
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* frv */
-#ifdef CONFIG_H8300
-
-#include <linux/unaligned/be_memmove.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* h8300 */
-#ifdef CONFIG_IA64
-
-#include <linux/unaligned/le_struct.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* ia64 */
-#ifdef CONFIG_M32R
-
-#if defined(__LITTLE_ENDIAN__)
-# include <linux/unaligned/le_memmove.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-#else
-# include <linux/unaligned/be_memmove.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-#endif
-
-#endif /* m32r */
-#ifdef CONFIG_M68K /* this handles both m68k and m68knommu */
-
-#ifdef CONFIG_COLDFIRE
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-#else
-
-/*
- * The m68k can do unaligned accesses itself.
- */
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-#endif
-
-#endif /* m68k and m68knommu */
-#ifdef CONFIG_MIPS
-
-#if defined(__MIPSEB__)
-# include <linux/unaligned/be_struct.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-# define get_unaligned __get_unaligned_be
-# define put_unaligned __put_unaligned_be
-#elif defined(__MIPSEL__)
-# include <linux/unaligned/le_struct.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-#endif
-
-#endif /* mips */
-#ifdef CONFIG_MN10300
-
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* mn10300 */
-#ifdef CONFIG_PARISC
-
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* parisc */
-#ifdef CONFIG_PPC
-/*
- * The PowerPC can do unaligned accesses itself in big endian mode.
- */
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* ppc */
-#ifdef CONFIG_S390
-
-/*
- * The S390 can do unaligned accesses itself.
- */
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* s390 */
-#ifdef CONFIG_SUPERH
-
-/* SH can't handle unaligned accesses. */
-#ifdef __LITTLE_ENDIAN__
-# include <linux/unaligned/le_struct.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-#else
-# include <linux/unaligned/be_struct.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-#endif
-
-#endif /* sh - SUPERH */
-#ifdef CONFIG_SPARC
-
-/* sparc and sparc64 */
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* sparc */
-#ifdef CONFIG_UML
-
-#include "asm/arch/unaligned.h"
-
-#endif /* um - uml */
-#ifdef CONFIG_V850
-
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* v850 */
-#ifdef CONFIG_X86
-/*
- * The x86 can do unaligned accesses itself.
- */
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* x86 */
-#ifdef CONFIG_XTENSA
-
-#ifdef __XTENSA_EL__
-# include <linux/unaligned/le_memmove.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-#elif defined(__XTENSA_EB__)
-# include <linux/unaligned/be_memmove.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-#else
-# error processor byte order undefined!
-#endif
-
-#endif /* xtensa */
-
-#define PCIE_LINK_STATE_L0S 1
-#define PCIE_LINK_STATE_L1 2
-#define PCIE_LINK_STATE_CLKPM 4
+#define PCIE_LINK_STATE_L0S 1
+#define PCIE_LINK_STATE_L1 2
+#define PCIE_LINK_STATE_CLKPM 4
static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
{
--
1.7.2.30.gc37d7.dirty
next prev parent reply other threads:[~2010-11-10 2:21 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-10 2:19 [PATCH 00/44] Compat Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 01/44] compat/2.6.17: add header's skeleton Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 02/44] compat/2.6.17: add compat macro for `NET_SKB_PAD' Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 03/44] compat/2.6.18: add compat skeleton for the `hwrng' API Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 04/44] compat/2.6.18: add compat inline for netdev_alloc_skb() Arnaud Lacombe
2010-11-10 21:53 ` Luis R. Rodriguez
2010-11-10 21:58 ` Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 05/44] compat/2.6.19: fix comment Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 06/44] compat/2.6.19: add typedef for `bool' and `true'/`false' Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 07/44] compat/2.6.19: rework compat macro to kmem_cache_destroy() Arnaud Lacombe
2010-11-10 21:57 ` Luis R. Rodriguez
2010-11-10 2:19 ` [PATCH 08/44] compat/2.6.20: add header's skeleton Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 09/44] compat/2.6.20: add compat macro for `struct delayed_work' Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 10/44] compat/2.6.23: add compat inline for notifier_{from,to}_errno() Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 11/44] compat/2.6.24: add compat macro for sk_alloc() Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 12/44] compat/2.6.25: don't include <linux/hw_random.h> prior to 2.6.18 Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 13/44] compat/2.6.25: don't include <linux/{io,leds}.h> prior to 2.6.17 Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 14/44] compat/2.6.25: conditionally defines `__WARN' Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 15/44] compat/2.6.25: add compat macro for ip_route_output_key() Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 16/44] compat/2.6.29: don't include <linux/if_link.h> prior to 2.6.19 Arnaud Lacombe
2010-11-10 2:19 ` [PATCH 17/44] compat/2.6.29: const'ify compat inline to dev_get_stats() Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 18/44] compat/2.6.31: gather all the threaded IRQ backport together Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 19/44] compat/2.6.31: fix threaded irq backport wrt. INIT_WORK() macro Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 20/44] compat/2.6.32: fix compat inline to flush_delayed_work() Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 21/44] compat/2.6.32: add compat macros for sysctl helpers Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 22/44] compat/2.6.33: add compat macro to BUILD_BUG_ON_NOT_POWER_OF_2() Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 23/44] compat/2.6.33: fix pcmcia include Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 24/44] compat/2.6.33: don't export prototype for pccard_loop_tuple() Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 25/44] compat/2.6.36: `va_list' needs <stdarg.h> Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 26/44] compat: remove a couple of macro definition protection Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 27/44] compat/2.6.33: remove macro not in mainline Arnaud Lacombe
2010-11-10 22:22 ` Luis R. Rodriguez
2010-11-10 2:20 ` [PATCH 28/44] compat: avoid using `#include_next' directive in compat headers Arnaud Lacombe
2010-11-10 22:23 ` Felix Fietkau
2010-11-10 22:24 ` Luis R. Rodriguez
2010-11-22 1:36 ` Arnaud Lacombe
2010-11-22 18:09 ` Luis R. Rodriguez
2010-11-23 2:19 ` Arnaud Lacombe
2010-11-23 2:32 ` Luis R. Rodriguez
2010-11-23 2:40 ` Arnaud Lacombe
2010-11-23 3:22 ` Luis R. Rodriguez
2010-11-23 17:57 ` Luis R. Rodriguez
2010-11-10 2:20 ` [PATCH 29/44] compat/2.6.22: rework `uninitialized_var' and `__maybe_unused' macros Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 30/44] compat/2.6.22: nuke pci_{clear,set}_mwi() Arnaud Lacombe
2010-11-10 22:27 ` Luis R. Rodriguez
2010-11-10 2:20 ` [PATCH 31/44] compat/2.6.22: add compat for couple of TCP accessors Arnaud Lacombe
2010-11-22 1:28 ` Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 32/44] compat/2.6.22: add compat inline for ip_hdrlen() Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 33/44] compat/2.6.22: constify skb_transport_header()'s argument Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 34/44] compat/2.6.24: move 'struct net' to its own compat header Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 35/44] compat/2.6.26: {U,}SHORT_MAX/SHORT_MIN have been deprecated Arnaud Lacombe
2010-11-10 2:20 ` Arnaud Lacombe [this message]
2010-11-10 22:30 ` [PATCH 36/44] compat/2.6.26: move unaligned backport to its own header Luis R. Rodriguez
2010-11-10 2:20 ` [PATCH 37/44] compat/2.6.2{7,8}: fix definition for IEEE80211_HT_CAP_DSSSCCK40 Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 38/44] compat/2.6.2{8,9}: fix tracepoint macros Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 39/44] compat/2.6.29: protect headers inclusion Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 40/44] compat/2.6.29: don't waste space around DIV_ROUND_CLOSEST() Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 41/44] compat/2.6.29: fix typos Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 42/44] compat/2.6.{21,30}: make dev_set_uevent_suppress() a no-op for <2.6.21 Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 43/44] compat/2.6.{19,31}: fix threaded irq backport for <2.6.19 Arnaud Lacombe
2010-11-10 2:20 ` [PATCH 44/44] compat/2.6.35: 2.6.35 does not define `SHRT_MIN' Arnaud Lacombe
2010-11-10 22:37 ` [PATCH 00/44] Compat Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1289355626-25373-37-git-send-email-lacombar@gmail.com \
--to=lacombar@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lrodriguez@atheros.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).