hostap hangs when reseting..

Denis Vlasenko vda
Tue May 13 23:47:06 PDT 2003


On 13 May 2003 17:19, Milan Krcmar wrote:
> It is a property of each and every computer with PRISM and hostap I
> know of. This is experience of a large user group counting several
> tens of hostap based APs. Various hardware used for computer itself,
> card mostly Zcomax Xi626, but also DLink 520 and so on).

me too. DLink 520

> The only way to make the hostap behave stably is to avoid resets (the
> most frequent reason hostap shedules card reset seems to be weak
> signal from AP while it is in Managed mode, I just had to use a
> better antenna).

No. The only acceptable way is to debug reset code and fix it.
Lets read the code (hostap-0.0.2): 

hostap_hw.c
===========
static void prism2_hw_reset(struct net_device *dev)
{
        local_info_t *local = (local_info_t *) dev->priv;
#if 0
        static long last_reset = 0;

        /* do not reset card more than once per second to avoid ending up in a
         * busy loop reseting the card */
        if (last_reset + HZ >= jiffies)
                return;
        last_reset = jiffies;
#endif
nice but 1) why is it commented out? 2) jiffies could wrap:
if(last_reset + HZ >= jiffies) ==> if(time_before(last_reset + HZ,jiffies))

        if (in_interrupt()) {
                printk(KERN_DEBUG "%s: driver bug - prism2_hw_reset() called "
                       "in interrupt context\n", dev->name);
                return;
        }

--->    if (local->hw_downloading)
                return;

--->    if (local->hw_resetting) {
                printk(KERN_WARNING "%s: %s: already resetting card - "
                       "ignoring reset request\n", dev_info, dev->name);
                return;
        }

        local->hw_reset_tries++;
        if (local->hw_reset_tries > 10) {
                printk(KERN_WARNING "%s: too many reset tries, skipping\n",
                       dev->name);
                return;
        }

        printk(KERN_WARNING "%s: %s: resetting card\n", dev_info, dev->name);
--->    local->hw_resetting = 1;
racy?
        hfa384x_disable_interrupts(dev);
        if (local->func->cor_sreset)

add a printk hunt?

+printk(KERN_DEBUG "cor_sreset()...\n");
                local->func->cor_sreset(local);
+printk(KERN_DEBUG "hw_shutdown()...\n");
        prism2_hw_shutdown(dev, 1);
+printk(KERN_DEBUG "hw_config()...\n");
        prism2_hw_config(dev, 0);
        local->hw_resetting = 0;
+printk(KERN_DEBUG "reset done\n");
}
--
vda




More information about the Hostap mailing list