2010-09-19 17:42:24

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 1/4] compat: backport PCMCIA API changes.

This backports the API change to pcmcia_enable_device

Signed-off-by: Hauke Mehrtens <[email protected]>
---
include/linux/compat-2.6.37.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-2.6.37.h b/include/linux/compat-2.6.37.h
index 8ea0bab..7fce42a 100644
--- a/include/linux/compat-2.6.37.h
+++ b/include/linux/compat-2.6.37.h
@@ -43,6 +43,8 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb)
#endif
}

+#define pcmcia_enable_device(link) pcmcia_request_configuration(link, &link->conf)
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) */

#endif /* LINUX_26_37_COMPAT_H */
--
1.7.0.4



2010-09-22 19:09:44

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: Re: [PATCH 3/4] compat: move pmcia backport code into compat-2.6.36.h



As on 2010-09-22 18:59, Luis R. Rodriguez did write:
> On Wed, Sep 22, 2010 at 9:55 AM, Kshitij Kulshreshtha
> <[email protected]> wrote:
>> Hello,
>>
>> As on 2010-09-19 19:42, Hauke Mehrtens did write:
>>> We have all out backport headers in include/linux/compat-2.6.XX.h also the pcmcia
>>> part there.
>>
>> I'm not sure if this won't make all the compat-wireless modules depend
>> on pcmcia.ko for kernels < 2.6.36 where
>> pcmcia_access_configuation_register() is exported. Even if someone is
>> only building selected drivers like iwlwifi or ath.
>
> Have you tried loading ath9k or iwlagn on compat-wireless? Did you
> note compat doesn't get loaded? Anyway, patches welcomed to enhance
> this if your concern is if your kernel won't build with this. We also
> plan on dropping PCMCIA completely anyway.

Actually compat does get loaded since mac80211 needs it for noop_llseek
on 2.6.34, however my current build is not showing the pcmcia dependency
that I was afraid of, so please ignore this.

Thanks.
--
Kshitij Kulshreshtha

Institut für Mathematik,
Universität Paderborn,
Warburger Straße 100,
33098 Paderborn.

Büro: A3.235

Privatanschrift:
Arnikaweg 62
33100 Paderborn.

2010-09-22 16:55:28

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: Re: [PATCH 3/4] compat: move pmcia backport code into compat-2.6.36.h

Hello,

As on 2010-09-19 19:42, Hauke Mehrtens did write:
> We have all out backport headers in include/linux/compat-2.6.XX.h also the pcmcia
> part there.

I'm not sure if this won't make all the compat-wireless modules depend
on pcmcia.ko for kernels < 2.6.36 where
pcmcia_access_configuation_register() is exported. Even if someone is
only building selected drivers like iwlwifi or ath.


