From jin@pesto.lbl.gov  Wed Sep 20 15:23:14 1995
Received: from pesto.lbl.gov (pesto.lbl.gov [128.3.196.67])
          by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id PAA03434
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Sep 1995 15:23:13 -0700
Received: (from jin@localhost) by pesto.lbl.gov (8.6.11/8.6.9) id PAA00315; Wed, 20 Sep 1995 15:23:11 GMT
Message-Id: <199509201523.PAA00315@pesto.lbl.gov>
Date: Wed, 20 Sep 1995 15:23:11 GMT
From: "Jin Guojun[ITG]" <jin@pesto.lbl.gov>
Reply-To: jin@pesto.lbl.gov
To: FreeBSD-gnats-submit@freebsd.org
Subject: 3Com 3C5x9 probe problem
X-Send-Pr-Version: 3.2

>Number:         730
>Category:       kern
>Synopsis:       3Com 3C5x9 probe problem
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gibbs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 20 15:30:01 PDT 1995
>Closed-Date:    Sun Mar 22 14:19:59 PST 1998
>Last-Modified:  Sun Mar 22 14:21:30 PST 1998
>Originator:     Jin Guojun[ITG]
>Release:        FreeBSD 2.0-BUILT-19950628 i386
>Organization:
/-------------- Jin Guojun ------------ v ---- Internet: g_jin@lbl.gov ----\
|	Imaging & Distributed Computing | Usenet: ucbvax!g_jin@lbl.gov	   |
|	Lawrence Berkeley Laboratory	| Bitnet:	--		   |
|	50B-2239, Berkeley, CA 94720	-  jin%george.lbl.gov@Csa3.LBL.Gov |
\--Ph#:(510) 486-7531 + Fax: 486-6363 --^--http://www-itg.lbl.gov/ITG.html-/
>Environment:

	3Com ethernet card + newer Pentinum motherboard

>Description:

	Fail to initialize 3Com 3C5x9 card on new Pentinum motherboard

>How-To-Repeat:

	Fixed in /sys/i386/isa/if_ep.c -- See patch below
	Please update the installation floppy (boot.flp) A.S.A.P.
	Thanks.

>Fix:
	

*** if_ep.c	Wed Sep 20 15:13:59 1995
--- if_ep.old	Wed Sep 20 15:06:59 1995
***************
*** 167,174 ****
  {
      int i;
  
!     for (i = 0; is_eeprom_busy(IS_BASE) && i < MAX_EEPROMBUSY; i++)
! 	DELAY(10);
      if (i >= MAX_EEPROMBUSY) {
  	printf("ep%d: eeprom failed to come ready.\n", is->id_unit);
  	return (0);
--- 166,172 ----
  {
      int i;
  
!     for (i = 0; is_eeprom_busy(IS_BASE) && i < MAX_EEPROMBUSY; i++);
      if (i >= MAX_EEPROMBUSY) {
  	printf("ep%d: eeprom failed to come ready.\n", is->id_unit);
  	return (0);
***************
*** 213,219 ****
          /* Look for the ISA boards. Init and leave them actived */
  	outb(id_port, 0xc0);	/* Global reset */
  	DELAY(10000);
! 	for (i = EP_MAX_BOARDS; i--;) {
  	    send_ID_sequence(id_port);
  
  	    data = get_eeprom_data(id_port, EEPROM_MFG_ID);
--- 211,219 ----
          /* Look for the ISA boards. Init and leave them actived */
  	outb(id_port, 0xc0);	/* Global reset */
  	DELAY(10000);
! 	for (i = 0; i < EP_MAX_BOARDS; i++) {
! 	    outb(id_port, 0);
! 	    outb(id_port, 0);
  	    send_ID_sequence(id_port);
  
  	    data = get_eeprom_data(id_port, EEPROM_MFG_ID);
***************
*** 225,247 ****
  		data = get_eeprom_data(id_port, j);
  
  	    ep_board[neisa+nisa].epb_used = 0;
! 	    ep_board[neisa+nisa].epb_addr =
  		(get_eeprom_data(id_port, EEPROM_ADDR_CFG) & 0x1f) * 0x10 + 0x200;
  	    outb(id_port, ep_current_tag);	/* tags board */
! 	    outb(id_port, 0xE0 | (ep_board[neisa+nisa++].epb_addr>>4) & 0x1F);
  	    ep_current_tag--;
  	}
  
  	ep_board[neisa+nisa].epb_addr = 0;
  	if (neisa) {
! 	    printf("%d 3C579 board(s) on EISA found at", neisa);
  	    for (j = 0; ep_board[j].epb_addr; j++)
  		if (ep_board[j].epb_addr >= EP_EISA_START)
  		    printf(" 0x%x", ep_board[j].epb_addr);
  	    printf("\n");
  	}
  	if (nisa) {
! 	    printf("%d 3C509 board(s) on ISA found at", nisa);
  	    for (j = 0; ep_board[j].epb_addr; j++)
  		if (ep_board[j].epb_addr < EP_EISA_START)
  		    printf(" 0x%x", ep_board[j].epb_addr);
--- 225,247 ----
  		data = get_eeprom_data(id_port, j);
  
  	    ep_board[neisa+nisa].epb_used = 0;
! 	    ep_board[neisa+nisa++].epb_addr =
  		(get_eeprom_data(id_port, EEPROM_ADDR_CFG) & 0x1f) * 0x10 + 0x200;
  	    outb(id_port, ep_current_tag);	/* tags board */
! 	    outb(id_port, ACTIVATE_ADAPTER_TO_CONFIG);
  	    ep_current_tag--;
  	}
  
  	ep_board[neisa+nisa].epb_addr = 0;
  	if (neisa) {
! 	    printf("%d 3C5x9 board(s) on EISA found at", neisa);
  	    for (j = 0; ep_board[j].epb_addr; j++)
  		if (ep_board[j].epb_addr >= EP_EISA_START)
  		    printf(" 0x%x", ep_board[j].epb_addr);
  	    printf("\n");
  	}
  	if (nisa) {
! 	    printf("%d 3C5x9 board(s) on ISA found at", nisa);
  	    for (j = 0; ep_board[j].epb_addr; j++)
  		if (ep_board[j].epb_addr < EP_EISA_START)
  		    printf(" 0x%x", ep_board[j].epb_addr);
***************
*** 273,283 ****
  	if( ep_board[i].epb_used || ep_board[i].epb_addr != IS_BASE)
  	    return 0;
  
- 	ep_board[i].epb_used=1;
  	if (inw(IS_BASE + EP_W0_EEPROM_COMMAND) & EEPROM_TST_MODE)
  	    printf("ep%d: 3c5x9 at 0x%x in test mode. Erase pencil mark!\n",
! 		   is->id_unit, IS_BASE),
! 		ep_board[i].epb_used++;	/* remember pencil mark!	*/
  	return 1;
      }
  }
--- 273,282 ----
  	if( ep_board[i].epb_used || ep_board[i].epb_addr != IS_BASE)
  	    return 0;
  
  	if (inw(IS_BASE + EP_W0_EEPROM_COMMAND) & EEPROM_TST_MODE)
  	    printf("ep%d: 3c5x9 at 0x%x in test mode. Erase pencil mark!\n",
! 		   is->id_unit, IS_BASE);
! 	ep_board[i].epb_used=1;
  	return 1;
      }
  }
***************
*** 1273,1281 ****
  {
      int cx, al;
  
!     outb(port, 0);
!     outb(port, 0);
!     for (al = cx = 0xff; cx--;) {
  	outb(port, al);
  	al <<= 1;
  	if (al & 0x100)
--- 1272,1278 ----
  {
      int cx, al;
  
!     for (al = 0xff, cx = 0; cx < 255; cx++) {
  	outb(port, al);
  	al <<= 1;
  	if (al & 0x100)
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gibbs 
Responsible-Changed-By: gibbs 
Responsible-Changed-When: Sun Feb 25 17:57:56 PST 1996 
Responsible-Changed-Why:  
State-Changed-From-To: open->feedback 
State-Changed-By: gibbs 
State-Changed-When: Sun Feb 25 17:58:39 PST 1996 
State-Changed-Why:  
I'll review this patch once I get documentation for these cards. 
Is this still a problem for you? 

From: Studded <Studded@dal.net>
To: freebsd-gnats-submit@freebsd.org, jin@pesto.lbl.gov
Cc:  Subject: Re: kern/730: 3Com 3C5x9 probe problem
Date: Sun, 22 Mar 1998 13:37:52 -0800

 Can we close this PR? It's very old and I use a 3c509 so I know it
 works. :)
 
 Doug
State-Changed-From-To: feedback->closed 
State-Changed-By: steve 
State-Changed-When: Sun Mar 22 14:19:59 PST 1998 
State-Changed-Why:  
Two years have passed since Justin last looked at this.  One 
can assume that he has received the requested docs and has 
since corrected the problem. 
>Unformatted:
