Lines Matching refs:dev

87 agp_find_caps(device_t dev)  in agp_find_caps()  argument
91 if (pci_find_extcap(dev, PCIY_AGP, &capreg) != 0) in agp_find_caps()
103 device_t bus, dev = 0; in agp_find_display() local
113 dev = kids[i]; in agp_find_display()
114 if (pci_get_class(dev) == PCIC_DISPLAY) in agp_find_display()
115 if (agp_find_caps(dev)) { in agp_find_display()
117 return dev; in agp_find_display()
128 agp_alloc_gatt(device_t dev) in agp_alloc_gatt() argument
130 u_int32_t apsize = AGP_GET_APERTURE(dev); in agp_alloc_gatt()
135 device_printf(dev, in agp_alloc_gatt()
140 device_printf(dev, "bad aperture size\n"); in agp_alloc_gatt()
150 device_printf(dev, "contiguous allocation failed\n"); in agp_alloc_gatt()
188 agp_set_aperture_resource(device_t dev, int rid) in agp_set_aperture_resource() argument
190 struct agp_softc *sc = device_get_softc(dev); in agp_set_aperture_resource()
196 agp_generic_attach(device_t dev) in agp_generic_attach() argument
198 struct agp_softc *sc = device_get_softc(dev); in agp_generic_attach()
209 sc->as_aperture = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in agp_generic_attach()
242 sc->as_devnode->si_drv1 = dev; in agp_generic_attach()
248 agp_free_cdev(device_t dev) in agp_free_cdev() argument
250 dev_ops_remove_minor(&agp_ops, device_get_unit(dev)); in agp_free_cdev()
254 agp_free_res(device_t dev) in agp_free_res() argument
256 struct agp_softc *sc = device_get_softc(dev); in agp_free_res()
258 bus_release_resource(dev, SYS_RES_MEMORY, sc->as_aperture_rid, in agp_free_res()
264 agp_generic_detach(device_t dev) in agp_generic_detach() argument
266 agp_free_cdev(dev); in agp_generic_detach()
267 agp_free_res(dev); in agp_generic_detach()
276 agp_generic_get_aperture(device_t dev) in agp_generic_get_aperture() argument
278 struct agp_softc *sc = device_get_softc(dev); in agp_generic_get_aperture()
288 agp_generic_set_aperture(device_t dev, u_int32_t aperture) in agp_generic_set_aperture() argument
292 current_aperture = AGP_GET_APERTURE(dev); in agp_generic_set_aperture()
304 agp_v3_enable(device_t dev, device_t mdev, u_int32_t mode) in agp_v3_enable() argument
310 tstatus = pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4); in agp_v3_enable()
352 device_printf(dev, "Setting AGP v3 mode %d\n", rate * 4); in agp_v3_enable()
354 pci_write_config(dev, agp_find_caps(dev) + AGP_COMMAND, 0, 4); in agp_v3_enable()
366 pci_write_config(dev, agp_find_caps(dev) + AGP_COMMAND, command, 4); in agp_v3_enable()
373 agp_v2_enable(device_t dev, device_t mdev, u_int32_t mode) in agp_v2_enable() argument
379 tstatus = pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4); in agp_v2_enable()
410 device_printf(dev, "Setting AGP v2 mode %d\n", rate); in agp_v2_enable()
419 pci_write_config(dev, agp_find_caps(dev) + AGP_COMMAND, command, 4); in agp_v2_enable()
426 agp_generic_enable(device_t dev, u_int32_t mode) in agp_generic_enable() argument
436 tstatus = pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4); in agp_generic_enable()
450 return (agp_v3_enable(dev, mdev, mode)); in agp_generic_enable()
452 return (agp_v2_enable(dev, mdev, mode)); in agp_generic_enable()
456 agp_generic_alloc_memory(device_t dev, int type, vm_size_t size) in agp_generic_alloc_memory() argument
458 struct agp_softc *sc = device_get_softc(dev); in agp_generic_alloc_memory()
488 agp_generic_free_memory(device_t dev, struct agp_memory *mem) in agp_generic_free_memory() argument
490 struct agp_softc *sc = device_get_softc(dev); in agp_generic_free_memory()
503 agp_generic_bind_memory(device_t dev, struct agp_memory *mem, in agp_generic_bind_memory() argument
506 struct agp_softc *sc = device_get_softc(dev); in agp_generic_bind_memory()
514 device_printf(dev, "memory already bound\n"); in agp_generic_bind_memory()
522 || offset + mem->am_size > AGP_GET_APERTURE(dev)) { in agp_generic_bind_memory()
523 device_printf(dev, "binding memory at bad offset %#x,%#x,%#x\n", in agp_generic_bind_memory()
525 (int)AGP_GET_APERTURE(dev)); in agp_generic_bind_memory()
560 error = AGP_BIND_PAGE(dev, offset + i + j, pa); in agp_generic_bind_memory()
568 AGP_UNBIND_PAGE(dev, offset + k); in agp_generic_bind_memory()
594 AGP_FLUSH_TLB(dev); in agp_generic_bind_memory()
605 agp_generic_unbind_memory(device_t dev, struct agp_memory *mem) in agp_generic_unbind_memory() argument
607 struct agp_softc *sc = device_get_softc(dev); in agp_generic_unbind_memory()
614 device_printf(dev, "memory is not bound\n"); in agp_generic_unbind_memory()
625 AGP_UNBIND_PAGE(dev, mem->am_offset + i); in agp_generic_unbind_memory()
636 AGP_FLUSH_TLB(dev); in agp_generic_unbind_memory()
649 agp_acquire_helper(device_t dev, enum agp_acquire_state state) in agp_acquire_helper() argument
651 struct agp_softc *sc = device_get_softc(dev); in agp_acquire_helper()
661 agp_release_helper(device_t dev, enum agp_acquire_state state) in agp_release_helper() argument
663 struct agp_softc *sc = device_get_softc(dev); in agp_release_helper()
676 agp_find_memory(device_t dev, int id) in agp_find_memory() argument
678 struct agp_softc *sc = device_get_softc(dev); in agp_find_memory()
693 agp_info_user(device_t dev, agp_info *info) in agp_info_user() argument
695 struct agp_softc *sc = device_get_softc(dev); in agp_info_user()
698 info->bridge_id = pci_get_devid(dev); in agp_info_user()
700 pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4); in agp_info_user()
702 info->aper_size = AGP_GET_APERTURE(dev) >> 20; in agp_info_user()
710 agp_setup_user(device_t dev, agp_setup *setup) in agp_setup_user() argument
712 return AGP_ENABLE(dev, setup->agp_mode); in agp_setup_user()
716 agp_allocate_user(device_t dev, agp_allocate *alloc) in agp_allocate_user() argument
720 mem = AGP_ALLOC_MEMORY(dev, in agp_allocate_user()
733 agp_deallocate_user(device_t dev, int id) in agp_deallocate_user() argument
735 struct agp_memory *mem = agp_find_memory(dev, id); in agp_deallocate_user()
738 AGP_FREE_MEMORY(dev, mem); in agp_deallocate_user()
746 agp_bind_user(device_t dev, agp_bind *bind) in agp_bind_user() argument
748 struct agp_memory *mem = agp_find_memory(dev, bind->key); in agp_bind_user()
753 return AGP_BIND_MEMORY(dev, mem, bind->pg_start << AGP_PAGE_SHIFT); in agp_bind_user()
757 agp_unbind_user(device_t dev, agp_unbind *unbind) in agp_unbind_user() argument
759 struct agp_memory *mem = agp_find_memory(dev, unbind->key); in agp_unbind_user()
764 return AGP_UNBIND_MEMORY(dev, mem); in agp_unbind_user()
768 agp_chipset_flush(device_t dev) in agp_chipset_flush() argument
771 return (AGP_CHIPSET_FLUSH(dev)); in agp_chipset_flush()
778 device_t dev = kdev->si_drv1; in agp_open() local
779 struct agp_softc *sc = device_get_softc(dev); in agp_open()
783 device_busy(dev); in agp_open()
793 device_t dev = kdev->si_drv1; in agp_close() local
794 struct agp_softc *sc = device_get_softc(dev); in agp_close()
802 AGP_UNBIND_MEMORY(dev, mem); in agp_close()
803 AGP_FREE_MEMORY(dev, mem); in agp_close()
806 agp_release_helper(dev, AGP_ACQUIRE_USER); in agp_close()
809 device_unbusy(dev); in agp_close()
819 device_t dev = kdev->si_drv1; in agp_ioctl() local
823 return agp_info_user(dev, (agp_info *)ap->a_data); in agp_ioctl()
826 return agp_acquire_helper(dev, AGP_ACQUIRE_USER); in agp_ioctl()
829 return agp_release_helper(dev, AGP_ACQUIRE_USER); in agp_ioctl()
832 return agp_setup_user(dev, (agp_setup *)ap->a_data); in agp_ioctl()
835 return agp_allocate_user(dev, (agp_allocate *)ap->a_data); in agp_ioctl()
838 return agp_deallocate_user(dev, *(int *)ap->a_data); in agp_ioctl()
841 return agp_bind_user(dev, (agp_bind *)ap->a_data); in agp_ioctl()
844 return agp_unbind_user(dev, (agp_unbind *)ap->a_data); in agp_ioctl()
847 return agp_chipset_flush(dev); in agp_ioctl()
857 device_t dev = kdev->si_drv1; in agp_mmap() local
858 struct agp_softc *sc = device_get_softc(dev); in agp_mmap()
860 if (ap->a_offset > AGP_GET_APERTURE(dev)) in agp_mmap()
890 agp_state(device_t dev) in agp_state() argument
892 struct agp_softc *sc = device_get_softc(dev); in agp_state()
897 agp_get_info(device_t dev, struct agp_info *info) in agp_get_info() argument
899 struct agp_softc *sc = device_get_softc(dev); in agp_get_info()
902 pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4); in agp_get_info()
910 agp_acquire(device_t dev) in agp_acquire() argument
912 return agp_acquire_helper(dev, AGP_ACQUIRE_KERNEL); in agp_acquire()
916 agp_release(device_t dev) in agp_release() argument
918 return agp_release_helper(dev, AGP_ACQUIRE_KERNEL); in agp_release()
922 agp_enable(device_t dev, u_int32_t mode) in agp_enable() argument
924 return AGP_ENABLE(dev, mode); in agp_enable()
927 void *agp_alloc_memory(device_t dev, int type, vm_size_t bytes) in agp_alloc_memory() argument
929 return (void *) AGP_ALLOC_MEMORY(dev, type, bytes); in agp_alloc_memory()
932 void agp_free_memory(device_t dev, void *handle) in agp_free_memory() argument
935 AGP_FREE_MEMORY(dev, mem); in agp_free_memory()
938 int agp_bind_memory(device_t dev, void *handle, vm_offset_t offset) in agp_bind_memory() argument
941 return AGP_BIND_MEMORY(dev, mem, offset); in agp_bind_memory()
944 int agp_unbind_memory(device_t dev, void *handle) in agp_unbind_memory() argument
947 return AGP_UNBIND_MEMORY(dev, mem); in agp_unbind_memory()
950 void agp_memory_info(device_t dev, void *handle, struct in agp_memory_info() argument