>
> CC: Kshitij Kulshreshtha <[email protected]>
> Signed-off-by: Hauke Mehrtens <[email protected]>
> ---
> include/linux/compat-2.6.36.h | 29 +++++++++++++++++++++++++++++
> include/pcmcia/ds.h | 36 ------------------------------------
> 2 files changed, 29 insertions(+), 36 deletions(-)
> delete mode 100644 include/pcmcia/ds.h
>
> diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
> index 2df34d6..1d929d7 100644
> --- a/include/linux/compat-2.6.36.h
> +++ b/include/linux/compat-2.6.36.h
> @@ -6,6 +6,8 @@
> #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
>
> #include <linux/usb.h>
> +#include <pcmcia/cistpl.h>
> +#include <pcmcia/ds.h>
>
> #define kparam_block_sysfs_write(a)
> #define kparam_unblock_sysfs_write(a)
> @@ -27,6 +29,33 @@ extern struct urb *compat_usb_get_from_anchor(struct usb_anchor *anchor);
> extern void compat_usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
> #endif
>
> +/**
> + * pcmcia_read_config_byte() - read a byte from a card configuration register
> + *
> + * pcmcia_read_config_byte() reads a byte from a configuration register in
> + * attribute memory.
> + */
> +static inline int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val)
> +{
> + int ret;
> + conf_reg_t reg = { 0, CS_READ, where, 0 };
> + ret = pcmcia_access_configuration_register(p_dev, &reg);
> + *val = reg.Value;
> + return ret;
> +}
> +
> +/**
> + * pcmcia_write_config_byte() - write a byte to a card configuration register
> + *
> + * pcmcia_write_config_byte() writes a byte to a configuration register in
> + * attribute memory.
> + */
> +static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val)
> +{
> + conf_reg_t reg = { 0, CS_WRITE, where, val };
> + return pcmcia_access_configuration_register(p_dev, &reg);
> +}
> +
> #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
>
> #endif /* LINUX_26_36_COMPAT_H */
> diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
> deleted file mode 100644
> index fc43703..0000000
> --- a/include/pcmcia/ds.h
> +++ /dev/null
> @@ -1,36 +0,0 @@
> -#ifndef _COMPAT_PCMCIA_DS_H
> -#define _COMPAT_PCMCIA_DS_H
> -#include <linux/version.h>
> -
> -#include_next <pcmcia/ds.h>
> -
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
> -/**
> - * pcmcia_read_config_byte() - read a byte from a card configuration register
> - *
> - * pcmcia_read_config_byte() reads a byte from a configuration register in
> - * attribute memory.
> - */
> -static inline int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val)
> -{
> - int ret;
> - conf_reg_t reg = { 0, CS_READ, where, 0 };
> - ret = pcmcia_access_configuration_register(p_dev, &reg);
> - *val = reg.Value;
> - return ret;
> -}
> -
> -/**
> - * pcmcia_write_config_byte() - write a byte to a card configuration register
> - *
> - * pcmcia_write_config_byte() writes a byte to a configuration register in
> - * attribute memory.
> - */
> -static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val)
> -{
> - conf_reg_t reg = { 0, CS_WRITE, where, val };
> - return pcmcia_access_configuration_register(p_dev, &reg);
> -}
> -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) */
> -
> -#endif

--
Kshitij Kulshreshtha

Institut für Mathematik,
Universität Paderborn,
Warburger Straße 100,
33098 Paderborn.

Büro: A3.235

Privatanschrift:
Arnikaweg 62
33100 Paderborn.

2010-09-23 19:33:09

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH 3/4] compat: move pmcia backport code into compat-2.6.36.h

On 22.09.2010 21:09, Kshitij Kulshreshtha wrote:
>
>
> As on 2010-09-22 18:59, Luis R. Rodriguez did write:
>> On Wed, Sep 22, 2010 at 9:55 AM, Kshitij Kulshreshtha
>> <[email protected]> wrote:
>>> Hello,
>>>
>>> As on 2010-09-19 19:42, Hauke Mehrtens did write:
>>>> We have all out backport headers in include/linux/compat-2.6.XX.h also the pcmcia
>>>> part there.
>>>
>>> I'm not sure if this won't make all the compat-wireless modules depend
>>> on pcmcia.ko for kernels < 2.6.36 where
>>> pcmcia_access_configuation_register() is exported. Even if someone is
>>> only building selected drivers like iwlwifi or ath.
>>
>> Have you tried loading ath9k or iwlagn on compat-wireless? Did you
>> note compat doesn't get loaded? Anyway, patches welcomed to enhance
>> this if your concern is if your kernel won't build with this. We also
>> plan on dropping PCMCIA completely anyway.
>
> Actually compat does get loaded since mac80211 needs it for noop_llseek
> on 2.6.34, however my current build is not showing the pcmcia dependency
> that I was afraid of, so please ignore this.
>
> Thanks.
Hi Kshitij,
Hi Luis,

in this case pcmcia_read_config_byte() and pcmcia_write_config_byte()
are inlined so the code will be placed in the drivers using this code
and not compat.ko. The header files for pcmcia are available independent
from how the kernel was configured.

