Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #2022 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

compilation error - trunk 2008-07-01

Reported by: usdanskys@rocketmail.com Assigned to:
Priority: minor Milestone: version 0.9.5
Component: madwifi: driver Version: trunk
Keywords: Cc:
Patch is attached: 0 Pending:

Description (Last modified by mrenzmann)

madwifi/net80211/ieee80211_wireless.c calls iwe_stream_add_xxx (where xxx is any one of a number of endings) with one less parameter than is required by the function in /usr/src/kernels/2.6.26-0.97.rc8.fc10.i686/include/net/iw_handler.h

  • OS: Fedora Rawhide
  • kernel: kernel-2.6.26-0.97.rc8.fc10.i686
  • gcc: gcc-4.3.1-3.i386
  • madwifi: latest trunk from svn (7:00 am Ventral Time, 20080701)

example code from ieee80211_wireless.c (line 1810):

	current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_ADDR_LEN);

from the actual function definition:

static inline char *
iwe_stream_add_event(struct iw_request_info *info, char *stream, char *ends,
                     struct iw_event *iwe, int event_len)

Attachments

madwifi_errors (9.3 kB) - added by anonymous on 07/01/08 15:03:40.
compilation errors
patch_for_wireless.c_3748 (1.8 kB) - added by usdanskys@rocketmail.com on 07/03/08 17:09:41.
patch to trunk-3748 that seems to work for me

Change History

07/01/08 15:03:40 changed by anonymous

  • attachment madwifi_errors added.

compilation errors

07/01/08 15:07:24 changed by mrenzmann

  • description changed.

07/01/08 15:11:20 changed by incith

Checked out external at revision 3747.

Checked out revision 3747.

Compiled fine.

  CC [M]  /home/incith/madwifi/net80211/ieee80211_wireless.o
Linux fnd02 2.6.24-gentoo-r8 #4 Sat Jun 28 04:06:24 MDT 2008 x86_64 AMD Athlon(tm) 64 Processor 3700+ AuthenticAMD GNU/Linux

gcc version 4.1.2 (Gentoo 4.1.2 p1.1)

07/02/08 07:40:15 changed by kelmo

Related to this patch, which is last of a series of patches cleaning up WEXT stuff.

07/03/08 17:09:41 changed by usdanskys@rocketmail.com

  • attachment patch_for_wireless.c_3748 added.

patch to trunk-3748 that seems to work for me

(follow-up: ↓ 5 ) 07/04/08 01:10:34 changed by anonymous

This problem also affects the 3698 snapshot that supports the AR5007EG. The patch also fixes the problem with that snapshot. That snapshot is in branches/madwifi-hal-0.10.5.6.

The Fedora Rawhide 2.6.26-0.93 kernel didn't have the problem, if that information is of any use. Anyway many thanks to the gentleman who created the patch.

Is it possible to get it put into that branch containing the snapshot?

(in reply to: ↑ 4 ) 07/04/08 05:02:18 changed by anonymous

Replying to anonymous:

This problem also affects the 3698 snapshot that supports the AR5007EG. The patch also fixes the problem with that snapshot. That snapshot is in branches/madwifi-hal-0.10.5.6. The Fedora Rawhide 2.6.26-0.93 kernel didn't have the problem, if that information is of any use. Anyway many thanks to the gentleman who created the patch. Is it possible to get it put into that branch containing the snapshot?

Actually, a bit more experimentation indicates that the patch doesn't work with the earlier kernels. It fixes the 2.6.26-97 and up, but had errors with the older 2.6.26-93.

However, it is necessary to fix the problems with the newer Rawhide kernels.

07/05/08 03:12:29 changed by mentor

  • priority changed from critical to minor.

07/05/08 04:22:27 changed by mentor

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to version 0.9.5.

r3750.

Please note that pre-release and vendor kernels are not supported.

(follow-up: ↓ 13 ) 07/05/08 11:09:31 changed by ekin@pardus.org.tr

Don't we also need this ? The in-kernel wireless drivers had this change along with the iwe_stream_add_* updates... Seems to compile & work form me..

@@ -1879,6 +1881,6 @@
 ·  memset(&iwe, 0, sizeof(iwe));
 ·  last_ev = current_ev;
 ·  iwe.cmd = SIOCGIWRATE;
-·  current_val = current_ev + IW_EV_LCP_LEN;
+·  current_val = current_ev + iwe_stream_lcp_len(info);
 ·  /* NB: not sorted, does it matter? */
@@ -1899,8 +1901,8 @@
 ·  ·   ·   ·   current_val, end_buf, &iwe,
 ·  ·   ·   ·   IW_EV_PARAM_LEN);
 ·  ·   }
 ·  }
 ·  /* remove fixed header if no rates were added */
