if_nfe.c (173674) | if_nfe.c (173839) |
---|---|
1/* $OpenBSD: if_nfe.c,v 1.54 2006/04/07 12:38:12 jsg Exp $ */ 2 3/*- 4 * Copyright (c) 2006 Shigeaki Tagashira <shigeaki@se.hiroshima-u.ac.jp> 5 * Copyright (c) 2006 Damien Bergamini <damien.bergamini@free.fr> 6 * Copyright (c) 2005, 2006 Jonathan Gray <jsg@openbsd.org> 7 * 8 * Permission to use, copy, modify, and distribute this software for any --- 7 unchanged lines hidden (view full) --- 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 */ 20 21/* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ 22 23#include <sys/cdefs.h> | 1/* $OpenBSD: if_nfe.c,v 1.54 2006/04/07 12:38:12 jsg Exp $ */ 2 3/*- 4 * Copyright (c) 2006 Shigeaki Tagashira <shigeaki@se.hiroshima-u.ac.jp> 5 * Copyright (c) 2006 Damien Bergamini <damien.bergamini@free.fr> 6 * Copyright (c) 2005, 2006 Jonathan Gray <jsg@openbsd.org> 7 * 8 * Permission to use, copy, modify, and distribute this software for any --- 7 unchanged lines hidden (view full) --- 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 */ 20 21/* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ 22 23#include <sys/cdefs.h> |
24__FBSDID("$FreeBSD: head/sys/dev/nfe/if_nfe.c 173674 2007-11-16 15:51:47Z sam $"); | 24__FBSDID("$FreeBSD: head/sys/dev/nfe/if_nfe.c 173839 2007-11-22 02:45:00Z yongari $"); |
25 26#ifdef HAVE_KERNEL_OPTION_HEADERS 27#include "opt_device_polling.h" 28#endif 29 30#include <sys/param.h> 31#include <sys/endian.h> 32#include <sys/systm.h> --- 38 unchanged lines hidden (view full) --- 71/* "device miibus" required. See GENERIC if you get errors here. */ 72#include "miibus_if.h" 73 74static int nfe_probe(device_t); 75static int nfe_attach(device_t); 76static int nfe_detach(device_t); 77static int nfe_suspend(device_t); 78static int nfe_resume(device_t); | 25 26#ifdef HAVE_KERNEL_OPTION_HEADERS 27#include "opt_device_polling.h" 28#endif 29 30#include <sys/param.h> 31#include <sys/endian.h> 32#include <sys/systm.h> --- 38 unchanged lines hidden (view full) --- 71/* "device miibus" required. See GENERIC if you get errors here. */ 72#include "miibus_if.h" 73 74static int nfe_probe(device_t); 75static int nfe_attach(device_t); 76static int nfe_detach(device_t); 77static int nfe_suspend(device_t); 78static int nfe_resume(device_t); |
79static void nfe_shutdown(device_t); | 79static int nfe_shutdown(device_t); |
80static void nfe_power(struct nfe_softc *); 81static int nfe_miibus_readreg(device_t, int, int); 82static int nfe_miibus_writereg(device_t, int, int, int); 83static void nfe_miibus_statchg(device_t); 84static void nfe_link_task(void *, int); 85static void nfe_set_intr(struct nfe_softc *); 86static __inline void nfe_enable_intr(struct nfe_softc *); 87static __inline void nfe_disable_intr(struct nfe_softc *); --- 3022 unchanged lines hidden (view full) --- 3110 3111 mii = device_get_softc(sc->nfe_miibus); 3112 mii_tick(mii); 3113 nfe_watchdog(ifp); 3114 callout_reset(&sc->nfe_stat_ch, hz, nfe_tick, sc); 3115} 3116 3117 | 80static void nfe_power(struct nfe_softc *); 81static int nfe_miibus_readreg(device_t, int, int); 82static int nfe_miibus_writereg(device_t, int, int, int); 83static void nfe_miibus_statchg(device_t); 84static void nfe_link_task(void *, int); 85static void nfe_set_intr(struct nfe_softc *); 86static __inline void nfe_enable_intr(struct nfe_softc *); 87static __inline void nfe_disable_intr(struct nfe_softc *); --- 3022 unchanged lines hidden (view full) --- 3110 3111 mii = device_get_softc(sc->nfe_miibus); 3112 mii_tick(mii); 3113 nfe_watchdog(ifp); 3114 callout_reset(&sc->nfe_stat_ch, hz, nfe_tick, sc); 3115} 3116 3117 |
3118static void | 3118static int |
3119nfe_shutdown(device_t dev) 3120{ 3121 struct nfe_softc *sc; 3122 struct ifnet *ifp; 3123 3124 sc = device_get_softc(dev); 3125 3126 NFE_LOCK(sc); 3127 ifp = sc->nfe_ifp; 3128 nfe_stop(ifp); 3129 /* nfe_reset(sc); */ 3130 NFE_UNLOCK(sc); | 3119nfe_shutdown(device_t dev) 3120{ 3121 struct nfe_softc *sc; 3122 struct ifnet *ifp; 3123 3124 sc = device_get_softc(dev); 3125 3126 NFE_LOCK(sc); 3127 ifp = sc->nfe_ifp; 3128 nfe_stop(ifp); 3129 /* nfe_reset(sc); */ 3130 NFE_UNLOCK(sc); |
3131 3132 return (0); |
|
3131} 3132 3133 3134static void 3135nfe_get_macaddr(struct nfe_softc *sc, uint8_t *addr) 3136{ 3137 uint32_t val; 3138 --- 79 unchanged lines hidden --- | 3133} 3134 3135 3136static void 3137nfe_get_macaddr(struct nfe_softc *sc, uint8_t *addr) 3138{ 3139 uint32_t val; 3140 --- 79 unchanged lines hidden --- |