2010-07-29 13:41:01

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: compat-wireless-2010-07-28.tar.bz2 fails to compile with 2.6.34.1

Hello,

I downloaded compat-wireless-2010-07-28.tar.bz2 from [1] and tried to
compile it with kernel v2.6.34.1 (config attached) that is running on
my laptop currently. Unfortunately the package failed to compile with
several compilation errors (compilation log attached, grep for Error).

I had to apply the attached 3 patches to make it compile. Please update
compat-wireless and compat git trees accordingly.

Thanks and regards.

[1] http://wireless.kernel.org/download/compat-wireless-2.6/
--
Kshitij Kulshreshtha

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

Büro: A3.319


Attachments:
config-2.6.34.1-7-kklaptop (105.27 kB)
compilelog (82.20 kB)
0001-hex_to_bin-was-added-first-in-2.6.35.patch (1.36 kB)
0002-Header-file-pcmcia-cs_types.h-has-been-removed-in-2..patch (5.53 kB)
0003-struct-va_format-has-been-added-first-in-2.6.36.patch (816.00 B)
Download all attachments

2010-08-01 22:03:29

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: [PATCH 5/5] compat-wireless: copy headers in include/pcmcia from compat

From: Kshitij Kulshreshtha <[email protected]>

this is needed after the removal of pcmcia/cs_types.h in v2.6.36

Signed-off-by: Kshitij Kulshreshtha <[email protected]>
---
scripts/admin-update.sh | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 4eb7c3e..8ff2ece 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -231,6 +231,7 @@ mkdir -p include/linux/ include/net/ include/linux/usb \
include/linux/unaligned \
include/linux/spi \
include/trace \
+ include/pcmcia \
net/mac80211/ net/wireless/ \
net/rfkill/ \
drivers/ssb/ \
@@ -353,6 +354,7 @@ cp -a $GIT_COMPAT_TREE/scripts/ $COMPAT/
cp -a $GIT_COMPAT_TREE/include/linux/* include/linux/
cp -a $GIT_COMPAT_TREE/include/net/* include/net/
cp -a $GIT_COMPAT_TREE/include/trace/* include/trace/
+cp -a $GIT_COMPAT_TREE/include/pcmcia/* include/pcmcia/
rm -f $COMPAT/*.mod.c

# Refresh patches using quilt
--
1.7.1


2010-08-01 22:03:16

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: [PATCH 1/3] compat: backport hex_to_bin first introduced in v2.6.35

Signed-off-by: Kshitij Kulshreshtha <[email protected]>
---
compat/Makefile | 1 +
compat/compat-2.6.35.c | 34 ++++++++++++++++++++++++++++++++++
include/linux/compat-2.6.35.h | 2 ++
3 files changed, 37 insertions(+), 0 deletions(-)
create mode 100644 compat/compat-2.6.35.c

diff --git a/compat/Makefile b/compat/Makefile
index 2005ff3..bcd8fe7 100644
--- a/compat/Makefile
+++ b/compat/Makefile
@@ -26,3 +26,4 @@ compat-$(CONFIG_COMPAT_KERNEL_30) += compat-2.6.30.o
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
diff --git a/compat/compat-2.6.35.c b/compat/compat-2.6.35.c
new file mode 100644
index 0000000..0d702ed
--- /dev/null
+++ b/compat/compat-2.6.35.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2010 Kshitij Kulshreshtha <[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.35.
+ */
+
+#include <linux/compat.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#include <linux/ctype.h>
+
+/**
+ * hex_to_bin - convert a hex digit to its real value
+ * @ch: ascii character represents hex digit
+ *
+ * hex_to_bin() converts one hex digit to its actual value or -1 in case of bad
+ * input.
+ */
+int hex_to_bin(char ch)
+{
+ if ((ch >= '0') && (ch <= '9'))
+ return ch - '0';
+ ch = tolower(ch);
+ if ((ch >= 'a') && (ch <= 'f'))
+ return ch - 'a' + 10;
+ return -1;
+}
+EXPORT_SYMBOL(hex_to_bin);
+
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) */
diff --git a/include/linux/compat-2.6.35.h b/include/linux/compat-2.6.35.h
index c6e7136..f0562cd 100644
--- a/include/linux/compat-2.6.35.h
+++ b/include/linux/compat-2.6.35.h
@@ -25,6 +25,8 @@ static inline wait_queue_head_t *sk_sleep(struct sock *sk)

#define sdio_writeb_readb(func, write_byte, addr, err_ret) sdio_readb(func, addr, err_ret)

+int hex_to_bin(char ch);
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */

#endif /* LINUX_26_35_COMPAT_H */
--
1.7.1


2010-08-02 19:48:57

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 3/3] compat: define struct va_format introduced in v2.6.36

On Mon, 2010-08-02 at 21:39 +0200, Kshitij Kulshreshtha wrote:
> As on 2010-08-02 20:00, Luis R. Rodriguez did write:
> > On Sun, Aug 1, 2010 at 3:02 PM, Kshitij Kulshreshtha
> >> +struct va_format {
> >> + const char *fmt;
> >> + va_list *va;
> >> +};
> > I'll apply this for now but what caller uses this for example?

Why is this necessary?


2010-08-02 20:08:49

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 3/3] compat: define struct va_format introduced in v2.6.36

On Mon, 2010-08-02 at 21:54 +0200, Kshitij Kulshreshtha wrote:
> As on 2010-08-02 21:48, Joe Perches did write:
> > On Mon, 2010-08-02 at 21:39 +0200, Kshitij Kulshreshtha wrote:
> >> As on 2010-08-02 20:00, Luis R. Rodriguez did write:
> >>> On Sun, Aug 1, 2010 at 3:02 PM, Kshitij Kulshreshtha
> >>>> +struct va_format {
> >>>> + const char *fmt;
> >>>> + va_list *va;
> >>>> +};
> >>> I'll apply this for now but what caller uses this for example?
> > Why is this necessary?
> I needed this to compile compat-wireless which is based on linux-next.
> Otherwise net/wireless/core.c fails to compile, due to the use of this
> struct va_format in the functions defined in lines 910--958. If this
> usage is reverted, we won't need it in compat.

I see your problem.

I think your problem should not be a constraint
on new development and I do not think the new use
should be reverted.

cheers, Joe


2010-08-01 22:03:25

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: [PATCH 3/3] compat: define struct va_format introduced in v2.6.36

Signed-off-by: Kshitij Kulshreshtha <[email protected]>
---
include/linux/compat-2.6.36.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
index 0307108..b14c772 100644
--- a/include/linux/compat-2.6.36.h
+++ b/include/linux/compat-2.6.36.h
@@ -8,6 +8,11 @@
#define kparam_block_sysfs_write(a)
#define kparam_unblock_sysfs_write(a)

+struct va_format {
+ const char *fmt;
+ va_list *va;
+};
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */

#endif /* LINUX_26_36_COMPAT_H */
--
1.7.1


2010-08-01 19:59:45

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: compat-wireless-2010-07-28.tar.bz2 fails to compile with 2.6.34.1

Am 29.07.2010 15:40, schrieb Kshitij Kulshreshtha:
> Hello,
>
> I downloaded compat-wireless-2010-07-28.tar.bz2 from [1] and tried to
> compile it with kernel v2.6.34.1 (config attached) that is running on
> my laptop currently. Unfortunately the package failed to compile with
> several compilation errors (compilation log attached, grep for Error).
>
> I had to apply the attached 3 patches to make it compile. Please update
> compat-wireless and compat git trees accordingly.
>
> Thanks and regards.
>
> [1] http://wireless.kernel.org/download/compat-wireless-2.6/

Hi Kshitij,

thank you for your patches.

Next time please inline your patches into the mail. It makes commenting
on the patch easier. See:
http://wireless.kernel.org/en/users/Download/hacking#Sending_patches

0001-hex_to_bin-was-added-first-in-2.6.35.patch:
hex_to_bin should be backported in compat. Then we do not need to add an
extra patch to compat-wireless. Patches in compat-wireless are hard to
maintain, because the wireless subsystem changes very often and the
patches have to be fixes very often.

0002-Header-file-pcmcia-cs_types.h-has-been-removed-in-2..patch:
This should also be backported in compat and not in compat-wireless. You
can add include/pcmcia/cistpl.h and include the needed file
(pcmcia/cs_types.h) and the original with #include_next <pcmcia/cistpl.h>

Hauke

2010-08-01 22:03:27

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: [PATCH 4/5] compat-wireless: allow compilation of compat-2.6.35.c from compat

From: Kshitij Kulshreshtha <[email protected]>

Signed-off-by: Kshitij Kulshreshtha <[email protected]>
---
config.mk | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/config.mk b/config.mk
index e8ec458..733ea33 100644
--- a/config.mk
+++ b/config.mk
@@ -20,7 +20,7 @@ endif
# as I suspect all users of this package want 802.11e (WME) and
# 802.11n (HT) support.
ifneq ($(wildcard $(KLIB_BUILD)/Makefile),)
-COMPAT_LATEST_VERSION = 33
+COMPAT_LATEST_VERSION = 35
KERNEL_SUBLEVEL := $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
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))
--
1.7.1


2010-08-02 18:01:13

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 3/3] compat: define struct va_format introduced in v2.6.36

On Sun, Aug 1, 2010 at 3:02 PM, Kshitij Kulshreshtha
<[email protected]> wrote:
> Signed-off-by: Kshitij Kulshreshtha <[email protected]>
> ---
>  include/linux/compat-2.6.36.h |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
> index 0307108..b14c772 100644
> --- a/include/linux/compat-2.6.36.h
> +++ b/include/linux/compat-2.6.36.h
> @@ -8,6 +8,11 @@
>  #define kparam_block_sysfs_write(a)
>  #define kparam_unblock_sysfs_write(a)
>
> +struct va_format {
> +       const char *fmt;
> +       va_list *va;
> +};
> +
>  #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
>
>  #endif /* LINUX_26_36_COMPAT_H */

I'll apply this for now but what caller uses this for example?

