From nobody@FreeBSD.ORG  Fri Jun  2 13:42:40 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 6CCE737B782; Fri,  2 Jun 2000 13:42:40 -0700 (PDT)
Message-Id: <20000602204240.6CCE737B782@hub.freebsd.org>
Date: Fri,  2 Jun 2000 13:42:40 -0700 (PDT)
From: yergeau@gloworm.stanford.edu
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: Linksys PCMPC100 *V2* gets incorrect hardware address
X-Send-Pr-Version: www-1.0

>Number:         18970
>Category:       i386
>Synopsis:       Linksys PCMPC100 *V2* gets incorrect hardware address
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 02 13:50:00 PDT 2000
>Closed-Date:    Sat Jun 17 23:01:26 PDT 2000
>Last-Modified:  Sat Jun 17 23:03:09 PDT 2000
>Originator:     Dan Yergeau
>Release:        4.0
>Organization:
>Environment:
FreeBSD ritter.Stanford.EDU 4.0-RELEASE FreeBSD 4.0-RELEASE #3: Fri Jun  2 12:19:41 PDT 2000     troot@ritter.Stanford.EDU:/usr/src/sys/compile/RITTER  i386
>Description:
Version 2 of this PCMCIA card is incorrectly identified as a NE2000,
and the incorrect MAC address is extracted.

  ed0: address 01:d4:ff:03:00:20, type NE2000 (16 bit)

The MAC address should be 00:e0:98:80:15:df (as printed on the card
and reported by Windoze).


>How-To-Repeat:

>Fix:
/sys/dev/ed/if_ed.c:ed_probe_Novell_generic tries to identify if the
card is NE2000, NE1000, or Linksys by writing a test pattern into
the card's memory at 8k.  This fails for the V2 version of the
Linksys PCMPC100, so ed_get_Linksys doesn't get called to extract
the MAC address in the special way needed for the Linksys (DL10019C).

When I change that conditional in if_ed.c to always succeed, 

=================================================================
***************
*** 1013,1019 ****
  	ed_pio_writemem(sc, test_pattern, 8192, sizeof(test_pattern));
  	ed_pio_readmem(sc, 8192, test_buffer, sizeof(test_pattern));
  
! 	if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) {
  	/* could be either an NE1000 or a Linksys ethernet controller */
  		linksys = ed_get_Linksys(sc);
  		if (linksys) {
--- 1022,1029 ----
  	ed_pio_writemem(sc, test_pattern, 8192, sizeof(test_pattern));
  	ed_pio_readmem(sc, 8192, test_buffer, sizeof(test_pattern));
  
! 	/*if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) {*/
! 	if (1) {
  	/* could be either an NE1000 or a Linksys ethernet controller */
  		linksys = ed_get_Linksys(sc);
  		if (linksys) {
=================================================================

the correct MAC address is not extracted and the card is 
identified as a "Linksys" instead of a "NE2000".

  ed0: address 00:e0:98:80:15:df, type Linksys (16 bit)

Note that I'm not suggesting the above diff as the fix, but it
does point out where the driver needs to be fixed.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ps 
State-Changed-When: Sat Jun 17 23:01:26 PDT 2000 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=18970 
>Unformatted:
