linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25
@ 2010-08-27 18:40 Hauke Mehrtens
  2010-08-27 18:40 ` [PATCH 1/7] compat-wireless: do not use needed_headroom Hauke Mehrtens
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2010-08-27 18:40 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

This series fixes some problems when compiling compat-wireless against 
kernel 2.6.24 or 2.6.25. Now this should work for every driver selected 
by default.
"add ifdefs into compat_autoconf.h" extends gen-compat-autoconf.sh to
handle some ifdef in config.mk.

This was compile tested with kernel 2.6.24 to 2.6.36.

Hauke Mehrtens (7):
  compat-wireless: do not use needed_headroom
  compat-wireless: fix patch stile.
  compat-wireless: remove linux/gpio.h include
  compat-wireless: multiple changes to config file
  compat-wireless: rename CONFIG_IWLWIFI config symbol
  compat-wireless: add ifdefs into compat_autoconf.h
  compat-wireless: add support for kernel 2.6.24

 config.mk                              |   63 +++++++++++++++++++-------------
 patches/01-netdev.patch                |   17 ++++++---
 patches/06-header-changes.patch        |   24 +++++++++++-
 patches/08-rename-iwl4965-config.patch |    8 ++++-
 patches/16-bluetooth.patch             |   26 +++++--------
 scripts/gen-compat-autoconf.sh         |   48 ++++++++++++------------
 6 files changed, 112 insertions(+), 74 deletions(-)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/7] compat-wireless: do not use needed_headroom
  2010-08-27 18:40 [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
@ 2010-08-27 18:40 ` Hauke Mehrtens
  2010-08-27 18:40 ` [PATCH 2/7] compat-wireless: fix patch stile Hauke Mehrtens
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2010-08-27 18:40 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

needed_headroom was introduced in kernel 2.6.26.
Resize hard_header_len instead as it was done before using
needed_headroom.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/01-netdev.patch |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/patches/01-netdev.patch b/patches/01-netdev.patch
index bb6b30d..e168105 100644
--- a/patches/01-netdev.patch
+++ b/patches/01-netdev.patch
@@ -278,7 +278,7 @@ without creating a headache on maintenance of the pathes.
  	dev->tx_queue_len = 0;
 --- a/drivers/net/wireless/orinoco/main.c
 +++ b/drivers/net/wireless/orinoco/main.c
-@@ -2268,9 +2268,9 @@ int orinoco_if_add(struct orinoco_privat
+@@ -2268,14 +2268,18 @@ int orinoco_if_add(struct orinoco_privat
  #endif
  	/* Default to standard ops if not set */
  	if (ops)
@@ -290,6 +290,15 @@ without creating a headache on maintenance of the pathes.
  
  	/* we use the default eth_mac_addr for setting the MAC addr */
  
+ 	/* Reserve space in skb for the SNAP header */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
+ 	dev->needed_headroom = ENCAPS_OVERHEAD;
++#else
++	dev->hard_header_len += ENCAPS_OVERHEAD;
++#endif
+ 
+ 	netif_carrier_off(dev);
+ 
 --- a/net/bluetooth/bnep/netdev.c
 +++ b/net/bluetooth/bnep/netdev.c
 @@ -170,8 +170,12 @@ static inline int bnep_net_proto_filter(
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/7] compat-wireless: fix patch stile.
  2010-08-27 18:40 [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
  2010-08-27 18:40 ` [PATCH 1/7] compat-wireless: do not use needed_headroom Hauke Mehrtens
@ 2010-08-27 18:40 ` Hauke Mehrtens
  2010-08-27 18:40 ` [PATCH 3/7] compat-wireless: remove linux/gpio.h include Hauke Mehrtens
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2010-08-27 18:40 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

This should not change any functionality but the patches are looking
better with theses changes.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/01-netdev.patch    |    6 ++----
 patches/16-bluetooth.patch |   26 ++++++++++----------------
 2 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/patches/01-netdev.patch b/patches/01-netdev.patch
index e168105..17b4b11 100644
--- a/patches/01-netdev.patch
+++ b/patches/01-netdev.patch
@@ -305,14 +305,12 @@ without creating a headache on maintenance of the pathes.
  }
  #endif
  
--static netdev_tx_t bnep_net_xmit(struct sk_buff *skb,
--				 struct net_device *dev)
 +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31))
