openwrt/staging/blogic.git
12 years agocompat: clean ckmake log of color output
Luis R. Rodriguez [Sat, 25 Feb 2012 02:55:11 +0000 (18:55 -0800)]
compat: clean ckmake log of color output

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: fix compilation warning for compat_firmware_class on 2.6.26
Luis R. Rodriguez [Sat, 25 Feb 2012 02:48:49 +0000 (18:48 -0800)]
compat: fix compilation warning for compat_firmware_class on 2.6.26

This fixes this compilation issue:

  CC [M]  /home/mcgrof/compat/compat/compat_firmware_class.o
/home/mcgrof/compat/compat/compat_firmware_class.c:24:0: warning: "to_dev" redefined
include/linux/input.h:1218:0: note: this is the location of the previous definition
/home/mcgrof/compat/compat/compat_firmware_class.c:24:0: warning: "to_dev" redefined
include/linux/input.h:1218:0: note: this is the location of the previous definition

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: fix compilation on latest kernels
Luis R. Rodriguez [Sat, 25 Feb 2012 02:38:14 +0000 (18:38 -0800)]
compat: fix compilation on latest kernels

The variables wasn't being set in shell. By defining
the variables in shell and outputing them once onto
a .config we avoid having to do release kernel checks
every single time.

We're back in business with the latest kernels.

mcgrof@tux ~/compat (git::master)$ ckmake
Trying kernel                  3.3.0-030300rc2-generic  [OK]
Trying kernel                     3.2.2-030202-generic  [OK]
Trying kernel                    3.1.10-030110-generic  [OK]
Trying kernel                    3.0.18-030018-generic  [OK]
Trying kernel                  2.6.39-02063904-generic  [OK]
Trying kernel                         2.6.38-8-generic  [OK]
Trying kernel                        2.6.38-13-generic  [OK]
Trying kernel                        2.6.38-12-generic  [OK]
Trying kernel                        2.6.38-11-generic  [OK]
Trying kernel                        2.6.38-10-generic  [OK]
Trying kernel                  2.6.38-02063808-generic  [OK]
Trying kernel                  2.6.37-02063706-generic  [OK]
Trying kernel                  2.6.36-02063604-generic  [OK]
Trying kernel                  2.6.35-02063512-generic  [OK]
Trying kernel                  2.6.34-02063410-generic  [OK]
Trying kernel                  2.6.33-02063305-generic  [OK]
Trying kernel                  2.6.32-02063255-generic  [OK]
Trying kernel                        2.6.31-22-generic  [OK]
Trying kernel                  2.6.31-02063113-generic  [OK]
Trying kernel                  2.6.30-02063010-generic  [OK]
Trying kernel                  2.6.29-02062906-generic  [OK]
Trying kernel                  2.6.28-02062810-generic  [OK]
Trying kernel                    2.6.27-020627-generic  [OK]
Trying kernel                    2.6.26-020626-generic  [OK]
Trying kernel                    2.6.25-020625-generic  [FAILED]

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: add some initial RHEL support
Luis R. Rodriguez [Sat, 25 Feb 2012 01:38:10 +0000 (17:38 -0800)]
compat: add some initial RHEL support

This adds a series of CONFIG_COMPAT_${RHEL_MAJOR}_${i} tags
for each known RHEL version that we supercede. I cannot
verify if this is correct but this is my translation of
this to script:

RHEL_MAJOR := $(shell grep ^RHEL_MAJOR $(KLIB_BUILD)/Makefile | sed -n 's/.*= *\(.*\)/\1/p')
ifneq ($(RHEL_MAJOR),)
RHEL_MINOR := $(shell grep ^RHEL_MINOR $(KLIB_BUILD)/Makefile | sed -n 's/.*= *\(.*\)/\1/p')
COMPAT_RHEL_VERSIONS := $(shell I=$(RHEL_MINOR); while [ "$$I" -ge 0 ]; do echo $$I; I=$$(($$I - 1)); done)
$(foreach ver,$(COMPAT_RHEL_VERSIONS),$(eval CONFIG_COMPAT_RHEL_$(RHEL_MAJOR)_$(ver)=y))

Cc: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: fix few compilations by adding compat_autoconf.h support
Luis R. Rodriguez [Fri, 24 Feb 2012 22:20:31 +0000 (14:20 -0800)]
compat: fix few compilations by adding compat_autoconf.h support

The Makefile was generating the appropriate CONFIG_COMPAT_KERNEL_*
variables for our Makefiles but this was being ignored by C files
as compat had no compat_autoconf.h being generated. This patch
addresses this but also puhes out the CONFIG_COMPAT_KERNEL_* variable
generation to scripts. We have now two scripts:

scripts/gen-compat-config.sh - generates .config for Makefile propagation
scripts/gen-compat-autoconf.sh  - generates compat_autoconf.h for code propagation

