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 #2408 (new defect)

Opened 4 years ago

Last modified 4 years ago

make error building against 2.6.35-rc1 with madwifi-hal-0.10.5.6.

Reported by: mgavl69@juno.com Assigned to:
Priority: minor Milestone:
Component: madwifi: driver Version:
Keywords: Cc:
Patch is attached: 0 Pending: 0

Description

These are functions I had to cut out of /ath/if_ath.c to make it compile...Specifically it has to do with mc_list. I'm using madwifi-hal-0.10.5.6.

/ath/if_ath.c
4255,4257c4255,4257
< static void
< ath_merge_mcast(struct ath_softc *sc, u_int32_t mfilt[2])
< {
---
> /*static void*/
> /*ath_merge_mcast(struct ath_softc *sc, u_int32_t mfilt[2])*/
> /*{
4259,4278c4259,4279
< 	struct ieee80211vap *vap;
< 	struct dev_mc_list *mc;
< 	u_int32_t val;
< 	u_int8_t pos;
< 
< 	mfilt[0] = mfilt[1] = 0;
< 	/* XXX locking */
< 	TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
< 		struct net_device *dev = vap->iv_dev;
< 		for (mc = dev->mc_list; mc; mc = mc->next) {
< 			/* calculate XOR of eight 6-bit values */
< 			val = LE_READ_4(mc->dmi_addr + 0);
< 			pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
< 			val = LE_READ_4(mc->dmi_addr + 3);
< 			pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
< 			pos &= 0x3f;
< 			mfilt[pos / 32] |= (1 << (pos % 32));
< 		}
< 	}
< }
---
> 	struct ieee80211vap *vap;*/
> 	/*struct dev_mc_list *mc;*/
> /*	u_int32_t val;*/
> /*	u_int8_t pos;
> *
> *
> *	mfilt[0] = mfilt[1] = 0;
> *	 XXX locking 
> *	TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
> *		struct net_device *dev = vap->iv_dev;
> *		for (mc = dev->mc_list; mc; mc = mc->next) {
> *			 calculate XOR of eight 6-bit values 
> *			val = LE_READ_4(mc->dmi_addr + 0);
> *			pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
> *			val = LE_READ_4(mc->dmi_addr + 3);
> *			pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
> *			pos &= 0x3f;
> *			mfilt[pos / 32] |= (1 << (pos % 32));
> *		}
> *	}
> */
4299,4301c4300,4302
< 	if ((dev->flags & IFF_ALLMULTI) == 0)
< 		ath_merge_mcast(sc, mfilt);
< 	else
---
> 	/*if ((dev->flags & IFF_ALLMULTI) == 0)
> 		ath_merge_mcast(sc, mfilt);*/
> 	

Change History

06/09/10 22:38:00 changed by anonymous

Error.

if_ath.c: In function 'ath_merge_mcast':
if_ath.c:4429: error: 'struct net_device' has no member named 'mc_list'
if_ath.c:4429: error: dereferencing pointer to incomplete type

Patch.

- 	 struct dev_mc_list *mc;
+        struct netdev_hw_addr *ha;

- 		for (mc = dev->mc_list; mc; mc = mc->next) {
-			/* calculate XOR of eight 6-bit values */
- 			val = LE_READ_4(mc->dmi_addr + 0);
- 			pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
- 			val = LE_READ_4(mc->dmi_addr + 3);
+		netdev_for_each_mc_addr(ha, dev) {
+			/* calculate XOR of eight 6-bit values */
+			val = LE_READ_4(ha->addr + 0);
+			pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
+			val = LE_READ_4(ha->addr + 3);

(follow-up: ↓ 7 ) 10/07/10 10:22:57 changed by anonymous

Works on 2.6.35-22

Thanks !!!

10/08/10 15:53:52 changed by anonymous

Thank you!

10/11/10 10:50:44 changed by chessking77

Thanks!

11/10/10 03:38:14 changed by kieth@swaneys.com

Ubuntu 10.10, Maverick, clean install to 32GB SSD, Asus Eee PC 900

Added headers, followed r4073 MadWiFi-ng installtion, along with patching steps. (Have done same with success on 10.04 Lubuntu).

Got headers errors (details below). Manually added in your patch (above), on top of the other r4073 injection patch. Still can't compile, same errors.

Errors as follows:

root@netbook-900:/madwifi-ng# make

./kernelversion.c:13: fatal error: linux/utsrelease.h: No such file or directory compilation terminated. Makefile.inc:81: *** Cannot detect kernel version - please check compiler and KERNELPATH. Stop.

root@netbook-900:/madwifi-ng#

root@netbook-900:/madwifi-ng# make install ./kernelversion.c:13: fatal error: linux/utsrelease.h: No such file or directory compilation terminated.

Makefile.inc:81: *** Cannot detect kernel version - please check compiler and KERNELPATH. Stop.

root@netbook-900:/madwifi-ng#

root@netbook-900:/madwifi-ng# depmod -ae WARNING: -e needs -E or -F

root@netbook-900:/madwifi-ng#

root@netbook-900:/madwifi-ng# modprobe ath_pci FATAL: Module ath_pci not found.

root@netbook-900:/madwifi-ng#

I've confirmed the headers are installed [ apt-get install linux-headers-$(uname -r) ].

I'm not sure if this issue is directly related. I have no idea what to do next. Any input would be greatly appreciated.

01/15/11 23:36:43 changed by alex

thank you very much!

(in reply to: ↑ 2 ) 03/17/11 14:01:15 changed by anonymous

Replying to anonymous:

Works on 2.6.35-22 Thanks !!!

Thanks, your patch seems to work. I will only hope that it will work better then 4136 version, which is still crashing from time to time.

03/17/11 14:13:04 changed by virnik@gmail.com

Here is complete patch:

--- ath/if_ath.c        2010-01-18 15:21:22.000000000 +0100
+++ ath/if_ath.c        2011-03-17 13:59:52.000000000 +0100
@@ -4257,7 +4257,7 @@
 {
        struct ieee80211com *ic = &sc->sc_ic;
        struct ieee80211vap *vap;
-       struct dev_mc_list *mc;
+       struct netdev_hw_addr *ha;
        u_int32_t val;
        u_int8_t pos;
 
@@ -4265,11 +4265,11 @@
        /* XXX locking */
        TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
                struct net_device *dev = vap->iv_dev;
-               for (mc = dev->mc_list; mc; mc = mc->next) {
+               netdev_for_each_mc_addr(ha, dev) {
                        /* calculate XOR of eight 6-bit values */
-                       val = LE_READ_4(mc->dmi_addr + 0);
+                       val = LE_READ_4(ha->addr + 0);
                        pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
-                       val = LE_READ_4(mc->dmi_addr + 3);
+                       val = LE_READ_4(ha->addr + 3);
                        pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
                        pos &= 0x3f;
                        mfilt[pos / 32] |= (1 << (pos % 32));

Save this as an madwifi_hal.diff file to the madwifi-hal development directory (where your source files are), and run this command: cat madwifi_hal.diff | patch -p0

this works excelent on Ubuntu 10.10. madwifi 0.9.4 is making kernel panic from time to time, madwifi-hal should be more stable.