But there are some other functions in compat-2.6.xx.c (e.g.
pccard_loop_tuple() in compat-2.6.33.c) depending on pcmcia code. This
will not cause an compile error because these backport functions are
only build if pcmcia is configured in the kernel but if the kernel
supports pcmcia compat.ko will depend on pcmcia. This does not harm on
normal desktop systems like ubuntu because the devices do have enoth
memory to load the probably unneeded pcmcia module. But if you are on an
embedded device with e.g. 4 MB flash and 16 MB Ram you do not want to
depend on pcmcia if you do not have to.

The same thing also regards usb and probably some other modules. In
OpenWrt we removed the usb backports from compat-wireless, because we
had no support for any driver needing these functions and we do not want
compat.ko to depend on usb, because some devices supported by OpenWrt do
not even have an usb port, but an build in wireless card.

It would make sense to split compat.ko up in compat-generic.ko,
compat-net.ko, compat-pcmcia.ko, compat-usb.ko, and so on, but this will
make maintaining them it really harder.

Hauke

2010-09-19 17:42:32

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 2/4] compat: backport some usb urb functions

These functions have to be backported, because they were thread-unsafe.
This is commit b3e670443b7fb8a2d29831b62b44a039c283e351 in mainline kernel.

CC: Christian Lamparter <[email protected]>
Signed-off-by: Hauke Mehrtens <[email protected]>
---
compat/Makefile | 1 +
compat/compat-2.6.28.c | 56 -----------------------
compat/compat-2.6.36.c | 100 +++++++++++++++++++++++++++++++++++++++++
include/linux/compat-2.6.28.h | 2 -
include/linux/compat-2.6.36.h | 12 +++++
5 files changed, 113 insertions(+), 58 deletions(-)
create mode 100644 compat/compat-2.6.36.c

diff --git a/compat/Makefile b/compat/Makefile
index b067be2..1f053f2 100644
--- a/compat/Makefile
+++ b/compat/Makefile
@@ -27,4 +27,5 @@ compat-$(CONFIG_COMPAT_KERNEL_31) += compat-2.6.31.o
compat-$(CONFIG_COMPAT_KERNEL_32) += compat-2.6.32.o
compat-$(CONFIG_COMPAT_KERNEL_33) += compat-2.6.33.o
compat-$(CONFIG_COMPAT_KERNEL_35) += compat-2.6.35.o
+compat-$(CONFIG_COMPAT_KERNEL_36) += compat-2.6.36.o
compat-$(CONFIG_COMPAT_KERNEL_37) += compat-2.6.37.o
diff --git a/compat/compat-2.6.28.c b/compat/compat-2.6.28.c
index bfb645a..c11ba40 100644
--- a/compat/compat-2.6.28.c
+++ b/compat/compat-2.6.28.c
@@ -225,62 +225,6 @@ EXPORT_SYMBOL_GPL(usb_poison_anchored_urbs);
#endif