This fixes running ckmake on older kernels. This issue was present
only on compat and not compat_wireless as compat_wireless was generating
its own compat_autoconf.h. This fixes compilation against some older
kernels of just the compat module alone. Some work is still required
for some newer and really ancient kernels:

mcgrof@tux ~/compat (git::master)$ ckmake
Trying kernel                  3.3.0-030300rc2-generic  [FAILED]
Trying kernel                     3.2.2-030202-generic  [FAILED]
Trying kernel                    3.1.10-030110-generic  [FAILED]
Trying kernel                    3.0.18-030018-generic  [FAILED]
Trying kernel                  2.6.39-02063904-generic  [FAILED]
Trying kernel                         2.6.38-8-generic  [OK]
Trying kernel                        2.6.38-13-generic  [OK]
Trying kernel                        2.6.38-12-generic  [OK]
Trying kernel                        2.6.38-11-generic  [OK]
Trying kernel                        2.6.38-10-generic  [OK]
Trying kernel                  2.6.38-02063808-generic  [OK]
Trying kernel                  2.6.37-02063706-generic  [OK]
Trying kernel                  2.6.36-02063604-generic  [OK]
Trying kernel                  2.6.35-02063512-generic  [OK]
Trying kernel                  2.6.34-02063410-generic  [OK]
Trying kernel                  2.6.33-02063305-generic  [OK]
Trying kernel                  2.6.32-02063255-generic  [OK]
Trying kernel                        2.6.31-22-generic  [OK]
Trying kernel                  2.6.31-02063113-generic  [OK]
Trying kernel                  2.6.30-02063010-generic  [OK]
Trying kernel                  2.6.29-02062906-generic  [OK]
Trying kernel                  2.6.28-02062810-generic  [OK]
Trying kernel                    2.6.27-020627-generic  [OK]
Trying kernel                    2.6.26-020626-generic  [OK]
Trying kernel                    2.6.25-020625-generic  [FAILED]
Trying kernel                    2.6.24-020624-generic  [FAILED]

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: README pointing to new shiny site
Luis R. Rodriguez [Fri, 17 Feb 2012 04:18:47 +0000 (20:18 -0800)]
compat: README pointing to new shiny site

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: add dummy lockdep_rtnl_is_held implementation
John W. Linville [Wed, 15 Feb 2012 21:36:25 +0000 (16:36 -0500)]
compat: add dummy lockdep_rtnl_is_held implementation

Obviously, this is wrong.  But the base kernel will have rtnl_mutex
declared static, with no way to access it.  I think this is the best
we can do...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: extend phys_addr_t backport to 2.6.24
Luis R. Rodriguez [Wed, 8 Feb 2012 04:01:55 +0000 (20:01 -0800)]
compat: extend phys_addr_t backport to 2.6.24

x86 only got phys_addr_t as of 2.6.25. This patch addresses
that. The only arch that had phys_addr_t prior to that is
PPC.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: backport making atomic_t and atomic64_t universal
Luis R. Rodriguez [Wed, 8 Feb 2012 03:22:02 +0000 (19:22 -0800)]
compat: backport making atomic_t and atomic64_t universal

mcgrof@tux ~/linux-next (git::master)$ \
git describe --contains ea435467500612636f8f4fb639ff6e76b2496e4b
v2.6.29-rc1~390

This commit moved atomic_t and atomic64_t to a generic
place, but some archs already had it defined. Just include
that header for the archs that had it.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: backport phys_addr_t (CONFIG_PHYS_ADDR_T_64BIT)
Luis R. Rodriguez [Wed, 8 Feb 2012 01:21:43 +0000 (17:21 -0800)]
compat: backport phys_addr_t (CONFIG_PHYS_ADDR_T_64BIT)

mcgrof@tux ~/linux-stable (git::linux-3.2.y)$ \
git describe --contains 600715dcdf567c86f8b2c6173fcfb4b873e25a19
v2.6.28-rc1~271^2^4~6

The CONFIG_PHYS_ADDR_T_64BIT  was added as of v2.6.28-rc1~271^2^4~6,
this is either u32 or u64 dependent on 64BIT || ARCH_PHYS_ADDR_T_64BIT.
The ARCH_PHYS_ADDR_T_64BIT allows architectures to override the
value even if the platform does not have CONFIG_64BIT. We simplify
this check by just checking for all known architecture variables and
also the CONFIG_64BIT -- but we skip adding this if the arch is
x86 or PPC which already had phys_addr_t.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: fix for new CONFIG_COMPAT_KERNEL_2_6_* name changes
Luis R. Rodriguez [Wed, 8 Feb 2012 00:44:01 +0000 (16:44 -0800)]
compat: fix for new CONFIG_COMPAT_KERNEL_2_6_* name changes

On the CONFIG_COMPAT_KERNEL_2_6* name change earlier we forgot
to update a few checks.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: add x86 support to get-compat-kernels for Ubuntu
Luis R. Rodriguez [Tue, 7 Feb 2012 08:36:04 +0000 (00:36 -0800)]
compat: add x86 support to get-compat-kernels for Ubuntu

