Subject: wpi(4) fixes for -current NetBSD/amd64
To: NetBSD current <current-users@NetBSD.org>
From: Nicolas Joly <njoly@pasteur.fr>
List: current-users
Date: 01/25/2007 11:46:18
--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


Hi,

A friend just got a new SONY Vaio SZ3XP laptop, which has a `Intel
PRO/Wireless LAN 3945ABG Mini-PCI Adapter' supported by the wpi(4)
driver.

Intel PRO/Wireless LAN 3945ABG Mini-PCI Adapter (miscellaneous network, revision 0x02) at pci2 dev 0 function 0 not configured

I think that nobody used that one outside the i386 arch, as it does
not even compile on amd64 (and other platforms where sizeof size_t an
sizeof int differs) ...

Once this little problem fixed (patch attached), it works fine.

wpi0 at pci2 dev 0 function 0: Intel PRO/Wireless LAN 3945ABG Mini-PCI Adapter (rev. 0x02)
wpi0: interrupting at ioapic0 pin 17 (irq 10)
wpi0: 802.11 address xx:xx:xx:xx:xx:xx
wpi0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wpi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wpi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.

--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="netbsd-wpiamd64.diff"

Index: sys/dev/pci/if_wpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_wpi.c,v
retrieving revision 1.7
diff -u -r1.7 if_wpi.c
--- sys/dev/pci/if_wpi.c	13 Jan 2007 09:39:06 -0000	1.7
+++ sys/dev/pci/if_wpi.c	23 Jan 2007 23:20:09 -0000
@@ -106,7 +106,7 @@
 static int  wpi_alloc_shared(struct wpi_softc *);
 static void wpi_free_shared(struct wpi_softc *);
 static struct wpi_rbuf *wpi_alloc_rbuf(struct wpi_softc *);
-static void wpi_free_rbuf(struct mbuf *, caddr_t, u_int, void *);
+static void wpi_free_rbuf(struct mbuf *, caddr_t, size_t, void *);
 static int  wpi_alloc_rpool(struct wpi_softc *);
 static void wpi_free_rpool(struct wpi_softc *);
 static int  wpi_alloc_rx_ring(struct wpi_softc *, struct wpi_rx_ring *);
@@ -561,7 +561,7 @@
  * Rx buffer is attached is freed.
  */
 static void
-wpi_free_rbuf(struct mbuf* m, caddr_t buf, u_int size, void *arg)
+wpi_free_rbuf(struct mbuf* m, caddr_t buf, size_t size, void *arg)
 {
 	struct wpi_rbuf *rbuf = arg;
 	struct wpi_softc *sc = rbuf->sc;
@@ -2695,7 +2695,7 @@
 		le32toh(hdr.datasz) + le32toh(hdr.bootsz);
 
 	if (size < wsize) {
-		aprint_error("%s: fw file too short: should be %d bytes\n",
+		aprint_error("%s: fw file too short: should be %zd bytes\n",
 			sc->sc_dev.dv_xname, wsize);
 		error = EINVAL;
 		goto fail2;

--Dxnq1zWXvFF0Q93v--