Subject: "fix" for LANCE problem
To: None <port-hp300@NetBSD.ORG>
From: Jason Thorpe <thorpej@OG.ORG>
List: port-hp300
Date: 03/17/1997 09:43:54
Michael Smith's note that the LANCE wasn't interrupting the host led me
to believe that the address filter was not being set properly, since no
changed had been made to the interrupt glue at all...

So, I made the following simple changes, and it works.  However, this
fix is sort of a kludge ... the sc_enaddr softc member shouldn't even
really be there...

I'm going to commit this until Ignatios can track down the problem with
the other code.

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

Index: am7990.c
===================================================================
RCS file: /usr/og/devsrc/netbsd/src/sys/dev/ic/am7990.c,v
retrieving revision 1.1.1.6
diff -c -r1.1.1.6 am7990.c
*** am7990.c	1997/03/16 21:55:41	1.1.1.6
--- am7990.c	1997/03/17 17:23:24
***************
*** 255,265 ****
  #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];
  	am7990_setladrf(&sc->sc_ethercom, init.init_ladrf);
  
  	sc->sc_last_rd = 0;
--- 255,265 ----
  #endif
  		init.init_mode = LE_MODE_NORMAL;
  	init.init_padr[0] =
! 	    (sc->sc_enaddr[1] << 8) | sc->sc_enaddr[0];
  	init.init_padr[1] =
! 	    (sc->sc_enaddr[3] << 8) | sc->sc_enaddr[2];
  	init.init_padr[2] =
! 	    (sc->sc_enaddr[5] << 8) | sc->sc_enaddr[4];
  	am7990_setladrf(&sc->sc_ethercom, init.init_ladrf);
  
  	sc->sc_last_rd = 0;
***************
*** 491,497 ****
  		 */
  		if ((ifp->if_flags & IFF_PROMISC) != 0 &&
  		    (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
! 		    ETHER_CMP(eh->ether_dhost, LLADDR(ifp->if_sadl))) {
  			m_freem(m);
  			return;
  		}
--- 491,497 ----
  		 */
  		if ((ifp->if_flags & IFF_PROMISC) != 0 &&
  		    (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
! 		    ETHER_CMP(eh->ether_dhost, sc->sc_enaddr)) {
  			m_freem(m);
  			return;
  		}
***************
*** 507,513 ****
  	 * destination address (garbage will usually not match).
  	 * Of course, this precludes multicast support...
  	 */
! 	if (ETHER_CMP(eh->ether_dhost, LLADDR(ifp->if_sadl)) &&
  	    ETHER_CMP(eh->ether_dhost, etherbroadcastaddr)) {
  		m_freem(m);
  		return;
--- 507,513 ----
  	 * destination address (garbage will usually not match).
  	 * Of course, this precludes multicast support...
  	 */
! 	if (ETHER_CMP(eh->ether_dhost, sc->sc_enaddr) &&
  	    ETHER_CMP(eh->ether_dhost, etherbroadcastaddr)) {
  		m_freem(m);
  		return;
***************
*** 878,887 ****
  
  			if (ns_nullhost(*ina))
  				ina->x_host =
! 				    *(union ns_host *)LLADDR(ifp->if_sadl);
  			else {
  				bcopy(ina->x_host.c_host,
! 				    LLADDR(ifp->if_sadl),
  				    sizeof(sc->sc_enaddr));
  			}	
  			/* Set new address. */
--- 878,887 ----
  
  			if (ns_nullhost(*ina))
  				ina->x_host =
! 				    *(union ns_host *)sc->sc_enaddr;
  			else {
  				bcopy(ina->x_host.c_host,
! 				    sc->sc_enaddr,
  				    sizeof(sc->sc_enaddr));
  			}	
  			/* Set new address. */