From 81166ce53e338642c67c45294330306cbcf71b4d Mon Sep 17 00:00:00 2001 From: "John W. Linville" Date: Thu, 17 Nov 2011 15:15:47 -0800 Subject: [PATCH] compat-wireless: add CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN An API change in the 2.6.33 timeframe made a number of bluetooth functions require an extra parameter. Some kernels (e.g. RHEL6) backport that API change, and this allow us to accommodate them. This adds CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN to config.mk and modifies an existing patch for the Bluetooth subsystem. Signed-off-by: John W. Linville Signed-off-by: Luis R. Rodriguez --- config.mk | 8 ++++++++ patches/16-bluetooth.patch | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/config.mk b/config.mk index 7116206f491d..2ccca7a418b9 100644 --- a/config.mk +++ b/config.mk @@ -128,6 +128,14 @@ ifdef CONFIG_COMPAT_KERNEL_2_6_36 CONFIG_COMPAT_KFIFO=y endif #CONFIG_COMPAT_KERNEL_2_6_36 +# +# CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN definition has no leading +# whitespace, because it gets passed-on through compat_autoconf.h. +# +ifndef CONFIG_COMPAT_KERNEL_2_6_33 +CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN=y +endif #CONFIG_COMPAT_KERNEL_2_6_33 + # Wireless subsystem stuff CONFIG_MAC80211=m diff --git a/patches/16-bluetooth.patch b/patches/16-bluetooth.patch index 5f799756c119..1d2cc9cc0a8c 100644 --- a/patches/16-bluetooth.patch +++ b/patches/16-bluetooth.patch @@ -45,7 +45,7 @@ here still, but for now we keep this here. } EXPORT_SYMBOL(bt_sock_unregister); -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) static int bt_sock_create(struct net *net, struct socket *sock, int proto, int kern) +#else @@ -58,7 +58,7 @@ here still, but for now we keep this here. read_lock(&bt_proto_lock); if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) err = bt_proto[proto]->create(net, sock, proto, kern); +#else + err = bt_proto[proto]->create(net, sock, proto); @@ -110,7 +110,7 @@ here still, but for now we keep this here. .obj_size = sizeof(struct hci_pinfo) }; -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) static int hci_sock_create(struct net *net, struct socket *sock, int protocol, int kern) +#else @@ -163,7 +163,7 @@ here still, but for now we keep this here. return ret; } -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count, unsigned char report_type) { @@ -431,7 +431,7 @@ here still, but for now we keep this here. return sk; } -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) static int rfcomm_sock_create(struct net *net, struct socket *sock, int protocol, int kern) +#else @@ -522,7 +522,7 @@ here still, but for now we keep this here. return sk; } -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) static int sco_sock_create(struct net *net, struct socket *sock, int protocol, int kern) +#else @@ -549,7 +549,7 @@ here still, but for now we keep this here. .obj_size = sizeof(struct bt_sock) }; -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) static int bnep_sock_create(struct net *net, struct socket *sock, int protocol, int kern) +#else @@ -564,7 +564,7 @@ here still, but for now we keep this here. .obj_size = sizeof(struct bt_sock) }; -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) static int cmtp_sock_create(struct net *net, struct socket *sock, int protocol, int kern) +#else @@ -579,7 +579,7 @@ here still, but for now we keep this here. .obj_size = sizeof(struct bt_sock) }; -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) static int hidp_sock_create(struct net *net, struct socket *sock, int protocol, int kern) +#else @@ -609,7 +609,7 @@ here still, but for now we keep this here. return sk; } -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) ++#if defined(CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN) static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol, int kern) +#else -- 2.30.2