Even though this looks like a fixed bug in current subversion repository, I wanted to report this so that others don't have to waste a day like I did.
In an environment with lots of SSIDs/APs, tools that are based on wireless extensions (iwlist, wpa_supplicant) will report a significantly less number of SSIDs than that are in the environment.
If you use wlanconfig ath0 list scan, you will see all the APs/SSIDs that are in the environment.
This was true when running a vanilla madwifi 0.9.2 that was distributed as an at.rpm:
The madwifi version info:
madwifi-0.9.2-28.fc5.at
madwifi-kmdl-2.6.17-1.2187_FC5-0.9.2-28.fc5.at
madwifi-hal-kmdl-2.6.17-1.2187_FC5-0.9.2-28.fc5.at
ath_hal: 0.9.17.2 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
ath_rate_sample: 1.2 (0.9.2)
ath_pci: 0.9.4.5 (0.9.2)
wlan: 0.8.4.2 (0.9.2)
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
wifi0: mac 5.9 phy 4.3 radio 4.6
wifi0: Atheros 5212: mem=0xb0300000, irq=225
When I built a new madwifi using the latest subversion repository, this was no longer a problem and I got the same number of APs/SSIDs with iwlist and wlanconfig.
The version info for the madwif that works fine (from today's subversion repository):
ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
wlan: 0.8.4.2 (svn r1750)
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
wifi0: mac 5.9 phy 4.3 radio 4.6