Luis

2010-08-01 22:03:28

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: [PATCH 2/3] compat: header <pcmcia/cs_types.h> was removed in v2.6.36

the header <pcmcia/cs.h> in versions < 2.6.36 requires types defined
in <pcmcia/cs_types.h> so include it first.

Signed-off-by: Kshitij Kulshreshtha <[email protected]>
---
include/pcmcia/cs.h | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
create mode 100644 include/pcmcia/cs.h

diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
new file mode 100644
index 0000000..1c5e0fa
--- /dev/null
+++ b/include/pcmcia/cs.h
@@ -0,0 +1,10 @@
+#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.1


2010-08-02 20:42:16

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 3/3] compat: define struct va_format introduced in v2.6.36

On Mon, Aug 02, 2010 at 01:08:47PM -0700, Joe Perches wrote:
> On Mon, 2010-08-02 at 21:54 +0200, Kshitij Kulshreshtha wrote:
> > As on 2010-08-02 21:48, Joe Perches did write:
> > > On Mon, 2010-08-02 at 21:39 +0200, Kshitij Kulshreshtha wrote:
> > >> As on 2010-08-02 20:00, Luis R. Rodriguez did write:
> > >>> On Sun, Aug 1, 2010 at 3:02 PM, Kshitij Kulshreshtha
> > >>>> +struct va_format {
> > >>>> + const char *fmt;
> > >>>> + va_list *va;
> > >>>> +};
> > >>> I'll apply this for now but what caller uses this for example?
> > > Why is this necessary?
> > I needed this to compile compat-wireless which is based on linux-next.
> > Otherwise net/wireless/core.c fails to compile, due to the use of this
> > struct va_format in the functions defined in lines 910--958. If this
> > usage is reverted, we won't need it in compat.
>
> I see your problem.
>
> I think your problem should not be a constraint
> on new development and I do not think the new use
> should be reverted.

Joe, compat.git does not go upstream into the kernel, compat.git
tries to backport as much new kernel stuff for usage on older kernels.
compat-wireless uses compat.git to help with backporting the 802.11/BT/ethernet
subsystems to older kernels.

In this case the patch Kshitij sent for compat.git is OK since the struct is
used in code only by cfg80211 which we end up updating using compat-wireless.

Thanks for the clarifications Kshitij.

Luis

2010-08-02 19:54:38

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: Re: [PATCH 3/3] compat: define struct va_format introduced in v2.6.36


As on 2010-08-02 21:48, Joe Perches did write:
> On Mon, 2010-08-02 at 21:39 +0200, Kshitij Kulshreshtha wrote:
>> As on 2010-08-02 20:00, Luis R. Rodriguez did write:
>>> On Sun, Aug 1, 2010 at 3:02 PM, Kshitij Kulshreshtha
>>>> +struct va_format {
>>>> + const char *fmt;
>>>> + va_list *va;
>>>> +};
>>> I'll apply this for now but what caller uses this for example?
>
> Why is this necessary?
>

I needed this to compile compat-wireless which is based on linux-next.
Otherwise net/wireless/core.c fails to compile, due to the use of this
struct va_format in the functions defined in lines 910--958. If this
usage is reverted, we won't need it in compat.

--
Kshitij Kulshreshtha

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

Büro: A3.319

2010-08-02 19:40:02

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: Re: [PATCH 3/3] compat: define struct va_format introduced in v2.6.36



As on 2010-08-02 20:00, Luis R. Rodriguez did write:
> On Sun, Aug 1, 2010 at 3:02 PM, Kshitij Kulshreshtha
> <[email protected]> wrote:
>> Signed-off-by: Kshitij Kulshreshtha <[email protected]>
>> ---
>> include/linux/compat-2.6.36.h | 5 +++++
>> 1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
>> index 0307108..b14c772 100644
>> --- a/include/linux/compat-2.6.36.h
>> +++ b/include/linux/compat-2.6.36.h
>> @@ -8,6 +8,11 @@
>> #define kparam_block_sysfs_write(a)
>> #define kparam_unblock_sysfs_write(a)
>>
>> +struct va_format {
>> + const char *fmt;
>> + va_list *va;
>> +};
>> +
>> #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
>>
>> #endif /* LINUX_26_36_COMPAT_H */
>
> I'll apply this for now but what caller uses this for example?
>

in linux-next.git
net/wireless/core.c:912
static int ___wiphy_printk(const char *level, const struct wiphy *wiphy,
struct va_format *vaf)



> Luis

--
Kshitij Kulshreshtha

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

Büro: A3.319

Privatanschrift:
Arnikaweg 62
33100 Paderborn.

2010-08-01 22:03:06

by Kshitij Kulshreshtha

[permalink] [raw]
Subject: [PATCH] build fixes for compat.git and compat-wireless.git

Hello,
here are some patches with build fixes for compat.git and
compat-wireless.git in order to build it with kernel v2.6.34.

I have incorporated the comments of Hauke Mehrtens.

Please review and apply.

Thanks and regards.
--
Kshitij Kulshreshtha

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

Büro: A3.319