2012-05-29 22:39:55

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 0/8] compat-wireless: misc patches to make it compile again

This patch series in combination with the series for compat makes
compat-wireless compile again for me on all supported kernel versions.

Hauke Mehrtens (8):
compat-wireless: make patches apply again
compat-wireless: add usb driver lpm
compat-wireless: deactivate wl1251 for kernel < 2.6.37
compat-wireless: add linux/compat.h header
compat-wireless: add asm/unaligned.h include to ath6kl
compat-wireless: add bluetooth to pr_fmt patch
compat-wireless: add bluetooth to sdio suspend remove patch
compat-wireless: add include/net/bluetooth/{hci_mon.h,sco.h}

config.mk | 6 +-
patches/05-usb.patch | 4 +-
patches/06-header-changes.patch | 40 +++++
patches/08-rename-config-options.patch | 8 +-
patches/16-bluetooth.patch | 72 +++++----
patches/24-pcmcia.patch | 28 ++--
patches/29-sdio_no_suspend.patch | 28 ++++
patches/46-use_other_workqueue.patch | 4 +-
patches/53-pr_fmt.patch | 14 ++
patches/62-usb_driver_lpm.patch | 276 ++++++++++++++++++++++++++++++++
scripts/admin-update.sh | 2 +-
11 files changed, 424 insertions(+), 58 deletions(-)
create mode 100644 patches/62-usb_driver_lpm.patch

--
1.7.9.5



2012-05-30 09:47:07

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH 1/8] compat-wireless: make patches apply again

On 05/30/2012 02:03 AM, Luis R. Rodriguez wrote:
> On Tue, May 29, 2012 at 4:16 PM, Luis R. Rodriguez <[email protected]> wrote:
>> On Tue, May 29, 2012 at 3:39 PM, Hauke Mehrtens <[email protected]> wrote:
>>>
>>> Signed-off-by: Hauke Mehrtens <[email protected]>
>>
>> Oops, I had just pushed out some changes to make patches apply but --
>> I hadn't started to address compilation yet, I think just patch 1
>> addresses application of patches, the rest seem to address compilation
>> so I'll try to apply the rest of the series. If you can rebase that'd
>> be great, I'll stop doing stuff right away.
>
> Actually I managed to apply them all, test compiling now!
>
> Luis
Hi Luis,

thanks for merging my patches in.
While doing a diff between my branch and yours I found one problem, I
will send a patch for it.

Hauke

2012-05-30 00:04:02

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 1/8] compat-wireless: make patches apply again

On Tue, May 29, 2012 at 4:16 PM, Luis R. Rodriguez <[email protected]> wrote:
> On Tue, May 29, 2012 at 3:39 PM, Hauke Mehrtens <[email protected]> wrote:
>>
>> Signed-off-by: Hauke Mehrtens <[email protected]>
>
> Oops, I had just pushed out some changes to make patches apply but --
> I hadn't started to address compilation yet, I think just patch 1
> addresses application of patches, the rest seem to address compilation
> so I'll try to apply the rest of the series. If you can rebase that'd
> be great, I'll stop doing stuff right away.

Actually I managed to apply them all, test compiling now!

Luis

2012-05-29 22:40:10

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 6/8] compat-wireless: add bluetooth to pr_fmt patch


Signed-off-by: Hauke Mehrtens <[email protected]>
---
patches/53-pr_fmt.patch | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/patches/53-pr_fmt.patch b/patches/53-pr_fmt.patch
index 1e5ee79..874e756 100644
--- a/patches/53-pr_fmt.patch
+++ b/patches/53-pr_fmt.patch
@@ -374,6 +374,20 @@ compiler warnings. This is going to be sent upstream.
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/types.h>
+--- a/net/bluetooth/lib.c
++++ b/net/bluetooth/lib.c
+@@ -24,9 +24,11 @@
+
+ /* Bluetooth kernel library. */
+
++#undef pr_fmt
+ #define pr_fmt(fmt) "Bluetooth: " fmt
+
+ #include <linux/export.h>
++#include <linux/printk.h>
+
+ #include <net/bluetooth/bluetooth.h>
+
--- a/net/wireless/lib80211.c
+++ b/net/wireless/lib80211.c
@@ -13,8 +13,10 @@
--
1.7.9.5


2012-05-29 22:40:15

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 7/8] compat-wireless: add bluetooth to sdio suspend remove patch