/**
- * usb_get_from_anchor - get an anchor's oldest urb
- * @anchor: the anchor whose urb you want
- *
- * this will take the oldest urb from an anchor,
- * unanchor and return it
- */
-struct urb *usb_get_from_anchor(struct usb_anchor *anchor)
-{
- struct urb *victim;
- unsigned long flags;
-
- spin_lock_irqsave(&anchor->lock, flags);
- if (!list_empty(&anchor->urb_list)) {
- victim = list_entry(anchor->urb_list.next, struct urb,
- anchor_list);
- usb_get_urb(victim);
- spin_unlock_irqrestore(&anchor->lock, flags);
- usb_unanchor_urb(victim);
- } else {
- spin_unlock_irqrestore(&anchor->lock, flags);
- victim = NULL;
- }
-
- return victim;
-}
-
-EXPORT_SYMBOL_GPL(usb_get_from_anchor);
-
-/**
- * usb_scuttle_anchored_urbs - unanchor all an anchor's urbs
- * @anchor: the anchor whose urbs you want to unanchor
- *
- * use this to get rid of all an anchor's urbs
- */
-void usb_scuttle_anchored_urbs(struct usb_anchor *anchor)
-{
- struct urb *victim;
- unsigned long flags;
-
- spin_lock_irqsave(&anchor->lock, flags);
- while (!list_empty(&anchor->urb_list)) {
- victim = list_entry(anchor->urb_list.prev, struct urb,
- anchor_list);
- usb_get_urb(victim);
- spin_unlock_irqrestore(&anchor->lock, flags);
- /* this may free the URB */
- usb_unanchor_urb(victim);
- usb_put_urb(victim);
- spin_lock_irqsave(&anchor->lock, flags);
- }
- spin_unlock_irqrestore(&anchor->lock, flags);
-}
-
-EXPORT_SYMBOL_GPL(usb_scuttle_anchored_urbs);
-
-/**
* usb_anchor_empty - is an anchor empty
* @anchor: the anchor you want to query
*
diff --git a/compat/compat-2.6.36.c b/compat/compat-2.6.36.c
new file mode 100644
index 0000000..bd9335d
--- /dev/null
+++ b/compat/compat-2.6.36.c
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2010 Hauke Mehrtens <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Compatibility file for Linux wireless for kernels 2.6.36.
+ */
+
+#include <linux/compat.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+
+#include <linux/usb.h>
+
+#ifdef CONFIG_COMPAT_USB_URB_THREAD_FIX
+/* Callers must hold anchor->lock */
+static void __usb_unanchor_urb(struct urb *urb, struct usb_anchor *anchor)
+{
+ urb->anchor = NULL;
+ list_del(&urb->anchor_list);
+ usb_put_urb(urb);
+ if (list_empty(&anchor->urb_list))
+ wake_up(&anchor->wait);
+}
+
+/**
+ * usb_unlink_anchored_urbs - asynchronously cancel transfer requests en masse
+ * @anchor: anchor the requests are bound to
+ *
+ * this allows all outstanding URBs to be unlinked starting
+ * from the back of the queue. This function is asynchronous.
+ * The unlinking is just tiggered. It may happen after this
+ * function has returned.
+ *
+ * This routine should not be called by a driver after its disconnect
+ * method has returned.
+ */
+void compat_usb_unlink_anchored_urbs(struct usb_anchor *anchor)
+{
+ struct urb *victim;
+
+ while ((victim = usb_get_from_anchor(anchor)) != NULL) {
+ usb_unlink_urb(victim);
+ usb_put_urb(victim);
+ }
+}
+EXPORT_SYMBOL_GPL(compat_usb_unlink_anchored_urbs);
+
+/**
+ * usb_get_from_anchor - get an anchor's oldest urb
+ * @anchor: the anchor whose urb you want
+ *
+ * this will take the oldest urb from an anchor,
+ * unanchor and return it
+ */
+struct urb *compat_usb_get_from_anchor(struct usb_anchor *anchor)
+{
+ struct urb *victim;
+ unsigned long flags;
+
+ spin_lock_irqsave(&anchor->lock, flags);
+ if (!list_empty(&anchor->urb_list)) {
+ victim = list_entry(anchor->urb_list.next, struct urb,
+ anchor_list);
+ usb_get_urb(victim);
+ __usb_unanchor_urb(victim, anchor);
+ } else {
+ victim = NULL;
+ }
+ spin_unlock_irqrestore(&anchor->lock, flags);
+
+ return victim;
+}
+EXPORT_SYMBOL_GPL(compat_usb_get_from_anchor);
+
+/**
+ * usb_scuttle_anchored_urbs - unanchor all an anchor's urbs
+ * @anchor: the anchor whose urbs you want to unanchor
+ *
+ * use this to get rid of all an anchor's urbs
+ */
+void compat_usb_scuttle_anchored_urbs(struct usb_anchor *anchor)
+{
+ struct urb *victim;
+ unsigned long flags;
+
+ spin_lock_irqsave(&anchor->lock, flags);
+ while (!list_empty(&anchor->urb_list)) {
+ victim = list_entry(anchor->urb_list.prev, struct urb,
+ anchor_list);
+ __usb_unanchor_urb(victim, anchor);
+ }
+ spin_unlock_irqrestore(&anchor->lock, flags);
+}
+EXPORT_SYMBOL_GPL(compat_usb_scuttle_anchored_urbs);
+#endif /* CONFIG_COMPAT_USB_URB_THREAD_FIX */
+
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) */
diff --git a/include/linux/compat-2.6.28.h b/include/linux/compat-2.6.28.h
index 649fbbc..1de39ad 100644
--- a/include/linux/compat-2.6.28.h
+++ b/include/linux/compat-2.6.28.h
@@ -62,8 +62,6 @@ extern void usb_unpoison_urb(struct urb *urb);
extern void usb_poison_anchored_urbs(struct usb_anchor *anchor);
#endif

