Date: Sun, 11 Apr 2004 09:12:52 -0700 (PDT) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 50846 for review Message-ID: <200404111612.i3BGCqGS022550@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=50846 Change 50846 by rwatson@rwatson_paprika on 2004/04/11 09:12:12 ACPI components now buildable as many driver modules. avail_end removed. pmap_kenter_temporary added. Support for Via entropy generation chipset ("Nehemiah") and hardware entropy sources. Infrastructural changes, some in debate, to support hardware entropy bypass of Yarrow. DEVICE_POLLING support for if_fxp now supports capabilities flags. PCI power state changes to power off unused devices, etc, etc; disabled by default via a tunable while nits are worked out. NFS client module unload cleaned up. NFS server can't be unloaded if there are active nfsd processes. Device polling may now be configured using ifconfig for supporting drivers; dc, fxp, ste, vr. Affected files ... .. //depot/projects/netperf_socket/sys/alpha/alpha/pmap.c#5 integrate .. //depot/projects/netperf_socket/sys/alpha/include/pmap.h#5 integrate .. //depot/projects/netperf_socket/sys/amd64/amd64/vm_machdep.c#7 integrate .. //depot/projects/netperf_socket/sys/amd64/include/md_var.h#4 integrate .. //depot/projects/netperf_socket/sys/amd64/include/pmap.h#5 integrate .. //depot/projects/netperf_socket/sys/conf/files#15 integrate .. //depot/projects/netperf_socket/sys/conf/files.i386#13 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_acad.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_button.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_cmbat.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_cpu.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_ec.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_isab.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_lid.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_pci.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_pcib_acpi.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_pcib_pci.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_resource.c#4 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_thermal.c#7 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_timer.c#4 integrate .. //depot/projects/netperf_socket/sys/dev/fxp/if_fxp.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/pccard/pccarddevs#4 integrate .. //depot/projects/netperf_socket/sys/dev/pccard/pccarddevs.h#4 integrate .. //depot/projects/netperf_socket/sys/dev/pci/pci.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/pci/pci_pci.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/pci/pci_private.h#2 integrate .. //depot/projects/netperf_socket/sys/dev/random/harvest.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/random/hash.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/random/hash.h#2 integrate .. //depot/projects/netperf_socket/sys/dev/random/nehemiah.c#1 branch .. //depot/projects/netperf_socket/sys/dev/random/nehemiah.h#1 branch .. //depot/projects/netperf_socket/sys/dev/random/probe.c#1 branch .. //depot/projects/netperf_socket/sys/dev/random/randomdev.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/random/randomdev.h#2 integrate .. //depot/projects/netperf_socket/sys/dev/random/randomdev_soft.c#1 branch .. //depot/projects/netperf_socket/sys/dev/random/randomdev_soft.h#1 branch .. //depot/projects/netperf_socket/sys/dev/random/yarrow.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/random/yarrow.h#2 integrate .. //depot/projects/netperf_socket/sys/dev/trm/trm.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/xe/if_xe_pccard.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/xe/if_xevar.h#2 integrate .. //depot/projects/netperf_socket/sys/i386/i386/identcpu.c#5 integrate .. //depot/projects/netperf_socket/sys/i386/i386/pmap.c#6 integrate .. //depot/projects/netperf_socket/sys/i386/i386/vm_machdep.c#10 integrate .. //depot/projects/netperf_socket/sys/i386/include/md_var.h#2 integrate .. //depot/projects/netperf_socket/sys/i386/include/pmap.h#5 integrate .. //depot/projects/netperf_socket/sys/ia64/ia64/pmap.c#6 integrate .. //depot/projects/netperf_socket/sys/kern/kern_linker.c#3 integrate .. //depot/projects/netperf_socket/sys/kern/kern_resource.c#4 integrate .. //depot/projects/netperf_socket/sys/modules/random/Makefile#2 integrate .. //depot/projects/netperf_socket/sys/modules/twa/Makefile#2 integrate .. //depot/projects/netperf_socket/sys/modules/wlan/Makefile#2 integrate .. //depot/projects/netperf_socket/sys/net/if.h#3 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c#3 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/hci/ng_hci_evnt.c#2 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/hci/ng_hci_misc.c#2 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c#2 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/hci/ng_hci_var.h#2 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c#2 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c#2 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c#2 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c#2 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/l2cap/ng_l2cap_var.h#2 integrate .. //depot/projects/netperf_socket/sys/nfsclient/nfs.h#6 integrate .. //depot/projects/netperf_socket/sys/nfsclient/nfs_nfsiod.c#3 integrate .. //depot/projects/netperf_socket/sys/nfsclient/nfs_node.c#3 integrate .. //depot/projects/netperf_socket/sys/nfsclient/nfs_subs.c#5 integrate .. //depot/projects/netperf_socket/sys/nfsserver/nfs.h#6 integrate .. //depot/projects/netperf_socket/sys/nfsserver/nfs_srvsubs.c#4 integrate .. //depot/projects/netperf_socket/sys/nfsserver/nfs_syscalls.c#5 integrate .. //depot/projects/netperf_socket/sys/pci/if_dc.c#4 integrate .. //depot/projects/netperf_socket/sys/pci/if_ste.c#12 integrate .. //depot/projects/netperf_socket/sys/pci/if_vr.c#6 integrate .. //depot/projects/netperf_socket/sys/powerpc/include/pmap.h#4 integrate .. //depot/projects/netperf_socket/sys/powerpc/powerpc/pmap.c#7 integrate .. //depot/projects/netperf_socket/sys/sparc64/include/pmap.h#4 integrate .. //depot/projects/netperf_socket/sys/sparc64/sparc64/pmap.c#5 integrate .. //depot/projects/netperf_socket/sys/vm/pmap.h#5 integrate Differences ... ==== //depot/projects/netperf_socket/sys/alpha/alpha/pmap.c#5 (text+ko) ==== @@ -148,7 +148,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.142 2004/04/05 04:07:58 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.143 2004/04/11 05:08:26 alc Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -301,7 +301,6 @@ */ struct pmap kernel_pmap_store; -vm_offset_t avail_end; /* PA of last available physical page */ vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ static boolean_t pmap_initialized = FALSE; /* Has pmap_init completed? */ @@ -511,9 +510,6 @@ Lev2map[i] = newpte; } - for (i = 0; phys_avail[i+2]; i+= 2) ; - avail_end = phys_avail[i+1]; - virtual_avail = VM_MIN_KERNEL_ADDRESS; virtual_end = VPTBASE; ==== //depot/projects/netperf_socket/sys/alpha/include/pmap.h#5 (text+ko) ==== @@ -39,7 +39,7 @@ * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 * from: i386 pmap.h,v 1.54 1997/11/20 19:30:35 bde Exp - * $FreeBSD: src/sys/alpha/include/pmap.h,v 1.28 2004/04/05 21:00:50 imp Exp $ + * $FreeBSD: src/sys/alpha/include/pmap.h,v 1.30 2004/04/11 05:08:26 alc Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -204,7 +204,6 @@ #ifdef _KERNEL -extern vm_offset_t avail_end; extern vm_offset_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; @@ -214,6 +213,7 @@ vm_offset_t pmap_steal_memory(vm_size_t); void pmap_bootstrap(vm_offset_t, u_int); void pmap_kenter(vm_offset_t va, vm_offset_t pa); +void *pmap_kenter_temporary(vm_offset_t pa, int i); void pmap_kremove(vm_offset_t); void pmap_setdevram(unsigned long long basea, vm_offset_t sizea); int pmap_uses_prom_console(void); ==== //depot/projects/netperf_socket/sys/amd64/amd64/vm_machdep.c#7 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.232 2004/04/03 09:16:25 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.233 2004/04/11 04:26:58 alc Exp $"); #include "opt_isa.h" #include "opt_cpu.h" @@ -522,8 +522,7 @@ */ int -is_physical_memory(addr) - vm_offset_t addr; +is_physical_memory(vm_paddr_t addr) { #ifdef DEV_ISA ==== //depot/projects/netperf_socket/sys/amd64/include/md_var.h#4 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.72 2004/03/31 02:03:49 alc Exp $ + * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.73 2004/04/11 04:26:58 alc Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -66,7 +66,7 @@ void enable_sse(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void fpstate_drop(struct thread *td); -int is_physical_memory(vm_offset_t addr); +int is_physical_memory(vm_paddr_t addr); int isa_nmi(int cd); void pagecopy(void *from, void *to); void pagezero(void *addr); ==== //depot/projects/netperf_socket/sys/amd64/include/pmap.h#5 (text+ko) ==== @@ -39,7 +39,7 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.112 2004/04/05 23:55:14 imp Exp $ + * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.113 2004/04/10 22:41:45 alc Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -264,6 +264,7 @@ void pmap_bootstrap(vm_paddr_t *); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); +void *pmap_kenter_temporary(vm_offset_t pa, int i); void pmap_kremove(vm_offset_t); void *pmap_mapdev(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); ==== //depot/projects/netperf_socket/sys/conf/files#15 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.882 2004/04/08 18:17:13 mlaier Exp $ +# $FreeBSD: src/sys/conf/files,v 1.884 2004/04/10 19:43:15 marcel Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -608,6 +608,8 @@ dev/puc/pucdata.c optional puc pci dev/random/harvest.c standard dev/random/randomdev.c optional random +dev/random/randomdev_soft.c optional random +dev/random/probe.c optional random dev/random/yarrow.c optional random dev/random/hash.c optional random crypto/rijndael/rijndael-alg-fst.c optional random ==== //depot/projects/netperf_socket/sys/conf/files.i386#13 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.i386,v 1.483 2004/04/01 10:02:50 des Exp $ +# $FreeBSD: src/sys/conf/files.i386,v 1.484 2004/04/10 19:43:15 marcel Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -152,6 +152,7 @@ dev/lnc/if_lnc_isa.c optional lnc isa dev/ppc/ppc.c optional ppc dev/ppc/ppc_puc.c optional ppc puc pci +dev/random/nehemiah.c optional random dev/sbni/if_sbni.c optional sbni dev/sbni/if_sbni_isa.c optional sbni isa dev/sbni/if_sbni_pci.c optional sbni pci ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_acad.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_acad.c,v 1.21 2004/03/03 18:34:42 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_acad.c,v 1.22 2004/04/09 18:14:32 njl Exp $ */ #include "opt_acpi.h" @@ -83,6 +83,7 @@ static devclass_t acpi_acad_devclass; DRIVER_MODULE(acpi_acad, acpi, acpi_acad_driver, acpi_acad_devclass, 0, 0); +MODULE_DEPEND(acpi_acad, acpi, 1, 1, 1); static void acpi_acad_get_status(void *context) ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_button.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_button.c,v 1.20 2004/02/19 18:16:34 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_button.c,v 1.21 2004/04/09 18:14:32 njl Exp $ */ #include "opt_acpi.h" @@ -83,6 +83,7 @@ static devclass_t acpi_button_devclass; DRIVER_MODULE(acpi_button, acpi, acpi_button_driver, acpi_button_devclass, 0, 0); +MODULE_DEPEND(acpi_button, acpi, 1, 1, 1); static int acpi_button_probe(device_t dev) ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_cmbat.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_cmbat.c,v 1.27 2003/12/23 18:27:35 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_cmbat.c,v 1.28 2004/04/09 18:14:32 njl Exp $ */ #include "opt_acpi.h" @@ -110,6 +110,7 @@ static devclass_t acpi_cmbat_devclass; DRIVER_MODULE(acpi_cmbat, acpi, acpi_cmbat_driver, acpi_cmbat_devclass, 0, 0); +MODULE_DEPEND(acpi_cmbat, acpi, 1, 1, 1); static int acpi_cmbat_info_expired(struct timespec *lastupdated) ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_cpu.c#5 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.32 2004/03/17 21:49:47 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.33 2004/04/09 18:14:32 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -184,6 +184,7 @@ static devclass_t acpi_cpu_devclass; DRIVER_MODULE(acpi_cpu, acpi, acpi_cpu_driver, acpi_cpu_devclass, 0, 0); +MODULE_DEPEND(acpi_cpu, acpi, 1, 1, 1); static int acpi_cpu_probe(device_t dev) ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_ec.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.45 2004/03/17 17:50:24 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.46 2004/04/09 18:14:32 njl Exp $ */ /****************************************************************************** * @@ -137,7 +137,7 @@ *****************************************************************************/ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.45 2004/03/17 17:50:24 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.46 2004/04/09 18:14:32 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -352,6 +352,7 @@ static devclass_t acpi_ec_devclass; DRIVER_MODULE(acpi_ec, acpi, acpi_ec_driver, acpi_ec_devclass, 0, 0); +MODULE_DEPEND(acpi_ec, acpi, 1, 1, 1); /* * Look for an ECDT and if we find one, set up default GPE and ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_isab.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_isab.c,v 1.4 2003/08/24 17:48:01 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_isab.c,v 1.5 2004/04/09 18:14:32 njl Exp $"); /* * ISA Bridge driver for Generic ISA Bus Devices. See section 10.7 of the @@ -88,6 +88,7 @@ }; DRIVER_MODULE(acpi_isab, acpi, acpi_isab_driver, isab_devclass, 0, 0); +MODULE_DEPEND(acpi_isab, acpi, 1, 1, 1); static int acpi_isab_probe(device_t dev) ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_lid.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_lid.c,v 1.16 2004/03/03 18:34:42 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_lid.c,v 1.17 2004/04/09 18:14:32 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -75,6 +75,7 @@ static devclass_t acpi_lid_devclass; DRIVER_MODULE(acpi_lid, acpi, acpi_lid_driver, acpi_lid_devclass, 0, 0); +MODULE_DEPEND(acpi_lid, acpi, 1, 1, 1); static int acpi_lid_probe(device_t dev) ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_pci.c#5 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.10 2004/04/07 19:42:21 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.12 2004/04/09 18:14:32 njl Exp $"); #include "opt_bus.h" @@ -79,7 +79,7 @@ DEVMETHOD(device_probe, acpi_pci_probe), DEVMETHOD(device_attach, acpi_pci_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_suspend, pci_suspend), DEVMETHOD(device_resume, pci_resume), /* Bus interface */ @@ -87,7 +87,7 @@ DEVMETHOD(bus_probe_nomatch, pci_probe_nomatch), DEVMETHOD(bus_read_ivar, acpi_pci_read_ivar), DEVMETHOD(bus_write_ivar, pci_write_ivar), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), + DEVMETHOD(bus_driver_added, pci_driver_added), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -123,8 +123,9 @@ }; DRIVER_MODULE(acpi_pci, pcib, acpi_pci_driver, pci_devclass, 0, 0); +MODULE_DEPEND(acpi_pci, acpi, 1, 1, 1); +MODULE_DEPEND(acpi_pci, pci, 1, 1, 1); MODULE_VERSION(acpi_pci, 1); -MODULE_DEPEND(acpi_pci, pci, 1, 1, 1); static int acpi_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_pcib_acpi.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.30 2004/03/03 18:34:42 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.32 2004/04/09 18:14:32 njl Exp $ */ #include "opt_acpi.h" #include <sys/param.h> @@ -70,6 +70,10 @@ u_int32_t data, int bytes); static int acpi_pcib_acpi_route_interrupt(device_t pcib, device_t dev, int pin); +static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev, + device_t child, int type, int *rid, + u_long start, u_long end, u_long count, + u_int flags); static device_method_t acpi_pcib_acpi_methods[] = { /* Device interface */ @@ -83,7 +87,7 @@ DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar), DEVMETHOD(bus_write_ivar, acpi_pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_alloc_resource, acpi_pcib_acpi_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), @@ -106,6 +110,7 @@ }; DRIVER_MODULE(acpi_pcib, acpi, acpi_pcib_acpi_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(acpi_pcib, acpi, 1, 1, 1); static int acpi_pcib_acpi_probe(device_t dev) @@ -289,3 +294,20 @@ sc = device_get_softc(pcib); return (acpi_pcib_route_interrupt(pcib, dev, pin, &sc->ap_prt)); } + +struct resource * +acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + /* + * If no memory preference is given, use upper 256MB slot most + * bioses use for their memory window. Typically other bridges + * before us get in the way to assert their preferences on memory. + * Hardcoding like this sucks, so a more MD/MI way needs to be + * found to do it. + */ + if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) + start = 0xf0000000; + return (bus_generic_alloc_resource(dev, child, type, rid, start, end, + count, flags)); +} ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_pcib_pci.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_pci.c,v 1.5 2003/08/24 17:48:01 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_pci.c,v 1.6 2004/04/09 18:14:32 njl Exp $"); #include "opt_acpi.h" @@ -106,6 +106,7 @@ }; DRIVER_MODULE(acpi_pcib, pci, acpi_pcib_pci_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(acpi_pcib, acpi, 1, 1, 1); static int acpi_pcib_pci_probe(device_t dev) ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_resource.c#4 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_resource.c,v 1.22 2004/03/31 17:23:46 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_resource.c,v 1.23 2004/04/09 18:14:32 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -568,6 +568,7 @@ static devclass_t acpi_sysresource_devclass; DRIVER_MODULE(acpi_sysresource, acpi, acpi_sysresource_driver, acpi_sysresource_devclass, 0, 0); +MODULE_DEPEND(acpi_sysresource, acpi, 1, 1, 1); static int acpi_sysresource_probe(device_t dev) ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_thermal.c#7 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.41 2004/04/09 06:55:50 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.42 2004/04/09 18:14:32 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -137,6 +137,7 @@ static devclass_t acpi_tz_devclass; DRIVER_MODULE(acpi_tz, acpi, acpi_tz_driver, acpi_tz_devclass, 0, 0); +MODULE_DEPEND(acpi_tz, acpi, 1, 1, 1); static struct sysctl_ctx_list acpi_tz_sysctl_ctx; static struct sysctl_oid *acpi_tz_sysctl_tree; ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_timer.c#4 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_timer.c,v 1.27 2004/03/17 17:50:24 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_timer.c,v 1.28 2004/04/09 18:14:32 njl Exp $ */ #include "opt_acpi.h" #include <sys/param.h> @@ -87,6 +87,7 @@ static devclass_t acpi_timer_devclass; DRIVER_MODULE(acpi_timer, acpi, acpi_timer_driver, acpi_timer_devclass, 0, 0); +MODULE_DEPEND(acpi_timer, acpi, 1, 1, 1); static struct timecounter acpi_timer_timecounter = { acpi_timer_get_timecount_safe, ==== //depot/projects/netperf_socket/sys/dev/fxp/if_fxp.c#5 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.202 2004/04/07 15:47:14 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.203 2004/04/11 15:35:49 ru Exp $"); /* * Intel EtherExpress Pro/100B PCI Fast Ethernet driver @@ -804,6 +804,12 @@ ifp->if_capenable = ifp->if_capabilities; } +#ifdef DEVICE_POLLING + /* Inform the world we support polling. */ + ifp->if_capabilities |= IFCAP_POLLING; + ifp->if_capenable |= IFCAP_POLLING; +#endif + /* * Attach the interface. */ @@ -1512,6 +1518,10 @@ u_int8_t statack; FXP_LOCK(sc); + if (!(ifp->if_capenable & IFCAP_POLLING)) { + ether_poll_deregister(ifp); + cmd = POLL_DEREGISTER; + } if (cmd == POLL_DEREGISTER) { /* final call, enable interrupts */ CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, 0); FXP_UNLOCK(sc); @@ -1559,7 +1569,8 @@ FXP_UNLOCK(sc); return; } - if (ether_poll_register(fxp_poll, ifp)) { + if ((ifp->if_capenable & IFCAP_POLLING) && + ether_poll_register(fxp_poll, ifp)) { /* disable interrupts */ CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE); FXP_UNLOCK(sc); @@ -2480,6 +2491,10 @@ } break; + case SIOCSIFCAP: + ifp->if_capenable = ifr->ifr_reqcap; + break; + default: /* * ether_ioctl() will eventually call fxp_start() which ==== //depot/projects/netperf_socket/sys/dev/pccard/pccarddevs#4 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.82 2004/03/25 21:56:28 imp Exp $ +$FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.83 2004/04/09 17:08:12 rsm Exp $ /* $NetBSD: pcmciadevs,v 1.186 2003/09/16 08:26:37 onoe Exp $ */ /* $OpenBSD: pcmciadevs,v 1.93 2002/06/21 08:31:10 henning Exp $ */ @@ -457,17 +457,23 @@ /* Xircom Products */ product XIRCOM CWE1130 0x0007 Xircom Wireless Ethernet Adapter product XIRCOM CE 0x0108 Xircom CreditCard Ethernet -product XIRCOM CE3 0x010a Xircom CreditCard 10/100 Ethernet -product XIRCOM CE2 0x010b Xircom CreditCard Ethernet II +product XIRCOM CE2 0x010a Xircom CreditCard Ethernet II +product XIRCOM CE3 0x010a Xircom CreditCard Ethernet 10/100 +product XIRCOM CE2_2 0x010b Xircom CreditCard Ethernet II product XIRCOM XE2000 0x0153 Xircom XE2000 10/100 Ethernet product XIRCOM CNW_801 0x0801 Xircom CreditCard Netwave (Canada) product XIRCOM CNW_802 0x0802 Xircom CreditCard Netwave (US) product XIRCOM CT2 0x1101 Xircom CreditCard Token Ring II product XIRCOM CEM 0x110a Xircom CreditCard Ethernet + Modem +product XIRCOM CEM2 0x110a Xircom CreditCard Ethernet + Modem +product XIRCOM CEM56 0x110a Xircom CreditCard Ethernet + Modem 56 +product XIRCOM REM10 0x110a Xircom CreditCard Ethernet 10 + Modem 56 product XIRCOM REM56 0x110a Xircom RealPort Ethernet 10/100 + Modem 56 -product XIRCOM CEM28 0x110b Xircom CreditCard Ethernet + Modem 28 -product XIRCOM CEM56 0x110b Xircom CreditCard Ethernet + Modem 56 -product XIRCOM CEM33 0x110d Xircom CreditCard Ethernet + Modem 33 +product XIRCOM XEM5600 0x110a Xircom 10/100 Network + 56K Modem PC Card +product XIRCOM CEM28 0x110b Xircom CreditCard Ethernet + Modem 28.8 +product XIRCOM CEM56_2 0x110b Xircom CreditCard Ethernet + Modem 56 +product XIRCOM CEM33 0x110c Xircom CreditCard Ethernet + Modem 33.6 +product XIRCOM CEM33_2 0x110d Xircom CreditCard Ethernet + Modem 33.6 /* ZONET */ product ZONET ZEN 0x0100 Zonet Zen 10/10 ==== //depot/projects/netperf_socket/sys/dev/pccard/pccarddevs.h#4 (text+ko) ==== @@ -1,10 +1,10 @@ -/* $FreeBSD: src/sys/dev/pccard/pccarddevs.h,v 1.82 2004/03/25 21:56:43 imp Exp $ */ +/* $FreeBSD: src/sys/dev/pccard/pccarddevs.h,v 1.83 2004/04/09 17:10:12 rsm Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.82 2004/03/25 21:56:28 imp Exp + * FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.83 2004/04/09 17:08:12 rsm Exp */ /* $NetBSD: pcmciadevs,v 1.186 2003/09/16 08:26:37 onoe Exp $ */ /* $OpenBSD: pcmciadevs,v 1.93 2002/06/21 08:31:10 henning Exp $ */ @@ -802,12 +802,15 @@ #define PCMCIA_CIS_XIRCOM_CE { NULL, NULL, NULL, NULL } #define PCMCIA_PRODUCT_XIRCOM_CE 0x0108 #define PCMCIA_STR_XIRCOM_CE "Xircom CreditCard Ethernet" +#define PCMCIA_CIS_XIRCOM_CE2 { NULL, NULL, NULL, NULL } +#define PCMCIA_PRODUCT_XIRCOM_CE2 0x010a +#define PCMCIA_STR_XIRCOM_CE2 "Xircom CreditCard Ethernet II" #define PCMCIA_CIS_XIRCOM_CE3 { NULL, NULL, NULL, NULL } #define PCMCIA_PRODUCT_XIRCOM_CE3 0x010a -#define PCMCIA_STR_XIRCOM_CE3 "Xircom CreditCard 10/100 Ethernet" -#define PCMCIA_CIS_XIRCOM_CE2 { NULL, NULL, NULL, NULL } -#define PCMCIA_PRODUCT_XIRCOM_CE2 0x010b -#define PCMCIA_STR_XIRCOM_CE2 "Xircom CreditCard Ethernet II" +#define PCMCIA_STR_XIRCOM_CE3 "Xircom CreditCard Ethernet 10/100" +#define PCMCIA_CIS_XIRCOM_CE2_2 { NULL, NULL, NULL, NULL } +#define PCMCIA_PRODUCT_XIRCOM_CE2_2 0x010b +#define PCMCIA_STR_XIRCOM_CE2_2 "Xircom CreditCard Ethernet II" #define PCMCIA_CIS_XIRCOM_XE2000 { NULL, NULL, NULL, NULL } #define PCMCIA_PRODUCT_XIRCOM_XE2000 0x0153 #define PCMCIA_STR_XIRCOM_XE2000 "Xircom XE2000 10/100 Ethernet" @@ -823,18 +826,33 @@ #define PCMCIA_CIS_XIRCOM_CEM { NULL, NULL, NULL, NULL } #define PCMCIA_PRODUCT_XIRCOM_CEM 0x110a #define PCMCIA_STR_XIRCOM_CEM "Xircom CreditCard Ethernet + Modem" +#define PCMCIA_CIS_XIRCOM_CEM2 { NULL, NULL, NULL, NULL } +#define PCMCIA_PRODUCT_XIRCOM_CEM2 0x110a +#define PCMCIA_STR_XIRCOM_CEM2 "Xircom CreditCard Ethernet + Modem" +#define PCMCIA_CIS_XIRCOM_CEM56 { NULL, NULL, NULL, NULL } +#define PCMCIA_PRODUCT_XIRCOM_CEM56 0x110a +#define PCMCIA_STR_XIRCOM_CEM56 "Xircom CreditCard Ethernet + Modem 56" +#define PCMCIA_CIS_XIRCOM_REM10 { NULL, NULL, NULL, NULL } +#define PCMCIA_PRODUCT_XIRCOM_REM10 0x110a +#define PCMCIA_STR_XIRCOM_REM10 "Xircom CreditCard Ethernet 10 + Modem 56" #define PCMCIA_CIS_XIRCOM_REM56 { NULL, NULL, NULL, NULL } #define PCMCIA_PRODUCT_XIRCOM_REM56 0x110a #define PCMCIA_STR_XIRCOM_REM56 "Xircom RealPort Ethernet 10/100 + Modem 56" +#define PCMCIA_CIS_XIRCOM_XEM5600 { NULL, NULL, NULL, NULL } +#define PCMCIA_PRODUCT_XIRCOM_XEM5600 0x110a +#define PCMCIA_STR_XIRCOM_XEM5600 "Xircom 10/100 Network + 56K Modem PC Card" #define PCMCIA_CIS_XIRCOM_CEM28 { NULL, NULL, NULL, NULL } #define PCMCIA_PRODUCT_XIRCOM_CEM28 0x110b -#define PCMCIA_STR_XIRCOM_CEM28 "Xircom CreditCard Ethernet + Modem 28" -#define PCMCIA_CIS_XIRCOM_CEM56 { NULL, NULL, NULL, NULL } -#define PCMCIA_PRODUCT_XIRCOM_CEM56 0x110b -#define PCMCIA_STR_XIRCOM_CEM56 "Xircom CreditCard Ethernet + Modem 56" +#define PCMCIA_STR_XIRCOM_CEM28 "Xircom CreditCard Ethernet + Modem 28.8" +#define PCMCIA_CIS_XIRCOM_CEM56_2 { NULL, NULL, NULL, NULL } +#define PCMCIA_PRODUCT_XIRCOM_CEM56_2 0x110b +#define PCMCIA_STR_XIRCOM_CEM56_2 "Xircom CreditCard Ethernet + Modem 56" #define PCMCIA_CIS_XIRCOM_CEM33 { NULL, NULL, NULL, NULL } -#define PCMCIA_PRODUCT_XIRCOM_CEM33 0x110d -#define PCMCIA_STR_XIRCOM_CEM33 "Xircom CreditCard Ethernet + Modem 33" +#define PCMCIA_PRODUCT_XIRCOM_CEM33 0x110c +#define PCMCIA_STR_XIRCOM_CEM33 "Xircom CreditCard Ethernet + Modem 33.6" +#define PCMCIA_CIS_XIRCOM_CEM33_2 { NULL, NULL, NULL, NULL } +#define PCMCIA_PRODUCT_XIRCOM_CEM33_2 0x110d +#define PCMCIA_STR_XIRCOM_CEM33_2 "Xircom CreditCard Ethernet + Modem 33.6" /* ZONET */ #define PCMCIA_CIS_ZONET_ZEN { NULL, NULL, NULL, NULL } ==== //depot/projects/netperf_socket/sys/dev/pci/pci.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/pci/pci.c,v 1.237 2003/12/24 02:01:22 imp Exp $ + * $FreeBSD: src/sys/dev/pci/pci.c,v 1.240 2004/04/11 07:02:49 imp Exp $ * */ @@ -68,7 +68,8 @@ static int pci_porten(device_t pcib, int b, int s, int f); static int pci_memen(device_t pcib, int b, int s, int f); -static int pci_add_map(device_t pcib, int b, int s, int f, int reg, +static int pci_add_map(device_t pcib, device_t bus, device_t dev, + int b, int s, int f, int reg, struct resource_list *rl); static void pci_add_resources(device_t pcib, device_t bus, device_t dev); @@ -82,13 +83,15 @@ static void pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg); static void pci_read_extcap(device_t pcib, pcicfgregs *cfg); +static void pci_cfg_restore(device_t, struct pci_devinfo *); +static void pci_cfg_save(device_t, struct pci_devinfo *, int); static device_method_t pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pci_probe), DEVMETHOD(device_attach, pci_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_suspend, pci_suspend), DEVMETHOD(device_resume, pci_resume), /* Bus interface */ @@ -96,7 +99,7 @@ DEVMETHOD(bus_probe_nomatch, pci_probe_nomatch), DEVMETHOD(bus_read_ivar, pci_read_ivar), DEVMETHOD(bus_write_ivar, pci_write_ivar), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), + DEVMETHOD(bus_driver_added, pci_driver_added), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -173,6 +176,14 @@ enable these bits correctly. We'd like to do this all the time, but there\n\ are some peripherals that this causes problems with."); +static int pci_do_powerstate = 0; +TUNABLE_INT("hw.pci.do_powerstate", (int *)&pci_do_powerstate); +SYSCTL_INT(_hw_pci, OID_AUTO, do_powerstate, CTLFLAG_RW, + &pci_do_powerstate, 0, + "Enable setting the power states of the PCI devices. This means that we\n\ +set devices into D0 before probe/attach, and D3 if they fail to attach. It\n\ +also means we set devices into D3 state before shutdown."); + /* Find a device_t by bus/slot/function */ device_t @@ -481,6 +492,12 @@ uint16_t status; int result; + /* + * Dx -> Dx is a nop always. + */ + if (pci_get_powerstate(dev) == state) + return (0); + if (cfg->pp.pp_cap != 0) { status = PCI_READ_CONFIG(dev, child, cfg->pp.pp_status, 2) & ~PCIM_PSTAT_DMASK; @@ -613,6 +630,7 @@ return (EINVAL); } pci_set_command_bit(dev, child, bit); + /* Some devices seem to need a brief stall here, what do to? */ command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); if (command & bit) return (0); @@ -719,11 +737,12 @@ * register is a 32bit map register or 2 if it is a 64bit register. */ static int -pci_add_map(device_t pcib, int b, int s, int f, int reg, - struct resource_list *rl) +pci_add_map(device_t pcib, device_t bus, device_t dev, + int b, int s, int f, int reg, struct resource_list *rl) { uint32_t map; uint64_t base; + uint64_t start, end, count; uint8_t ln2size; uint8_t ln2range; uint32_t testval; @@ -731,25 +750,35 @@ int type; map = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4); - - if (map == 0 || map == 0xffffffff) - return (1); /* skip invalid entry */ - PCIB_WRITE_CONFIG(pcib, b, s, f, reg, 0xffffffff, 4); testval = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4); PCIB_WRITE_CONFIG(pcib, b, s, f, reg, map, 4); - base = pci_mapbase(map); if (pci_maptype(map) & PCI_MAPMEM) type = SYS_RES_MEMORY; else type = SYS_RES_IOPORT; ln2size = pci_mapsize(testval); ln2range = pci_maprange(testval); - if (ln2range == 64) { + base = pci_mapbase(map); + + /* + * For I/O registers, if bottom bit is set, and the next bit up + * isn't clear, we know we have a BAR that doesn't conform to the + * spec, so ignore it. Also, sanity check the size of the data + * areas to the type of memory involved. Memory must be at least + * 32 bytes in size, while I/O ranges must be at least 4. + */ + if ((testval & 0x1) == 0x1 && + (testval & 0x2) != 0) + return (1); + if ((type == SYS_RES_MEMORY && ln2size < 5) || + (type == SYS_RES_IOPORT && ln2size < 2)) + return (1); + + if (ln2range == 64) /* Read the other half of a 64bit map register */ base |= (uint64_t) PCIB_READ_CONFIG(pcib, b, s, f, reg + 4, 4) << 32; - } if (bootverbose) { printf("\tmap[%02x]: type %x, range %2d, base %08x, size %2d", @@ -765,9 +794,10 @@ /* * This code theoretically does the right thing, but has - * undesirable side effects in some cases where - * peripherals respond oddly to having these bits - * enabled. Leave them alone by default. + * undesirable side effects in some cases where peripherals + * respond oddly to having these bits enabled. Let the user + * be able to turn them off (since pci_enable_io_modes is 1 by + * default). */ if (pci_enable_io_modes) { /* Turn on resources that have been left off by a lazy BIOS */ @@ -787,9 +817,23 @@ if (type == SYS_RES_MEMORY && !pci_memen(pcib, b, s, f)) return (1); } - resource_list_add(rl, type, reg, base, base + (1 << ln2size) - 1, - (1 << ln2size)); + /* + * If base is 0, then we have problems. It is best to ignore + * such entires for the moment. These will be allocated later if + * the driver specifically requests them. + */ + if (base == 0) + return 1; + start = base; + end = base + (1 << ln2size) - 1; + count = 1 << ln2size; + resource_list_add(rl, type, reg, start, end, count); + /* + * Not quite sure what to do on failure of allocating the resource + * since I can postulate several right answers. + */ + resource_list_alloc(rl, bus, dev, type, ®, start, end, count, 0); return ((ln2range == 64) ? 2 : 1); } @@ -805,14 +849,13 @@ b = cfg->bus; s = cfg->slot; f = cfg->func; - for (i = 0; i < cfg->nummaps;) { - i += pci_add_map(pcib, b, s, f, PCIR_BAR(i), rl); - } + for (i = 0; i < cfg->nummaps;) + i += pci_add_map(pcib, bus, dev, b, s, f, PCIR_BAR(i), rl); for (q = &pci_quirks[0]; q->devid; q++) { if (q->devid == ((cfg->device << 16) | cfg->vendor) && q->type == PCI_QUIRK_MAP_REG) - pci_add_map(pcib, b, s, f, q->arg1, rl); + pci_add_map(pcib, bus, dev, b, s, f, q->arg1, rl); } if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { @@ -873,6 +916,8 @@ pcib = device_get_parent(bus); dinfo->cfg.dev = device_add_child(bus, NULL, -1); device_set_ivars(dinfo->cfg.dev, dinfo); + pci_cfg_save(dinfo->cfg.dev, dinfo, 0); + pci_cfg_restore(dinfo->cfg.dev, dinfo); pci_add_resources(pcib, bus, dinfo->cfg.dev); pci_print_verbose(dinfo); } @@ -907,6 +952,52 @@ return (bus_generic_attach(dev)); } +int +pci_suspend(device_t dev) +{ + int numdevs; + device_t *devlist; + device_t child; + struct pci_devinfo *dinfo; + int i; + + /* + * Save the pci configuration space for each child. We don't need + * to do this, unless the BIOS suspend code powers down the bus and + * the devices on the bus. + */ + device_get_children(dev, &devlist, &numdevs); + for (i = 0; i < numdevs; i++) { + child = devlist[i]; + dinfo = (struct pci_devinfo *) device_get_ivars(child); + pci_cfg_save(child, dinfo, 0); + } + free(devlist, M_TEMP); + return (bus_generic_suspend(dev)); +} + +int +pci_resume(device_t dev) +{ + int numdevs; + device_t *devlist; >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404111612.i3BGCqGS022550>