diff options
author | jhb <jhb@FreeBSD.org> | 2005-12-20 19:58:28 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-12-20 19:58:28 +0000 |
commit | 619a2b9cae3992904087b1de756bddd04ae64e50 (patch) | |
tree | a8ebb008a94030133be968b1a8fa3d9adc82081d /sys/pci | |
parent | 54f0fa09adeb8b48cf9720bad8972ade5f309dd6 (diff) | |
download | FreeBSD-src-619a2b9cae3992904087b1de756bddd04ae64e50.zip FreeBSD-src-619a2b9cae3992904087b1de756bddd04ae64e50.tar.gz |
Use pci_find_extcap() to search for AGP capabilities (PCIY_AGP).
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/agp.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/sys/pci/agp.c b/sys/pci/agp.c index a31c4d0..d074f18 100644 --- a/sys/pci/agp.c +++ b/sys/pci/agp.c @@ -101,33 +101,12 @@ agp_flush_cache() u_int8_t agp_find_caps(device_t dev) { - u_int32_t status; - u_int8_t ptr, next; + int capreg; - /* - * Check the CAP_LIST bit of the PCI status register first. - */ - status = pci_read_config(dev, PCIR_STATUS, 2); - if (!(status & 0x10)) - return 0; - - /* - * Traverse the capabilities list. - */ - for (ptr = pci_read_config(dev, AGP_CAPPTR, 1); - ptr != 0; - ptr = next) { - u_int32_t capid = pci_read_config(dev, ptr, 4); - next = AGP_CAPID_GET_NEXT_PTR(capid); - /* - * If this capability entry ID is 2, then we are done. - */ - if (AGP_CAPID_GET_CAP_ID(capid) == 2) - return ptr; - } - - return 0; + if (pci_find_extcap(dev, PCIY_AGP, &capreg) != 0) + capreg = 0; + return (capreg); } /* |