Subject: Re: DEFPA-DA FDDI on NetBSD/sparc64?
To: Sean Caron <caron.sean@gmail.com>
From: Jochen Kunz <jkunz@unixag-kl.fh-kl.de>
List: port-sparc64
Date: 04/14/2006 22:41:04
--Multipart_Fri__14_Apr_2006_22_41_04_+0200_r=6g81GlGbG0i57D
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Tue, 11 Apr 2006 22:49:14 -0400
"Sean Caron" <caron.sean@gmail.com> wrote:

> I say "ifconfig fpa0 up".. just the simplest thing ever, not even
> assign an address to it, and I get:
>=20
> fpa0: Unsolicited Event: Station: Unknown Event #0
>=20
> just scrolling down the screen infinitely, and the box is locked hard.
I just remembered. fpa(4) does dirty tricks with bus_dma(9) it should
not do. You will need the attached patch to make fpa(4) work on sparc /
sparc64.
--=20


tsch=FC=DF,
       Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz/


--Multipart_Fri__14_Apr_2006_22_41_04_+0200_r=6g81GlGbG0i57D
Content-Type: text/plain; name=defpa-fpa-pdq-pfusch.patch
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename=defpa-fpa-pdq-pfusch.patch

--- pdq_ifsubr.c.orig	2003-02-26 07:31:10.000000000 +0100
+++ pdq_ifsubr.c	2004-12-09 15:18:19.000000000 +0100
@@ -596,7 +596,11 @@
     not_ok = bus_dmamem_alloc(sc->sc_dmatag,
 			 sizeof(*pdq->pdq_dbp), sizeof(*pdq->pdq_dbp),
 			 sizeof(*pdq->pdq_dbp), db_segs, 1, &db_nsegs,
+#if defined(__sparc__) || defined(__sparc64__)
+			 BUS_DMA_NOWAIT | BUS_DMA_COHERENT);
+#else
 			 BUS_DMA_NOWAIT);
+#endif
     if (!not_ok) {
 	steps = 1;
 	not_ok = bus_dmamem_map(sc->sc_dmatag, db_segs, db_nsegs,
@@ -646,9 +650,14 @@
 	cb_segs[0] = db_segs[0];
 	cb_segs[0].ds_addr += offsetof(pdq_descriptor_block_t, pdqdb_consumer);
 	cb_segs[0].ds_len = sizeof(pdq_consumer_block_t);
+#if defined(__sparc__) || defined(__sparc64__)
+	pdq->pdq_cbp = (pdq_consumer_block_t*)((unsigned long int)pdq->pdq_dbp +
+	    (unsigned long int)offsetof(pdq_descriptor_block_t,pdqdb_consumer));
+#else
 	not_ok = bus_dmamem_map(sc->sc_dmatag, cb_segs, 1,
-				sizeof(*pdq->pdq_cbp), (caddr_t *) &pdq->pdq_cbp,
+				sizeof(*pdq->pdq_cbp), (caddr_t *)&pdq->pdq_cbp,
 				BUS_DMA_NOWAIT|BUS_DMA_COHERENT);
+#endif
     }
     if (!not_ok) {
 	steps = 9;

--Multipart_Fri__14_Apr_2006_22_41_04_+0200_r=6g81GlGbG0i57D--