-extern struct urb *usb_get_from_anchor(struct usb_anchor *anchor);
-extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
extern int usb_anchor_empty(struct usb_anchor *anchor);
#endif /* CONFIG_USB */
#endif
diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
index 5b48215..2df34d6 100644
--- a/include/linux/compat-2.6.36.h
+++ b/include/linux/compat-2.6.36.h
@@ -5,6 +5,8 @@

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))

+#include <linux/usb.h>
+
#define kparam_block_sysfs_write(a)
#define kparam_unblock_sysfs_write(a)

@@ -15,6 +17,16 @@ struct va_format {

#define device_rename(dev, new_name) device_rename(dev, (char *)new_name)

+#ifdef CONFIG_COMPAT_USB_URB_THREAD_FIX
+#define usb_scuttle_anchored_urbs(anchor) compat_usb_scuttle_anchored_urbs(anchor)
+#define usb_get_from_anchor(anchor) compat_usb_get_from_anchor(anchor)
+#define usb_unlink_anchored_urbs(anchor) compat_usb_unlink_anchored_urbs(anchor)
+
+extern void compat_usb_unlink_anchored_urbs(struct usb_anchor *anchor);
+extern struct urb *compat_usb_get_from_anchor(struct usb_anchor *anchor);
+extern void compat_usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
+#endif
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */

#endif /* LINUX_26_36_COMPAT_H */
--
1.7.0.4


2010-09-20 15:32:44

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 1/4] compat: backport PCMCIA API changes.

On Sun, Sep 19, 2010 at 10:42 AM, Hauke Mehrtens <[email protected]> wrote:
> This backports the API change to pcmcia_enable_device
>
> Signed-off-by: Hauke Mehrtens <[email protected]>

Thanks! Applied all for and pushed out.

Luis

2010-09-19 17:42:33

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 3/4] compat: move pmcia backport code into compat-2.6.36.h

We have all out backport headers in include/linux/compat-2.6.XX.h also the pcmcia
part there.

CC: Kshitij Kulshreshtha <[email protected]>
Signed-off-by: Hauke Mehrtens <[email protected]>
---
include/linux/compat-2.6.36.h | 29 +++++++++++++++++++++++++++++
include/pcmcia/ds.h | 36 ------------------------------------
2 files changed, 29 insertions(+), 36 deletions(-)
delete mode 100644 include/pcmcia/ds.h

diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
index 2df34d6..1d929d7 100644
--- a/include/linux/compat-2.6.36.h
+++ b/include/linux/compat-2.6.36.h
@@ -6,6 +6,8 @@
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))

#include <linux/usb.h>
+#include <pcmcia/cistpl.h>
+#include <pcmcia/ds.h>

#define kparam_block_sysfs_write(a)
#define kparam_unblock_sysfs_write(a)
@@ -27,6 +29,33 @@ extern struct urb *compat_usb_get_from_anchor(struct usb_anchor *anchor);
extern void compat_usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
#endif