Now both x86_64 and x86 are supported.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: backport __netdev_printk()
Luis R. Rodriguez [Tue, 31 Jan 2012 22:44:41 +0000 (14:44 -0800)]
compat: backport __netdev_printk()

This was added in v3.2, and will be used by the new
shiny alx Ethernet driver which is not yet upstream.
This now has some fixes for 2.6.35.

Tested with ckmake.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: export compat kernel versions info
Luis R. Rodriguez [Sat, 4 Feb 2012 00:56:18 +0000 (16:56 -0800)]
compat: export compat kernel versions info

The reason this worked on compat-wireless was that
config.mk exported every variable. We need to do the
same.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: add compat kernel checker and downloader
Luis R. Rodriguez [Fri, 3 Feb 2012 23:11:07 +0000 (15:11 -0800)]
compat: add compat kernel checker and downloader

This adds get-compat-kernels, a utility that is intended
to be Linux distribution agnostic that downloads and installs
all kernel headers for all supported kernel releases of compat.
You also have the option of specifying you want to also install
the actual kernel image (get-compat-kernels -i).

We start off by adding support for Ubuntu on x86_64 as that
is what a few of us maintaining compat and compat-wireless run.
Just for kernel headers (default run of get-compat-kernels),
you'll need currently 205 M of hard drive space.

Once done with running get-compat-kernels, you can then
start running ckmake to verify your compat kernel changes
won't bust compilation against any known supported kernel.

I'd like to start requiring runs against this script for
patch submissions. Eventually we can try to add the same
runs against compat-wireless so we can verify integrity
against compilation for different kernel versions.

Support for different Linux distributios is welcomed.

Debug log goes out to ckmake.log

Example output:

mcgrof@tux ~/compat (git::master)$ ckmake
Trying kernel                  3.3.0-030300rc2-generic  [OK]
Trying kernel                     3.2.2-030202-generic  [OK]
Trying kernel                    3.1.10-030110-generic  [OK]
Trying kernel                    3.0.18-030018-generic  [OK]
Trying kernel                  2.6.39-02063904-generic  [OK]
Trying kernel                         2.6.38-8-generic  [OK]
Trying kernel                        2.6.38-13-generic  [OK]
Trying kernel                        2.6.38-12-generic  [OK]
Trying kernel                        2.6.38-11-generic  [OK]
Trying kernel                        2.6.38-10-generic  [OK]
Trying kernel                  2.6.38-02063808-generic  [OK]
Trying kernel                  2.6.37-02063706-generic  [OK]
Trying kernel                  2.6.36-02063604-generic  [OK]
Trying kernel                  2.6.35-02063512-generic  [OK]
Trying kernel                  2.6.34-02063410-generic  [OK]
Trying kernel                  2.6.33-02063305-generic  [OK]
Trying kernel                  2.6.32-02063255-generic  [OK]
Trying kernel                        2.6.31-22-generic  [OK]
Trying kernel                  2.6.31-02063113-generic  [OK]
Trying kernel                  2.6.30-02063010-generic  [OK]
Trying kernel                  2.6.29-02062906-generic  [OK]
Trying kernel                  2.6.28-02062810-generic  [OK]
Trying kernel                    2.6.27-020627-generic  [OK]
Trying kernel                    2.6.26-020626-generic  [OK]
Trying kernel                    2.6.25-020625-generic  [OK]
Trying kernel                    2.6.24-020624-generic  [OK]

Cc: kernel-team@lists.ubuntu.com
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: add .gitignore
Luis R. Rodriguez [Fri, 3 Feb 2012 23:10:46 +0000 (15:10 -0800)]
compat: add .gitignore

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: fix building for 3.0 kernels
Luis R. Rodriguez [Fri, 3 Feb 2012 21:51:42 +0000 (13:51 -0800)]
compat: fix building for 3.0 kernels

Changes integrated from compat-wireless

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agoRevert "compat: backport __netdev_printk()"
Luis R. Rodriguez [Fri, 3 Feb 2012 18:25:35 +0000 (10:25 -0800)]
Revert "compat: backport __netdev_printk()"

Reverting for now until this is fixed for all kernels
that we support.

This reverts commit fd3a74e12f687509da0a996b4e01c4fa6ca32ff8.

12 years agocompat: use kconfig.h in compat-2.6.h for 3.1 and later kernels
John W. Linville [Thu, 26 Jan 2012 18:00:56 +0000 (13:00 -0500)]
compat: use kconfig.h in compat-2.6.h for 3.1 and later kernels

This file was introduced in commit 2a11c8ea20bf850b3a2c60db8c2e7497d28aba99
and included in 3.1 and later kernels.  It includes <generated/autoconf.h>
itself, as well as some other definitions that are used elsewhere.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: move br_port_exists() to compat-2.6.36.h
Hauke Mehrtens [Thu, 26 Jan 2012 22:51:45 +0000 (23:51 +0100)]
compat: move br_port_exists() to compat-2.6.36.h