Signed-off-by: Hauke Mehrtens <[email protected]>
---
patches/29-sdio_no_suspend.patch | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/patches/29-sdio_no_suspend.patch b/patches/29-sdio_no_suspend.patch
index 4d4986c..2a47d37 100644
--- a/patches/29-sdio_no_suspend.patch
+++ b/patches/29-sdio_no_suspend.patch
@@ -169,3 +169,31 @@ suspend and resume that are not backported.
.drv = {
.pm = &brcmf_sdio_pm_ops,
},
+--- a/drivers/bluetooth/btmrvl_sdio.c
++++ b/drivers/bluetooth/btmrvl_sdio.c
+@@ -1049,6 +1049,7 @@ static void btmrvl_sdio_remove(struct sd
+ }
+ }
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ static int btmrvl_sdio_suspend(struct device *dev)
+ {
+ struct sdio_func *func = dev_to_sdio_func(dev);
+@@ -1144,6 +1145,7 @@ static const struct dev_pm_ops btmrvl_sd
+ .suspend = btmrvl_sdio_suspend,
+ .resume = btmrvl_sdio_resume,
+ };
++#endif
+
+ static struct sdio_driver bt_mrvl_sdio = {
+ .name = "btmrvl_sdio",
+@@ -1152,7 +1154,9 @@ static struct sdio_driver bt_mrvl_sdio =
+ .remove = btmrvl_sdio_remove,
+ .drv = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ .pm = &btmrvl_sdio_pm_ops,
++#endif
+ }
+ };
+
--
1.7.9.5


2012-05-29 22:40:23

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 8/8] compat-wireless: add include/net/bluetooth/{hci_mon.h,sco.h}

These two header files used by the bluetooth system are not included in
compat-wireless, but should be.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
scripts/admin-update.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index cbdcb44..a52c908 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -18,7 +18,7 @@
GIT_URL="git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git"
GIT_COMPAT_URL="git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/compat.git"

-INCLUDE_NET_BT="hci_core.h l2cap.h bluetooth.h rfcomm.h hci.h mgmt.h smp.h"
+INCLUDE_NET_BT="hci_core.h l2cap.h bluetooth.h rfcomm.h hci.h hci_mon.h mgmt.h sco.h smp.h"
NET_BT_DIRS="bluetooth bluetooth/bnep bluetooth/cmtp bluetooth/rfcomm bluetooth/hidp"

INCLUDE_LINUX="ieee80211.h nl80211.h"
--
1.7.9.5


2012-05-29 22:40:02

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 3/8] compat-wireless: deactivate wl1251 for kernel < 2.6.37

wl1251_sdio and wl1251_spi are depending on irq_set_status_flags() since

commit f380f2c4a12e913356bd49f8790ec1063c4fe9f8
Author: Grazvydas Ignotas <[email protected]>
Date: Fri May 18 03:04:08 2012 +0300

wl1251: fix oops on early interrupt

irq_set_status_flags() was added to the kernel in version 2.6.37 and
backporting it is hard, so do not build wl1251_sdio and wl1251_spi for
older kernel versions.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
config.mk | 6 +++++-
patches/08-rename-config-options.patch | 8 +++++---
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/config.mk b/config.mk
index 3caebc4..bc0296f 100644
--- a/config.mk
+++ b/config.mk
@@ -556,7 +556,9 @@ ifdef CONFIG_SPI_MASTER
ifndef CONFIG_COMPAT_KERNEL_2_6_25

ifdef CONFIG_CRC7
-export CONFIG_WL1251_SPI=m
+ifndef CONFIG_COMPAT_KERNEL_2_6_37
+export CONFIG_COMPAT_WL1251_SPI=m
+endif #CONFIG_COMPAT_KERNEL_2_6_37
export CONFIG_WLCORE_SPI=m
endif #CONFIG_CRC7
export CONFIG_P54_SPI=m
@@ -579,7 +581,9 @@ export CONFIG_B43_SDIO=y

ifdef CONFIG_CRC7
ifdef CONFIG_WL12XX_PLATFORM_DATA
+ifndef CONFIG_COMPAT_KERNEL_2_6_37
export CONFIG_COMPAT_WL1251_SDIO=m
+endif #CONFIG_COMPAT_KERNEL_2_6_37
export CONFIG_WLCORE_SDIO=m
endif #CONFIG_WL12XX_PLATFORM_DATA
endif #CONFIG_CRC7
diff --git a/patches/08-rename-config-options.patch b/patches/08-rename-config-options.patch
index 44c362d..f8d459a 100644
--- a/patches/08-rename-config-options.patch
+++ b/patches/08-rename-config-options.patch
@@ -92,11 +92,13 @@ CONFIG_BT_HIDP does not build with older kernel versions.
hidp-objs := core.o sock.o
--- a/drivers/net/wireless/ti/wl1251/Makefile
+++ b/drivers/net/wireless/ti/wl1251/Makefile
-@@ -5,6 +5,6 @@ wl1251_sdio-objs += sdio.o
+@@ -4,7 +4,7 @@ wl1251_spi-objs += spi.o
+ wl1251_sdio-objs += sdio.o