+/**
+ * pcmcia_read_config_byte() - read a byte from a card configuration register
+ *
+ * pcmcia_read_config_byte() reads a byte from a configuration register in
+ * attribute memory.
+ */
+static inline int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val)
+{
+ int ret;
+ conf_reg_t reg = { 0, CS_READ, where, 0 };
+ ret = pcmcia_access_configuration_register(p_dev, &reg);
+ *val = reg.Value;
+ return ret;
+}
+
+/**
+ * pcmcia_write_config_byte() - write a byte to a card configuration register
+ *
+ * pcmcia_write_config_byte() writes a byte to a configuration register in
+ * attribute memory.
+ */
+static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val)
+{
+ conf_reg_t reg = { 0, CS_WRITE, where, val };
+ return pcmcia_access_configuration_register(p_dev, &reg);
+}
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */

#endif /* LINUX_26_36_COMPAT_H */
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
deleted file mode 100644
index fc43703..0000000
--- a/include/pcmcia/ds.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef _COMPAT_PCMCIA_DS_H
-#define _COMPAT_PCMCIA_DS_H
-#include <linux/version.h>
-
-#include_next <pcmcia/ds.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
-/**
- * pcmcia_read_config_byte() - read a byte from a card configuration register
- *
- * pcmcia_read_config_byte() reads a byte from a configuration register in
- * attribute memory.
- */
-static inline int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val)
-{
- int ret;
- conf_reg_t reg = { 0, CS_READ, where, 0 };
- ret = pcmcia_access_configuration_register(p_dev, &reg);
- *val = reg.Value;
- return ret;
-}
-
-/**
- * pcmcia_write_config_byte() - write a byte to a card configuration register
- *
- * pcmcia_write_config_byte() writes a byte to a configuration register in
- * attribute memory.
- */
-static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val)
-{
- conf_reg_t reg = { 0, CS_WRITE, where, val };
- return pcmcia_access_configuration_register(p_dev, &reg);
-}
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) */
-
-#endif
--
1.7.0.4


2010-09-22 16:59:38

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 3/4] compat: move pmcia backport code into compat-2.6.36.h

On Wed, Sep 22, 2010 at 9:55 AM, Kshitij Kulshreshtha
<[email protected]> wrote:
> Hello,
>
> As on 2010-09-19 19:42, Hauke Mehrtens did write:
>> We have all out backport headers in include/linux/compat-2.6.XX.h also the pcmcia
>> part there.
>
> I'm not sure if this won't make all the compat-wireless modules depend
> on pcmcia.ko for kernels < 2.6.36 where
> pcmcia_access_configuation_register() is exported. Even if someone is
> only building selected drivers like iwlwifi or ath.

Have you tried loading ath9k or iwlagn on compat-wireless? Did you
note compat doesn't get loaded? Anyway, patches welcomed to enhance
this if your concern is if your kernel won't build with this. We also
plan on dropping PCMCIA completely anyway.

Luis

2010-09-19 17:42:36

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 4/4] compat: pcmcia/cs.h is removed form new kernels

On older kernel versions we have to include pcmcia/cs_types.h and
pcmcia/cs.h before pcmcia/cistpl.h.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
include/pcmcia/cistpl.h | 10 ++++++++++
include/pcmcia/cs.h | 10 ----------
2 files changed, 10 insertions(+), 10 deletions(-)
create mode 100644 include/pcmcia/cistpl.h
delete mode 100644 include/pcmcia/cs.h

diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h
new file mode 100644
index 0000000..789dc59
--- /dev/null
+++ b/include/pcmcia/cistpl.h
@@ -0,0 +1,10 @@
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+#include <pcmcia/cs_types.h>
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+#include <pcmcia/cs.h>
+#endif
+
+#include_next <pcmcia/cistpl.h>
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
deleted file mode 100644
index 1c5e0fa..0000000
--- a/include/pcmcia/cs.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _COMPAT_PCMCIA_CS_H
-#define _COMPAT_PCMCIA_CS_H
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
-#include <pcmcia/cs_types.h>
-#endif
-
-#include_next <pcmcia/cs.h>
-#endif
--
1.7.0.4