pci-aspm.h was introduced in kernel 2.6.25 and is used by the ath5k and iwlwifi driver.
v2: Do not place the empty functions into pci-aspm.h. Now we do not
have to change pci-aspm.h when it changes in the mainline kernel only
compat-2.6.26.h has to be changed.
This fixes a compilation warning on Ubuntu's 2.6.24
kernel which added the PM_EVENT_SLEEP even though upstream
Linux 2.6.24.7 (the last 2.6.24) does not have it. Its
a trivial change and I'm willing to support it to avoid
compilation.
Hauke Mehrtens [Tue, 17 Aug 2010 18:32:32 +0000 (20:32 +0200)]
compat: backport net_ns_type_operations
net_ns_type_operations needs to be exported. This only works for kernel
>= 2.6.35 because struct kobj_ns_type_operations was introduced in
kernel 2.6.35.
compat: add br_port_exists() and ask for inclusion upstream
The br_port_exists() call is used internally on private bridge
code on net/bridge/ to check if a netdevice is a bridge port.
The way to check if a netdevice is a bridge port has changed
for 2.6.36 from checking the netdev->br_port pointer to
checking for a IFF_BRIDGE_PORT flag on the netdev->priv_flags.
Instead of requiring backport code to ifdef the checks lets
move the private br_port_exists() to a public header accessible
by drivers and consistantly use it to check for the bridge
port.
I'll submit a patch upstream to move br_port_exists() to a public
header so that we don't have to later even require a patch on
backported code. We'll see if it gets accepted though.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
trace/define_trace.h can be included more often and it have to.
This fixes some errors like this:
WARNING: "__tracepoint_iwlwifi_dev_rx" [/home/hauke/compat-wireless/compat-wireless-git/drivers/net/wireless/iwlwifi/iwlcore.ko] undefined!
compat: Fix panic caused by NULL pointer derefence in rtnl_fill_ifinfo
get stats netdev ops is blindy called for older kernels (< 2.6.29) and
so assigning a NULL pointer from netdev_attach_ops causes a NULL pointer
dereference.
By default, netdev alloc provides an internal stats reference. So fill
this only if ndo_get_stats is defined.
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>