Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 2002 08:31:50 -0700 (PDT)
From:      Alex Smith <alex@sniikt.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   i386/38459: Intel SB82558B NIC won't initialize properly
Message-ID:  <200205231531.g4NFVouq057271@www.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         38459
>Category:       i386
>Synopsis:       Intel SB82558B NIC won't initialize properly
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 23 08:40:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Alex Smith
>Release:        FreeBSD 4.5 cvsup'd to current
>Organization:
>Environment:
FreeBSD nokia.jesterchef.com 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Thu May 16 12:46:51 GMT 2002     jay@magnus.jesterchef.com:/usr/src/sys/compile/JAY  i386
>Description:
a couple years ago, K.J. Koster wrote you guys regarding experiencing
problems getting an Intel SB82558B chip to be recognized correctly on an
Alpha machine. There were several threads regarding the issue, one of
which was from Andrew Gallatin who submitted a patch to for the fxp0
driver to have it read through I/O. K.J. reported the patch worked
swimingly, but it appears that it didn't make it into the main stream
distribution for a couple reasons.

I am having similar problems trying to get this same chip recognized on an
AMD NoName unit. The interesting thing about my dilemma is that I can IP
the interface, I can ping out, I can throw it in promiscuous mode through
tcpdump, I can see traffic coming to the interface, but it won't respond
to ping requests from another box.

The patch I was referring to is here:

Index: if_fxp.c
===================================================================
RCS file: /home/ncvs/src/sys/pci/if_fxp.c,v
retrieving revision 1.77.2.6
diff -u -r1.77.2.6 if_fxp.c
--- if_fxp.c    2000/07/19 14:36:36     1.77.2.6
+++ if_fxp.c    2000/07/25 18:53:08
@@ -515,6 +515,8 @@
        return ENXIO;
 }

+#define FXP_PREFER_IOSPACE
+
 static int
 fxp_attach(device_t dev)
 {
@@ -533,12 +535,31 @@
         * Enable bus mastering.
         */
        val = pci_read_config(dev, PCIR_COMMAND, 2);
+#ifdef FXP_PREFER_IOSPACE       /*XXX*/
+       val |= (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN);
+#else
        val |= (PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
+#endif
        pci_write_config(dev, PCIR_COMMAND, val, 2);

        /*
         * Map control/status registers.
         */
+#ifdef FXP_PREFER_IOSPACE       /*XXX*/
+       device_printf(dev, "using i/o space access");
+       rid = FXP_PCI_IOBA;
+       sc->io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
+                                    0, ~0, 1, RF_ACTIVE);
+       if (!sc->io) {
+               device_printf(dev, "could not map memory");
+               error = ENXIO;
+               goto fail;
+        }
+
+       sc->sc_st = rman_get_bustag(sc->io);
+       sc->sc_sh = rman_get_bushandle(sc->io);
+
+#else
        rid = FXP_PCI_MMBA;
        sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
                                     0, ~0, 1, RF_ACTIVE);
@@ -550,7 +571,7 @@

        sc->sc_st = rman_get_bustag(sc->mem);
        sc->sc_sh = rman_get_bushandle(sc->mem);
-
+#endif
        /*
         * Allocate our interrupt.
         */
@@ -575,7 +596,11 @@
                /* Failed! */
                bus_teardown_intr(dev, sc->irq, sc->ih);
                bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq);
+#ifdef FXP_PREFER_IOSPACE /* XXX */
                bus_release_resource(dev, SYS_RES_MEMORY, FXP_PCI_MMBA,
sc->mem);
+#else
+               bus_release_resource(dev, SYS_RES_IOPORT, FXP_PCI_IOBA,
sc->io);
+#endif
                error = ENXIO;
                goto fail;
        }
@@ -639,8 +664,11 @@
         */
        bus_teardown_intr(dev, sc->irq, sc->ih);
        bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq);
+#ifdef FXP_PREFER_IOSPACE /* XXX */
+       bus_release_resource(dev, SYS_RES_IOPORT, FXP_PCI_IOBA, sc->io);
+#else
        bus_release_resource(dev, SYS_RES_MEMORY, FXP_PCI_MMBA, sc->mem);
-
+#endif
        /*
         * Free all the receive buffers.
         */
Index: if_fxpvar.h
===================================================================
RCS file: /home/ncvs/src/sys/pci/if_fxpvar.h,v
retrieving revision 1.9.2.1
diff -u -r1.9.2.1 if_fxpvar.h
--- if_fxpvar.h 2000/03/29 02:02:39     1.9.2.1
+++ if_fxpvar.h 2000/07/25 18:28:23
@@ -46,6 +46,7 @@
 #else
        struct arpcom arpcom;           /* per-interface network data */
        struct resource *mem;           /* resource descriptor for
registers */
+       struct resource *io;            /* resource descriptor for
registers */
        struct resource *irq;           /* resource descriptor for
interrupt */
        void *ih;                       /* interrupt handler cookie */
 #endif /* __NetBSD__ */

Unfortunately, I don't think this patch will work with the driver version
I'm using (FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.110.2.18 2002/02/11
23:22:43 silby Exp). Would you possibly be able to provide me with a
similar patch to get this working for me?

I'm running 4.5 cvsup'd to Stable and here's some relevant dmesg and
ifconfig info:

# dmesg
Copyright (c) 1992-2002 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD 4.5-RELEASE #0: Thu May 16 12:46:51 GMT 2002
    jay@magnus.jesterchef.com:/usr/src/sys/compile/JAY
Timecounter "i8254"  frequency 1193182 Hz
CPU: AMD-K6(tm) 3D processor (400.91-MHz 586-class CPU)
  Origin = "AuthenticAMD"  Id = 0x58c  Stepping = 12
  Features=0x8021bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,PGE,MMX>
  AMD Features=0x80000800<SYSCALL,3DNow!>
real memory  = 268435456 (262144K bytes)
config> di sn0
config> di lnc0
config> di ie0
config> di fe0
config> di cs0
config> q
avail memory = 256749568 (250732K bytes)
Preloaded elf kernel "kernel" at 0xc0463000.
Preloaded userconfig_script "/boot/kernel.conf" at 0xc046309c.
K6-family MTRR support enabled (2 registers)
md0: Malloc disk
Using $PIR table, 7 entries at 0xc00fd3c0
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
isab0: <Intel 82371AB PCI to ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX4 ATA33 controller> port 0xf000-0xf00f at device 7.1
on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
pci0: <Intel 82371AB/EB (PIIX4) USB controller> at 7.2 irq 11
chip1: <Intel 82371AB Power management controller> port 0x6200-0x620f at
device 7.3 on pci0
fxp0: <Intel Pro 10/100B/100+ Ethernet> port 0x6800-0x681f mem
0xe0000000-0xe00fffff,0xe0300000-0xe0300fff irq 10 at device 13.0 on pci0
fxp0: Ethernet address ff:ff:ff:ff:ff:ff, 10Mbps
fxp1: <Intel Pro 10/100B/100+ Ethernet> port 0x6c00-0x6c1f mem
0xe0100000-0xe01fffff,0xe0302000-0xe0302fff irq 12 at device 14.0 on pci0
fxp1: Ethernet address ff:ff:ff:ff:ff:ff, 10Mbps
fxp2: <Intel Pro 10/100B/100+ Ethernet> port 0x7000-0x701f mem
0xe0200000-0xe02fffff,0xe0301000-0xe0301fff irq 5 at device 15.0 on pci0
fxp2: Ethernet address ff:ff:ff:ff:ff:ff, 10Mbps
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A, console
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
ppc0: parallel port not found.
ad0: 9787MB <QUANTUM FIREBALLlct10 10> [19885/16/63] at ata0-master UDMA33
Mounting root from ufs:/dev/ad0s1a
fxp0: promiscuous mode enabled
fxp0: promiscuous mode disabled

*************************************************************************************

ifconfig -a
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.0.60 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::1c7d:f83c:5680:b5a0%fxp0 prefixlen 64 scopeid 0x1
        ether ff:ff:ff:ff:ff:ff
        media: Ethernet manual
fxp1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ether ff:ff:ff:ff:ff:ff
        media: Ethernet manual
fxp2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ether ff:ff:ff:ff:ff:ff
        media: Ethernet manual
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet 127.0.0.1 netmask 0xff000000
ppp0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
sl0: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 552
faith0: flags=8002<BROADCAST,MULTICAST> mtu 1500

************************************************************************************

# ifconfig -m fxp0
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.0.60 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::1c7d:f83c:5680:b5a0%fxp0 prefixlen 64 scopeid 0x1
        ether ff:ff:ff:ff:ff:ff
        media: Ethernet manual
        supported media:
                media manual

************************************************************************************


Thanks in advance for everyone's help!!

-Alex Smith

>How-To-Repeat:
put an Intel SB82558B NIC in an i386 box and try to get it to initialize on fxp0
>Fix:
I'm hoping if I can get it to initialize through I/O, it will initialize properly.
>Release-Note:
>Audit-Trail:
>Unformatted:

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?200205231531.g4NFVouq057271>