-·  if ((current_val - current_ev) > IW_EV_LCP_LEN) {
+·  if ((current_val - current_ev) > iwe_stream_lcp_len(info)) {
 ·  ·   current_ev = current_val;
 ·  } else {
 ·  ·   /* We ran out of space in the buffer. */

07/07/08 10:15:45 changed by bugreports@nn7.de

The patch in current svn is broken, I think that the one below should be the right fix

Index: net80211/ieee80211_wireless.c
===================================================================
--- net80211/ieee80211_wireless.c	(revision 3757)
+++ net80211/ieee80211_wireless.c	(working copy)
@@ -1776,7 +1776,7 @@
 	int mode;
 };
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25)
 #define iwe_stream_add_event(a, b, c, d, e)	iwe_stream_add_event(b, c, d, e)
 #define iwe_stream_add_point(a, b, c, d, e)	iwe_stream_add_point(b, c, d, e)
 #define iwe_stream_add_value(a, b, c, d, e, f)	\

(follow-up: ↓ 11 ) 07/07/08 12:04:38 changed by kelmo

Your suggestion is incorrect.

(in reply to: ↑ 10 ; follow-up: ↓ 12 ) 07/07/08 13:12:38 changed by anonymous

Replying to kelmo:

Your suggestion is incorrect.

Could be, but without the patch madwifi does not compile on 2.6.26-rc9.

(in reply to: ↑ 11 ) 07/07/08 13:22:42 changed by anonymous

Replying to anonymous:

Replying to kelmo:

Your suggestion is incorrect.

Could be, but without the patch madwifi does not compile on 2.6.26-rc9.

Works with rc8 too. It seems to be the only way with pre-release kernels as stated in comment 7.

(in reply to: ↑ 8 ) 07/07/08 21:28:56 changed by mentor

Replying to ekin@pardus.org.tr: Thanks; missed that. Applied as r3760.

07/12/08 17:48:29 changed by mentor

r3767 - Thanks to proski

I am now thoroughly confused. I blame Fedora kernels.

12/13/08 10:19:59 changed by Dmitry Gordiyevsky <dimgord@gmail.com>

In addition to the patch 3748 I added one line which passes info variable to giwscan_cb callback. In net80211/ieee80211_wireless.c:

.
.
1814 	        struct iwscanreq req;
1815 	        int res = 0;
1816
    <<<Inserted>>>  req.info = info;
1817 	        req.vap = vap;
1818 	        req.current_ev = extra;
1819 	        if (data->length == 0) {
1820 	          req.end_buf = extra + IW_SCAN_MAX_DATA;
1821 	        } else {
1822 	          req.end_buf = extra + data->length;
1823 	        }
.
.

IMHO, it is essential change, because of "int lcp_len = iwe_stream_lcp_len(info);" inside of iwe_stream_add_value/point/event() functions. If info is not set correctly, lcp_len might be set to garbage, and then memcpy(stream + lcp_len,...) result is unpredictable.
It works for me (I'm writing this message using freshly compiled madwifi-0.9.4 :) ), and I hope it will help somebody else.

Regards, Dmitry

12/13/08 10:27:40 changed by Dmitry Gordiyevsky <dimgord@gmail.com>

Forgot to mention, I am using Fedora 8, kernel 2.6.27.8

12/13/08 11:05:18 changed by Dmitry Gordiyevsky <dimgord@gmail.com>

Oops, yet another two changes which I found here: http: //bugs.gentoo.org/show_bug.cgi?id=242238

Additionally, they did kernel-independent code, so it's better to take whole file from here: http: //svn.madwifi.org/madwifi/branches/madwifi-hal-testing/net80211/ieee80211_wireless.c

Regards, Dmitry

01/06/09 09:38:33 changed by doff

Happy new year,

Using the 2.6.28 kernel source from the kernel.org site, and the madwifi 0.9.4, I still have the error :

root:/work/compil/madwifi-0.9.4 # make KERNELPATH=/work/compil/linux-2.6.28
Checking requirements... ok.
Checking kernel configuration... ok.
make -C /work/compil/linux-2.6.28 SUBDIRS=/work/compil/madwifi-0.9.4 modules
make[1]: Entering directory `/work/compil/linux-2.6.28'
  CC [M]  /work/compil/madwifi-0.9.4/net80211/ieee80211_wireless.o
cc1: warnings being treated as errors
/work/compil/madwifi-0.9.4/net80211/ieee80211_wireless.c: In function 'giwscan_cb':
/work/compil/madwifi-0.9.4/net80211/ieee80211_wireless.c:1593: warning: passing argument 1 of 'iwe_stream_add_event' from incompatible pointer type
/work/compil/madwifi-0.9.4/net80211/ieee80211_wireless.c:1593: warning: passing argument 3 of 'iwe_stream_add_event' from incompatible pointer type
/work/compil/madwifi-0.9.4/net80211/ieee80211_wireless.c:1593: warning: passing argument 4 of 'iwe_stream_add_event' makes pointer from integer without a cast

...

make[3]: *** [/work/compil/madwifi-0.9.4/net80211/ieee80211_wireless.o] Error 1
make[2]: *** [/work/compil/madwifi-0.9.4/net80211] Error 2
make[1]: *** [_module_/work/compil/madwifi-0.9.4] Error 2
make[1]: Leaving directory `/work/compil/linux-2.6.28'
make: *** [modules] Error 2

The patch 3748 do not solve the issue, and the line numbers are incorrect. Regards