From 0a46b1dcccb2a33b9c29a92754f207d05a2174d1 Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Fri, 27 Oct 2000 00:15:04 +0000 Subject: [PATCH] Yet another bug fix/optimization for the Davicom DM9100/9102: increase the PCI latency timer value to 0x80. Davicom's Linux driver does this, and it drastically reduces the number of TX underruns in my tests. (Note: this is done only for the Davicom chips. I'm not sure it's a good idea to do it for all of them.) Again, still waiting on confirmation before merging to stable. --- sys/dev/dc/if_dc.c | 5 +++++ sys/pci/if_dc.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index a838709c9ee4..ee839512cacc 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1836,6 +1836,11 @@ static int dc_attach(dev) sc->dc_flags |= DC_TX_COALESCE|DC_TX_INTR_ALWAYS; sc->dc_flags |= DC_REDUCED_MII_POLL|DC_TX_STORENFWD; sc->dc_pmode = DC_PMODE_MII; + /* Increase the latency timer value. */ + command = pci_read_config(dev, DC_PCI_CFLT, 4); + command &= 0xFFFF00FF; + command |= 0x00008000; + pci_write_config(dev, DC_PCI_CFLT, command, 4); break; case DC_DEVICEID_AL981: sc->dc_type = DC_TYPE_AL981; diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index a838709c9ee4..ee839512cacc 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -1836,6 +1836,11 @@ static int dc_attach(dev) sc->dc_flags |= DC_TX_COALESCE|DC_TX_INTR_ALWAYS; sc->dc_flags |= DC_REDUCED_MII_POLL|DC_TX_STORENFWD; sc->dc_pmode = DC_PMODE_MII; + /* Increase the latency timer value. */ + command = pci_read_config(dev, DC_PCI_CFLT, 4); + command &= 0xFFFF00FF; + command |= 0x00008000; + pci_write_config(dev, DC_PCI_CFLT, command, 4); break; case DC_DEVICEID_AL981: sc->dc_type = DC_TYPE_AL981;