Subject: Problem with Webgear Aviator 2.4
To: None <current-users@netbsd.org>
From: Dave Huang <khym@bga.com>
List: current-users
Date: 01/31/2000 21:46:43
Well, I stopped by CompUSA today and picked up the 2-card kit... one
goes in my NetBSD/i386 router, and the other goes in my Win2K
laptop... too bad there's no Win2K driver :) The Raytheon RayLink driver
doesn't work either, even after I changed the ID string to match... but
that's not a problem for this list :)

One little thing I noticed... the i386 GENERIC includes the ray driver,
which needs 0xc000 bytes of i/o memory space. However, pcic0 at isa's
iosize is only 0x4000, which causes ray's attach to fail with "can't
alloc shared memory". Anyways, after bumping iosize to 0x10000, I get:

pcic0 at isa0 port 0x3e0-0x3e1 iomem 0xd0000-0xdffff: using irq 5
pcic0: controller 0 (Intel 82365SL Revision 1) has socket A only
pcmcia0 at pcic0 controller 0 socket 0
ray0 at pcmcia0 function 0: WebGear, PC Card WLAN Adapter, Version 4.88 Jan 1999
ray0: firmware version 85
ray0: supported rates 32:55:55:55:55:55:55:55
ray0: 802.11 address 00:00:f1:11:5a:89

My problem is that if I set the LINK0 flag during the initial ifconfig
(e.g. include link0 in /etc/ifconfig.ray0), I get:

pcmcia0: card irq 9
ray0: intr: bad cmd index 255
ray0: intr: bad cmd index 255
ray0: starting DAD for fe80:000e::0200:f1ff:fe11:5a89
stray interrupt 9
ray0: could not run DAD, driver problem?

And the light on the card doesn't come on... ifconfig shows the
interface as having OACTIVE set. But if I ifconfig without LINK0, then
turn LINK0 on after the card is up, it works fine (I do still get the
two "bad cmd index 255" messages though).

Any thoughts?

BTW, I tried compiling the driver on the alpha, and it doesn't
compile... mainly warnings about printf format mismatches. It's also
unhappy with ray_read_region() and ray_write_region() passing a
u_int8_t* to bus_space_{read,write}_region_{2,4}. The following patch
makes it compile, but it doesn't actually work... I get an endless
stream of "ray0: intr: bad cmd index 255".

--- /usr/src/sys/dev/pcmcia/if_ray.c	Thu Jan 27 07:00:48 2000
+++ if_ray.c	Mon Jan 31 17:59:41 2000
@@ -1091,7 +1091,8 @@
 		pktlen = m0->m_pkthdr.len;
 		if (pktlen > ETHER_MAX_LEN - ETHER_CRC_LEN) {
 			RAY_DPRINTF((
-			    "%s: mbuf too long %d\n", ifp->if_xname, pktlen));
+			    "%s: mbuf too long %d\n", ifp->if_xname,
+			    (int)pktlen));
 			m_freem(m0);
 			continue;
 		}
@@ -1234,7 +1235,7 @@
 	RAY_ECF_START_CMD(sc);
 
 	RAY_DPRINTF_XMIT(("%s: sent packet: len %d\n", sc->sc_xname,
-	    pktlen));
+	    (int)pktlen));
 }
 
 /*
@@ -1270,9 +1271,9 @@
 	pktlen = SRAM_READ_FIELD_2(sc, ccs, ray_cmd_rx, c_pktlen);
 
 	RAY_DPRINTF(("%s: recv pktlen %d nofrag %d\n", sc->sc_xname,
-	    pktlen, nofrag));
+	    (int)pktlen, nofrag));
 	RAY_DPRINTF_XMIT(("%s: received packet: len %d\n", sc->sc_xname,
-	    pktlen));
+	    (int)pktlen));
 	if (pktlen > MCLBYTES
 	    || pktlen < (sizeof(*frame) + sizeof(struct llc))) {
 		RAY_DPRINTF(("%s: PKTLEN TOO BIG OR TOO SMALL\n",
@@ -1318,10 +1319,10 @@
 #endif
 		ni = SRAM_READ_FIELD_1(sc, ccs, ray_cmd_rx, c_nextfrag);
 		RAY_DPRINTF(("%s: recv frag index %d len %d bufp 0x%x ni %d\n",
-		    sc->sc_xname, i, len, (int)bufp, ni));
+		    sc->sc_xname, i, (int)len, (int)bufp, ni));
 		if (len + lenread > pktlen) {
 			RAY_DPRINTF(("%s: BAD LEN current 0x%x pktlen 0x%x\n",
-			    sc->sc_xname, len + lenread, pktlen));
+			    sc->sc_xname, (int)(len + lenread), (int)pktlen));
 			ifp->if_ierrors++;
 			m_freem(m);
 			m = 0;
@@ -1362,7 +1363,7 @@
 		return;
 
 	RAY_DPRINTF(("%s: recv got packet pktlen %d actual %d\n",
-	    sc->sc_xname, pktlen, lenread));
+	    sc->sc_xname, (int)pktlen, (int)lenread));
 #ifdef RAY_DEBUG
 	if (ray_debug && ray_debug_dump_rx)
 		ray_dump_mbuf(sc, m);
@@ -2834,9 +2835,9 @@
 	/* XXX we may be making poor assumptions here but lets hope */
 	switch ((off|(bus_addr_t)p) & 0x03) {
 	case 0:
-		if ((n4 = c / 4)) {
+		if ((n4 = c / 4) != 0) {
 			bus_space_read_region_4(sc->sc_memt, sc->sc_memh, off,
-			    p, n4);
+			    (u_int32_t *)p, n4);
 			tmp = c & ~0x3;
 			c &= 0x3;
 			p += tmp;
@@ -2854,9 +2855,9 @@
 		}
 		break;
 	case 2:
-		if ((n2 = (c >> 1)))
+		if ((n2 = (c >> 1)) != 0)
 			bus_space_read_region_2(sc->sc_memt, sc->sc_memh, off,
-			    p, n2);
+			    (u_int16_t *)p, n2);
 		if (c & 1) {
 			c &= ~0x1;
 			*(p + c) = bus_space_read_1(sc->sc_memt, sc->sc_memh,
@@ -2889,9 +2890,9 @@
 	/* XXX we may be making poor assumptions here but lets hope */
 	switch ((off|(bus_addr_t)p) & 0x03) {
 	case 0:
-		if ((n4 = (c >> 2))) {
+		if ((n4 = (c >> 2)) != 0) {
 			bus_space_write_region_4(sc->sc_memt, sc->sc_memh, off,
-			    p, n4);
+			    (u_int32_t *)p, n4);
 			tmp = c & ~0x3;
 			c &= 0x3;
 			p += tmp;
@@ -2909,9 +2910,9 @@
 		}
 		break;
 	case 2:
-		if ((n2 = (c >> 1)))
+		if ((n2 = (c >> 1)) != 0)
 			bus_space_write_region_2(sc->sc_memt, sc->sc_memh, off,
-			    p, n2);
+			    (u_int16_t *)p, n2);
 		if (c & 0x1) {
 			c &= ~0x1;
 			bus_space_write_1(sc->sc_memt, sc->sc_memh,

-- 
Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 24 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++