# Madwifi and Kernel 2.6.25

## nostabo

Does this mean Gentoo-Sources 2.6.25 is not compatible with madwifi-ng 0.9.4? Or is there another problem...?

```
[32;01m*[0m Determining the location of the kernel source code

 [32;01m*[0m Found kernel source directory:

 [32;01m*[0m     /usr/src/linux

 [32;01m*[0m Found kernel object directory:

 [32;01m*[0m     /lib/modules/2.6.25-gentoo-r1/build

 [32;01m*[0m Found sources for kernel version:

 [32;01m*[0m     2.6.25-gentoo-r1

 [32;01m*[0m Checking for suitable kernel configuration options...

[A[72C  [34;01m[ [32;01mok[34;01m ][0m

>>> Unpacking source...

>>> Unpacking madwifi-0.9.4.tar.bz2 to /var/tmp/portage/net-wireless/madwifi-ng-0.9.4/work

 [32;01m*[0m Applying madwifi-ng-0.9.3-uudecode-gcda-fix.patch ...

[A[72C  [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Converting madwifi-0.9.4/ath/Makefile to use M= instead of SUBDIRS= ...

[A[72C  [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Converting madwifi-0.9.4/ath_hal/Makefile to use M= instead of SUBDIRS= ...

[A[72C  [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Converting madwifi-0.9.4/net80211/Makefile to use M= instead of SUBDIRS= ...

[A[72C  [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Converting madwifi-0.9.4/ath_rate/Makefile to use M= instead of SUBDIRS= ...

[A[72C  [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Converting madwifi-0.9.4/ath_rate/amrr/Makefile to use M= instead of SUBDIRS= ...

[A[72C  [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Converting madwifi-0.9.4/ath_rate/minstrel/Makefile to use M= instead of SUBDIRS= ...

[A[72C  [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Converting madwifi-0.9.4/ath_rate/onoe/Makefile to use M= instead of SUBDIRS= ...

[A[72C  [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Converting madwifi-0.9.4/ath_rate/sample/Makefile to use M= instead of SUBDIRS= ...

[A[72C  [34;01m[ [32;01mok[34;01m ][0m

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/net-wireless/madwifi-ng-0.9.4/work/madwifi-0.9.4 ...

 [32;01m*[0m Preparing ath_hal module

make -C /lib/modules/2.6.25-gentoo-r1/build M=/var/tmp/portage/net-wireless/madwifi-ng-0.9.4/work/madwifi-0.9.4/ath_hal modules

make[1]: Entering directory `/usr/src/linux-2.6.25-gentoo-r1'

  WARNING: Symbol version dump /usr/src/linux-2.6.25-gentoo-r1/Module.symvers

           is missing; modules will have no dependencies and modversions.

  CC [M]  /var/tmp/portage/net-wireless/madwifi-ng-0.9.4/work/madwifi-0.9.4/ath_hal/ah_os.o

  HOSTCC  /var/tmp/portage/net-wireless/madwifi-ng-0.9.4/work/madwifi-0.9.4/ath_hal/uudecode.o

  HOSTLD  /var/tmp/portage/net-wireless/madwifi-ng-0.9.4/work/madwifi-0.9.4/ath_hal/uudecode

  UUDECODE /var/tmp/portage/net-wireless/madwifi-ng-0.9.4/work/madwifi-0.9.4/ath_hal/i386-elf.hal.o

/bin/sh: scripts/genksyms/genksyms: No such file or directory

make[2]: *** [/var/tmp/portage/net-wireless/madwifi-ng-0.9.4/work/madwifi-0.9.4/ath_hal/ah_os.o] Error 1

make[1]: *** [_module_/var/tmp/portage/net-wireless/madwifi-ng-0.9.4/work/madwifi-0.9.4/ath_hal] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.25-gentoo-r1'