-+static netdev_tx_t bnep_net_xmit(struct sk_buff *skb, struct net_device *dev)
+ static netdev_tx_t bnep_net_xmit(struct sk_buff *skb,
+ 				 struct net_device *dev)
 +#else
 +static int bnep_net_xmit(struct sk_buff *skb, struct net_device *dev)
 +#endif
-+
  {
  	struct bnep_session *s = netdev_priv(dev);
  	struct sock *sk = s->sock->sk;
diff --git a/patches/16-bluetooth.patch b/patches/16-bluetooth.patch
index 29d990a..85e9b25 100644
--- a/patches/16-bluetooth.patch
+++ b/patches/16-bluetooth.patch
@@ -63,7 +63,7 @@ here still, but for now we keep this here.
 +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32))
  		sock_recv_ts_and_drops(msg, sk, skb);
 +#else
-+	  sock_recv_timestamp(msg, sk, skb);
++		sock_recv_timestamp(msg, sk, skb);
 +#endif
  
  	skb_free_datagram(sk, skb);
@@ -75,7 +75,7 @@ here still, but for now we keep this here.
 +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31))
  		amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
 +#else
-+    amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
++		amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
 +#endif
  		if (amount < 0)
  			amount = 0;
@@ -201,27 +201,21 @@ here still, but for now we keep this here.
  
  static void hidp_idle_timeout(unsigned long arg)
  {
-@@ -596,10 +607,16 @@ static int hidp_session(void *arg)
- 		session->input = NULL;
+@@ -597,8 +608,14 @@ static int hidp_session(void *arg)
  	}
  
--	if (session->hid) {
--		hid_destroy_device(session->hid);
--		session->hid = NULL;
--	}
-+  if (session->hid) {
+ 	if (session->hid) {
 +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27))
-+    hid_destroy_device(session->hid);
-+    session->hid = NULL;
+ 		hid_destroy_device(session->hid);
+ 		session->hid = NULL;
 +#else
-+    if (session->hid->claimed & HID_CLAIMED_INPUT)
-+      hidinput_disconnect(session->hid);
-+    hid_free_device(session->hid);
++		if (session->hid->claimed & HID_CLAIMED_INPUT)
++			hidinput_disconnect(session->hid);
++		hid_free_device(session->hid);
 +#endif
-+  }
+ 	}
  
  	/* Wakeup user-space polling for socket errors */
