1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

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
This commit is contained in:
Ian Dowse 2001-03-02 00:40:06 +00:00
parent 7595222a22
commit 783e9b1a7a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=73302

View File

@ -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);