compat: add seq_hlist_next and seq_hlist_start_head

These functions are copied from the kernel and are needed by
net/bluetooth/af_bluetooth.c

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: add sk_entry

This function is copied from the kernel.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: add sk_wmem_alloc_get and sk_has_allocations

These functions are copied from the kernel.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: remove backport of irq_modify_status

Only kernel >= 2.6.39 irq_to_desc or irq_desc are exporting, so that
compat is not able to access this on the kernel versions where it is
needed. irq_to_desc and irq_desc are defined in the header files so
compilation works, but the module is not loadable because of the
missing exported symbol which make compat unusable on all these kernel
versions. Remove this function, no driver seams to need it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: fix endless recursion in flush_scheduled_work

The hader file defines flush_scheduled_work(a)
compat_flush_scheduled_work(a), which causes flush_scheduled_work() and
compat_flush_scheduled_work() to be the same function.

With this patch it calls the actual function in the kernel.

This fixes problems when unloading mac80211 from compat-wireless.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: handle pci suspend/resume on kernel 2.6.29

Before kernel 2.6.29, we use compat_pci_{suspend,resume}
and not the SIMPLE_DEV_PM_OPS, which include the code for
PCI device handling. For 2.6.30 and higher, the core PCI
code includes the device handling.

That leaves 2.6.29 as the odd one out and causes suspend
and resume to fail. Fix it by including the PCI device
handling code in the definition of SIMPLE_DEV_PM_OPS for
that kernel version.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: backport PCIe register definitions

New DRM core in 3.6 needs these in order to detect the maximum
link speed of the underlying bus.

This backports:

	commit cdcac9cd7741af2c2b9255cbf060f772596907bb
	Author: Dave Airlie <airlied@redhat.com>
	Date:   Wed Jun 27 08:35:52 2012 +0100

	    pci_regs: define LNKSTA2 pcie cap + bits.

	    We need these for detecting the max link speed for drm drivers.

	    Acked-by: Bjorn Helgaas <bhelgass@google.com>
	    Signed-off-by: Dave Airlie <airlied@redhat.com>

[root@ozan linux-2.6]# git describe --contains cdcac9cd
v3.6-rc1~83^2~26

Trying kernel 3.5.0-030500-generic [OK]
Trying kernel 3.4.4-030404-generic [OK]
Trying kernel 3.3.7-030307-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-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-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]

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: Backport kmalloc_array()

The new radeon DRM driver from 3.6 uses kmalloc_array().

This backports:

commit a8203725dfded5c1f79dca3368a4a273e24b59bb
Author: Xi Wang <xi.wang@gmail.com>
Date:   Mon Mar 5 15:14:41 2012 -0800

    slab: introduce kmalloc_array()

[root@ozan linux-2.6]# git describe --contains a8203725
v3.4-rc1~56^2~1

Trying kernel 3.5.0-030500-generic [OK]
Trying kernel 3.4.4-030404-generic [OK]
Trying kernel 3.3.7-030307-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-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-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]

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Some distro kernels (in particular the Debian 3.2.0-3
kernel I'm running) backport codel already, so trying
to backport it again causes issues. Protect the compat
backport with #ifdef TCA_CODEL_MAX.

Also link the flow_dissector code into the codel module
which then won't be loaded on kernels that already have
codel backported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Revert "Some distro kernels (in particular the Debian 3.2.0-3"

This reverts commit 0ab0e31955e0016a4048724f794e8994ed4eec07.
compat: fix undef syntax

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: add include/linux/olpc-ec.h

The libertas driver now needs this include file.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>