br_port_exists() was moved to a new compat-*.h file for every new
kernel release, as it is not in mainline. This patch moves it to compat-
2.6.36.h so it has not to be moved any more for a new kernel version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: backport __netdev_printk()
Luis R. Rodriguez [Tue, 31 Jan 2012 22:44:41 +0000 (14:44 -0800)]
compat: backport __netdev_printk()

This was added in v3.2, and will be used by the new
shiny alx Ethernet driver which is not yet upstream.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agoAdd dma_zalloc_coherent to fix build with kernels older than 3.2
Nikolay Martynov [Mon, 16 Jan 2012 05:07:55 +0000 (00:07 -0500)]
Add dma_zalloc_coherent to fix build with kernels older than 3.2

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
12 years agocompat: add module_usb_driver and module_platform_driver
Hauke Mehrtens [Sat, 3 Dec 2011 14:49:26 +0000 (15:49 +0100)]
compat: add module_usb_driver and module_platform_driver

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 years agocompat: add config var for CORDIC and CRC8
Hauke Mehrtens [Sat, 3 Dec 2011 14:49:25 +0000 (15:49 +0100)]
compat: add config var for CORDIC and CRC8

Sometimes the kernel version compat-wireless is build against has
support for cordic and crc8 in its source, but these modules were not
build when the kernel was build, because no one selected them. The modules are
needed for the bcmsmac driver and they should be build every time when
they were not already build while the kernel was build.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 years agocompat: fix security_sk_clone dummy backport compile
Felix Fietkau [Fri, 2 Dec 2011 11:12:46 +0000 (12:12 +0100)]
compat: fix security_sk_clone dummy backport compile

linux/security.h needs to be included before the dummy function overrides it,
otherwise the macro that redirects it to the compat version will apply to
the kernel function as well, causing multiple conflicting definitions

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agocompat: backport atomic64 support
Felix Fietkau [Fri, 2 Dec 2011 10:28:26 +0000 (11:28 +0100)]
compat: backport atomic64 support

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agocompat: implement dummy security_sk_clone
John W. Linville [Fri, 18 Nov 2011 20:52:44 +0000 (15:52 -0500)]
compat: implement dummy security_sk_clone

This has been defined in include/linux/security.h for some time, but was
only given an EXPORT_SYMBOL for 3.1.  Add a compat_* definition to avoid
breaking the module load with an undefined symbol.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocompat: fix misplaced #ifdef for the workqueue backport
Felix Fietkau [Sun, 20 Nov 2011 09:39:22 +0000 (10:39 +0100)]
compat: fix misplaced #ifdef for the workqueue backport

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
13 years agocompat: avoid warning in compat_system_workqueue_create
John W. Linville [Thu, 17 Nov 2011 00:39:33 +0000 (19:39 -0500)]
compat: avoid warning in compat_system_workqueue_create

The check in the WARN_ON is inverted.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocompat: backport netdev_features_t
Hauke Mehrtens [Thu, 17 Nov 2011 21:23:11 +0000 (22:23 +0100)]
compat: backport netdev_features_t

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
13 years agocompat: backport kfree_rcu()
Hauke Mehrtens [Thu, 17 Nov 2011 23:05:45 +0000 (00:05 +0100)]
compat: backport kfree_rcu()

This adds a nested function everywhere kfree_rcu() was called. This
function frees the memory and is given as a function to call_rcu().
The kfree_rcu define was made by Johannes Berg.
The rcu callback could happen every time also after the module was
unloaded and this will cause problems.
A rcu_barrier() was added into every module_exit so that this will not
be called after the module was unloaded.

