*BSD News Article 21761


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!spool.mu.edu!sol.ctr.columbia.edu!news.kei.com!bloom-beacon.mit.edu!ai-lab!life.ai.mit.edu!mycroft
From: mycroft@duality.gnu.ai.mit.edu (Charles Hannum)
Newsgroups: comp.os.386bsd.questions
Subject: Re: NE1000
Date: 01 Oct 1993 23:56:16 GMT
Organization: MIT Artificial Intelligence Lab
Lines: 114
Message-ID: <MYCROFT.93Oct1195616@duality.gnu.ai.mit.edu>
References: <9309301740.AA10498@fee.unicamp.br>
NNTP-Posting-Host: duality.gnu.ai.mit.edu
In-reply-to: Gorgonio@fee.unicamp.br's message of 30 Sep 1993 12:40:35 -0500


In article <9309301740.AA10498@fee.unicamp.br> Gorgonio@fee.unicamp.br
writes:

   [...], but the device driver is getting a wrong ethernet
   address. Look:

	   ne0 at 0x300-0x30f irq 5 on isa
	   ne0: ne1000 ethernet address 00:4e:2a:00:00:00
						 ^^^^^^^^

The following patch to if_ne.c fixes this.

   What does this isr 1[57] mean?

A rather cryptic message; it means the ring buffer overflowed.

	   3. Isn't possible to use a ne1 device driver?

There was a really inane bug in neprobe().  The following patch should
also fix it.

PLEASE NOTE: This patch is not tested!  I would recommend using the
current version of if_ed.c instead.

===================================================================
RCS file: /b/source/CVS/src/sys/arch/i386/isa/if_ne.c,v
retrieving revision 1.9
retrieving revision 1.12
diff -c -r1.9 -r1.12
*** 1.9	1993/07/17 16:41:27
--- 1.12	1993/10/01 23:12:04
***************
*** 32,38 ****
   * SUCH DAMAGE.
   *
   *	from: @(#)if_ne.c	7.4 (Berkeley) 5/21/91
!  *	$Id: if_ne.c,v 1.9 1993/07/17 16:41:27 mycroft Exp $
   */
  
  /*
--- 32,38 ----
   * SUCH DAMAGE.
   *
   *	from: @(#)if_ne.c	7.4 (Berkeley) 5/21/91
!  *	$Id: if_ne.c,v 1.12 1993/10/01 23:12:04 mycroft Exp $
   */
  
  /*
***************
*** 127,139 ****
  
  #define	PAT(n)	(0xa55a + 37*(n))
  
! u_short boarddata[16];
   
  neprobe(dvp)
  	struct isa_device *dvp;
  {
  	int val, i, s, sum, bytemode = 1, pat;
! 	register struct ne_softc *ns = &ne_softc[0];
  	register nec;
  
  #ifdef lint
--- 127,139 ----
  
  #define	PAT(n)	(0xa55a + 37*(n))
  
! u_char boarddata[16];
   
  neprobe(dvp)
  	struct isa_device *dvp;
  {
  	int val, i, s, sum, bytemode = 1, pat;
! 	register struct ne_softc *ns = &ne_softc[dvp->id_unit];
  	register nec;
  
  #ifdef lint
***************
*** 237,243 ****
  	nefetch (ns, (caddr_t)boarddata, 0, sizeof(boarddata));
  
  	for(i=0; i < 6; i++)
! 		ns->ns_addrp[i] = boarddata[i];
  	splx(s);
  	return (16);
  }
--- 237,243 ----
  	nefetch (ns, (caddr_t)boarddata, 0, sizeof(boarddata));
  
  	for(i=0; i < 6; i++)
! 		ns->ns_addrp[i] = boarddata[i*(2-bytemode)];
  	splx(s);
  	return (16);
  }
***************
*** 643,650 ****
  
  	/* Receiver ovverun? */
  	if (isr & DSIS_ROVRN) {
! 		log(LOG_ERR, "ne%d: error: isr %x\n", ns-ne_softc, isr
! 			/*, DSIS_BITS*/);
  		outb(nec+ds0_rbcr0, 0);
  		outb(nec+ds0_rbcr1, 0);
  		outb(nec+ds0_tcr, DSTC_LB0);
--- 643,650 ----
  
  	/* Receiver ovverun? */
  	if (isr & DSIS_ROVRN) {
! 		log(LOG_ERR, "ne%d: ring buffer overflow; isr=%x\n",
! 		    ns-ne_softc, isr/*, DSIS_BITS*/);
  		outb(nec+ds0_rbcr0, 0);
  		outb(nec+ds0_rbcr1, 0);
  		outb(nec+ds0_tcr, DSTC_LB0);