Subject: More on the LANCE lossage
To: None <port-hp300@NetBSD.ORG>
From: Jason Thorpe <thorpej@OG.ORG>
List: port-hp300
Date: 03/17/1997 10:27:20
Attached below is a less-intrusive patch for the LANCE problem.
The lossage appears to have been a screwup on the shift of a signed-char.

        -- Jason R. Thorpe <thorpej@og.org>

Index: am7990.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/am7990.c,v
retrieving revision 1.27
diff -u -r1.27 am7990.c
--- am7990.c	1997/03/17 03:14:03	1.27
+++ am7990.c	1997/03/17 18:17:02
@@ -256,6 +256,7 @@
 	struct leinit init;
 	struct lermd rmd;
 	struct letmd tmd;
+	u_int8_t *myaddr;
 
 #if NBPFILTER > 0
 	if (ifp->if_flags & IFF_PROMISC)
@@ -263,12 +264,11 @@
 	else
 #endif
 		init.init_mode = LE_MODE_NORMAL;
-	init.init_padr[0] =
-	    (LLADDR(ifp->if_sadl)[1] << 8) | LLADDR(ifp->if_sadl)[0];
-	init.init_padr[1] =
-	    (LLADDR(ifp->if_sadl)[3] << 8) | LLADDR(ifp->if_sadl)[2];
-	init.init_padr[2] =
-	    (LLADDR(ifp->if_sadl)[5] << 8) | LLADDR(ifp->if_sadl)[4];
+
+	myaddr = LLADDR(ifp->if_sadl);
+	init.init_padr[0] = (myaddr[1] << 8) | myaddr[0];
+	init.init_padr[1] = (myaddr[3] << 8) | myaddr[2];
+	init.init_padr[2] = (myaddr[5] << 8) | myaddr[4];
 	am7990_setladrf(&sc->sc_ethercom, init.init_ladrf);
 
 	sc->sc_last_rd = 0;