OpenWrt Forum Archive

Topic: madwifi + hostapd problem when trying multiple ssid

The content of this topic has been archived on 1 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to setup multiple ssids (two ap) and this is the error I get

root@OpenWrt:~# wifi up
Configuration file: /var/run/hostapd-ath0.conf
wlanconfig: ioctl: No such device
enable_atheros(wifi1): Failed to set up ap vif

Some (maybe?) useful info;

definitely using atheros AR5212

root@OpenWrt:~# lspci -v
00:02.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)
        Subsystem: Giga-byte Technology Gigabyte GN-WIAG02
        Flags: bus master, medium devsel, latency 96, IRQ 6
        Memory at 40000000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [44] Power Management version 2
        Kernel driver in use: ath_pci

no strange messages in dmesg

root@OpenWrt:~# dmesg 
Linux version 2.6.23.17 (pedro@pebf) (gcc version 4.1.2) #4 Mon Jun 2 01:40:39 CEST 2008
...
ssb: Core 4 found: PCI (cc 0x804, rev 0x08, vendor 0x4243)
...
wlan: trunk
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 0.9.30.13 (AR5210, AR5211, AR5212, AR5416, RF5111, RF5112, RF2413, RF5413, RF2133, REGOPS_FUNC)
ath_rate_minstrel: Minstrel automatic rate control algorithm 1.2 (trunk)
ath_rate_minstrel: look around rate set to 10%
ath_rate_minstrel: EWMA rolloff level set to 75%
ath_rate_minstrel: max segment size in the mrr set to 6000 us
wlan: mac acl policy registered
ath_pci: trunk
PCI: Enabling device 0000:00:02.0 (0000 -> 0002)
PCI: Fixing up device 0000:00:02.0
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
ath_pci: wifi0: Atheros 5212: mem=0x40000000, irq=6
device ath0 entered promiscuous mode
...

versions of hostapd and madwifi

root@OpenWrt:~# grep KAMIKAZE /etc/banner 
 KAMIKAZE (bleeding edge, r11264) -------------------

root@OpenWrt:~# hostapd -v
hostapd v0.6.0
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2007, Jouni Malinen <j@w1.fi> and contributors

root@OpenWrt:~# ipkg list_installed|grep madwifi
kmod-madwifi - 2.6.23.17+r3314-brcm47xx-1 -

these are the loaded modules:

root@OpenWrt:~# lsmod | grep ath
ath_pci               101392  0 
ath_rate_minstrel       8512  1 
ath_hal               271168  3 ath_pci,ath_rate_minstrel
wlan                  151600  10 ath_pci,wlan_xauth,wlan_wep,wlan_tkip,wlan_ccmp,wlan_acl,ath_rate_minstrel,wlan_scan_sta,wlan_scan_ap

and finally my wireless config file:

root@OpenWrt:~# cat /etc/config/wireless 

config 'wifi-device' 'wifi0'
        option 'type' 'atheros'
        option 'channel' '10'
        option 'disabled' '0'
        option 'agmode' '11bg'
        option 'diversity' '0'
        option 'txantenna' '1'
        option 'rxantenna' '1'
        option 'distance' '600'

config 'wifi-iface'
        option 'device' 'wifi0'
        option 'network' 'lan'
        option 'mode' 'ap'
        option 'ssid' 'OpenWrt'
        option 'encryption' 'psk2'
        option 'txpower' '19'
        option 'bursting' '1'
        option 'xr' '1'
        option 'key' 'one big fat secrete'
        option 'hidden' '0'
        option 'isolate' '0'
        option 'bgscan' '0'
        option 'wds' '0'
        option '80211h' '0'
        option 'wmm' '0'
        option 'ar' '0'
        option 'turbo' '0'
        option 'macpolicy' 'none'

config 'wifi-device' 'wifi1'
        option 'type' 'atheros'
        option 'channel' '11'
        option 'disabled' '0'
        option 'agmode' '11bg'
        option 'diversity' '0'
        option 'txantenna' '1'
        option 'rxantenna' '1'
        option 'distance' '600'

config 'wifi-iface'
        option 'device' 'wifi1'
        option 'mode' 'ap'
        option 'ssid' 'OpenWrt3'
        option 'hidden' '1'
        option 'encryption' 'none'
        option 'network' 'lan2'
        option 'isolate' '0'
        option 'txpower' '19'
        option 'bgscan' '0'
        option 'wds' '0'
        option '80211h' '0'
        option 'bursting' '1'
        option 'wmm' '0'
        option 'xr' '1'
        option 'ar' '0'
        option 'turbo' '0'
        option 'macpolicy' 'none'

I'm building revision 11349 (did a make distclean just before) and will try it tomorrow.

Meanwhile, does anyone have any ideas of what the solution may be?

pedrofaustino wrote:

I'm trying to setup multiple ssids (two ap) and this is the error I get
...
I'm building revision 11349 (did a make distclean just before) and will try it tomorrow.

Meanwhile, does anyone have any ideas of what the solution may be?

guess

wifi-device' 'wifi1'

should be

wifi-device' 'wifi0'

I was almost replying to the other post wink

I've already tried wireless config with just one wifi-device block (thus only wifi0) and two wifi-iface blocks. Didn't work, the error message I got was the same as posted (but with wifi1 changed to wifi0 of course).

