From nobody@FreeBSD.org  Wed Feb 23 14:44:55 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AE25016A4CF
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 23 Feb 2005 14:44:55 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 88C1F43D66
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 23 Feb 2005 14:44:55 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j1NEitw0013304
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 23 Feb 2005 14:44:55 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j1NEitF5013303;
	Wed, 23 Feb 2005 14:44:55 GMT
	(envelope-from nobody)
Message-Id: <200502231444.j1NEitF5013303@www.freebsd.org>
Date: Wed, 23 Feb 2005 14:44:55 GMT
From: Paul <mirnshi@163.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: lnc0 can NOT be detected in vmware 4.5.2 while using PXE to load FreebSD 4.x
X-Send-Pr-Version: www-2.3

>Number:         77982
>Category:       kern
>Synopsis:       [lnc] [patch] lnc0 can NOT be detected in vmware 4.5.2 while using PXE to load FreebSD 4.x
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 23 14:50:23 GMT 2005
>Closed-Date:    Thu Jun 05 09:39:35 UTC 2008
>Last-Modified:  Wed Apr 30 05:10:00 UTC 2014
>Originator:     Paul
>Release:        4.10 4.11
>Organization:
>Environment:
FreeBSD bsd 4.11-RELEASE FreeBSD 4.11-RELEASE #0: Wed Feb 16 20:41:07 CST 2005     root@bsd:/GENERIC  i386
>Description:
The driver can NOT work in vmware 4.5.2(79C970A) while using PXE.
The lnc0 can not be detected. It is same as
http://lists.freebsd.org/pipermail/freebsd-stable/2004-October/008971.html

It should be reset but NOT, see patch.
>How-To-Repeat:
pxe boot in vmware
>Fix:
--- i386/isa/if_lnc.c.orig   Wed Feb 13 08:43:10 2002
+++ i386/isa/if_lnc.c   Wed Feb 23 17:15:41 2005
@@ -114,6 +114,7 @@
   int rap;
   int rdp;
   int bdp;
+   int reset;
#ifdef DEBUG
   int lnc_debug;
#endif
@@ -1120,13 +1121,20 @@
{
   u_long chip_id;
   int type;
-
-   /*
+   int reset_val;
+   
+   /*
    * The PCnet family don't reset the RAP register on reset so we'll
    * have to write during the probe :-) It does have an ID register
    * though so the probe is just a matter of reading it.
+    *
+    * THAT can NOT work in vmware 4.5.2(79C970A) while using PXE.
+    * The lnc0 can not be detected, but lnc1 or/and lnc2 fine.
+    * So it's better to reset first.
+    *                                       -- Paul Meng
    */
-
+   reset_val = inw(sc->reset);
+   outw(reset_val, sc->reset);
   if ((type = lance_probe(sc))) {
      chip_id = read_csr(sc, CSR89);
      chip_id <<= 16;
@@ -1293,6 +1301,7 @@
      sc->rap = iobase + PCNET_RAP;
      sc->rdp = iobase + PCNET_RDP;
      sc->bdp = iobase + PCNET_BDP;
+      sc->reset = iobase + PCNET_RESET;

      sc->nic.ic = pcnet_probe(sc);
      if (sc->nic.ic >= PCnet_32) { 
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Thu Jun 5 09:38:05 UTC 2008 
State-Changed-Why:  
Unfortunately since this PR was submitted, the lnc driver was deprecated. 
The Lance style hardware is supported by the le and pnc drivers. 

Thanks for submission and sorry that it didn't work out. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77982 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/77982: commit references a PR
Date: Wed, 30 Apr 2014 05:00:56 +0000 (UTC)

 Author: dteske
 Date: Wed Apr 30 05:00:52 2014
 New Revision: 265128
 URL: http://svnweb.freebsd.org/changeset/base/265128
 
 Log:
   Fix lnc0 detection in VMware when PXE booting.
   This is a direct commit to stable/4 since lnc(4) was deprecated
   and does not exist beyond this branch.
   
   Submitted by:	Paul Meng <mirnshi@163.com>
   PR:		kern/77982
 
 Modified:
   stable/4/sys/i386/isa/if_lnc.c
 
 Modified: stable/4/sys/i386/isa/if_lnc.c
 ==============================================================================
 --- stable/4/sys/i386/isa/if_lnc.c	Wed Apr 30 04:44:51 2014	(r265127)
 +++ stable/4/sys/i386/isa/if_lnc.c	Wed Apr 30 05:00:52 2014	(r265128)
 @@ -114,6 +114,7 @@ struct lnc_softc {
  	int rap;
  	int rdp;
  	int bdp;
 +	int reset;
  #ifdef DEBUG
  	int lnc_debug;
  #endif
 @@ -1120,6 +1121,7 @@ pcnet_probe(struct lnc_softc *sc)
  {
  	u_long chip_id;
  	int type;
 +	int reset_val;
  
  	/*
  	 * The PCnet family don't reset the RAP register on reset so we'll
 @@ -1127,6 +1129,8 @@ pcnet_probe(struct lnc_softc *sc)
  	 * though so the probe is just a matter of reading it.
  	 */
  
 +	reset_val = inw(sc->reset);
 +	outw(reset_val, sc->reset);
  	if ((type = lance_probe(sc))) {
  		chip_id = read_csr(sc, CSR89);
  		chip_id <<= 16;
 @@ -1293,6 +1297,7 @@ lnc_attach_ne2100_pci(int unit, unsigned
  		sc->rap = iobase + PCNET_RAP;
  		sc->rdp = iobase + PCNET_RDP;
  		sc->bdp = iobase + PCNET_BDP;
 +		sc->reset = iobase + PCNET_RESET;
  
  		sc->nic.ic = pcnet_probe(sc);
  		if (sc->nic.ic >= PCnet_32) {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