make: *** [all] Error 2

 [31;01m*[0m 

 [31;01m*[0m ERROR: net-wireless/madwifi-ng-0.9.4 failed.

 [31;01m*[0m Call stack:

 [31;01m*[0m               ebuild.sh, line   49:  Called src_compile

 [31;01m*[0m             environment, line 3169:  Called linux-mod_src_compile

 [31;01m*[0m             environment, line 2411:  Called die

 [31;01m*[0m The specific snippet of code:

 [31;01m*[0m               eval "emake HOSTCC=\"$(tc-getBUILD_CC)\"                   CC=\"$(get-KERNEL_CC)\"                   LDFLAGS=\"$(get_abi_LDFLAGS)\"                   ${BUILD_FIXES}                   ${BUILD_PARAMS}                   ${BUILD_TARGETS} " || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CC="$(get-KERNEL_CC)" LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}";

 [31;01m*[0m  The die message:

 [31;01m*[0m   Unable to emake HOSTCC=i686-pc-linux-gnu-gcc CC=i686-pc-linux-gnu-gcc LDFLAGS=  KERNELPATH=/lib/modules/2.6.25-gentoo-r1/build all

 [31;01m*[0m 

 [31;01m*[0m If you need support, post the topmost build error, and the call stack if relevant.

 [31;01m*[0m A complete build log is located at '/var/tmp/portage/net-wireless/madwifi-ng-0.9.4/temp/build.log'.

 [31;01m*[0m The ebuild environment file is located at '/var/tmp/portage/net-wireless/madwifi-ng-0.9.4/temp/environment'.

 [31;01m*[0m 
```

----------

## overkll

Kernel 2.6.25 includes the new ath5k driver with the new mac80211 wireless stack.  AFAIK, it's the in-kernel replacement for madwifi-ng.

----------

## nostabo

Thanks for the help. If that be the case, what wireless tools do I need? If any?

----------

## overkll

The same as with madwifi-ng - wireless-tools.  If you use or want to use WEP or WPA, you'd also need wpa_supplicant.

The rt2500 driver went throught the same change with kernel 2.6.24.  It is in the kernel now too.  I had some intermittent disconnected/reconnect issues that were solved by updating the firmware on my wireless access point.  Works perfectly now.   :Laughing: 

I do some IT work for a private school.  They have 9 laptops with gentoo and all have an atheros chipset.  I'll be upgrading those soon and plan on testing the in-kernel 2.6.25 ath5k driver on them.  Let me know how it goes with your upgrade.

----------

## nostabo

I just rebuilt my kernel adding the ath5k driver and the new MAC80211 stack and booted off it. I now get an error message that says ath0 won't start:

```
Real Time Clock Driver v1.12ac

Linux agpgart interface v0.103

agpgart: Detected AGP bridge 0

agpgart: AGP aperture is 128M @ 0xf0000000

input: PC Speaker as /class/input/input2

via-rhine.c:v1.10-LK1.4.3 2007-03-06 Written by Donald Becker

ACPI: PCI Interrupt 0000:00:12.0[A] -> GSI 23 (level, low) -> IRQ 23

eth0: VIA Rhine II at 0xfbdef800, 00:1a:92:0f:1b:46, IRQ 23.

eth0: MII PHY found at address 1, status 0x786d advertising 01e1 Link 45e1.

input: Power Button (FF) as /class/input/input3

Floppy drive(s): fd0 is 1.44M

FDC 0 is a post-1991 82077

ACPI: PCI Interrupt 0000:00:0c.0[A] -> GSI 17 (level, low) -> IRQ 17

ath5k_pci 0000:00:0c.0: registered as 'phy0'

ACPI: Power Button (FF) [PWRF]

input: Power Button (CM) as /class/input/input4

ACPI: ACPI0007:00 is registered as cooling_device0

ACPI: Processor [CPU1] (supports 16 throttling states)

phy0: Selected rate control algorithm 'pid'

ACPI: Power Button (CM) [PWRB]

hdd: No disk in drive

parport_pc 00:06: reported by Plug and Play ACPI

parport0: PC-style at 0x378 (0x778), irq 7, dma 3 [PCSPP,TRISTATE,COMPAT,EPP,ECP,DMA]

ath5k phy0: Atheros AR5213A chip found (MAC: 0x78, PHY: 0x45)

ath5k phy0: RF2112A 2GHz radio found (0x56)

ACPI: PCI Interrupt 0000:04:01.0[A] -> GSI 17 (level, low) -> IRQ 17

PCI: Setting latency timer of device 0000:04:01.0 to 64

udev: renamed network interface wlan0 to ath0

ppdev: user-space parallel port driver

hda_codec: Unknown model for ALC861, trying auto-probe from BIOS...

EXT3 FS on hda6, internal journal

kjournald starting.  Commit interval 5 seconds

EXT3-fs warning: maximal mount count reached, running e2fsck is recommended

EXT3 FS on hda7, internal journal

EXT3-fs: mounted filesystem with ordered data mode.

kjournald starting.  Commit interval 5 seconds

EXT3-fs warning: maximal mount count reached, running e2fsck is recommended

EXT3 FS on hda8, internal journal

EXT3-fs: mounted filesystem with ordered data mode.

Adding 2048248k swap on /dev/hda9.  Priority:-1 extents:1 across:2048248k

NET: Registered protocol family 10

lo: Disabled Privacy Extensions

```

Is the device name now phy0 instead of ath0?

----------

## Simba7

Does the new ath5k driver support Master mode? I *REALLY* need it.

I know when I switched from the rt2x00 drivers on one box to the in-kernel one, it screwed that completely up.

----------

## overkll

Simba7,

I know that atheros in general supports master mode.  I would think that the new in-kernel driver would support that.  Check the madwifi site for more info on the ath5k driver.

nostabo,

Don't know if the interface name has changed or not.  It may have become wlan0 instead of ath0.  What's the output of "iwconfig" and "ifconfig -a"?

The module ath5k_pci seems to have loaded with no errors.

----------

## Monkeh

ath5k only supports a handful of chipsets. The (very) common AR2413 has only just gained functionality (in git. 2.6.25 will not work with it). It may support master mode, but it doesn't seem to like the idea much with my 2413.

----------

## overkll

Doesn't it support the 5000 series?, thus the name ath5k?

----------

## Monkeh

 *overkll wrote:*   

> Doesn't it support the 5000 series?, thus the name ath5k?

 

It supports a handful of cards from the 5 series. It's far from a replacement for madwifi-ng.

----------

## nostabo

This the output from iwconfig:

```
strider ~ # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

wmaster0  no wireless extensions.

ath0      IEEE 802.11g  ESSID:""  

          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated   

          Tx-Power=off   

          Retry min limit:7   RTS thr:off   Fragment thr=2352 B   

          Encryption key:6A1F-9093-F5AB-D11B-AFCD-4737-7A

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
```

The "wmaster0" entry is new since I recompiled my kernel with the ath5k driver.

...and here is the ouput from the ifconfig -a command:

```
strider ~ # ifconfig -a

ath0      Link encap:Ethernet  HWaddr 00:15:e9:fb:6d:8b  

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 00:1a:92:0f:1b:46  

          inet addr:192.168.1.112  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::21a:92ff:fe0f:1b46/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:3584 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1845 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:2003034 (1.9 MiB)  TX bytes:334149 (326.3 KiB)

          Interrupt:23 Base address:0xa800 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:6 errors:0 dropped:0 overruns:0 frame:0

          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:448 (448.0 B)  TX bytes:448 (448.0 B)

wmaster0  Link encap:UNSPEC  HWaddr 00-15-E9-FB-6D-8B-65-74-00-00-00-00-00-00-00-00  

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

```

I guess I'll lose the ath0 link to net.lo and add one for wmaster0 and see what happens. The output from dmesg (in one of my former posts) had a couple of references to "phy0" so I thought that might be important...but maybe it's really "wmaster0".

----------

## nostabo

 *Quote:*   

> I guess I'll lose the ath0 link to net.lo and add one for wmaster0 and see what happens. 

 

That doesn't work, and neither does using "net.phy0"...hmmm

----------

## Monkeh

 *nostabo wrote:*   

>  *Quote:*   I guess I'll lose the ath0 link to net.lo and add one for wmaster0 and see what happens.  
> 
> That doesn't work, and neither does using "net.phy0"...hmmm

 

That's because phy0 is not a device name. wmaster0 is nothing you should be touching. wlan0, or ath0 as udev helpfully renames it to, is the device you want.

----------

## GrindGod

I have a AR5212 - card and configured the kernel. 

iwconfig says:

 *Quote:*   

> lo        no wireless extensions.
> 
> eth0      no wireless extensions.
> 
> wmaster0  no wireless extensions.
> ...

 

But when I try to start net.ath0 with this wpa_supplicant.conf (it works with madwifi-ng) :

 *Quote:*   

> 
> 
> ctrl_interface=/var/run/wpa_supplicant
> 
> ctrl_interface_group=0
> ...

 

I only get this error:

 *Quote:*   

> 
> 
> * Bringing up interface ath0
> 
>  *   Starting wpa_supplicant on ath0 ...
> ...

 

Does anybody know what is wrong?

----------

## overkll

Grindgod,

Check your /etc/conf.d/net.  When changing from the madwifi-ng package to the kernel based atheros driver, you need to change /etc/conf.d/net from:

```
wpa_supplicant_ath0="-Dmadwifi"
```

to:

```
wpa_supplicant_ath0="-Dwext"
```

since it uses the kernel's wireless extensions, not the madwifi extensions

----------

## ww9rivers

With overkll's change, net.ath0 starts up.

However, there is still an ioctl error:

```

tweety conf.d # /etc/init.d/net.ath0 restart

 * Caching service dependencies ...

 * Starting ath0

 *   Starting wpa_supplicant on ath0 ...

ioctl[SIOCSIWAUTH]: Operation not supported

 [ ok ]th param 4 value 0x0 -

 *   Starting wpa_cli on ath0 ...                                                             [ ok ]

 *     Backgrounding ...

```

----------

## vps

 *ww9rivers wrote:*   

> With overkll's change, net.ath0 starts up.
> 
> However, there is still an ioctl error:
> 
> ```
> ...

 

Yes, there is an error.  But ath5k works nevertheless.  At least here: AR5212, wireless-testing kernel, WPA.  Even powersave mode!  :Smile: 

Vitus

----------