Did you manage to have two ssids?

pedrofaustino wrote:

I was almost replying to the other post wink

I've already tried wireless config with just one wifi-device block (thus only wifi0) and two wifi-iface blocks. Didn't work, the error message I got was the same as posted (but with wifi1 changed to wifi0 of course).

Did you manage to have two ssids?

no, but i dodn't tried it wink ill update my asus this evening to the latest trunk (config update) and try it. ill post my results here.

cheers

ONLY when loading ath_pci into the kernel with the following parameters:

ath_pci autocreate=none maxvaps=2

(max is 32 for current openwrt's madwifi revision as given by http://madwifi.org/ticket/1769)

and with /etc/config/wireless like this:

config 'wifi-device' 'wifi0'
        option 'type' 'atheros'
        option 'channel' '11'
        option 'disabled' '0'
        option 'agmode' '11bg'
        option 'distance' '60'
        option 'diversity' '0'
        option 'txantenna' '1'
        option 'rxantenna' '1'

config 'wifi-iface'
        option 'device' 'wifi0'
        option 'network' 'lan'
        option 'mode' 'ap'
        option 'ssid' 'OpenWrt1'
        option 'encryption' 'psk2'
        option 'hidden' '0'
        option 'isolate' '0'
        option 'txpower' '19'
        option 'bgscan' '0'
        option 'wds' '0'
        option 'key' 'one big fat secret 1'
        option '80211h' '0'
        option 'bursting' '1'
        option 'wmm' '0'
        option 'xr' '1'
        option 'ar' '0'
        option 'turbo' '0'
        option 'macpolicy' 'none'


config 'wifi-iface'
        option 'device' 'wifi0'
        option 'network' 'lan'
        option 'mode' 'ap'
        option 'ssid' 'OpenWrt1'
        option 'encryption' 'psk2'
        option 'hidden' '0'
        option 'isolate' '0'
        option 'txpower' '19'
        option 'bgscan' '0'
        option 'wds' '0'
        option 'key' 'one big fat secret 2'
        option '80211h' '0'
        option 'bursting' '1'
        option 'wmm' '0'
        option 'xr' '1'
        option 'ar' '0'
        option 'turbo' '0'
        option 'macpolicy' 'none'

I was able to have two different SSIDs.


But...there are still some problems though...when I disable and enable the wifi interface more than (maxvaps-1) I have the following error:

root@OpenWrt:~# wifi down; sleep 1; wifi up
wlanconfig: ioctl: Input/output error
enable_atheros(wifi0): Failed to set up sta vif

Now when trying AP+STA modes I get following error:

root@OpenWrt:~# wifi up
Configuration file: /var/run/hostapd-ath0.conf
/sbin/uci: Entry not found
Interface type  not supported.
root@OpenWrt:~# cat /etc/config/wireless

config 'wifi-device' 'wifi0'
        option 'type' 'atheros'
        option 'channel' '11'
        option 'disabled' '0'
        option 'agmode' '11bg'
        option 'distance' '60'
        option 'diversity' '0'
        option 'txantenna' '1'
        option 'rxantenna' '1'

config 'wifi-iface'
        option 'device' 'wifi0'
        option 'network' 'lan'
        option 'mode' 'ap'
        option 'ssid' 'OpenWrt1'
        option 'encryption' 'psk2'
        option 'hidden' '0'
        option 'isolate' '0'
        option 'txpower' '19'
        option 'bgscan' '0'
        option 'wds' '0'
        option 'key' 'one big fat secret 1'
        option '80211h' '0'
        option 'bursting' '1'
        option 'wmm' '0'
        option 'xr' '1'
        option 'ar' '0'
        option 'turbo' '0'
        option 'macpolicy' 'none'

config 'wifi-iface'
        option 'device' 'wifi0'
        option 'network' 'none'
        option 'mode' 'sta'
        option 'ssid' 'Wireless Ville de Lausanne'
        option 'encryption' 'none'

Does anyone of you guys have any idea of what's going on?

At this post http://forum.openwrt.org/viewtopic.php?pid=69252 Wallace78 is also having the same issue.

Could someone post a hint/direction on what the cause/solution could be?
Anyone running an updated version of madwifi?

pedrofaustino wrote:

Now when trying AP+STA modes I get following error:

root@OpenWrt:~# wifi up
Configuration file: /var/run/hostapd-ath0.conf
/sbin/uci: Entry not found
Interface type  not supported.

The script network-wlan.sh from Webif uses none as the value of the
network option in /etc/config/wireless when the wifi-iface is not
supposed to be bridged.
This patch modifies madwifi.sh in order to take into account that possibility.

Index: package/madwifi/files/lib/wifi/madwifi.sh
===================================================================
--- package/madwifi/files/lib/wifi/madwifi.sh   (revision 11372)
+++ package/madwifi/files/lib/wifi/madwifi.sh   (working copy)
@@ -249,7 +249,7 @@
 
                local net_cfg bridge
                net_cfg="$(find_net_config "$vif")"
-               [ -z "$net_cfg" ] || {
+               [ -z "$net_cfg" -o "$net_cfg" = none ] || {
                        bridge="$(bridge_interface "$net_cfg")"
                        config_set "$vif" bridge "$bridge"
                        start_net "$ifname" "$net_cfg"

The discussion might have continued from here.