Easy first:  The docs in trunk and on the wiki disagree about setting the a/b/g mode.  Is the config entry in in the 'wifi-device' section of '/etc/wireless' supposed to be named 'mode' or 'agmode'?

*EDIT* DOH!  My mistake on the following, I had the wrong interface names in /etc/config/network. (Had wifi0 not ath0/1).  There is still the question about the unrecognized ioctls though.

Now is this a bug or some deficiency in the Fon hardware?  When using two SSIDs on the one radio,  the wifi0 device is assigned the same address as ath0.  This causes some nasty routing issues:

ifconfig:

ath0      Link encap:Ethernet  HWaddr 00:18:84:20:52:6D
          inet addr:192.168.22.254  Bcast:192.168.22.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:2290  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:320 (320.0 B)

ath1      Link encap:Ethernet  HWaddr 06:18:84:20:52:6D
          inet addr:192.168.23.254  Bcast:192.168.23.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:2290  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:320 (320.0 B)

wifi0     Link encap:Ethernet  HWaddr 00:18:84:20:52:6D
          inet addr:192.168.22.254  Bcast:192.168.22.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:244 errors:0 dropped:0 overruns:0 frame:20
          TX packets:103 errors:41 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:199
          RX bytes:14481 (14.1 KiB)  TX bytes:14526 (14.1 KiB)
          Interrupt:3 Memory:b0000000-b00ffffc

netstat -rn

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.23.0    0.0.0.0         255.255.255.0   U         0 0          0 ath1
192.168.22.0    0.0.0.0         255.255.255.0   U         0 0          0 wifi0
192.168.22.0    0.0.0.0         255.255.255.0   U         0 0          0 ath0

This seems to be a problem outside of the wifi up/down code because if I flush the address on wifi0 and then rerun wifi down and up, wifi0 doesn't pick up an address.

There is also an issue with wifi up/down on this hardware.  There are some private ioctls issued during wifi up/down that the hardware doesn't recognize:

root@FonOpenWrt:~# wifi up
Interface doesn't accept private ioctl...
ff (8BE0): Invalid argument
Configuration file: /var/run/hostapd-ath0.conf
Interface doesn't accept private ioctl...
ff (8BE0): Invalid argument
Configuration file: /var/run/hostapd-ath1.conf

Here are my configs:

/etc/config/wireless:

config wifi-device  wifi0
        option type     'atheros'
        option country  'ca'
        option channel  '2'
#       option maxassoc ''
#       option distance ''
        option agmode   '11g'
#       option disabled '1'

config wifi-iface
        option network  'wlan1'
        option device   'wifi0'
        option mode     'ap'
        option ssid     'OpenWrt1'
#       option bssid    ''
        option encryption       'psk2'
        option key      '**********'
#       option key1     ''
#       option key2     ''
#       option key3     ''
#       option key4     ''
#       option server ''
#       option port ''
        option txpower '15'
#       option hidden ''
#       option isolate ''

config wifi-iface
        option network  'wlan2'
        option device   'wifi0'
        option mode     'ap'
        option ssid     'OpenWrt2'
#       option bssid    ''
        option encryption       'psk2'
        option key      '**********'
#       option key1     ''
#       option key2     ''
#       option key3     ''
#       option key4     ''
#       option server ''
#       option port ''
        option txpower '15'
#       option hidden ''
#       option isolate ''

/etc/config/network:

config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option ifname   eth0.2
        option proto    static
        option ipaddr   192.168.21.254
        option netmask  255.255.255.0

config interface wan
        option ifname   eth0.3
        option proto    dhcp
        option hostname FonOpenWRT

config interface management
        option ifname   eth0.1
        option proto    static
        option ipaddr   192.168.1.254
        option netmask  255.255.255.0

config interface wlan1
        option ifname   wifi0
        option proto    static
        option ipaddr   192.168.22.254
        option netmask  255.255.255.0

config interface wlan2
        option ifname   wifi0
        option proto    static
        option ipaddr   192.168.23.254
        option netmask  255.255.255.0

Thanks,
Jon

(Last edited by PraysToPan on 23 Nov 2007, 12:05)