Subject: Re: Arp problems on recent -current kernel?
To: None <port-pmax@NetBSD.ORG>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 04/18/1995 23:41:56
cgd writes:

>you need a change similar to the ones below, in your if_le.
>(the following changes were pulled fromthe sparc if_le, so may or may
>not drop right in.)

the following works for me -- tho' there's still some lint in
how leinit() and friends are declared.  

I guess the line setting if_output should be deleted, not
just commented out, too.

--Jonathan


*** if_le.c.DIST	Mon Nov 21 14:40:28 1994
--- if_le.c	Tue Apr 18 23:16:35 1995
***************
*** 164,169 ****
--- 164,171 ----
  extern u_long le_iomem;
  extern u_long asic_base;
  
+ extern void lestart(struct ifnet *);
+ 
  /*
   * Test to see if device is present.
   * Return true if found and initialized ok.
***************
*** 179,185 ****
  	struct ifnet *ifp = &le->sc_if;
  	u_char *cp;
  	int i;
! 	extern int leinit(), lereset(), leioctl(), lestart(), ether_output();
  
  	switch (pmax_boardtype) {
  	case DS_PMAX:
--- 181,187 ----
  	struct ifnet *ifp = &le->sc_if;
  	u_char *cp;
  	int i;
! 	extern int leinit(), lereset(), leioctl(), ether_output();
  
  	switch (pmax_boardtype) {
  	case DS_PMAX:
***************
*** 253,259 ****
  	ifp->if_mtu = ETHERMTU;
  	ifp->if_reset = lereset;
  	ifp->if_ioctl = leioctl;
! 	ifp->if_output = ether_output;
  	ifp->if_start = lestart;
  #ifdef MULTICAST
  	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
--- 255,261 ----
  	ifp->if_mtu = ETHERMTU;
  	ifp->if_reset = lereset;
  	ifp->if_ioctl = leioctl;
! 	/*ifp->if_output = ether_output;*/
  	ifp->if_start = lestart;
  #ifdef MULTICAST
  	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
***************
*** 468,474 ****
  		s = splnet();
  		ifp->if_flags |= IFF_RUNNING;
  		lereset(unit);
! 	        (void) lestart(ifp);
  		splx(s);
  	}
  }
--- 470,476 ----
  		s = splnet();
  		ifp->if_flags |= IFF_RUNNING;
  		lereset(unit);
! 	        lestart(ifp);
  		splx(s);
  	}
  }
***************
*** 483,488 ****
--- 485,491 ----
   * off of the interface queue, and copy it to the interface
   * before starting the output.
   */
+ void
  lestart(ifp)
  	struct ifnet *ifp;
  {
***************
*** 493,499 ****
  	int len = 0;
  
  	if ((le->sc_if.if_flags & IFF_RUNNING) == 0)
! 		return (0);
  	while (bix != le->sc_tmd) {
  		if (LER2V_tmd1(tmd) & LE_OWN)
  			panic("lestart");
--- 496,502 ----
  	int len = 0;
  
  	if ((le->sc_if.if_flags & IFF_RUNNING) == 0)
! 		return;
  	while (bix != le->sc_tmd) {
  		if (LER2V_tmd1(tmd) & LE_OWN)
  			panic("lestart");
***************
*** 519,525 ****
  		LERDWR(ler0, LE_TDMD | LE_INEA, le->sc_r1->ler1_rdp);
  	}
  	le->sc_tmdnext = bix;
! 	return (0);
  }
  
  /*
--- 522,528 ----
  		LERDWR(ler0, LE_TDMD | LE_INEA, le->sc_r1->ler1_rdp);
  	}
  	le->sc_tmdnext = bix;
! 	return;
  }
  
  /*
***************
*** 617,623 ****
  	}
  	if (bix == le->sc_tmdnext)
  		le->sc_if.if_flags &= ~IFF_OACTIVE;
! 	(void) lestart(&le->sc_if);
  }
  
  #define	LENEXTRMP \
--- 620,626 ----
  	}
  	if (bix == le->sc_tmdnext)
  		le->sc_if.if_flags &= ~IFF_OACTIVE;
! 	lestart(&le->sc_if);
  }
  
  #define	LENEXTRMP \
***************
*** 906,915 ****
  		switch (ifa->ifa_addr->sa_family) {
  #ifdef INET
  		case AF_INET:
! 			leinit(ifp->if_unit);	/* before arpwhohas */
! 			((struct arpcom *)ifp)->ac_ipaddr =
! 				IA_SIN(ifa)->sin_addr;
! 			arpwhohas((struct arpcom *)ifp, &IA_SIN(ifa)->sin_addr);
  			break;
  #endif
  #ifdef NS
--- 909,916 ----
  		switch (ifa->ifa_addr->sa_family) {
  #ifdef INET
  		case AF_INET:
! 			(void)leinit(ifp->if_unit);
! 			arp_ifinit(&le->sc_ac, ifa);
  			break;
  #endif
  #ifdef NS