obj-$(CONFIG_WL1251) += wl1251.o
- obj-$(CONFIG_WL1251_SPI) += wl1251_spi.o
+-obj-$(CONFIG_WL1251_SPI) += wl1251_spi.o
-obj-$(CONFIG_WL1251_SDIO) += wl1251_sdio.o
++obj-$(CONFIG_COMPAT_WL1251_SPI)+= wl1251_spi.o
+obj-$(CONFIG_COMPAT_WL1251_SDIO)+= wl1251_sdio.o

ccflags-y += -D__CHECK_ENDIAN__
@@ -154,7 +156,7 @@ CONFIG_BT_HIDP does not build with older kernel versions.
#else
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
-@@ -879,7 +879,7 @@ static int rfcomm_sock_ioctl(struct sock
+@@ -860,7 +860,7 @@ static int rfcomm_sock_ioctl(struct sock
err = bt_sock_ioctl(sock, cmd, arg);

if (err == -ENOIOCTLCMD) {
--
1.7.9.5


2012-05-29 22:40:16

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 5/8] compat-wireless: add asm/unaligned.h include to ath6kl

Some old kernel versions are missing this include and we get a compile
error because of missing get_unaligned_le16() prototype.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
patches/06-header-changes.patch | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/patches/06-header-changes.patch b/patches/06-header-changes.patch
index db84468..d77e5fb 100644
--- a/patches/06-header-changes.patch
+++ b/patches/06-header-changes.patch
@@ -105,3 +105,13 @@ cases.

#include "hidp.h"

+--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
++++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
+@@ -20,6 +20,7 @@
+ #include <linux/moduleparam.h>
+ #include <linux/inetdevice.h>
+ #include <linux/export.h>
++#include <asm/unaligned.h>
+
+ #include "core.h"
+ #include "cfg80211.h"
--
1.7.9.5


2012-05-29 22:40:04

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 2/8] compat-wireless: add usb driver lpm

This adds a patch to backport:
commit e1f12eb6ba6f1e74007eb01ed26fad7c5239d62b
Author: Sarah Sharp <[email protected]>
Date: Mon Apr 23 10:08:51 2012 -0700

USB: Disable hub-initiated LPM for comms devices.

This patch should be replaced with something in compat, but I do not
have the time now.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
patches/62-usb_driver_lpm.patch | 276 +++++++++++++++++++++++++++++++++++++++
1 file changed, 276 insertions(+)
create mode 100644 patches/62-usb_driver_lpm.patch

diff --git a/patches/62-usb_driver_lpm.patch b/patches/62-usb_driver_lpm.patch
new file mode 100644
index 0000000..3679add
--- /dev/null
+++ b/patches/62-usb_driver_lpm.patch
@@ -0,0 +1,276 @@
+--- a/drivers/bluetooth/ath3k.c
++++ b/drivers/bluetooth/ath3k.c
+@@ -445,7 +445,9 @@ static struct usb_driver ath3k_driver =
+ .probe = ath3k_probe,
+ .disconnect = ath3k_disconnect,
+ .id_table = ath3k_table,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(ath3k_driver);
+--- a/drivers/bluetooth/bcm203x.c
++++ b/drivers/bluetooth/bcm203x.c
+@@ -279,7 +279,9 @@ static struct usb_driver bcm203x_driver
+ .probe = bcm203x_probe,
+ .disconnect = bcm203x_disconnect,
+ .id_table = bcm203x_table,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(bcm203x_driver);
+--- a/drivers/bluetooth/bfusb.c
++++ b/drivers/bluetooth/bfusb.c
+@@ -749,7 +749,9 @@ static struct usb_driver bfusb_driver =
+ .probe = bfusb_probe,
+ .disconnect = bfusb_disconnect,
+ .id_table = bfusb_table,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(bfusb_driver);
+--- a/drivers/bluetooth/bpa10x.c
++++ b/drivers/bluetooth/bpa10x.c
+@@ -508,7 +508,9 @@ static struct usb_driver bpa10x_driver =
+ .probe = bpa10x_probe,
+ .disconnect = bpa10x_disconnect,
+ .id_table = bpa10x_table,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(bpa10x_driver);
+--- a/drivers/bluetooth/btusb.c
++++ b/drivers/bluetooth/btusb.c
+@@ -1222,7 +1222,9 @@ static struct usb_driver btusb_driver =
+ #endif
+ .id_table = btusb_table,
+ .supports_autosuspend = 1,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(btusb_driver);
+--- a/drivers/net/usb/cdc_ether.c
++++ b/drivers/net/usb/cdc_ether.c
+@@ -705,7 +705,9 @@ static struct usb_driver cdc_driver = {
+ .resume = usbnet_resume,
+ .reset_resume = usbnet_resume,
+ .supports_autosuspend = 1,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(cdc_driver);
+--- a/drivers/net/usb/rndis_host.c
++++ b/drivers/net/usb/rndis_host.c
+@@ -643,7 +643,9 @@ static struct usb_driver rndis_driver =
+ .disconnect = usbnet_disconnect,
+ .suspend = usbnet_suspend,
+ .resume = usbnet_resume,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(rndis_driver);
+--- a/drivers/net/wireless/at76c50x-usb.c
++++ b/drivers/net/wireless/at76c50x-usb.c
+@@ -2486,7 +2486,9 @@ static struct usb_driver at76_driver = {
+ .probe = at76_probe,
+ .disconnect = at76_disconnect,
+ .id_table = dev_table,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ static int __init at76_mod_init(void)
+--- a/drivers/net/wireless/ath/ath6kl/usb.c
++++ b/drivers/net/wireless/ath/ath6kl/usb.c
+@@ -1191,7 +1191,9 @@ static struct usb_driver ath6kl_usb_driv
+ .disconnect = ath6kl_usb_remove,
+ .id_table = ath6kl_usb_ids,
+ .supports_autosuspend = true,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ static int ath6kl_usb_init(void)
+--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
++++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
+@@ -1360,7 +1360,9 @@ static struct usb_driver ath9k_hif_usb_d
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
+ .soft_unbind = 1,
+ #endif
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ int ath9k_hif_usb_init(void)
+--- a/drivers/net/wireless/ath/carl9170/usb.c
++++ b/drivers/net/wireless/ath/carl9170/usb.c
+@@ -1159,7 +1159,9 @@ static struct usb_driver carl9170_driver
+ .resume = carl9170_usb_resume,
+ .reset_resume = carl9170_usb_resume,
+ #endif /* CONFIG_PM */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(carl9170_driver);
+--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
++++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+@@ -1598,7 +1598,9 @@ static struct usb_driver brcmf_usbdrvr =
+ .suspend = brcmf_usb_suspend,
+ .resume = brcmf_usb_resume,
+ .supports_autosuspend = 1,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ void brcmf_usb_exit(void)
+--- a/drivers/net/wireless/libertas/if_usb.c
++++ b/drivers/net/wireless/libertas/if_usb.c
+@@ -1015,7 +1015,9 @@ static struct usb_driver if_usb_driver =
+ .suspend = if_usb_suspend,
+ .resume = if_usb_resume,
+ .reset_resume = if_usb_resume,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(if_usb_driver);
+--- a/drivers/net/wireless/libertas_tf/if_usb.c
++++ b/drivers/net/wireless/libertas_tf/if_usb.c
+@@ -922,7 +922,9 @@ static struct usb_driver if_usb_driver =
+ .id_table = if_usb_table,
+ .suspend = if_usb_suspend,
+ .resume = if_usb_resume,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(if_usb_driver);
+--- a/drivers/net/wireless/orinoco/orinoco_usb.c
++++ b/drivers/net/wireless/orinoco/orinoco_usb.c
+@@ -1752,7 +1752,9 @@ static struct usb_driver orinoco_driver
+ .probe = ezusb_probe,
+ .disconnect = ezusb_disconnect,
+ .id_table = ezusb_table,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(orinoco_driver);
+--- a/drivers/net/wireless/p54/p54usb.c
++++ b/drivers/net/wireless/p54/p54usb.c
+@@ -1142,7 +1142,9 @@ static struct usb_driver p54u_driver = {
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
+ .soft_unbind = 1,
+ #endif
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(p54u_driver);
+--- a/drivers/net/wireless/rndis_wlan.c
++++ b/drivers/net/wireless/rndis_wlan.c
+@@ -3755,7 +3755,9 @@ static struct usb_driver rndis_wlan_driv
+ .disconnect = usbnet_disconnect,
+ .suspend = usbnet_suspend,
+ .resume = usbnet_resume,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(rndis_wlan_driver);
+--- a/drivers/net/wireless/rt2x00/rt2500usb.c
++++ b/drivers/net/wireless/rt2x00/rt2500usb.c
+@@ -1980,7 +1980,9 @@ static struct usb_driver rt2500usb_drive
+ .disconnect = rt2x00usb_disconnect,
+ .suspend = rt2x00usb_suspend,
+ .resume = rt2x00usb_resume,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(rt2500usb_driver);
+--- a/drivers/net/wireless/rt2x00/rt2800usb.c
++++ b/drivers/net/wireless/rt2x00/rt2800usb.c
+@@ -1302,7 +1302,9 @@ static struct usb_driver rt2800usb_drive
+ .disconnect = rt2x00usb_disconnect,
+ .suspend = rt2x00usb_suspend,
+ .resume = rt2x00usb_resume,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(rt2800usb_driver);
+--- a/drivers/net/wireless/rt2x00/rt73usb.c
++++ b/drivers/net/wireless/rt2x00/rt73usb.c
+@@ -2527,7 +2527,9 @@ static struct usb_driver rt73usb_driver
+ .disconnect = rt2x00usb_disconnect,
+ .suspend = rt2x00usb_suspend,
+ .resume = rt2x00usb_resume,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(rt73usb_driver);
+--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
++++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
+@@ -1671,7 +1671,9 @@ static struct usb_driver rtl8187_driver
+ .id_table = rtl8187_table,
+ .probe = rtl8187_probe,
+ .disconnect = __devexit_p(rtl8187_disconnect),
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(rtl8187_driver);
+--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
++++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+@@ -373,7 +373,9 @@ static struct usb_driver rtl8192cu_drive
+ #ifdef CONFIG_AUTOSUSPEND
+ .supports_autosuspend = 1,
+ #endif
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ module_usb_driver(rtl8192cu_driver);
+--- a/drivers/net/wireless/zd1211rw/zd_usb.c
++++ b/drivers/net/wireless/zd1211rw/zd_usb.c
+@@ -1542,7 +1542,9 @@ static struct usb_driver driver = {
+ .disconnect = disconnect,
+ .pre_reset = pre_reset,
+ .post_reset = post_reset,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ .disable_hub_initiated_lpm = 1,
++#endif
+ };
+
+ struct workqueue_struct *zd_workqueue;
--
1.7.9.5


2012-05-29 23:16:56

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 1/8] compat-wireless: make patches apply again

On Tue, May 29, 2012 at 3:39 PM, Hauke Mehrtens <[email protected]> wrote:
>
> Signed-off-by: Hauke Mehrtens <[email protected]>

Oops, I had just pushed out some changes to make patches apply but --
I hadn't started to address compilation yet, I think just patch 1
addresses application of patches, the rest seem to address compilation
so I'll try to apply the rest of the series. If you can rebase that'd
be great, I'll stop doing stuff right away.

Luis

2012-05-29 22:39:59

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 1/8] compat-wireless: make patches apply again


Signed-off-by: Hauke Mehrtens <[email protected]>
---
patches/05-usb.patch | 4 +-
patches/16-bluetooth.patch | 72 +++++++++++++++++-----------------
patches/24-pcmcia.patch | 28 ++++++-------
patches/46-use_other_workqueue.patch | 4 +-
4 files changed, 55 insertions(+), 53 deletions(-)

diff --git a/patches/05-usb.patch b/patches/05-usb.patch
index 9b0cfea..7f78c6c 100644
--- a/patches/05-usb.patch
+++ b/patches/05-usb.patch
@@ -9,9 +9,9 @@ USB opt soft_unbid was added as of 2.6.27.
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
.soft_unbind = 1,
+#endif
+ .disable_hub_initiated_lpm = 1,
};

- module_usb_driver(p54u_driver);
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1357,7 +1357,9 @@ static struct usb_driver ath9k_hif_usb_d
@@ -21,6 +21,6 @@ USB opt soft_unbid was added as of 2.6.27.
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
.soft_unbind = 1,
+#endif
+ .disable_hub_initiated_lpm = 1,
};

