Hauke Mehrtens [Sun, 6 Jun 2010 09:12:27 +0000 (11:12 +0200)]
compat: use kernel pm_qos_params.h
Do not use pm_qos_params.h from compat-wireless if the kernel also
ships this file. In kernel 2.6.35 pm_qos_params.h changed and the in
kernel header file is needed.
This will be used to identify the backport project
only during initialization, there is no associated
module parameter for this as there is no need for it.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
This will allow you to supply a version tag for the
backport you use. Compat-wireless will re-use this and
give it its own value based on the kernel we backport
from. It will use either the linux-next git describe
or the stable kernel git describe. Any delta on top of
the git tree should also be reflected then in case of
custom private trees/releases.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
compat: add new way to backport the usage of net_device_ops
We tend to #ifdef code that uses the new net_device_ops
on kernels older than 2.6.29. This tends to create a burden
on the upkeeping of the hunks. We can minimize our work by
instead definining a new netdev_attach_ops() which will do
our backport work for the older kernels and simply attach
the ops for newer kernels.
This should simplify backporting of network drivers
considerably.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
compat: fix uevent_suppress on 2.6.29 or older kernels
Missing uevent_suppress is causing two uevents instead of one, which is
confusing udev and sometimes causing firmware load to fail due to race
condition, so let's add it.
Pavel Roskin [Sat, 20 Feb 2010 01:17:42 +0000 (20:17 -0500)]
compat: move debugfs_remove_recursive() to compat-2.6.27
debugfs_remove_recursive() appeared in Linux 2.6.27, so it should be in
compat-2.6.27, not in compat-2.6.26. Don't compile it if
CONFIG_DEBUG_FS is disabled.
Hauke Mehrtens [Thu, 21 Jan 2010 19:32:48 +0000 (20:32 +0100)]
compat: fix build on arm
ARM does not provided the include file asm/compat.h. Use linux/compat.h
instead, it includes asm/compat.h if needed.
This patch is from OpenWRT:
https://dev.openwrt.org/browser/trunk/package/mac80211/patches/020-fix_compat_h.patch?rev=19063
Install udev rules and scripts needed for compat_firmware_class
If you are a distribution maintainer and your distribution has
lsb_release and if you disagree with the way we handle the
uknown case just go ahead and add a case for yourself in
scripts/compat_firmware_install along with a directory and
your own files.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Backport the new firmware_class from > 2.6.33 down to 2.6.23
My main concern with this backport was the usage of the
core driver "base.h" but as it turns out firmware_class doesn't
even need it. This allowed the backport to go through.
This new backport allows drivers which use the new modified firmware
API request_firmware_nowait() on older kernels. You should not
need to chagne the your request_firmware_nowait() calls at all;
the compat-2.6.32.h header ensures that your calls get mapped
to compat_request_firmware_nowait()
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Hauke Mehrtens [Wed, 13 Jan 2010 21:20:18 +0000 (22:20 +0100)]
compat: autoconf.h moved from linux/ to generated/ with kernel 2.6.33
Changed the headers, because autoconf.h moved from linux/ into
generated/
All compat-2.6.XX.h files are included by compat-2.6.h, so only
compat-2.6.h needs to include autoconf.h. There is no situation known to
me where you want to include any compat-2.6.XX.h file directly.
This fixes build with kernel 2.6.33, without it complains about a
missing import:
/include/linux/compat-2.6.h:4:28: error: linux/autoconf.h: No such file or directory
Hauke Mehrtens [Wed, 13 Jan 2010 21:20:17 +0000 (22:20 +0100)]
compat: fix two return types
This fixes a build error introduced in 7d2b68df6301937a8299bca8bef135ae951b569c:
/include/linux/compat-2.6.25.h:172: error: two or more data types in declaration specifiers
Add module load print to know where we backported from
For stable kernels this will be more important. I'll soon start
a branch based on new kernel releases so if anyone wants to
base their code only up to a specific point release they can use
that.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Adds __dev_addr_delete() and __dev_addr_add() for 2.6.22
Not sure how to port this yet though:
CC [M] /home/mcgrof/compat/compat/compat-2.6.32.o
/home/mcgrof/compat/compat/compat-2.6.32.c: In function ‘__dev_addr_sync’:
/home/mcgrof/compat/compat/compat-2.6.32.c:84: error: ‘struct dev_mc_list’ has no member named ‘da_synced’
/home/mcgrof/compat/compat/compat-2.6.32.c:89: error: ‘struct dev_mc_list’ has no member named ‘da_synced’
/home/mcgrof/compat/compat/compat-2.6.32.c: In function ‘__dev_addr_unsync’:
/home/mcgrof/compat/compat/compat-2.6.32.c:111: error: ‘struct dev_mc_list’ has no member named ‘da_synced’
/home/mcgrof/compat/compat/compat-2.6.32.c:114: error: ‘struct dev_mc_list’ has no member named ‘da_synced’
make[3]: *** [/home/mcgrof/compat/compat/compat-2.6.32.o] Error 1
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Synch up pm-qos implementation completely with linux-next next-20100111
This should be easier to keep track of and backport now
for older kernels. As we move along each new kernel release
will get a branch and have its own pm-qos implementation,
the master tag will always keep backporting the latest
bleedinge edge (from linux-next).
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Add the new system bus frequency pm-qos object for older kernels
This adds the new system_bus_freq_pm_qos for older kernels.
This also fixes a compile warning on possible array out of
bounds access on pm-qos, this was due to the fact that the
pm-qos implementation we had on code was out of synch with
the header we were copying over. This synchs up the array
to what is in linux-next as of linux-next tag next-20100111
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
This removes this nagging complaint on older kernels:
CC [M] /home/mcgrof/compat/compat/compat-2.6.32.o
In file included from include/asm-i386/cpufeature.h:11,
from include/asm/cpufeature.h:10,
from include/asm/alternative.h:43,
from include/asm/atomic.h:4,
from /home/mcgrof/compat/include/linux/compat-2.6.24.h:10,
from /home/mcgrof/compat/include/linux/compat-2.6.h:15,
from <command-line>:0:
/home/mcgrof/compat/include/linux/bitops.h:10:1: warning: "BITS_TO_LONGS" redefined
In file included from include/asm/alternative.h:6,
from include/asm/atomic.h:4,
from /home/mcgrof/compat/include/linux/compat-2.6.24.h:10,
from /home/mcgrof/compat/include/linux/compat-2.6.h:15,
from <command-line>:0:
include/linux/types.h:6:1: warning: this is the location of the previous definition
In file included from include/asm-i386/cpufeature.h:11,
from include/asm/cpufeature.h:10,
from include/asm/alternative.h:43,
from include/asm/atomic.h:4,
from /home/mcgrof/compat/include/linux/compat-2.6.24.h:10,
from /home/mcgrof/compat/include/linux/compat-2.6.h:15,
from <command-line>:0:
Note that this means we'll have to keep include/linux/bitops.h up to
date on our tree now. Shouldn't be an issue but just worth noting.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Add initial backport support for network namespaces
We simply declare the overly used init_net sprinkled all over
the kernel, and declare its. All other code should that uses
network namespaces should be ifdef'd for now as well as
inclusion of net/net_namespace.h as we do not backport
the network namespace implemetnation at all, we simply
try to nullify its effect.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Newer rfkill implementations makes use of this. rfkill
for newer kernels has been backported for older kernels
through compat-wireless. Maybe we should bring that in
here?
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
These header files are used regularly by new Linux driver.
Instead of backporting those headers just copy the headers
over. This is typically not recommended unless you know
what you are doing. In this case we do -- we ensure structs
don't change for usage of certain subystems and when they do
change we port the entire subsystem ourselves.
In this case we only copy over bit operations, unaligned helpers.
The only subystem related header we copy over is the wireless header
for which we use to backport the entire 802.11 subsystem using
compat-wireless, and compat-wireless uses this compat module.
We'll synch these on each kernel release.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
This allows compilation of compat for 2.6.23 for builds
that do not require MMC/SDIO. Anyone interested in MMC/SDIO
backport support should look to see if its possible to
backport/add MMC/SDIO support to older kernels. That's
likeley a project on its own though, not sure.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
pm-qos is used by mac80211 and ipw2100. mac80211 uses it for
the dynamic power save to see if to enable it or not upon
recalculation for dynamic ps. It takes the latency registered
to the kernel into account.
Since older kernels do not have pm-qos we simply initialize
pm-qos stuff durng the compat module probe treating pm-qos as if
it were a feature of the compat module. We carry the header file
include/linux/pm_qos_params.h as part of this package, external
kernel drivers just need to ensure they also make use of the
NOSTDINC_FLAGS flag as we do on the top level Makefile to be
able to benefit from a direct port and let external drivers
also inlcude include/linux/pm_qos_params.h as it if it were
in their older kernels.
Cc: Mark Gross <mgross@linux.intel.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
CC [M] /home/mcgrof/devel/compat-wireless-2.6/net/mac80211/iface.o
/home/mcgrof/devel/compat-wireless-2.6/net/mac80211/iface.c: In function ‘ieee80211_stop’:
/home/mcgrof/devel/compat-wireless-2.6/net/mac80211/iface.c:392: warning: statement with no effect
/home/mcgrof/devel/compat-wireless-2.6/net/mac80211/iface.c:397: warning: statement with no effect
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Make kobject_set_name_vargs() do nothing on <= 2.6.24
The struct kobject does not have a name member on older kernels
so naming something naming a kobject will be futile. This implies
dev_set_name() won't be able to rename the kobject. This may
actually bust 2.6.24, I believe we discussed this particular
issue on the linux-wireless mailing list at some point with
a person trying 2.6.24. If there is an issue with this patch
we can go back and check the list. I'm offline rigtt now though
so trying to get compilation to work at least.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>