- 	session->intr_sock->sk->sk_err = EUNATCH;
 @@ -711,6 +728,70 @@ static void hidp_close(struct hid_device
  {
  }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/7] compat-wireless: remove linux/gpio.h include
  2010-08-27 18:40 [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
  2010-08-27 18:40 ` [PATCH 1/7] compat-wireless: do not use needed_headroom Hauke Mehrtens
  2010-08-27 18:40 ` [PATCH 2/7] compat-wireless: fix patch stile Hauke Mehrtens
@ 2010-08-27 18:40 ` Hauke Mehrtens
  2010-08-27 18:40 ` [PATCH 4/7] compat-wireless: multiple changes to config file Hauke Mehrtens
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2010-08-27 18:40 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

Kernel 2.6.24 does not have this header file. No method provided by
gpio.h is used in wl12*1_boot.c so this include looks unneeded to me.
This should probably also go into mainline.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/06-header-changes.patch |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/patches/06-header-changes.patch b/patches/06-header-changes.patch
index e0846f5..17c4465 100644
--- a/patches/06-header-changes.patch
+++ b/patches/06-header-changes.patch
@@ -16,9 +16,19 @@ cases.
  
  struct b43_wldev;
  
+--- a/drivers/net/wireless/wl12xx/wl1251_boot.c
++++ b/drivers/net/wireless/wl12xx/wl1251_boot.c
+@@ -19,7 +19,6 @@
+  *
+  */
+ 
+-#include <linux/gpio.h>
+ #include <linux/slab.h>
+ 
+ #include "wl1251_reg.h"
 --- a/drivers/net/wireless/wl12xx/wl1251_main.c
 +++ b/drivers/net/wireless/wl12xx/wl1251_main.c
-@@ -26,6 +26,9 @@
+@@ -24,6 +24,9 @@
  #include <linux/firmware.h>
  #include <linux/delay.h>
  #include <linux/irq.h>
@@ -30,7 +40,7 @@ cases.
  #include <linux/vmalloc.h>
 --- a/drivers/net/wireless/wl12xx/wl1251_spi.c
 +++ b/drivers/net/wireless/wl12xx/wl1251_spi.c
-@@ -25,6 +25,9 @@
+@@ -23,6 +23,9 @@
  #include <linux/module.h>
  #include <linux/slab.h>
  #include <linux/crc7.h>
@@ -40,6 +50,16 @@ cases.
  #include <linux/spi/spi.h>
  #include <linux/spi/wl12xx.h>
  
+--- a/drivers/net/wireless/wl12xx/wl1271_boot.c
++++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
+@@ -21,7 +21,6 @@
+  *
+  */
+ 
+-#include <linux/gpio.h>
+ #include <linux/slab.h>
+ 
+ #include "wl1271_acx.h"
 --- a/net/mac80211/key.c
 +++ b/net/mac80211/key.c
 @@ -22,6 +22,9 @@
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/7] compat-wireless: multiple changes to config file
  2010-08-27 18:40 [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
                   ` (2 preceding siblings ...)
  2010-08-27 18:40 ` [PATCH 3/7] compat-wireless: remove linux/gpio.h include Hauke Mehrtens
@ 2010-08-27 18:40 ` Hauke Mehrtens
  2010-08-27 18:40 ` [PATCH 5/7] compat-wireless: rename CONFIG_IWLWIFI config symbol Hauke Mehrtens
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2010-08-27 18:40 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

 *	deactivate SPI drivers for kernel < 2.6.25 because linux/gpio.h
	is missing
 * 	CONFIG_WL1251 and CONFIG_WL1271 both need CRC7
 * 	CONFIG_RT2X00_LIB_LEDS does not work for kernel < 2.6.25
	because of missing blink_set

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 config.mk |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/config.mk b/config.mk
index edfeca2..4c4a111 100644
--- a/config.mk
+++ b/config.mk
@@ -436,12 +436,12 @@ CONFIG_BT_ATH3K=m
 endif # end of USB driver list
 
 ifneq ($(CONFIG_SPI_MASTER),)
+ifndef CONFIG_COMPAT_KERNEL_25
 
-CONFIG_WL1251=m
 ifneq ($(CONFIG_CRC7),)
 CONFIG_WL1251_SPI=m
-endif
 CONFIG_WL1271_SPI=m
+endif
 CONFIG_P54_SPI=m
 
 ifdef CONFIG_COMPAT_KERNEL_27
@@ -452,18 +452,23 @@ CONFIG_LIBERTAS_SPI=m
 NEED_LIBERTAS=y
 endif
 
+endif
 endif # end of SPI driver list
 
 ifneq ($(CONFIG_MMC),)
 
 CONFIG_SSB_SDIOHOST=y
 CONFIG_B43_SDIO=y
+
+ifneq ($(CONFIG_CRC7),)
 CONFIG_WL1251_SDIO=m
 
 ifndef CONFIG_COMPAT_KERNEL_32
 CONFIG_WL1271_SDIO=m
 endif
 
+endif
+
 ifdef CONFIG_COMPAT_KERNEL_27
 CONFIG_LIBERTAS_SDIO=n
 NEED_LIBERTAS=n
@@ -488,7 +493,11 @@ CONFIG_RT2800_LIB=m
 CONFIG_RT2X00_LIB_HT=y
 CONFIG_RT2X00_LIB_FIRMWARE=y
 CONFIG_RT2X00_LIB_CRYPTO=y
+ifdef CONFIG_COMPAT_KERNEL_25
+CONFIG_RT2X00_LIB_LEDS=n
+else
 CONFIG_RT2X00_LIB_LEDS=y
+endif
 # CONFIG_RT2X00_DEBUG=y
 # CONFIG_RT2X00_LIB_DEBUGFS
 endif
@@ -506,8 +515,8 @@ CONFIG_ATH_COMMON=m
 # CONFIG_ATH_DEBUG=y
 
 CONFIG_WL12XX=y
-CONFIG_WL1251=m
 ifneq ($(CONFIG_CRC7),)
+CONFIG_WL1251=m
 CONFIG_WL1271=m
 endif
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/7] compat-wireless: rename CONFIG_IWLWIFI config symbol
  2010-08-27 18:40 [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
                   ` (3 preceding siblings ...)
  2010-08-27 18:40 ` [PATCH 4/7] compat-wireless: multiple changes to config file Hauke Mehrtens
@ 2010-08-27 18:40 ` Hauke Mehrtens
  2010-08-27 18:40 ` [PATCH 6/7] compat-wireless: add ifdefs into compat_autoconf.h Hauke Mehrtens
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2010-08-27 18:40 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

In kernel 2.6.24 CONFIG_IWLWIFI was a bool config symbol and not a
tristate one. In that kernel it was used for showing the menu option for
the Intel driver and not for selection the module it is used for today.
In kernel configurations for version 2.6.24 it is set so y and not to m.
As we do not overwrite some value selected in the kernel config it
will cause problems when we build some parts of the Intel driver in
compat-wireless directly into the kernel.
Now we use an other name for this config symbol to work around the
problem.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 config.mk                              |    2 +-
 patches/08-rename-iwl4965-config.patch |    8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/config.mk b/config.mk
index 4c4a111..110291d 100644
--- a/config.mk
+++ b/config.mk
@@ -214,7 +214,7 @@ CONFIG_ATH9K_COMMON=m
 # CONFIG_ATH9K_PKTLOG=y
 
 
-CONFIG_IWLWIFI=m
+CONFIG_COMPAT_IWLWIFI=m
 # CONFIG_IWLWIFI_DEBUG=y
 # CONFIG_IWLWIFI_DEBUGFS=y
 # CONFIG_IWLWIFI_DEVICE_TRACING=y
diff --git a/patches/08-rename-iwl4965-config.patch b/patches/08-rename-iwl4965-config.patch
index 568314f..28cd39e 100644
--- a/patches/08-rename-iwl4965-config.patch
+++ b/patches/08-rename-iwl4965-config.patch
@@ -5,6 +5,12 @@ CONFIG_IWL4965 has to be set to y, to build correctly.
 
 --- a/drivers/net/wireless/iwlwifi/Makefile
 +++ b/drivers/net/wireless/iwlwifi/Makefile
+@@ -1,4 +1,4 @@
+-obj-$(CONFIG_IWLWIFI)	+= iwlcore.o
++obj-$(CONFIG_COMPAT_IWLWIFI)	+= iwlcore.o
+ iwlcore-objs 		:= iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o
+ iwlcore-objs 		+= iwl-rx.o iwl-tx.o iwl-sta.o
+ iwlcore-objs 		+= iwl-scan.o iwl-led.o
 @@ -15,7 +15,7 @@ iwlagn-objs		+= iwl-agn-lib.o iwl-agn-rx
  iwlagn-objs		+= iwl-agn-tt.o
  iwlagn-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-agn-debugfs.o
@@ -16,7 +22,7 @@ CONFIG_IWL4965 has to be set to y, to build correctly.
  iwlagn-$(CONFIG_IWL5000) += iwl-1000.o
 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c
 +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
-@@ -4339,10 +4339,10 @@ static void __devexit iwl_pci_remove(str
+@@ -4450,10 +4450,10 @@ static void __devexit iwl_pci_remove(str
  
  /* Hardware specific file defines the PCI IDs table for that hardware module */
  static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/7] compat-wireless: add ifdefs into compat_autoconf.h
  2010-08-27 18:40 [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
                   ` (4 preceding siblings ...)
  2010-08-27 18:40 ` [PATCH 5/7] compat-wireless: rename CONFIG_IWLWIFI config symbol Hauke Mehrtens
@ 2010-08-27 18:40 ` Hauke Mehrtens
  2010-08-27 18:40 ` [PATCH 7/7] compat-wireless: add support for kernel 2.6.24 Hauke Mehrtens
  2010-08-27 21:27 ` [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
  7 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2010-08-27 18:40 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

When using ifdef or ifndef in config.mk these conditions are now also
written into compat_autoconf.h. This replaces some special handling in
gen-compat-autoconf.sh. This was needed because CONFIG_RT2X00_LIB_LEDS
should only be selected for kernel > 2.6.24.
The script adds ifdefs, ifndefs else and endif into the header file. It
adds endif and else only if it is followed by " #CONFIG_" This is
needed because we do not support something like "ifneq
($(CONFIG_CRC7),)" or "ifeq ($(wildcard $(KLIB_BUILD)/.config),)" for
now.
Now egrep is needed because grep does not support the needed regular
expressions.
The spaces in the egrep part have to be replaced by some other
character, a + is used here.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 config.mk                      |   50 ++++++++++++++++++++-------------------
 scripts/gen-compat-autoconf.sh |   46 ++++++++++++++++++------------------
 2 files changed, 49 insertions(+), 47 deletions(-)

diff --git a/config.mk b/config.mk
index 110291d..27e2322 100644
--- a/config.mk
+++ b/config.mk
@@ -27,7 +27,7 @@ $(foreach ver,$(COMPAT_VERSIONS),$(eval CONFIG_COMPAT_KERNEL_$(ver)=y))
 
 ifdef CONFIG_COMPAT_KERNEL_25
 $(error "ERROR: compat-wireless by default supports kernels >= 2.6.25, try enabling only one driver though")
-endif
+endif #CONFIG_COMPAT_KERNEL_25
 
 ifeq ($(CONFIG_CFG80211),y)
 $(error "ERROR: your kernel has CONFIG_CFG80211=y, you should have it CONFIG_CFG80211=m if you want to use this thing.")
@@ -97,13 +97,13 @@ else
  CONFIG_COMPAT_BLUETOOTH=y
  CONFIG_COMPAT_BLUETOOTH_MODULES=m
 endif
-endif # Kernel >= 2.6.26
+endif #CONFIG_COMPAT_KERNEL_27
 
-ifeq ($(CONFIG_COMPAT_KERNEL_33),y)
+ifdef CONFIG_COMPAT_KERNEL_33
 ifneq ($(CONFIG_FW_LOADER),)
  CONFIG_COMPAT_FIRMWARE_CLASS=m
 endif
-endif
+endif #CONFIG_COMPAT_KERNEL_33
 
 
 # Wireless subsystem stuff
@@ -323,9 +323,9 @@ CONFIG_ATL2=m
 CONFIG_ATL1E=m
 ifdef CONFIG_COMPAT_KERNEL_27
 CONFIG_ATL1C=n
-else
+else #CONFIG_COMPAT_KERNEL_27
 CONFIG_ATL1C=m
-endif
+endif #CONFIG_COMPAT_KERNEL_27
 
 CONFIG_HERMES=m
 CONFIG_HERMES_CACHE_FW_ON_INIT=y
@@ -349,10 +349,10 @@ ifneq ($(CONFIG_PCMCIA),)
 ifdef CONFIG_COMPAT_KERNEL_27
 CONFIG_LIBERTAS=n
 CONFIG_LIBERTAS_CS=n
-else
+else #CONFIG_COMPAT_KERNEL_27
 CONFIG_LIBERTAS_CS=m
 NEED_LIBERTAS=y
-endif
+endif #CONFIG_COMPAT_KERNEL_27
 
 endif
 ## end of PCMCIA
@@ -377,12 +377,14 @@ CONFIG_USB_COMPAT_USBNET=n
 CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
 CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
 CONFIG_USB_NET_COMPAT_CDCETHER=n
-else
+else #CONFIG_COMPAT_KERNEL_29
 CONFIG_USB_COMPAT_USBNET=m
+ifdef CONFIG_USB_NET_CDCETHER
 CONFIG_USB_NET_COMPAT_RNDIS_HOST=m
 CONFIG_USB_NET_COMPAT_RNDIS_WLAN=m
+endif #CONFIG_USB_NET_CDCETHER
 CONFIG_USB_NET_COMPAT_CDCETHER=m
-endif
+endif #CONFIG_COMPAT_KERNEL_29
 
 
 CONFIG_P54_USB=m
@@ -394,7 +396,7 @@ CONFIG_AT76C50X_USB=m
 ifndef CONFIG_COMPAT_KERNEL_28
 CONFIG_AR9170_USB=m
 CONFIG_AR9170_LEDS=y
-endif
+endif #CONFIG_COMPAT_KERNEL_28
 
 CONFIG_ATH9K_HTC=m
 # CONFIG_ATH9K_HTC_DEBUGFS=y
@@ -419,11 +421,11 @@ ifdef CONFIG_COMPAT_KERNEL_27
 CONFIG_LIBERTAS_THINFIRM_USB=n
 CONFIG_LIBERTAS_USB=n
 NEED_LIBERTAS=n
-else
+else #CONFIG_COMPAT_KERNEL_27
 CONFIG_LIBERTAS_THINFIRM_USB=m
 CONFIG_LIBERTAS_USB=m
 NEED_LIBERTAS=y
-endif
+endif #CONFIG_COMPAT_KERNEL_27
 
 CONFIG_ORINOCO_USB=m
 
@@ -447,12 +449,12 @@ CONFIG_P54_SPI=m
 ifdef CONFIG_COMPAT_KERNEL_27
 CONFIG_LIBERTAS_SPI=n
 NEED_LIBERTAS=n
-else
+else #CONFIG_COMPAT_KERNEL_27
 CONFIG_LIBERTAS_SPI=m
 NEED_LIBERTAS=y
-endif
+endif #CONFIG_COMPAT_KERNEL_27
 
-endif
+endif #CONFIG_COMPAT_KERNEL_25
 endif # end of SPI driver list
 
 ifneq ($(CONFIG_MMC),)
@@ -465,17 +467,17 @@ CONFIG_WL1251_SDIO=m
 
 ifndef CONFIG_COMPAT_KERNEL_32
 CONFIG_WL1271_SDIO=m
-endif
+endif #CONFIG_COMPAT_KERNEL_32
 
 endif
 
 ifdef CONFIG_COMPAT_KERNEL_27
 CONFIG_LIBERTAS_SDIO=n
 NEED_LIBERTAS=n
-else
+else #CONFIG_COMPAT_KERNEL_27
 CONFIG_LIBERTAS_SDIO=m
 NEED_LIBERTAS=y
-endif
+endif #CONFIG_COMPAT_KERNEL_27
 
 CONFIG_IWM=m
 # CONFIG_IWM_DEBUG=y
@@ -495,9 +497,9 @@ CONFIG_RT2X00_LIB_FIRMWARE=y
 CONFIG_RT2X00_LIB_CRYPTO=y
 ifdef CONFIG_COMPAT_KERNEL_25
 CONFIG_RT2X00_LIB_LEDS=n
-else
+else #CONFIG_COMPAT_KERNEL_25
 CONFIG_RT2X00_LIB_LEDS=y
-endif
+endif #CONFIG_COMPAT_KERNEL_25
 # CONFIG_RT2X00_DEBUG=y
 # CONFIG_RT2X00_LIB_DEBUGFS
 endif
@@ -522,14 +524,14 @@ endif
 
 ifdef CONFIG_COMPAT_KERNEL_27
 CONFIG_LIBERTAS=n
-else
+else #CONFIG_COMPAT_KERNEL_27
 ifeq ($(NEED_LIBERTAS),y)
 CONFIG_LIBERTAS_THINFIRM=m
 CONFIG_LIBERTAS=m
 CONFIG_LIBERTAS_MESH=y
 # CONFIG_LIBERTAS_DEBUG=y
 endif
-endif
+endif #CONFIG_COMPAT_KERNEL_27
 
 # We need the backported rfkill module on kernel < 2.6.31.
 # In more recent kernel versions use the in kernel rfkill module.
@@ -537,5 +539,5 @@ ifdef CONFIG_COMPAT_KERNEL_31
 CONFIG_RFKILL_BACKPORT=m
 CONFIG_RFKILL_BACKPORT_LEDS=y
 CONFIG_RFKILL_BACKPORT_INPUT=y
-endif
+endif #CONFIG_COMPAT_KERNEL_31
 
diff --git a/scripts/gen-compat-autoconf.sh b/scripts/gen-compat-autoconf.sh
index 1e3002e..7b5773c 100755
--- a/scripts/gen-compat-autoconf.sh
+++ b/scripts/gen-compat-autoconf.sh
@@ -145,36 +145,36 @@ EOF
 kernel_version_req $OLDEST_KERNEL_SUPPORTED
 
 # For each CONFIG_FOO=x option
-for i in $(grep '^CONFIG_' $COMPAT_CONFIG); do
-	# Get the element on the left of the "="
-	VAR=$(echo $i | cut -d"=" -f 1)
-	# Get the element on the right of the "="
-	VALUE=$(echo $i | cut -d"=" -f 2)
-
-	# skip vars that weren't actually set due to dependencies
-	#if [ "${!VAR}" = "" ] ; then
-	#	continue
-	#fi
-
-	# Handle core kernel module depenencies here.
-	case $VAR in
-	CONFIG_USB_NET_RNDIS_WLAN)
-		define_config_dep $VAR $VALUE CONFIG_USB_NET_CDCETHER
+for i in $(egrep '^CONFIG_|^ifdef CONFIG_|^ifndef CONFIG_|^endif #CONFIG_|^else #CONFIG_' $COMPAT_CONFIG | sed 's/ /+/'); do
+	case $i in
+	'ifdef+CONFIG_'* | 'ifndef+CONFIG_'* ) #
+		echo "#$i" | sed 's/+/ /' | sed 's/\(ifdef CONFIG_COMPAT_KERNEL_\)\([0-9]*\)/if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,\2))/'
 		continue
 		;;
-	CONFIG_USB_NET_RNDIS_HOST)
-		define_config_dep $VAR $VALUE CONFIG_USB_NET_CDCETHER
+	'else+#CONFIG_'* | 'endif+#CONFIG_'* )
+		echo "#$i */" |sed -e 's/+#/ \/* /g'
 		continue
 		;;
-	# ignore this, we have a special hanlder for this at the botttom
-	# instead. We still need to keep this in config.mk to let Makefiles
-	# know its enabled so just ignore it here.
-	CONFIG_MAC80211_QOS)
+	CONFIG_* )
+		# Get the element on the left of the "="
+		VAR=$(echo $i | cut -d"=" -f 1)
+		# Get the element on the right of the "="
+		VALUE=$(echo $i | cut -d"=" -f 2)
+
+		# Handle core kernel module depenencies here.
+		case $VAR in
+		# ignore this, we have a special hanlder for this at the botttom
+		# instead. We still need to keep this in config.mk to let Makefiles
+		# know its enabled so just ignore it here.
+		CONFIG_MAC80211_QOS)
+			continue
+			;;
+		esac
+		# Any other module which can *definitely* be built as a module goes here
+		define_config $VAR $VALUE
 		continue
 		;;
 	esac
-	# Any other module which can *definitely* be built as a module goes here
-	define_config $VAR $VALUE
 done
 
 # Deal with special cases. CONFIG_MAC80211_QOS is such a case.
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/7] compat-wireless: add support for kernel 2.6.24
  2010-08-27 18:40 [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
                   ` (5 preceding siblings ...)
  2010-08-27 18:40 ` [PATCH 6/7] compat-wireless: add ifdefs into compat_autoconf.h Hauke Mehrtens
@ 2010-08-27 18:40 ` Hauke Mehrtens
  2010-08-27 21:27 ` [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
  7 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2010-08-27 18:40 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 config.mk                      |    6 +++---
 scripts/gen-compat-autoconf.sh |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/config.mk b/config.mk
index 27e2322..87b637e 100644
--- a/config.mk
+++ b/config.mk
@@ -25,9 +25,9 @@ KERNEL_SUBLEVEL := $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2
 COMPAT_VERSIONS := $(shell I=$(COMPAT_LATEST_VERSION); while [ "$$I" -gt $(KERNEL_SUBLEVEL) ]; do echo $$I; I=$$(($$I - 1)); done)
 $(foreach ver,$(COMPAT_VERSIONS),$(eval CONFIG_COMPAT_KERNEL_$(ver)=y))
 
-ifdef CONFIG_COMPAT_KERNEL_25
-$(error "ERROR: compat-wireless by default supports kernels >= 2.6.25, try enabling only one driver though")
-endif #CONFIG_COMPAT_KERNEL_25
+ifdef CONFIG_COMPAT_KERNEL_24
+$(error "ERROR: compat-wireless by default supports kernels >= 2.6.24, try enabling only one driver though")
+endif #CONFIG_COMPAT_KERNEL_24
 
 ifeq ($(CONFIG_CFG80211),y)
 $(error "ERROR: your kernel has CONFIG_CFG80211=y, you should have it CONFIG_CFG80211=m if you want to use this thing.")
diff --git a/scripts/gen-compat-autoconf.sh b/scripts/gen-compat-autoconf.sh
index 7b5773c..65232ab 100755
--- a/scripts/gen-compat-autoconf.sh
+++ b/scripts/gen-compat-autoconf.sh
@@ -11,7 +11,7 @@
 
 # This indicates which is the oldest kernel we support
 # Update this if you are adding support for older kernels.
-OLDEST_KERNEL_SUPPORTED="2.6.25"
+OLDEST_KERNEL_SUPPORTED="2.6.24"
 COMPAT_RELEASE="compat_version"
 KERNEL_RELEASE="compat_base_tree_version"
 MULT_DEP_FILE=".compat_pivot_dep"
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25
  2010-08-27 18:40 [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
                   ` (6 preceding siblings ...)
  2010-08-27 18:40 ` [PATCH 7/7] compat-wireless: add support for kernel 2.6.24 Hauke Mehrtens
@ 2010-08-27 21:27 ` Hauke Mehrtens
  2010-08-28 20:57   ` Luis R. Rodriguez
  7 siblings, 1 reply; 10+ messages in thread
From: Hauke Mehrtens @ 2010-08-27 21:27 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: lrodriguez, linux-wireless, mcgrof

Am 27.08.2010 20:40, schrieb Hauke Mehrtens:
> This series fixes some problems when compiling compat-wireless against 
> kernel 2.6.24 or 2.6.25. Now this should work for every driver selected 
> by default.
> "add ifdefs into compat_autoconf.h" extends gen-compat-autoconf.sh to
> handle some ifdef in config.mk.
> 
> This was compile tested with kernel 2.6.24 to 2.6.36.
> 
> Hauke Mehrtens (7):
>   compat-wireless: do not use needed_headroom
>   compat-wireless: fix patch stile.
>   compat-wireless: remove linux/gpio.h include
>   compat-wireless: multiple changes to config file
>   compat-wireless: rename CONFIG_IWLWIFI config symbol
>   compat-wireless: add ifdefs into compat_autoconf.h
>   compat-wireless: add support for kernel 2.6.24

These patches and the patch for compat should also go into stable. I
have tested then with origin/linux-2.6.36.y and they also worked on that
branch.

Hauke

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25
  2010-08-27 21:27 ` [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
@ 2010-08-28 20:57   ` Luis R. Rodriguez
  0 siblings, 0 replies; 10+ messages in thread
From: Luis R. Rodriguez @ 2010-08-28 20:57 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linux-wireless, mcgrof

On Fri, Aug 27, 2010 at 2:27 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> Am 27.08.2010 20:40, schrieb Hauke Mehrtens:
>> This series fixes some problems when compiling compat-wireless against
>> kernel 2.6.24 or 2.6.25. Now this should work for every driver selected
>> by default.
>> "add ifdefs into compat_autoconf.h" extends gen-compat-autoconf.sh to
>> handle some ifdef in config.mk.
>>
>> This was compile tested with kernel 2.6.24 to 2.6.36.
>>
>> Hauke Mehrtens (7):
>>   compat-wireless: do not use needed_headroom
>>   compat-wireless: fix patch stile.
>>   compat-wireless: remove linux/gpio.h include
>>   compat-wireless: multiple changes to config file
>>   compat-wireless: rename CONFIG_IWLWIFI config symbol
>>   compat-wireless: add ifdefs into compat_autoconf.h
>>   compat-wireless: add support for kernel 2.6.24
>
> These patches and the patch for compat should also go into stable. I
> have tested then with origin/linux-2.6.36.y and they also worked on that
> branch.

Awesome thanks, all applied cleanly on the 2.6.36.y branch except the
iwlwifi one but I manged that. Merged and pushed.

 Luis

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-08-28 20:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-27 18:40 [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
2010-08-27 18:40 ` [PATCH 1/7] compat-wireless: do not use needed_headroom Hauke Mehrtens
2010-08-27 18:40 ` [PATCH 2/7] compat-wireless: fix patch stile Hauke Mehrtens
2010-08-27 18:40 ` [PATCH 3/7] compat-wireless: remove linux/gpio.h include Hauke Mehrtens
2010-08-27 18:40 ` [PATCH 4/7] compat-wireless: multiple changes to config file Hauke Mehrtens
2010-08-27 18:40 ` [PATCH 5/7] compat-wireless: rename CONFIG_IWLWIFI config symbol Hauke Mehrtens
2010-08-27 18:40 ` [PATCH 6/7] compat-wireless: add ifdefs into compat_autoconf.h Hauke Mehrtens
2010-08-27 18:40 ` [PATCH 7/7] compat-wireless: add support for kernel 2.6.24 Hauke Mehrtens
2010-08-27 21:27 ` [PATCH 0/7] compat-wireless: add support for kernel 2.6.24 and 2.6.25 Hauke Mehrtens
2010-08-28 20:57   ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).