Date: Sun, 15 Aug 2010 23:02:41 +0000 (UTC) From: Pyun YongHyeon <yongari@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r211375 - stable/8/sys/dev/bge Message-ID: <201008152302.o7FN2fFT075625@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: yongari Date: Sun Aug 15 23:02:41 2010 New Revision: 211375 URL: http://svn.freebsd.org/changeset/base/211375 Log: MFC r205651: Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim read request size. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:59:35 2010 (r211374) +++ stable/8/sys/dev/bge/if_bge.c Sun Aug 15 23:02:41 2010 (r211375) @@ -423,7 +423,6 @@ static uint32_t bge_readreg_ind(struct b #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); @@ -564,32 +563,6 @@ bge_writemem_ind(struct bge_softc *sc, i 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) @@ -2705,7 +2678,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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008152302.o7FN2fFT075625>