Module Name: src Committed By: snj Date: Sat Oct 3 21:53:36 UTC 2009
Modified Files: src/sys/dev/pci [netbsd-5]: if_vr.c Log Message: Pull up following revision(s) (requested by jmcneill in ticket #1022): sys/dev/pci/if_vr.c: revision 1.99 add suspend/resume support To generate a diff of this commit: cvs rdiff -u -r1.95.4.1 -r1.95.4.2 src/sys/dev/pci/if_vr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_vr.c diff -u src/sys/dev/pci/if_vr.c:1.95.4.1 src/sys/dev/pci/if_vr.c:1.95.4.2 --- src/sys/dev/pci/if_vr.c:1.95.4.1 Sat Oct 3 21:53:01 2009 +++ src/sys/dev/pci/if_vr.c Sat Oct 3 21:53:36 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vr.c,v 1.95.4.1 2009/10/03 21:53:01 snj Exp $ */ +/* $NetBSD: if_vr.c,v 1.95.4.2 2009/10/03 21:53:36 snj Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.95.4.1 2009/10/03 21:53:01 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.95.4.2 2009/10/03 21:53:36 snj Exp $"); #include "rnd.h" @@ -216,6 +216,7 @@ uint8_t vr_enaddr[ETHER_ADDR_LEN]; struct mii_data vr_mii; /* MII/media info */ + pcireg_t vr_id; /* vendor/product ID */ uint8_t vr_revid; /* Rhine chip revision */ callout_t vr_tick_ch; /* tick callout */ @@ -324,6 +325,7 @@ static void vr_reset(struct vr_softc *); static int vr_restore_state(pci_chipset_tag_t, pcitag_t, device_t, pcireg_t); +static bool vr_resume(device_t PMF_FN_PROTO); int vr_copy_small = 0; @@ -1462,6 +1464,7 @@ sc->vr_dev = self; sc->vr_pc = pa->pa_pc; sc->vr_tag = pa->pa_tag; + sc->vr_id = pa->pa_id; callout_init(&sc->vr_tick_ch, 0); vrt = vr_lookup(pa); @@ -1713,7 +1716,7 @@ RND_TYPE_NET, 0); #endif - if (pmf_device_register1(self, NULL, NULL, vr_shutdown)) + if (pmf_device_register1(self, NULL, vr_resume, vr_shutdown)) pmf_class_network_register(self, ifp); else aprint_error_dev(self, "couldn't establish power handler\n"); @@ -1762,3 +1765,14 @@ PCI_CONF_WRITE(PCI_INTERRUPT_REG, sc->vr_save_irq); return 0; } + +static bool +vr_resume(device_t self PMF_FN_ARGS) +{ + struct vr_softc *sc = device_private(self); + + if (PCI_PRODUCT(sc->vr_id) != PCI_PRODUCT_VIATECH_VT3043) + VR_CLRBIT(sc, VR_STICKHW, (VR_STICKHW_DS0|VR_STICKHW_DS1)); + + return true; +}