Loading driver on DWL-650 revP with kernel 2.6.19.2

Andrew Shaffer aeshaffer at gmail.com
Thu Jan 18 18:35:18 EST 2007


Hi,

     I've been having trouble with the hostap_cs driver on kernel 2.6.19.2.
I'm using a D-Link 650 rev P, which needs its firmware loaded in volatile
RAM.  The card has worked with earlier kernel versions (I seem to remember
being able to get the card recognized correctly with the default Ubuntu
kernel.  I've since switched back to Debian 3.1.  I've shut down the pcmcia
service and am manually inserting modules - should this be a problem?)

    I had found a thread on this list (2006-December/014795.html) about
adding the manufacturer information for this card to the hostap_cs.c file,
which I did (that change should be in the attached patch. - I replaced an
existing entry, rather than added a new one...)

When I modprobe hostap_cs, after the

hostap_cs: 0.4.4 (Jouni.....)
hostap_cs: Registered netdevice wifi0
hostap_cs: index 0x0: , irq 3, io 0xe100-0xe17f
hostap_cs: first command failed - assuming card does not have primary
firmware

messages, the system hangs until I pull the card, at which point I get:

prism2_hw_init: initialized in 0 ms
wifi0: prism2_enable_aux_port - timeout - reg=0xffff
wifi0: prism2_enable_aux_port - timeout - reg=0xffff
SWSUPPORT0 write/read failed: FFFF != 8A32
hostap_cs: Initialization failed
hostap_cs: probe of 0.0 failed with error 1

and, although a single shell prompt is printed, the system hangs.

What I believe to be happening is that in prism2_hw_init in hostap_hw.c,
around line 1332:

start = jiffies;
delay = jiffies + HFA384X_INIT_TIMEOUT;
while (!(HFA384X_INW(HFA384X_EVSTAT_OFF) & HFA384X_EV_CMD) &&
               time_before(jiffies, delay))
                yield();

the loop never exits because jiffies isn't updating.  I think that this loop
is supposed to time out since my card doesn't have the firmware loaded yet.
After making the changes in the attached patch (just prink-ing the jiffies
value every iteration through the loop), this seems to be the case.
Although I'm not sure about the details, I've read in a couple of places
that yield() shouldn't be used in favor of other, more specific functions.
Perhaps that's the problem?

Thanks a lot,

Andrew Shaffer
aeshaffer at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.shmoo.com/pipermail/hostap/attachments/20070118/1288dd5f/attachment.htm 
-------------- next part --------------
Only in .: aes.diff
Only in /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/: hostap_80211.h
Only in /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/: hostap_ap.h
Only in /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/: hostap_common.h
Only in /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/: hostap_config.h
diff -u ./hostap_cs.c /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/hostap_cs.c
--- ./hostap_cs.c	2007-01-18 18:05:57.000000000 -0500
+++ /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/hostap_cs.c	2007-01-10 14:10:37.000000000 -0500
@@ -22,7 +22,7 @@
 #include "hostap_wlan.h"
 
 
-static char *version = PRISM2_VERSION " (Jouni Malinen <jkmaline at cc.hut.fi>) (BORKED BY AES)";
+static char *version = PRISM2_VERSION " (Jouni Malinen <jkmaline at cc.hut.fi>)";
 static dev_info_t dev_info = "hostap_cs";
 
 MODULE_AUTHOR("Jouni Malinen");
@@ -829,7 +829,7 @@
 }
 
 static struct pcmcia_device_id hostap_cs_ids[] = {
-	PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7110),
+	PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7100),
 	PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7300),
 	PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777),
 	PCMCIA_DEVICE_MANF_CARD(0x0126, 0x8000),
Only in .: hostap_cs.mod.c
Only in /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/: hostap.h
diff -u ./hostap_hw.c /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/hostap_hw.c
--- ./hostap_hw.c	2007-01-18 18:05:57.000000000 -0500
+++ /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/hostap_hw.c	2007-01-10 14:10:37.000000000 -0500
@@ -1303,7 +1303,6 @@
 	local_info_t *local;
 	int ret, first = 1;
 	unsigned long start, delay;
-	int loopcount = 0;
 
 	PDEBUG(DEBUG_FLOW, "prism2_hw_init()\n");
 
@@ -1324,7 +1323,7 @@
 		/* EvStat has Cmd bit set in some cases, so retry once if no
 		 * wait was needed */
 		HFA384X_OUTW(HFA384X_EV_CMD, HFA384X_EVACK_OFF);
-		printk(KERN_INFO "%s: init command completed too quickly - "
+		printk(KERN_DEBUG "%s: init command completed too quickly - "
 		       "retrying\n", dev->name);
 		first = 0;
 		goto init;
@@ -1333,33 +1332,21 @@
 	start = jiffies;
 	delay = jiffies + HFA384X_INIT_TIMEOUT;
 	while (!(HFA384X_INW(HFA384X_EVSTAT_OFF) & HFA384X_EV_CMD) &&
-	       time_before(jiffies, delay)) {
-	  loopcount++;
-	  if(loopcount % 1000 == 1) {
-	    printk(KERN_INFO "%d) Start: %lu, Now: %lu, Delay: %lu, yielding...\n", 
-		   loopcount,
-		   (start-start)*1000/HZ, 
-		   (jiffies-start)*1000/HZ, 
-		   (delay-start)*1000/HZ
-		   );	  
-	  }
-	  yield();
-	}
-
+	       time_before(jiffies, delay))
+		yield();
 	if (!(HFA384X_INW(HFA384X_EVSTAT_OFF) & HFA384X_EV_CMD)) {
-		printk(KERN_INFO "%s: assuming no Primary image in "
+		printk(KERN_DEBUG "%s: assuming no Primary image in "
 		       "flash - card initialization not completed\n",
 		       dev_info);
 		local->no_pri = 1;
 #ifdef PRISM2_DOWNLOAD_SUPPORT
-		printk(KERN_INFO "Download Support..");
 			if (local->sram_type == -1)
 				local->sram_type = prism2_get_ram_size(local);
 #endif /* PRISM2_DOWNLOAD_SUPPORT */
 		return 1;
 	}
 	local->no_pri = 0;
-	printk(KERN_INFO "prism2_hw_init: initialized in %lu ms\n",
+	printk(KERN_DEBUG "prism2_hw_init: initialized in %lu ms\n",
 	       (jiffies - start) * 1000 / HZ);
 	HFA384X_OUTW(HFA384X_EV_CMD, HFA384X_EVACK_OFF);
 	return 0;
Only in .: hostap.mod.c
Only in /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/: hostap_wlan.h
Only in /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/: Kconfig
Only in /usr/src/linux-2.6.19.2/drivers/net/wireless/hostap/: Makefile


More information about the HostAP mailing list