Monitor mode bug

Gerald Britton gbritton at doomcom.org
Sat Feb 15 00:20:55 EST 2003


Monitor mode puts the device into HostAP mode rather than PseudoIBSS mode
with the current code causing beacons to be set while monitoring.

In prism2_ioctl_siwmode(), when monitor mode is enabled, we drop through
into the code which sets the port type:

        printk(KERN_DEBUG "prism2: %s: operating mode changed "
               "%d -> %d\n", dev->name, local->iw_mode, *mode);
        local->iw_mode = *mode;

        if (local->iw_mode == IW_MODE_MONITOR)
                hostap_monitor_mode_enable(local);
        else if (local->iw_mode == IW_MODE_MASTER && !local->host_encrypt &&
                 !local->fw_encrypt_ok) {
                printk(KERN_DEBUG "%s: defaulting to host-based encryption as "
                       "a workaround for firmware bug in Host AP mode WEP\n",
                       dev->name);
                local->host_encrypt = 1;
        }

        if (hostap_set_word(dev, HFA384X_RID_CNFPORTTYPE,
                            hostap_get_porttype(local)))
                return -EOPNOTSUPP;

        if (local->func->reset_port(dev))
                return -EINVAL;

... This should perhaps be a "return hostap_monitor_mode_enable(local);"
instead.  Making this change works great on my pccard, but with my minipci
card, I endup with messages like this:

prism2: wlan0: operating mode changed 2 -> 6
Enabling monitor mode
wlan0: LinkStatus=2 (Disconnected)
wlan0: LinkStatus: BSSID=00:00:00:00:00:00
wlan0: hfa384x_setup_bap - timeout after
wlan0: hfa384x_set_rid (rid=fc03, len=2) - failed - res=-110
wlan0: Disabling monitor mode
prism2: wlan0: operating mode changed 6 -> 2

This is enabling monitor mode and then tuning to a channel.  subsequent
retunes appear to work correctly, only the first after enabling monitor
mode seems to fail.

The MiniPCI wlan0:
NICID: id=0x8013 v1.0.0 (PRISM II (2.5) Mini-PCI (SST parallel flash))
PRIID: id=0x0015 v1.1.0
STAID: id=0x001f v1.4.9 (station firmware)

The PCMCIA wlan1:
NICID: id=0x800c v1.0.0 (PRISM II (2.5) PCMCIA (SST parallel flash))
PRIID: id=0x0015 v1.0.7
STAID: id=0x001f v1.3.5 (station firmware)

				-- Gerald




More information about the HostAP mailing list