[PATCH] talkative reset
Denis Vlasenko
vda
Thu May 15 22:59:53 PDT 2003
On 16 May 2003 00:49, Lukic wrote:
> well, i did some more printk :-) in hostap_pci.c, so sreset seems
> like this (don't blame me, i don't know how to use diff or so :-)):
>
> ----------------cut starts here-----------------
> static void prism2_pci_cor_sreset(local_info_t *local)
> {
> struct net_device *dev = local->dev;
>
> /* linux-wlan-ng uses extremely long hold and settle times
> for * COR sreset. A comment in the driver code mentions that the long
> * delays appear to be necessary. However, at least IBM 22P6901 *
> seems to work fine with shorter delays.
> *
> * Longer delays can be configured by uncommenting following
> line: */
> #define PRISM2_PCI_USE_LONG_DELAYS
>
> #ifdef PRISM2_PCI_USE_LONG_DELAYS
> int timeout;
> printk(KERN_WARNING "here we are.. going to send 0x0080 \n");
> // this is the last message i get..
give it a couple of yield() calls after printk
and be sure to have syslog written to file with
O_SYNC and/or redirected on a tty.
> HFA384X_OUTW(0x0080, HFA384X_PCICOR_OFF);
> // probably point of hang
put a printk,yield here too
> timeout = jiffies + HZ / 4;
> while (time_before(jiffies, timeout))
> // we can't run in loop, cause, with short
> udelay(5);
> // with short delays system hangs too.. :-((
replace all this with single nice mdelay(250), then
printk again
> HFA384X_OUTW(0x0, HFA384X_PCICOR_OFF);
printk
> timeout = jiffies + HZ / 2;
> while (time_before(jiffies, timeout))
> udelay(5);
replace by mdelay(500)
> printk(KERN_WARNING "sent 0x0 waiting..\n");
add yield
> /* Wait for f/w to complete initialization (CMD:BUSY == 0) */
> timeout = jiffies + 2 * HZ;
> while ((HFA384X_INW(HFA384X_CMD_OFF) & HFA384X_CMD_BUSY) &&
> time_before(jiffies, timeout))
> udelay(10);
> printk(KERN_WARNING "waited... end of reset soon..\n");
add yield
>
> #else /* PRISM2_PCI_USE_LONG_DELAYS */
>
> printk(KERN_WARNING "here we are.. going to send 0x0080 \n");
add yield
> HFA384X_OUTW(0x0080, HFA384X_PCICOR_OFF);
> printk(KERN_WARNING "sent 0x0080 sending 0x0\n");
add yield
> mdelay(1);
> HFA384X_OUTW(0x0, HFA384X_PCICOR_OFF);
> mdelay(1);
> printk(KERN_WARNING "sent 0x0 ...\n");
add yield
>
> #endif /* PRISM2_PCI_USE_LONG_DELAYS */
>
>
> if (HFA384X_INW(HFA384X_CMD_OFF) & HFA384X_CMD_BUSY) {
> printk(KERN_DEBUG "%s: COR sreset timeout\n",
> dev->name); }
> printk(KERN_WARNING "end of reset...\n");
add yield
--
vda
More information about the Hostap
mailing list