diff options
author | yongari <yongari@FreeBSD.org> | 2010-03-25 17:17:35 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2010-03-25 17:17:35 +0000 |
commit | b360d7db9a6ab6ca923817b16369d869bd87bf76 (patch) | |
tree | 0b1517750207ebf1366203b9d3a1c66bdf820f1b /sys/dev/bge | |
parent | 3ce45e987032caba6d8f8c810a15c49fc0311957 (diff) | |
download | FreeBSD-src-b360d7db9a6ab6ca923817b16369d869bd87bf76.zip FreeBSD-src-b360d7db9a6ab6ca923817b16369d869bd87bf76.tar.gz |
Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim
read request size.
Diffstat (limited to 'sys/dev/bge')
-rw-r--r-- | sys/dev/bge/if_bge.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index b21fd72..4333f20 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -421,7 +421,6 @@ static uint32_t bge_readreg_ind(struct bge_softc *, int); #endif static void bge_writemem_direct(struct bge_softc *, int, int); static void bge_writereg_ind(struct bge_softc *, int, int); -static void bge_set_max_readrq(struct bge_softc *); static int bge_miibus_readreg(device_t, int, int); static int bge_miibus_writereg(device_t, int, int, int); @@ -561,32 +560,6 @@ bge_writemem_ind(struct bge_softc *sc, int off, int val) pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4); } -/* - * PCI Express only - */ -static void -bge_set_max_readrq(struct bge_softc *sc) -{ - device_t dev; - uint16_t val; - - dev = sc->bge_dev; - - val = pci_read_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); - if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) != - BGE_PCIE_DEVCTL_MAX_READRQ_4096) { - if (bootverbose) - device_printf(dev, "adjust device control 0x%04x ", - val); - val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; - val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096; - pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, - val, 2); - if (bootverbose) - printf("-> 0x%04x\n", val); - } -} - #ifdef notdef static uint32_t bge_readreg_ind(struct bge_softc *sc, int off) @@ -2695,7 +2668,8 @@ bge_attach(device_t dev) */ sc->bge_flags |= BGE_FLAG_PCIE; sc->bge_expcap = reg; - bge_set_max_readrq(sc); + if (pci_get_max_read_req(dev) != 4096) + pci_set_max_read_req(dev, 4096); } else { /* * Check if the device is in PCI-X Mode. |