Subject: Re: EtherM
To: Dave J Thorn <dave@axa.co.uk>
From: Ale Terlevich <A.I.Terlevich@durham.ac.uk>
List: port-arm32
Date: 05/28/1997 11:38:55
On Wed, 28 May 1997, Dave J Thorn wrote:

> Neil,
> 	While I respect the fact that the RiscBSD people (AKA Causality) 
> have other things to do, can I ask about the (new) EtherH driver. People 
> have been talking about a new version for some time and I was wondering 
> when it will get released, surely if it has been written it can just be 
> merged into the source tree ? ie Why the month wait ?
> 
> 	Please explain where I've gone wrong here,
> 
> 		Yours,
> 
> 			Dave Thorn
> 			(Who managed to write a largish X application 
> 			with the EtherH dirve going belly up every hour or so.)

   I've managed to get my if_eh.c pretty stable simply by adding a line 
to reset the card after every transmit error (This used to hang it). I've 
also increased the speed by commenting out most of the debug/error printfs.

  Here's the diff against sys/arch/arm32/podulebus/if_eh.c.  If've been 
using it for AGES now with no problems.

Ale.

*** if_eh.c.orig	Sun Mar 16 11:22:00 1997
--- if_eh.c	Wed May 28 11:34:27 1997
***************
*** 551,557 ****
  	        /* And blat it to the card */
  
  		if (eh_copyout ( sc, txbuf, sc->sc_tbs[nextbuf], len ) == 0) {
! 			printf("ehstart: failed to load packet\n");
  			continue;
  		}
  
--- 551,557 ----
  	        /* And blat it to the card */
  
  		if (eh_copyout ( sc, txbuf, sc->sc_tbs[nextbuf], len ) == 0) {
! /*			printf("ehstart: failed to load packet\n");*/
  			continue;
  		}
  
***************
*** 724,742 ****
  
  	if ((status&COM_ABORT)==0) {
  	        int dummy=0;
! 		printf("EHDEBUG: Remote %d wasn't finished : spl level %d\n", type, s);
  		SetReg(EH_COMMAND, status|COM_ABORT);
! 		printf("EHDEBUG: SetReg done : status %d : type %d\n", status, type);
  		switch(type) {
  		case COM_READ:
  			dummy = GetReg ( EH_DATA_PORT );
  			break;
  		case COM_WRITE:
! 			printf ( "EHDEBUG: COM_WRITE : About to SetReg ( EH_DATA_PORT, dummy );\n" );
  			/*SetReg ( EH_DATA_PORT, dummy );*/
  			break;
! 		default:
! 		    printf("EHDEBUG: default : type = %d\n", type);
  		}
  		ehinit (sc);
  		splx(s);	/* XXX - jasper */
--- 724,742 ----
  
  	if ((status&COM_ABORT)==0) {
  	        int dummy=0;
! /*		printf("EHDEBUG: Remote %d wasn't finished : spl level %d\n", type, s);*/
  		SetReg(EH_COMMAND, status|COM_ABORT);
! /*		printf("EHDEBUG: SetReg done : status %d : type %d\n", status, type);*/
  		switch(type) {
  		case COM_READ:
  			dummy = GetReg ( EH_DATA_PORT );
  			break;
  		case COM_WRITE:
! /*			printf ( "EHDEBUG: COM_WRITE : About to SetReg ( EH_DATA_PORT, dummy );\n" );*/
  			/*SetReg ( EH_DATA_PORT, dummy );*/
  			break;
! /*		default:
! 		    printf("EHDEBUG: default : type = %d\n", type);*/
  		}
  		ehinit (sc);
  		splx(s);	/* XXX - jasper */
***************
*** 1206,1212 ****
  
  	if ( isr & ISR_RXE ) {
  		int status = GetReg ( EH_RSR );
! 		PRINTF ( "eh: Receive Error:" );
  		if ( status&RSR_PRX )
  			PRINTF ( " packet received intact (this should happen)" );
  		if ( status&RSR_CRC )
--- 1206,1212 ----
  
  	if ( isr & ISR_RXE ) {
  		int status = GetReg ( EH_RSR );
! 		/*		PRINTF ( "eh: Receive Error:" );
  		if ( status&RSR_PRX )
  			PRINTF ( " packet received intact (this should happen)" );
  		if ( status&RSR_CRC )
***************
*** 1219,1225 ****
  			PRINTF ( " missed packet" );
  		if ( status&RSR_DIS )
  			PRINTF ( " receiver disabled" );
! 		printf ( "\n" );
  		INTR_ACK ( ISR_RXE );
  		ehinit (sc);
  		splx(s);    /* XXX - jasper */
--- 1219,1225 ----
  			PRINTF ( " missed packet" );
  		if ( status&RSR_DIS )
  			PRINTF ( " receiver disabled" );
! 		printf ( "\n" );*/
  		INTR_ACK ( ISR_RXE );
  		ehinit (sc);
  		splx(s);    /* XXX - jasper */
***************
*** 1249,1262 ****
  		if ( status&TSR_ABT )
  			PRINTF ( "eh: too many collisions\n" );
  
! 		if ( status&TSR_CRS )
  			PRINTF ( "eh: no carrier\n" );
  
  		if ( status&TSR_CDH )
  			PRINTF ( "eh: tranceiver failure, no heartbeat \n" );
  
  		if ( status&TSR_OWC )
! 			PRINTF ( "eh: out of window \n" );
  
  		if ( status&(TSR_ABT|TSR_CRS|TSR_FU|TSR_CDH|TSR_OWC) )
  			ifp->if_oerrors++;
--- 1249,1262 ----
  		if ( status&TSR_ABT )
  			PRINTF ( "eh: too many collisions\n" );
  
! /*		if ( status&TSR_CRS )
  			PRINTF ( "eh: no carrier\n" );
  
  		if ( status&TSR_CDH )
  			PRINTF ( "eh: tranceiver failure, no heartbeat \n" );
  
  		if ( status&TSR_OWC )
! 			PRINTF ( "eh: out of window \n" );*/
  
  		if ( status&(TSR_ABT|TSR_CRS|TSR_FU|TSR_CDH|TSR_OWC) )
  			ifp->if_oerrors++;
***************
*** 1266,1272 ****
  
  	if ( isr & ISR_TXE ) {
  		INTR_ACK ( ISR_TXE );
! 		PRINTF ( "ehintr: Transmit error\n" );
  	}
  
  	if ( isr & ISR_OVW ) {
--- 1266,1272 ----
  
  	if ( isr & ISR_TXE ) {
  		INTR_ACK ( ISR_TXE );
! 		ehinit (sc);
  	}
  
  	if ( isr & ISR_OVW ) {