- int ath9k_hif_usb_init(void)
diff --git a/patches/16-bluetooth.patch b/patches/16-bluetooth.patch
index 46794bb..90ec831 100644
--- a/patches/16-bluetooth.patch
+++ b/patches/16-bluetooth.patch
@@ -31,7 +31,7 @@ here still, but for now we keep this here.

--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
-@@ -122,8 +122,12 @@ int bt_sock_unregister(int proto)
+@@ -111,8 +111,12 @@ int bt_sock_unregister(int proto)
}
EXPORT_SYMBOL(bt_sock_unregister);

@@ -44,7 +44,7 @@ here still, but for now we keep this here.
{
int err;

-@@ -141,7 +145,11 @@ static int bt_sock_create(struct net *ne
+@@ -130,7 +134,11 @@ static int bt_sock_create(struct net *ne
read_lock(&bt_proto_lock);

if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) {
@@ -56,7 +56,7 @@ here still, but for now we keep this here.
if (!err)
bt_sock_reclassify_lock(sock->sk, proto);
module_put(bt_proto[proto]->owner);
-@@ -473,7 +481,11 @@ int bt_sock_ioctl(struct socket *sock, u
+@@ -463,7 +471,11 @@ int bt_sock_ioctl(struct socket *sock, u
if (sk->sk_state == BT_LISTEN)
return -EINVAL;

@@ -84,19 +84,21 @@ here still, but for now we keep this here.
wake_up_process(session->task);
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
-@@ -891,7 +891,11 @@ drop:
+@@ -883,8 +883,13 @@ drop:
goto done;
}

+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31))
- static int hci_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int len)
+ static int hci_sock_setsockopt(struct socket *sock, int level, int optname,
+ char __user *optval, unsigned int len)
+#else
-+static int hci_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int len)
++static int hci_sock_setsockopt(struct socket *sock, int level, int optname,
++ char __user *optval, int len)
+#endif
{
struct hci_ufilter uf = { .opcode = 0 };
struct sock *sk = sock->sk;
-@@ -1063,8 +1067,12 @@ static struct proto hci_sk_proto = {
+@@ -1057,8 +1062,12 @@ static struct proto hci_sk_proto = {
.obj_size = sizeof(struct hci_pinfo)
};

@@ -111,7 +113,7 @@ here still, but for now we keep this here.

--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
-@@ -72,7 +72,11 @@ static struct attribute_group bt_link_gr
+@@ -71,7 +71,11 @@ static struct attribute_group bt_link_gr
.attrs = bt_link_attrs,
};

@@ -123,7 +125,7 @@ here still, but for now we keep this here.
&bt_link_group,
NULL
};
-@@ -141,7 +145,11 @@ void hci_conn_del_sysfs(struct hci_conn
+@@ -140,7 +144,11 @@ void hci_conn_del_sysfs(struct hci_conn
dev = device_find_child(&conn->dev, NULL, __match_tty);
if (!dev)
break;
@@ -135,7 +137,7 @@ here still, but for now we keep this here.
put_device(dev);
}

-@@ -361,7 +369,11 @@ static struct attribute_group bt_host_gr
+@@ -378,7 +386,11 @@ static struct attribute_group bt_host_gr
.attrs = bt_host_attrs,
};

@@ -149,7 +151,7 @@ here still, but for now we keep this here.
};
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
-@@ -398,6 +398,7 @@ err:
+@@ -379,6 +379,7 @@ err:
return ret;
}

@@ -157,7 +159,7 @@ here still, but for now we keep this here.
static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count,
unsigned char report_type)
{
-@@ -456,6 +457,16 @@ err:
+@@ -437,6 +438,16 @@ err:
mutex_unlock(&session->report_mutex);
return ret;
}
@@ -174,7 +176,7 @@ here still, but for now we keep this here.

static void hidp_idle_timeout(unsigned long arg)
{
-@@ -757,8 +768,14 @@ static int hidp_session(void *arg)
+@@ -738,8 +749,14 @@ static int hidp_session(void *arg)
}

if (session->hid) {
@@ -189,7 +191,7 @@ here still, but for now we keep this here.
}

/* Wakeup user-space polling for socket errors */
-@@ -869,6 +886,70 @@ static void hidp_close(struct hid_device
+@@ -850,6 +867,70 @@ static void hidp_close(struct hid_device
{
}

@@ -260,7 +262,7 @@ here still, but for now we keep this here.
static int hidp_parse(struct hid_device *hid)
{
struct hidp_session *session = hid->driver_data;
-@@ -956,7 +1037,9 @@ static int hidp_setup_hid(struct hidp_se
+@@ -937,7 +1018,9 @@ static int hidp_setup_hid(struct hidp_se
hid->dev.parent = &session->conn->dev;
hid->ll_driver = &hidp_hid_driver;

@@ -270,7 +272,7 @@ here still, but for now we keep this here.
hid->hid_output_raw_report = hidp_output_raw_report;

return 0;
-@@ -967,6 +1050,7 @@ fault:
+@@ -948,6 +1031,7 @@ fault:

return err;
}
@@ -278,7 +280,7 @@ here still, but for now we keep this here.

int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock)
{
-@@ -982,6 +1066,39 @@ int hidp_add_connection(struct hidp_conn
+@@ -963,6 +1047,39 @@ int hidp_add_connection(struct hidp_conn

BT_DBG("rd_data %p rd_size %d", req->rd_data, req->rd_size);

@@ -318,7 +320,7 @@ here still, but for now we keep this here.
down_write(&hidp_session_sem);

s = __hidp_get_session(&bt_sk(ctrl_sock->sk)->dst);
-@@ -1029,6 +1146,7 @@ int hidp_add_connection(struct hidp_conn
+@@ -1010,6 +1127,7 @@ int hidp_add_connection(struct hidp_conn

__hidp_link_session(session);

@@ -326,7 +328,7 @@ here still, but for now we keep this here.
if (req->rd_size > 0) {
err = hidp_setup_hid(session, req);
if (err)
-@@ -1040,6 +1158,16 @@ int hidp_add_connection(struct hidp_conn
+@@ -1021,6 +1139,16 @@ int hidp_add_connection(struct hidp_conn
if (err < 0)
goto purge;
}
@@ -343,7 +345,7 @@ here still, but for now we keep this here.

hidp_set_timer(session);

-@@ -1098,6 +1226,7 @@ unlink:
+@@ -1079,6 +1207,7 @@ unlink:
session->input = NULL;
}

@@ -351,7 +353,7 @@ here still, but for now we keep this here.
if (session->hid) {
hid_destroy_device(session->hid);
session->hid = NULL;
-@@ -1111,10 +1240,15 @@ purge:
+@@ -1092,10 +1221,15 @@ purge:

skb_queue_purge(&session->ctrl_transmit);
skb_queue_purge(&session->intr_transmit);
@@ -369,7 +371,7 @@ here still, but for now we keep this here.
}
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
-@@ -325,8 +325,13 @@ static struct sock *rfcomm_sock_alloc(st
+@@ -306,8 +306,13 @@ static struct sock *rfcomm_sock_alloc(st
return sk;
}

@@ -383,7 +385,7 @@ here still, but for now we keep this here.
{
struct sock *sk;

-@@ -680,7 +685,11 @@ static int rfcomm_sock_setsockopt_old(st
+@@ -661,7 +666,11 @@ static int rfcomm_sock_setsockopt_old(st
return err;
}

@@ -397,7 +399,7 @@ here still, but for now we keep this here.
struct bt_security sec;
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
-@@ -718,8 +718,12 @@ static int rfcomm_tty_open(struct tty_st
+@@ -713,8 +713,12 @@ static int rfcomm_tty_open(struct tty_st
remove_wait_queue(&dev->wait, &wait);

if (err == 0)
@@ -410,7 +412,7 @@ here still, but for now we keep this here.

rfcomm_tty_copy_pending(dev);

-@@ -743,7 +747,11 @@ static void rfcomm_tty_close(struct tty_
+@@ -738,7 +742,11 @@ static void rfcomm_tty_close(struct tty_
if (!--dev->port.count) {
spin_unlock_irqrestore(&dev->port.lock, flags);
if (dev->tty_dev->parent)
@@ -422,7 +424,7 @@ here still, but for now we keep this here.

/* Close DLC and dettach TTY */
rfcomm_dlc_close(dev->dlc, 0);
-@@ -819,7 +827,11 @@ static int rfcomm_tty_write_room(struct
+@@ -814,7 +822,11 @@ static int rfcomm_tty_write_room(struct
return room;
}

@@ -434,7 +436,7 @@ here still, but for now we keep this here.
{
BT_DBG("tty %p cmd 0x%02x", tty, cmd);

-@@ -1078,7 +1090,11 @@ static void rfcomm_tty_hangup(struct tty
+@@ -1073,7 +1085,11 @@ static void rfcomm_tty_hangup(struct tty
}
}

@@ -446,7 +448,7 @@ here still, but for now we keep this here.
{
struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;

-@@ -1087,7 +1103,11 @@ static int rfcomm_tty_tiocmget(struct tt
+@@ -1082,7 +1098,11 @@ static int rfcomm_tty_tiocmget(struct tt
return dev->modem_status;
}

@@ -460,7 +462,7 @@ here still, but for now we keep this here.
struct rfcomm_dlc *dlc = dev->dlc;
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
-@@ -440,8 +440,12 @@ static struct sock *sco_sock_alloc(struc
+@@ -423,8 +423,12 @@ static struct sock *sco_sock_alloc(struc
return sk;
}

@@ -473,7 +475,7 @@ here still, but for now we keep this here.
{
struct sock *sk;

-@@ -670,7 +674,11 @@ static int sco_sock_sendmsg(struct kiocb
+@@ -653,7 +657,11 @@ static int sco_sock_sendmsg(struct kiocb
return err;
}

@@ -487,7 +489,7 @@ here still, but for now we keep this here.
int err = 0;
--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
-@@ -195,8 +195,12 @@ static struct proto bnep_proto = {
+@@ -180,8 +180,12 @@ static struct proto bnep_proto = {
.obj_size = sizeof(struct bt_sock)
};

@@ -517,7 +519,7 @@ here still, but for now we keep this here.

--- a/net/bluetooth/hidp/sock.c
+++ b/net/bluetooth/hidp/sock.c
-@@ -242,8 +242,12 @@ static struct proto hidp_proto = {
+@@ -229,8 +229,12 @@ static struct proto hidp_proto = {
.obj_size = sizeof(struct bt_sock)
};

@@ -532,7 +534,7 @@ here still, but for now we keep this here.

--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
-@@ -539,7 +539,14 @@ static int l2cap_sock_setsockopt_old(str
+@@ -538,7 +538,14 @@ static int l2cap_sock_setsockopt_old(str
return err;
}

@@ -547,7 +549,7 @@ here still, but for now we keep this here.
{
struct sock *sk = sock->sk;
struct l2cap_chan *chan = l2cap_pi(sk)->chan;
-@@ -1079,8 +1086,12 @@ static struct sock *l2cap_sock_alloc(str
+@@ -1166,8 +1173,12 @@ static struct sock *l2cap_sock_alloc(str
return sk;
}

@@ -560,7 +562,7 @@ here still, but for now we keep this here.
{
struct sock *sk;

-@@ -1092,7 +1103,11 @@ static int l2cap_sock_create(struct net
+@@ -1179,7 +1190,11 @@ static int l2cap_sock_create(struct net
sock->type != SOCK_DGRAM && sock->type != SOCK_RAW)
return -ESOCKTNOSUPPORT;

diff --git a/patches/24-pcmcia.patch b/patches/24-pcmcia.patch
index 0d07aa7..5fcdc94 100644
--- a/patches/24-pcmcia.patch
+++ b/patches/24-pcmcia.patch
@@ -30,13 +30,13 @@

do {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- register unsigned int iobase = info->p_dev->resource[0]->start;
+ unsigned int iobase = info->p_dev->resource[0]->start;
+#else
-+ register unsigned int iobase = info->p_dev->io.BasePort1;
++ unsigned int iobase = info->p_dev->io.BasePort1;
+#endif
- register unsigned int offset;
- register unsigned char command;
- register unsigned long ready_bit;
+ unsigned int offset;
+ unsigned char command;
+ unsigned long ready_bit;
@@ -378,7 +391,11 @@ static void bluecard_receive(bluecard_in
return;
}
@@ -196,12 +196,12 @@

do {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- register unsigned int iobase = info->p_dev->resource[0]->start;
+ unsigned int iobase = info->p_dev->resource[0]->start;
+#else
-+ register unsigned int iobase = info->p_dev->io.BasePort1;
++ unsigned int iobase = info->p_dev->io.BasePort1;
+#endif
register struct sk_buff *skb;
- register int len;
+ int len;

@@ -224,7 +228,11 @@ static void bt3c_receive(bt3c_info_t *in
return;
@@ -376,12 +376,12 @@

do {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- register unsigned int iobase = info->p_dev->resource[0]->start;
+ unsigned int iobase = info->p_dev->resource[0]->start;
+#else
-+ register unsigned int iobase = info->p_dev->io.BasePort1;
++ unsigned int iobase = info->p_dev->io.BasePort1;
+#endif
register struct sk_buff *skb;
- register int len;
+ int len;

@@ -181,7 +185,11 @@ static void btuart_receive(btuart_info_t
return;
@@ -580,12 +580,12 @@

do {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- register unsigned int iobase = info->p_dev->resource[0]->start;
+ unsigned int iobase = info->p_dev->resource[0]->start;
+#else
-+ register unsigned int iobase = info->p_dev->io.BasePort1;
++ unsigned int iobase = info->p_dev->io.BasePort1;
+#endif
register struct sk_buff *skb;
- register int len;
+ int len;

@@ -209,7 +213,11 @@ static void dtl1_receive(dtl1_info_t *in
return;
diff --git a/patches/46-use_other_workqueue.patch b/patches/46-use_other_workqueue.patch
index 3e55e1d..4438051 100644
--- a/patches/46-use_other_workqueue.patch
+++ b/patches/46-use_other_workqueue.patch
@@ -4,13 +4,13 @@ position before.

--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
-@@ -1740,8 +1740,12 @@ int hci_register_dev(struct hci_dev *hde
+@@ -1722,8 +1722,12 @@ int hci_register_dev(struct hci_dev *hde

write_unlock(&hci_dev_list_lock);

+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
hdev->workqueue = alloc_workqueue(hdev->name, WQ_HIGHPRI | WQ_UNBOUND |
- WQ_MEM_RECLAIM, 1);
+ WQ_MEM_RECLAIM, 1);
+#else
+ hdev->workqueue = create_singlethread_workqueue(hdev->name);
+#endif
--
1.7.9.5


2012-05-29 22:40:06

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 4/8] compat-wireless: add linux/compat.h header

For some older kernel versions we have to include linux/compat.h in
some bluetooth code, otherwise it will not find functions like
compat_ptr().

Signed-off-by: Hauke Mehrtens <[email protected]>
---
patches/06-header-changes.patch | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

diff --git a/patches/06-header-changes.patch b/patches/06-header-changes.patch
index 92ed02d..db84468 100644
--- a/patches/06-header-changes.patch
+++ b/patches/06-header-changes.patch
@@ -75,3 +75,33 @@ cases.

/**
* DOC: Key handling basics
+--- a/net/bluetooth/bnep/sock.c
++++ b/net/bluetooth/bnep/sock.c
+@@ -26,6 +26,7 @@
+
+ #include <linux/export.h>
+ #include <linux/file.h>
++#include <linux/compat.h>
+
+ #include "bnep.h"
+
+--- a/net/bluetooth/hci_sock.c
++++ b/net/bluetooth/hci_sock.c
+@@ -25,6 +25,7 @@
+ /* Bluetooth HCI sockets. */
+
+ #include <linux/export.h>
++#include <linux/compat.h>
+ #include <asm/unaligned.h>
+
+ #include <net/bluetooth/bluetooth.h>
+--- a/net/bluetooth/hidp/sock.c
++++ b/net/bluetooth/hidp/sock.c
+@@ -22,6 +22,7 @@
+
+ #include <linux/export.h>
+ #include <linux/file.h>
++#include <linux/compat.h>
+
+ #include "hidp.h"
+
--
1.7.9.5