From nobody@FreeBSD.ORG Tue May 11 13:13:22 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id DE34A14C18; Tue, 11 May 1999 13:13:22 -0700 (PDT)
Message-Id: <19990511201322.DE34A14C18@hub.freebsd.org>
Date: Tue, 11 May 1999 13:13:22 -0700 (PDT)
From: banman@wwdg.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: Linksys PCI 10/100 Ethernet cards not wokring.
X-Send-Pr-Version: www-1.0

>Number:         11654
>Category:       conf
>Synopsis:       Linksys PCI 10/100 Ethernet cards not wokring.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    wpaul
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 11 13:20:01 PDT 1999
>Closed-Date:    Thu Jun 24 16:10:49 PDT 1999
>Last-Modified:  Thu Jun 24 16:24:39 PDT 1999
>Originator:     Ryan Banas
>Release:        3.1 RELEASE
>Organization:
None
>Environment:
FreeBSD 3.1-RELEASE FreeBSD 3.1-RELEASE #4: Sat May  8 11:25:27 CDT 1999     :/usr/src/sys/compile/MYKERNEL  i386
>Description:
Due to ignorance on my behalf, here is full information:
Machine is a Dell P2-400, 128MB of ram, 1 ATAPI 40x CD-ROM, 1 4x/8x
Mitsumi ATAPI CD-R, TB Montego Soundcard, 2 Linksys Etherfast 10/100 PCI 
cards, IBM 7200RPM 512k 10GB HDD, and an STB NVidia 8MB RIVA AGP Video 
card.

Both of these cards have been tested, and both do work properly under
DOS, Windows95/98 and Windows NT 4.0.
I could not find any information in the booklets and documentation that
was supplied by Dell, thus I am not sure about bus mastering slots, but
since the cards have worked fine under the other operating systems, I'm
guessing I have them in the appropriate PCI slots. I have tried different
slots previously and they seem to work in any slot as far as I can see.

My kernel seems ok, and upon bootup, the Linksys ethernet cards are found
as pn1 and pn0. However, after each identifaction line, the text,
"Could not map ports" is printed below. And after logging in as root,
there is no pn0 or pn1 interfaces.
I have one of these ethernet cards connected to the HUB of my LAN,
and the other directly to my cable modem. 
I can't seem to figure out why this message has occured. 
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Bill Paul <wpaul@skynet.ctr.columbia.edu>
To: banman@wwdg.com
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: conf/11654: Linksys PCI 10/100 Ethernet cards not wokring.
Date: Tue, 11 May 1999 17:05:45 -0400 (EDT)

 Of all the gin joints in all the towns in all the world, banman@wwdg.com 
 had to walk into mine and say:
 
 > Machine is a Dell P2-400, 128MB of ram, 1 ATAPI 40x CD-ROM, 1 4x/8x
 > Mitsumi ATAPI CD-R, TB Montego Soundcard, 2 Linksys Etherfast 10/100 PCI 
 > cards, IBM 7200RPM 512k 10GB HDD, and an STB NVidia 8MB RIVA AGP Video 
 > card.
 > 
 > Both of these cards have been tested, and both do work properly under
 > DOS, Windows95/98 and Windows NT 4.0.
 > I could not find any information in the booklets and documentation that
 > was supplied by Dell, thus I am not sure about bus mastering slots, but
 > since the cards have worked fine under the other operating systems, I'm
 > guessing I have them in the appropriate PCI slots. I have tried different
 > slots previously and they seem to work in any slot as far as I can see.
 
 But have you tried them one at a time instead of both at once.
  
 > My kernel seems ok, and upon bootup, the Linksys ethernet cards are found
 > as pn1 and pn0. However, after each identifaction line, the text,
 > "Could not map ports" is printed below.
 
 This means the call to pci_map_port() failed. However I don't know
 *why* it failed. Finding out why requires me (or someone smarted than
 me) having access to your system in order to track down the bug. There's
 nothing the driver can do to make pci_map_port() work; either it works
 or it doesn't. If it doesn't, then the problem is either some peculiar
 configuration of your PCI BIOS or some bug in the PCI support code.
 
 No, this is not normal. Yes you are a special case. No, I can't figure
 out what the problem is from here because I can't duplicate it on any
 of my hardware (none of my machines demonstrate this behavior).
 
 The best I can do is a workaround. The correct thing is to have somebody
 who has more insight into the workings of the PCI code than I address this
 issue, but since it that could take forever, I'm going to offer you a
 hack. Actually, there are two hacks:
 
 1) Try the patch included at the end of this message. This attempts to
    read the I/O address of the NIC directly from the PCI registers on
    the card. THIS SHOULD NOT BE BE NECESSARY: pci_map_port() is supposed
    to do this for you. To apply the patch, do the following:
 
    o save this message to a file, e.g. /tmp/pn.patch
    o log in as root
    o cd /sys/pci
    o patch < /tmp/pn.patch
 
    Then compile a new kernel:
 
    o cd /sys/i386/conf
    o config GENERIC
    o cd /sys/compile/GENERIC
    o make depend; make; make install
    o reboot
 
    Obviously, you need the kernel source code for this. Warning: do not
    cut & paste the patch from this message as that will mess up the white
    space. Also, if ther patch(1) utility gives you some warnings about
    the lines being offset, don't worry. As long as it doesn't give you
    an outright failure message it should work okay.
 
 2) Edit /sys/pci/if_pn.c and comment out or remove the line that says:
 
 #define PN_USEIOSPACE
 
    This will cause the code to try and use PCI memory mapped I/O
    instead of programmed I/O. This uses pci_map_mem() instead of
    pci_map_port(). I don't know if this will work, but I'm curious
    to see what it does.
 
 Note: when you try workaround 1), the kernel will print some additional
 lines after it says 'cannot map ports.' I would like you to show me what
 those lines say.
 
 -Bill
 
 -- 
 =============================================================================
 -Bill Paul            (212) 854-6020 | System Manager, Master of Unix-Fu
 Work:         wpaul@ctr.columbia.edu | Center for Telecommunications Research
 Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
 =============================================================================
  "It is not I who am crazy; it is I who am mad!" - Ren Hoek, "Space Madness"
 =============================================================================
 
 *** if_pn.c	1999/05/05 19:04:09	1.52
 --- if_pn.c	1999/05/11 20:46:27
 ***************
 *** 1050,1056 ****
   	if (!pci_map_port(config_id, PN_PCI_LOIO,
   					(u_short *)&(sc->pn_bhandle))) {
   		printf ("pn%d: couldn't map ports\n", unit);
 ! 		goto fail;
   	}
   #ifdef __i386__
   	sc->pn_btag = I386_BUS_SPACE_IO;
 --- 1050,1062 ----
   	if (!pci_map_port(config_id, PN_PCI_LOIO,
   					(u_short *)&(sc->pn_bhandle))) {
   		printf ("pn%d: couldn't map ports\n", unit);
 ! 		printf ("pn%d: address was: %x\n", unit,
 ! 		    (u_int32_t)sc->pn_bhandle);
 ! 		sc->pn_bhandle =
 ! 		    pci_conf_read(config_id, PN_PCI_LOIO) & 0xFFFFFFF0;
 ! 		printf ("pn%d: forcing I/O address to: %x\n",
 ! 		    unit, (u_int32_t)sc->pn_bhandle);
 ! 		/*goto fail;*/
   	}
   #ifdef __i386__
   	sc->pn_btag = I386_BUS_SPACE_IO;
 

