diff options
author | iedowse <iedowse@FreeBSD.org> | 2001-03-02 00:40:06 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2001-03-02 00:40:06 +0000 |
commit | f98bf018d616081b5772282259145a2d066cf42b (patch) | |
tree | 02b836037efad77d3014d53123c73542cc142ed0 /sys/dev | |
parent | 11f2d952f6a02ee56ce81ea30ec037e1077017a0 (diff) | |
download | FreeBSD-src-f98bf018d616081b5772282259145a2d066cf42b.zip FreeBSD-src-f98bf018d616081b5772282259145a2d066cf42b.tar.gz |
There were a few changes missed when this file was converted to
newbus in revision 1.19. As a result, lnc was, I believe, broken
for all PCI cards. The softc fields `lnc_btag' and `lnc_bhandle'
were not initialised, `rap', `rdp' and `bdp' were initialised to
the wrong values, and the size of the DMA ring memory was calculated
incorrectly.
Paul Richards has further cleanups in the pipeline, but this at
least is enough to make the driver usable with VMware.
Approved by: paul
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/lnc/if_lnc_pci.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/lnc/if_lnc_pci.c b/sys/dev/lnc/if_lnc_pci.c index e5a84e7..6c8b05a 100644 --- a/sys/dev/lnc/if_lnc_pci.c +++ b/sys/dev/lnc/if_lnc_pci.c @@ -50,6 +50,7 @@ #include <pci/pcireg.h> #include <pci/pcivar.h> +#include <dev/lnc/if_lncreg.h> #include <dev/lnc/if_lncvar.h> #define AMD_VENDOR_ID 0x1022 @@ -122,6 +123,8 @@ lnc_pci_attach(device_t dev) device_printf(dev, "Cannot setup irq handler\n"); sc->iobase = rman_get_start(sc->portres); + sc->lnc_btag = rman_get_bustag(sc->portres); + sc->lnc_bhandle = rman_get_bushandle(sc->portres); /* XXX temp setting for nic */ sc->nic.ic = PCnet_PCI; @@ -129,15 +132,18 @@ lnc_pci_attach(device_t dev) sc->nic.mem_mode = DMA_FIXED; sc->nrdre = NRDRE; sc->ntdre = NTDRE; - sc->rap = sc->iobase + PCNET_RAP; - sc->rdp = sc->iobase + PCNET_RDP; - sc->bdp = sc->iobase + PCNET_BDP; + sc->rap = PCNET_RAP; + sc->rdp = PCNET_RDP; + sc->bdp = PCNET_BDP; /* Create a DMA tag describing the ring memory we need */ lnc_mem_size = ((NDESC(sc->nrdre) + NDESC(sc->ntdre)) * sizeof(struct host_ring_entry)); + lnc_mem_size += sizeof(struct init_block) + (sizeof(struct mds) * + (NDESC(sc->nrdre) + NDESC(sc->ntdre))) + MEM_SLEW; + lnc_mem_size += (NDESC(sc->nrdre) * RECVBUFSIZE) + (NDESC(sc->ntdre) * TRANSBUFSIZE); |