The define overwriting module_exit is based on the original module_exit
which looks like this:
/* This is only required if you want to be unloadable. */
/#define module_exit(exitfn)                                    \
        static inline exitcall_t __exittest(void)               \
        { return exitfn; }                                      \
        void cleanup_module(void) __attribute__((alias(#exitfn)));

We replaced the call to the actual function exitfn() with a call to our
function which calls the original exitfn() and then rcu_barrier()

As a module will not be unloaded that ofter it should not have a big
performance impact when rcu_barrier() is called on every module exit,
also when no kfree_rcu() backport is used in that module.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
CC: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
13 years agocompat: add support for kernel 3.2
Hauke Mehrtens [Thu, 17 Nov 2011 21:23:09 +0000 (22:23 +0100)]
compat: add support for kernel 3.2

This adds suport for kernel 3.2.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
13 years agocompat: support RHEL6 as a build target
John W. Linville [Thu, 17 Nov 2011 22:20:42 +0000 (17:20 -0500)]
compat: support RHEL6 as a build target

This patch enables compatibility with RHEL6 as a build target, mostly
with simple tricks similar to what was added for compatibility with
Debian Squeeze.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
13 years agocompat: check CONFIG_COMPAT_FIRMWARE_CLASS in compat-2.6.33.h
John W. Linville [Thu, 17 Nov 2011 22:20:41 +0000 (17:20 -0500)]
compat: check CONFIG_COMPAT_FIRMWARE_CLASS in compat-2.6.33.h

If a pre-2.6.33 kernel has backported suitable firmware loader
functionality, then it doesn't need the compat_firmware_class.  In that
case, compat-2.6.33 should not redefine the *_firmware function names.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
13 years agocompat: add CONFIG_COMPAT_FIRMWARE_DATA_RW_NEEDS_FILP
John W. Linville [Thu, 17 Nov 2011 22:20:40 +0000 (17:20 -0500)]
compat: add CONFIG_COMPAT_FIRMWARE_DATA_RW_NEEDS_FILP

Some kernels have versions of (struct bin_attribute)->{read,write}
that require a struct file * as their first argument.  This change
accommodates them in the firmware loader class.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
13 years agocompat: use separate CONFIG_COMPAT_KFIFO option for building kfifo.o
John W. Linville [Thu, 17 Nov 2011 22:20:39 +0000 (17:20 -0500)]
compat: use separate CONFIG_COMPAT_KFIFO option for building kfifo.o

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
13 years agocompat: add skb_complete_wifi_ack & feature flag
Johannes Berg [Mon, 14 Nov 2011 16:58:07 +0000 (17:58 +0100)]
compat: add skb_complete_wifi_ack & feature flag

This just needs to be empty -- older kernels don't
have the necessary infrastructure for this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agocompat: add some workarounds for Debian squeeze
Hauke Mehrtens [Tue, 8 Nov 2011 20:46:31 +0000 (21:46 +0100)]
compat: add some workarounds for Debian squeeze

Debian squeeze also backports some stuff and this conflicts with compat
wireless stuff. This is a nice way of making compat work with debian
squeeze without breaking normal kernels.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocomapt: add skb_frag_size() and hex_byte_pack()
Hauke Mehrtens [Sun, 6 Nov 2011 21:25:04 +0000 (22:25 +0100)]
comapt: add skb_frag_size() and hex_byte_pack()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: backport system_nrt_wq
Hauke Mehrtens [Sun, 6 Nov 2011 21:25:03 +0000 (22:25 +0100)]
compat: backport system_nrt_wq

The workqueue system_nrt_wq is not available in kernel version < 2.6.36.
This backport code creates such a queue but this old kernel does not
have WQ_NON_REENTRANT, so we use a single threaded queue instead as it
should meat the same restrictions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agoDepending on the arguments to alloc_netdev_mqs(),
Johannes Berg [Thu, 6 Oct 2011 08:45:26 +0000 (10:45 +0200)]
Depending on the arguments to alloc_netdev_mqs(),
it may give a warning due to the use of max().
Fix the warning with max_t().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agocompat: add linux/of.h just when CONFIG_OF is set.
Hauke Mehrtens [Tue, 4 Oct 2011 11:11:47 +0000 (13:11 +0200)]
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 <hauke@hauke-m.de>
13 years agocompat: add is_unicast_ether_addr
Hauke Mehrtens [Tue, 4 Oct 2011 11:11:46 +0000 (13:11 +0200)]
compat: add is_unicast_ether_addr

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add ETH_P_TDLS
Hauke Mehrtens [Tue, 4 Oct 2011 11:11:45 +0000 (13:11 +0200)]
compat: add ETH_P_TDLS

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add skb_tx_timestamp() and skb_defer_rx_timestamp()
Hauke Mehrtens [Sat, 1 Oct 2011 10:32:54 +0000 (12:32 +0200)]
compat: add skb_tx_timestamp() and skb_defer_rx_timestamp()

Just add an empty implementation of these functions to do the same as
when timestamping is deactivated.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add IS_ERR_OR_NULL()
Hauke Mehrtens [Wed, 28 Sep 2011 18:43:44 +0000 (20:43 +0200)]
compat: add IS_ERR_OR_NULL()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: provide INIT_WORK with 2 arguments for kernels before 2.6.20
Pavel Roskin [Fri, 23 Sep 2011 21:48:05 +0000 (17:48 -0400)]
compat: provide INIT_WORK with 2 arguments for kernels before 2.6.20

Also provide work_func_t.  Originally implemented and tested in
ndiswrapper.

Signed-off-by: Pavel Roskin <proski@gnu.org>
13 years agocompat: add lower_32_bits
Hauke Mehrtens [Wed, 21 Sep 2011 17:04:24 +0000 (19:04 +0200)]
compat: add lower_32_bits

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add rcu_read_lock_held()
Hauke Mehrtens [Wed, 21 Sep 2011 17:04:23 +0000 (19:04 +0200)]
compat: add rcu_read_lock_held()

just the version without lock debug support is implemented, if you want
to debug the logs use a more recent kernel version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add kstrtou8_from_user
Hauke Mehrtens [Wed, 31 Aug 2011 22:20:12 +0000 (00:20 +0200)]
compat: add kstrtou8_from_user

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add skb_frag_dma_map
Hauke Mehrtens [Wed, 31 Aug 2011 22:20:11 +0000 (00:20 +0200)]
compat: add skb_frag_dma_map

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add __always_unused
Hauke Mehrtens [Wed, 31 Aug 2011 22:20:10 +0000 (00:20 +0200)]
compat: add __always_unused

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add crc8 lib
Hauke Mehrtens [Wed, 24 Aug 2011 11:20:39 +0000 (13:20 +0200)]
compat: add crc8 lib

compat/crc8.c was copied from lib/crc8.c and include/linux/crc8.h was
copied from include/linux/crc8.h

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add cordic lib
Hauke Mehrtens [Wed, 24 Aug 2011 11:20:38 +0000 (13:20 +0200)]
compat: add cordic lib

compat/cordic.c was copied from lib/cordic.c and include/linux/cordic.h was
copied from include/linux/cordic.h

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add mac_pton()
Hauke Mehrtens [Wed, 24 Aug 2011 11:20:37 +0000 (13:20 +0200)]
compat: add mac_pton()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add PMSG_IS_AUTO
Hauke Mehrtens [Tue, 23 Aug 2011 11:38:29 +0000 (13:38 +0200)]
compat: add PMSG_IS_AUTO

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: pm_qos_params.h was renamed to pm_qos.h
Hauke Mehrtens [Tue, 23 Aug 2011 11:38:28 +0000 (13:38 +0200)]
compat: pm_qos_params.h was renamed to pm_qos.h

pm_qos.h was renamed to pm_qos_params.h in:
commit 1eee4691c3f058d1cf9757947ad9d9e03145a12c
Author: Jean Pihet <j-pihet@ti.com>
Date:   Thu Aug 18 10:31:55 2011 +0200

    PM QoS: Move and rename the implementation files

For older kernel versions the old header file should be used instead of the new one.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agoThe led_lock is never initialised, so there
Johannes Berg [Fri, 12 Aug 2011 18:23:08 +0000 (20:23 +0200)]
The led_lock is never initialised, so there
are warnings/errors. It can also be made
static.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agocompat: add support for linux 3.1
Hauke Mehrtens [Mon, 15 Aug 2011 18:32:50 +0000 (20:32 +0200)]
compat: add support for linux 3.1

br_port_exists is not in mainline, will it ever?

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add round_down
Hauke Mehrtens [Thu, 11 Aug 2011 11:02:37 +0000 (13:02 +0200)]
compat: add round_down

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add linux/atmoic.h
Hauke Mehrtens [Tue, 2 Aug 2011 21:14:23 +0000 (23:14 +0200)]
compat: add linux/atmoic.h

This include is needed by some drivers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add linux/export.h
Hauke Mehrtens [Tue, 2 Aug 2011 21:14:22 +0000 (23:14 +0200)]
compat: add linux/export.h

Export will be added in linux-3.2, for older kernel versions the stuff
is in linux/module.h.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add PCMCIA_DEVICE_MANF_CARD_PROD_ID3
Hauke Mehrtens [Tue, 2 Aug 2011 21:14:21 +0000 (23:14 +0200)]
compat: add PCMCIA_DEVICE_MANF_CARD_PROD_ID3

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add IFF_TX_SKB_SHARING
Hauke Mehrtens [Tue, 2 Aug 2011 21:14:20 +0000 (23:14 +0200)]
compat: add IFF_TX_SKB_SHARING

This flag should be ignored by older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add skb_walk_frags() and skb_has_frag_list()
Hauke Mehrtens [Tue, 2 Aug 2011 21:14:19 +0000 (23:14 +0200)]
compat: add skb_walk_frags() and skb_has_frag_list()

These functions are needed for ./net/bluetooth/l2cap_core.c and ./net/bluetooth/af_bluetooth.c.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add include/crypto/aes.h
Hauke Mehrtens [Fri, 22 Jul 2011 16:51:10 +0000 (18:51 +0200)]
compat: add include/crypto/aes.h

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: backport generic pr_fmt
Hauke Mehrtens [Fri, 22 Jul 2011 16:51:09 +0000 (18:51 +0200)]
compat: backport generic pr_fmt

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: backport ETH_P_LINK_CTL
Hauke Mehrtens [Wed, 20 Jul 2011 01:07:53 +0000 (18:07 -0700)]
compat: backport ETH_P_LINK_CTL

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add alloc_netdev_mqs
Stanislaw Gruszka [Fri, 15 Jul 2011 15:50:26 +0000 (17:50 +0200)]
compat: add alloc_netdev_mqs

Function was added in 2.6.38 kernel commit:

commit 36909ea43814cba34f7c921e99cba33d770a54e1
Author: Tom Herbert <therbert@google.com>
Date:   Sun Jan 9 19:36:31 2011 +0000

    net: Add alloc_netdev_mqs function

Emulate it using alloc_netdev_mq(), newer kernels use
opposite emulation method :-)

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
13 years agocompat: add pr_<level>_once macros
Stanislaw Gruszka [Fri, 15 Jul 2011 15:50:25 +0000 (17:50 +0200)]
compat: add pr_<level>_once macros

Add functions from 2.6.38 kernel commit:

commit 16cb839f13324978bd58082e69de81a711802b11
Author: Joe Perches <joe@perches.com>
Date:   Wed Jan 12 16:59:46 2011 -0800

    include/linux/printk.h: add pr_<level>_once macros

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
13 years agoSigned-off-by: Pavel Roskin <proski@gnu.org>
Pavel Roskin [Wed, 29 Jun 2011 22:01:10 +0000 (18:01 -0400)]
Signed-off-by: Pavel Roskin <proski@gnu.org>
set_irq_probe() and set_irq_probe() are missing on Linux 2.6.24, so the
code won't compile.  compat-wireless doesn't need those functions.  Keep
the functions for Linux 2.6.25 and newer for other compat packages.

13 years agoSigned-off-by: Pavel Roskin <proski@gnu.org>
Pavel Roskin [Wed, 29 Jun 2011 20:47:15 +0000 (16:47 -0400)]
Signed-off-by: Pavel Roskin <proski@gnu.org>
Debian backports netdev_name as a function.  As we cannot test if a
function is present, use an equivalent macro.

Reported by Sivaraman V <krusna@gmail.com> and Alex <alex9434@gmail.com>

13 years agocompat: replace genl_dump_check_consistent
Hauke Mehrtens [Tue, 28 Jun 2011 18:39:57 +0000 (20:39 +0200)]
compat: replace genl_dump_check_consistent

remove the usage of genl_dump_check_consistent from the code.

This was introduced in:
commit 9720bb3ab0b80659c63ed337eab66104a4156db0
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Tue Jun 21 09:45:33 2011 +0200

    nl80211: use netlink consistent dump feature for BSS dumps

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add bcma
Hauke Mehrtens [Thu, 9 Jun 2011 22:04:47 +0000 (00:04 +0200)]
compat: add bcma

13 years agocompat: add KEY_WPS_BUTTON
Hauke Mehrtens [Thu, 9 Jun 2011 22:04:46 +0000 (00:04 +0200)]
compat: add KEY_WPS_BUTTON

This is needed for carl9170.

Add to compat-3.0-stable

13 years agocompat: rename CONFIG_COMPAT_KERNEL_
Hauke Mehrtens [Thu, 9 Jun 2011 22:04:45 +0000 (00:04 +0200)]
compat: rename CONFIG_COMPAT_KERNEL_

CONFIG_COMPAT_KERNEL_XX was renamed to CONFIG_COMPAT_KERNEL_2_6_XX in
compat-wireless to support kernel 3.XX, do the same in compat.

Add to compat-3.0-stable

13 years agocompat: add device name in register_netdevice(dev)
Hauke Mehrtens [Thu, 9 Jun 2011 22:04:44 +0000 (00:04 +0200)]
compat: add device name in register_netdevice(dev)

dev_alloc_name() is not called explicitly in the driver code any more,
but it is done in register_netdevice(). This causes devices getting
wrong names like "wlan%d". With this patch they get names like wlan0
again.

Add to compat-3.0-stable

CC: Ignacy Gawedzki <i@lri.fr>
13 years agocompat: add support for kernel 3.0
Hauke Mehrtens [Thu, 9 Jun 2011 22:04:43 +0000 (00:04 +0200)]
compat: add support for kernel 3.0

Kernel 2.6.40 is now 3.0. The br_port_exists() is function is not in
3.0 yet, so it should go to compat-3.1.h

Add to compat-3.0-stable

13 years agocompat: define create_freezable_workqueue
Eliad Peller [Thu, 9 Jun 2011 15:35:03 +0000 (18:35 +0300)]
compat: define create_freezable_workqueue

create_freezeable_workqueue() was renamed to
create_freezable_workqueue().

Signed-off-by: Eliad Peller <eliad@wizery.com>
13 years agocompat: add an empty implementation for pm_wakeup_event()
Eliad Peller [Mon, 23 May 2011 14:17:05 +0000 (17:17 +0300)]
compat: add an empty implementation for pm_wakeup_event()

Needed for wl12xx compilation

Signed-off-by: Eliad Peller <eliad@wizery.com>
13 years agocompat: remove wrong backport of kfree_rcu
Hauke Mehrtens [Sun, 22 May 2011 10:47:34 +0000 (12:47 +0200)]
compat: remove wrong backport of kfree_rcu

Backporting kfree_rcu() in compat does not work as
struct rcu_head->func is always interpreted as a pointer in older
kernel versions, but when using kfree_rcu() it is set to an offset.
rcu_head->func is used in some functions in the kernel not backported
by compat-wireless.

In older kernel versions in __rcu_reclaim just the else path is available.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: backport RCU_INIT_POINTER
Hauke Mehrtens [Sun, 22 May 2011 10:47:33 +0000 (12:47 +0200)]
compat: backport RCU_INIT_POINTER

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: backport rcu_dereference_raw
Hauke Mehrtens [Sun, 22 May 2011 10:47:32 +0000 (12:47 +0200)]
compat: backport rcu_dereference_raw

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: backport rtnl_dereference
Felix Fietkau [Mon, 16 May 2011 18:10:19 +0000 (20:10 +0200)]
compat: backport rtnl_dereference

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
13 years agocompat: backport rcu_access_pointer
Felix Fietkau [Mon, 16 May 2011 18:10:18 +0000 (20:10 +0200)]
compat: backport rcu_access_pointer

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
13 years agocompat: backport rcu_dereference_protected
Felix Fietkau [Mon, 16 May 2011 17:43:35 +0000 (19:43 +0200)]
compat: backport rcu_dereference_protected

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
13 years agocompat: add an empty definition for __rcu
Felix Fietkau [Mon, 16 May 2011 17:43:33 +0000 (19:43 +0200)]
compat: add an empty definition for __rcu

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
13 years agocompat: add header linux/printk.h
Hauke Mehrtens [Sat, 14 May 2011 17:47:32 +0000 (19:47 +0200)]
compat: add header linux/printk.h

Some drivers are including linux/printk.h and this is not available for
kernel < 2.6.37, but the needed declared methods are all in
linux/kernel.h.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: backport ethtool_cmd_speed
Hauke Mehrtens [Tue, 10 May 2011 11:10:16 +0000 (13:10 +0200)]
compat: backport ethtool_cmd_speed

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: backport kfree_rcu
Hauke Mehrtens [Tue, 10 May 2011 11:10:15 +0000 (13:10 +0200)]
compat: backport kfree_rcu

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add missing include
Hauke Mehrtens [Tue, 10 May 2011 11:10:14 +0000 (13:10 +0200)]
compat: add missing include

Reported-By: George Nychis <gnychis@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: handle fail of vmalloc()
Hauke Mehrtens [Wed, 27 Apr 2011 19:01:22 +0000 (21:01 +0200)]
compat: handle fail of vmalloc()

Only memset the memory if we get a valid pointer.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: backport vzalloc()
Hauke Mehrtens [Wed, 27 Apr 2011 18:04:16 +0000 (20:04 +0200)]
compat: backport vzalloc()

vzalloc() is used in rtl8192ce now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: fix TASK_INTERRUPTIBLE missing
Hauke Mehrtens [Sun, 24 Apr 2011 16:11:15 +0000 (18:11 +0200)]
compat: fix TASK_INTERRUPTIBLE missing

When compiling against the Ubuntu Natty kernel (2.6.38-8-generic)
TASK_INTERRUPTIBLE is not defined here.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: do not include kstrto* for kernel >= 2.6.38.4
Hauke Mehrtens [Sun, 24 Apr 2011 16:11:14 +0000 (18:11 +0200)]
compat: do not include kstrto* for kernel >= 2.6.38.4

kstrto* went into kernel 2.6.38.4 and causes conflicts with the version
included in compat-wireless. We use strict_strtol to check if kstrto*
is already available.
kstrto* was not moved to compat-2.6.38.h because kernel version <=
2.6.38.3 needs this backport and some distributions like Ubuntu still
ship an older version of this kernel.

Reported-by: Andreas Hartmann <andihartmann@01019freenet.de>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add time_to_tm
Hauke Mehrtens [Wed, 20 Apr 2011 21:31:50 +0000 (23:31 +0200)]
compat: add time_to_tm

time_to_tm is needed in net/mac80211/debugfs_sta.c now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: remove sdio_set_host_pm_flags
Hauke Mehrtens [Thu, 7 Apr 2011 14:39:18 +0000 (16:39 +0200)]
compat: remove sdio_set_host_pm_flags

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: add kstrtox
Hauke Mehrtens [Thu, 7 Apr 2011 14:39:17 +0000 (16:39 +0200)]
compat: add kstrtox

compat/kstrtox.c is copied from lib/kstrtox.c in the Linux kernel.
This is needed by some drivers now.
For kernel < 2.6.26 div_u64 needs to be backported.

We should not copy the files like kstrtox.c, kfifo.c and so on to
compat/ by hand, but copy them when creating compat-wireless along with
the wireless drivers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: integrate kfifo into compat.ko
Hauke Mehrtens [Thu, 7 Apr 2011 14:39:16 +0000 (16:39 +0200)]
compat: integrate kfifo into compat.ko

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 years agocompat: semaphore.h mpoved from asm/ to linux/
Hauke Mehrtens [Thu, 31 Mar 2011 16:21:35 +0000 (09:21 -0700)]
compat: semaphore.h mpoved from asm/ to linux/

In kernel <= 2.6.25 linux/semaphore.h does not exist.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>