Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 May 1999 14:10:02 -0700 (PDT)
From:      Bill Paul <wpaul@skynet.ctr.columbia.edu>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: conf/11654: Linksys PCI 10/100 Ethernet cards not wokring.
Message-ID:  <199905112110.OAA76668@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/11654; it has been noted by GNATS.

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;
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905112110.OAA76668>