Date: Fri, 5 Feb 2010 17:20:48 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r203529 - head/sys/dev/siis Message-ID: <201002051720.o15HKmRA002899@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Feb 5 17:20:48 2010 New Revision: 203529 URL: http://svn.freebsd.org/changeset/base/203529 Log: Use new helper functions to set PCIe max read request size. Modified: head/sys/dev/siis/siis.c Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Fri Feb 5 17:18:48 2010 (r203528) +++ head/sys/dev/siis/siis.c Fri Feb 5 17:20:48 2010 (r203529) @@ -230,20 +230,10 @@ static int siis_resume(device_t dev) { struct siis_controller *ctlr = device_get_softc(dev); - int cap; - uint16_t val; /* Set PCIe max read request size to at least 1024 bytes */ - if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { - val = pci_read_config(dev, - cap + PCIR_EXPRESS_DEVICE_CTL, 2); - if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) < 0x3000) { - val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; - val |= 0x3000; - pci_write_config(dev, - cap + PCIR_EXPRESS_DEVICE_CTL, val, 2); - } - } + if (pci_get_max_read_req(dev) < 1024) + pci_set_max_read_req(dev, 1024); /* Put controller into reset state. */ ctlr->gctl |= SIIS_GCTL_GRESET; ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002051720.o15HKmRA002899>