Ticket #811 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

0.9.2 fails to compile on RHEL3 kernels

Reported by: anonymous Assigned to:
Priority: major Milestone: version 0.9.3
Component: madwifi: other Version:
Keywords: Cc:
Patch is attached: 1 Pending:

Description

I am attempting to compile 0.9.2 on Centos 3 (kernel 2.4.21-32.0.1.EL).

I get the following error:

[root@centos3-devel madwifi-0.9.2]# make KERNELPATH=/usr/src/linux-2.4.21-32.0.1.EL
[snip]
gcc -D__KERNEL__ -I/usr/src/linux-2.4.21-32.0.1.EL/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common  -Wno-unused -fomit-frame-pointer -pipe -freorder-blocks -mpreferred-stack-boundary=2 -march=athlon -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.21-32.0.1.EL/include/linux/modversions.h -include ./../include/compat.h -I./../include -I./../hal -I./../hal/linux -I./../net80211 -I./.. -Werror -DAH_BYTE_ORDER=AH_LITTLE_ENDIAN -fomit-frame-pointer -DATH_SUPERG_FF=1 -DATH_SUPERG_DYNTURBO=1 -DATH_TURBO_SCAN=1 -DATH_SUPERG_XR=1 -nostdinc -iwithprefix include -DKBUILD_BASENAME=ieee80211_wireless  -DEXPORT_SYMTAB -c ieee80211_wireless.c
ieee80211_wireless.c: In function `ieee80211_ioctl_setthrspy':
ieee80211_wireless.c:1144: storage size of `threshold' isn't known
ieee80211_wireless.c:1152: sizeof applied to an incomplete type
ieee80211_wireless.c:1152: sizeof applied to an incomplete type
ieee80211_wireless.c:1152: sizeof applied to an incomplete type
ieee80211_wireless.c: In function `ieee80211_ioctl_getthrspy':
ieee80211_wireless.c:1184: dereferencing pointer to incomplete type
ieee80211_wireless.c:1185: dereferencing pointer to incomplete type
make[3]: *** [ieee80211_wireless.o] Error 1
make[3]: Leaving directory `/usr/src/redhat/SOURCES/madwifi-0.9.2/net80211'
make[2]: *** [_mod_/usr/src/redhat/SOURCES/madwifi-0.9.2/net80211] Error 2
make[2]: Leaving directory `/usr/src/linux-2.4.21-32.0.1.EL'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/redhat/SOURCES/madwifi-0.9.2/net80211'
make: *** [modules] Error 1
[root@centos3-devel madwifi-0.9.2]#

If I backout changeset 1668, with the following patch, then the module compiles fine.

diff -uNr madwifi-0.9.2/net80211/ieee80211_input.c madwifi-0.9.2.patched/net80211/ieee80211_input.c
--- madwifi-0.9.2/net80211/ieee80211_input.c    2006-07-06 05:23:08.000000000 +0200
+++ madwifi-0.9.2.patched/net80211/ieee80211_input.c    2006-08-08 21:39:18.000000000 +0200
@@ -46,9 +46,6 @@
 #include <linux/etherdevice.h>
 #include <linux/random.h>
 #include <linux/if_vlan.h>
-#include <net/iw_handler.h> /* wireless_send_event(..) */
-#include <linux/wireless.h> /* SIOCGIWTHRSPY */
-#include <linux/if_arp.h> /* ARPHRD_ETHER */

 #include "if_llc.h"
 #include "if_ethersubr.h"
@@ -129,83 +126,6 @@
 static unsigned short ath_eth_type_trans(struct sk_buff *, struct net_device *);
 #endif

-/* Enhanced iwspy support */
-#ifdef CONFIG_NET_WIRELESS
-#if WIRELESS_EXT >= 16
-
-#ifndef IW_QUAL_QUAL_UPDATED
-#define IW_QUAL_QUAL_UPDATED   0x01
-#define IW_QUAL_LEVEL_UPDATED  0x02
-#define IW_QUAL_NOISE_UPDATED  0x04
-#endif /* IW_QUAL_QUAL_UPDATED */
-
-/**
- * This function is a clone of set_quality(..) in ieee80211_wireless.c
- */
-static void
-set_quality(struct iw_quality *iq, u_int rssi)
-{
-       iq->qual = rssi;
-       /* NB: max is 94 because noise is hardcoded to 161 */
-       if (iq->qual > 94)
-               iq->qual = 94;
-
-       iq->noise = 161;                /* -95dBm */
-       iq->level = iq->noise + iq->qual;
-       iq->updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED |
-               IW_QUAL_NOISE_UPDATED;
-}
-
-/**
- * Given a node and the rssi value of a just received frame from the node, this
- * function checks if to raise an iwspy event because we iwspy the node and rssi
- * exceeds threshold (if active).
- *
- * @param vap: vap
- * @param ni: sender node
- * @param rssi: rssi value of received frame
- */
-static void
-iwspy_event(struct ieee80211vap *vap, struct ieee80211_node *ni, u_int rssi)
-{
-       if (vap->iv_spy.thr_low && vap->iv_spy.num && ni && (rssi <
-               vap->iv_spy.thr_low || rssi > vap->iv_spy.thr_high)) {
-               int i;
-               for (i = 0; i < vap->iv_spy.num; i++) {
-                       if (IEEE80211_ADDR_EQ(ni->ni_macaddr,
-                               &(vap->iv_spy.mac[i * IEEE80211_ADDR_LEN]))) {
-
-                               union iwreq_data wrq;
-                               struct iw_thrspy thr;
-                               IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
-                                       "%s: we spy %s, threshold is active "
-                                       "and rssi exceeds it -> raise an iwspy"
-                                       " event\n", __func__, ether_sprintf(
-                                        ni->ni_macaddr));
-                               memset(&wrq, 0, sizeof(wrq));
-                               wrq.data.length = 1;
-                               memset(&thr, 0, sizeof(struct iw_thrspy));
-                               memcpy(thr.addr.sa_data, ni->ni_macaddr,
-                                       IEEE80211_ADDR_LEN);
-                               thr.addr.sa_family = ARPHRD_ETHER;
-                               set_quality(&thr.qual, rssi);
-                               set_quality(&thr.low, vap->iv_spy.thr_low);
-                               set_quality(&thr.high, vap->iv_spy.thr_high);
-                               wireless_send_event(vap->iv_dev,
-                                       SIOCGIWTHRSPY, &wrq, (char*) &thr);
-                               break;
-                       }
-               }
-       }
-}
-
-#else
-#define iwspy_event(_vap, _ni, _rssi)
-#endif /* WIRELESS_EXT >= 16 */
-#else
-#define iwspy_event(_vap, _ni, _rssi)
-#endif /* CONFIG_NET_WIRELESS */
-
 /*
  * Process a received frame.  The node associated with the sender
  * should be supplied.  If nothing was found in the node table then
@@ -292,7 +212,6 @@
                                vap->iv_stats.is_rx_wrongbss++;
                                goto out;
                        }
-                       iwspy_event(vap, ni, rssi);
                        break;
                case IEEE80211_M_IBSS:
                case IEEE80211_M_AHDEMO:
@@ -331,7 +250,6 @@
                                        }
                                }
                        }
-                       iwspy_event(vap, ni, rssi);
                        break;
                case IEEE80211_M_HOSTAP:
                        if (dir != IEEE80211_FC1_DIR_NODS)
diff -uNr madwifi-0.9.2/net80211/ieee80211_var.h madwifi-0.9.2.patched/net80211/ieee80211_var.h
--- madwifi-0.9.2/net80211/ieee80211_var.h      2006-07-06 05:23:08.000000000 +0200
+++ madwifi-0.9.2.patched/net80211/ieee80211_var.h      2006-08-08 21:37:26.000000000 +0200
@@ -262,8 +262,6 @@
 #define IW_MAX_SPY 8
 struct ieee80211_spy {
         u_int8_t mac[IW_MAX_SPY * IEEE80211_ADDR_LEN];
-        u_int8_t thr_low;      /* 1 byte rssi value, 0 = threshold is off */
-        u_int8_t thr_high;     /* 1 byte rssi value */
         u_int8_t num;
 };

diff -uNr madwifi-0.9.2/net80211/ieee80211_wireless.c madwifi-0.9.2.patched/net80211/ieee80211_wireless.c
--- madwifi-0.9.2/net80211/ieee80211_wireless.c 2006-07-06 05:23:08.000000000 +0200
+++ madwifi-0.9.2.patched/net80211/ieee80211_wireless.c 2006-08-08 21:37:26.000000000 +0200
@@ -1135,61 +1135,6 @@
        return 0;
 }

-/* Enhanced iwspy support */
-static int
-ieee80211_ioctl_setthrspy(struct net_device *dev, struct iw_request_info *info,
-       struct iw_point *data, char *extra)
-{
-       struct ieee80211vap *vap = dev->priv;
-       struct iw_thrspy threshold;
-
-       if (data->length != 1)
-               return -EINVAL;
-
-       /* get the threshold values into the driver */
-       if (data->pointer) {
-               if (copy_from_user(&threshold, data->pointer,
-                   sizeof(struct iw_thrspy)))
-                       return -EFAULT;
-        } else
-               return -EINVAL;
-
-       if (threshold.low.level == 0) {
-               /* disable threshold */
-               vap->iv_spy.thr_low = 0;
-               vap->iv_spy.thr_high = 0;
-               IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
-                       "%s: disabled iw_spy threshold\n", __func__);
-       } else {
-               /* calculate corresponding rssi values */
-               vap->iv_spy.thr_low = threshold.low.level - 161;
-               vap->iv_spy.thr_high = threshold.high.level - 161;
-               IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
-                       "%s: enabled iw_spy threshold\n", __func__);
-       }
-
-       return 0;
-}
-
-static int
-ieee80211_ioctl_getthrspy(struct net_device *dev, struct iw_request_info *info,
-       struct iw_point *data, char *extra)
-{
-       struct ieee80211vap *vap = dev->priv;
-       struct iw_thrspy *threshold;
-
-       threshold = (struct iw_thrspy *) extra;
-
-       /* set threshold values */
-       set_quality(&(threshold->low), vap->iv_spy.thr_low);
-       set_quality(&(threshold->high), vap->iv_spy.thr_high);
-
-       /* copy results to userspace */
-       data->length = 1;
-
-       return 0;
-}
-
 static int
 ieee80211_ioctl_siwmode(struct net_device *dev, struct iw_request_info *info,
        __u32 *mode, char *extra)
@@ -4855,8 +4800,8 @@
        (iw_handler) NULL /* kernel code */,            /* SIOCGIWSTATS */
        (iw_handler) ieee80211_ioctl_setspy,            /* SIOCSIWSPY */
        (iw_handler) ieee80211_ioctl_getspy,            /* SIOCGIWSPY */
-       (iw_handler) ieee80211_ioctl_setthrspy,         /* SIOCSIWTHRSPY */
-       (iw_handler) ieee80211_ioctl_getthrspy,         /* SIOCGIWTHRSPY */
+       (iw_handler) NULL,                              /* -- hole -- */
+       (iw_handler) NULL,                              /* -- hole -- */
        (iw_handler) ieee80211_ioctl_siwap,             /* SIOCSIWAP */
        (iw_handler) ieee80211_ioctl_giwap,             /* SIOCGIWAP */
 #ifdef SIOCSIWMLME

Attachments

Change History

08/09/06 04:29:56 changed by mentor

  • status changed from new to closed.
  • resolution set to fixed.

Appears to me missing a header. Applied fix as r1701. Reopen if I'm wrong.

08/17/06 20:36:23 changed by cpicton@users.sf.net

  • status changed from closed to reopened.
  • resolution deleted.

The suggested patch does not work, as linux/wireless.h does not define struct iw_thrspy.

In fact, that struct is not used anywhere in the kernel include tree.

[root@centos3-devel SOURCES]# grep -r thrspy /usr/src/linux-2.4.21-40.EL/include/
[root@centos3-devel SOURCES]#

The offending parts probably need to be wrapped with a

#if WIRELESS_EXT >= 16

directive.

11/10/06 06:12:42 changed by kiddo

I have same problem as you. But I just use version 0.9.0 instead of 0.9.2 then it's ok now, and function OK

11/22/06 10:28:43 changed by kelmo

  • status changed from reopened to closed.
  • resolution set to fixed.
  • milestone set to version 0.9.3.

IMHO, this was fixed in r1703

12/26/06 03:48:07 changed by anonymous

I am trying to compile 0.9.2.1 on CentOS 3.8 with kernel-2.4.21-47.0.1.EL and get the same error:

ieee80211_wireless.c: In function `ieee80211_ioctl_setthrspy':
ieee80211_wireless.c:1144: storage size of `threshold' isn't known
ieee80211_wireless.c:1152: sizeof applied to an incomplete type
ieee80211_wireless.c:1152: sizeof applied to an incomplete type
ieee80211_wireless.c:1152: sizeof applied to an incomplete type
cc1: warnings being treated as errors
ieee80211_wireless.c:1144: warning: unused variable `threshold'
ieee80211_wireless.c: In function `ieee80211_ioctl_getthrspy':
ieee80211_wireless.c:1184: dereferencing pointer to incomplete type
ieee80211_wireless.c:1185: dereferencing pointer to incomplete type
make[3]: *** [ieee80211_wireless.o] Error 1
make[3]: Leaving directory `/root/madwifi-0.9.2.1/net80211'
make[2]: *** [_mod_/root/madwifi-0.9.2.1/net80211] Error 2
make[2]: Leaving directory `/usr/src/linux-2.4.22-10006.C3.LSE'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/madwifi-0.9.2.1/net80211'
make: *** [modules] Error 1


Add/Change #811 (0.9.2 fails to compile on RHEL3 kernels)