From: "Daniel C. Sobral" <dcs@newsguy.com>
To: banman@wwdg.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: conf/11654: Linksys PCI 10/100 Ethernet cards not wokring.
Date: Wed, 12 May 1999 23:32:37 +0900

 banman@wwdg.com wrote:
 > 
 > >Description:
 > Due to ignorance on my behalf, here is full information:
 > Machine is a Dell P2-400, 128MB of ram, 1 ATAPI 40x CD-ROM, 1 4x/8x
 > Mitsumi ATAPI CD-R, TB Montego Soundcard, 2 Linksys Etherfast 10/100 PCI
 > cards, IBM 7200RPM 512k 10GB HDD, and an STB NVidia 8MB RIVA AGP Video
 > card.
 
 God bless the ignorants, for it seems they are the only ones who
 provide full information. (Well, not true, actually... :-) but so
 few people do that, that I wished to commend you on it. :)
 
 You could have provided the motherboard chipset and BIOS
 model/version, though. :-)
 
 Also, this message you saw can probably be retrieved through dmesg.
 The dmesg could possibly provide important clues.
 
 --
 Daniel C. Sobral			(8-DCS)
 dcs@newsguy.com
 dcs@freebsd.org
 
 	"Proof of Trotsky's farsightedness is that _none_ of his
 predictions have come true yet."
 
 
 
Responsible-Changed-From-To: freebsd-bugs->wpaul 
Responsible-Changed-By: msmith 
Responsible-Changed-When: Wed Jun 23 17:50:41 PDT 1999 
Responsible-Changed-Why:  
Bill owns the pn driver. 
State-Changed-From-To: open->closed 
State-Changed-By: wpaul 
State-Changed-When: Thu Jun 24 16:10:49 PDT 1999 
State-Changed-Why:  





This problem is most likely due to the 'Plug and Play OS' setting 
in the BIOS being set to "yes" which is wrong. In this mode, the PCI 
BIOS doesn't configure the devices thinking that the OS will do it. 
This only works for Win85/98. 

The workaround patch supplied previously should get around the problem, 
but the bug submitter never responded with the results of applying 
the patch. Since the submitter isn't answering and the problem isn't 
really due to a bug with FreeBSD anyway, this PR is being closed. 

-Bill 
. 
>Unformatted:
