if_my.c (172568) | if_my.c (188172) |
---|---|
1/*- 2 * Written by: yen_cw@myson.com.tw 3 * Copyright (c) 2002 Myson Technology Inc. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * Myson fast ethernet PCI NIC driver, available at: http://www.myson.com.tw/ 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Written by: yen_cw@myson.com.tw 3 * Copyright (c) 2002 Myson Technology Inc. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * Myson fast ethernet PCI NIC driver, available at: http://www.myson.com.tw/ 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/my/if_my.c 172568 2007-10-12 06:03:46Z kevlo $"); | 31__FBSDID("$FreeBSD: head/sys/dev/my/if_my.c 188172 2009-02-05 19:30:55Z imp $"); |
32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/sockio.h> 36#include <sys/mbuf.h> 37#include <sys/malloc.h> 38#include <sys/kernel.h> 39#include <sys/socket.h> --- 82 unchanged lines hidden (view full) --- 122static void my_intr(void *); 123static void my_start(struct ifnet *); 124static void my_start_locked(struct ifnet *); 125static int my_ioctl(struct ifnet *, u_long, caddr_t); 126static void my_init(void *); 127static void my_init_locked(struct my_softc *); 128static void my_stop(struct my_softc *); 129static void my_watchdog(struct ifnet *); | 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/sockio.h> 36#include <sys/mbuf.h> 37#include <sys/malloc.h> 38#include <sys/kernel.h> 39#include <sys/socket.h> --- 82 unchanged lines hidden (view full) --- 122static void my_intr(void *); 123static void my_start(struct ifnet *); 124static void my_start_locked(struct ifnet *); 125static int my_ioctl(struct ifnet *, u_long, caddr_t); 126static void my_init(void *); 127static void my_init_locked(struct my_softc *); 128static void my_stop(struct my_softc *); 129static void my_watchdog(struct ifnet *); |
130static void my_shutdown(device_t); | 130static int my_shutdown(device_t); |
131static int my_ifmedia_upd(struct ifnet *); 132static void my_ifmedia_sts(struct ifnet *, struct ifmediareq *); 133static u_int16_t my_phy_readreg(struct my_softc *, int); 134static void my_phy_writereg(struct my_softc *, int, int); 135static void my_autoneg_xmit(struct my_softc *); 136static void my_autoneg_mii(struct my_softc *, int, int); 137static void my_setmode_mii(struct my_softc *, int); 138static void my_getmode_mii(struct my_softc *); --- 1609 unchanged lines hidden (view full) --- 1748 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); 1749 return; 1750} 1751 1752/* 1753 * Stop all chip I/O so that the kernel's probe routines don't get confused 1754 * by errant DMAs when rebooting. 1755 */ | 131static int my_ifmedia_upd(struct ifnet *); 132static void my_ifmedia_sts(struct ifnet *, struct ifmediareq *); 133static u_int16_t my_phy_readreg(struct my_softc *, int); 134static void my_phy_writereg(struct my_softc *, int, int); 135static void my_autoneg_xmit(struct my_softc *); 136static void my_autoneg_mii(struct my_softc *, int, int); 137static void my_setmode_mii(struct my_softc *, int); 138static void my_getmode_mii(struct my_softc *); --- 1609 unchanged lines hidden (view full) --- 1748 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); 1749 return; 1750} 1751 1752/* 1753 * Stop all chip I/O so that the kernel's probe routines don't get confused 1754 * by errant DMAs when rebooting. 1755 */ |
1756static void | 1756static int |
1757my_shutdown(device_t dev) 1758{ 1759 struct my_softc *sc; 1760 1761 sc = device_get_softc(dev); 1762 MY_LOCK(sc); 1763 my_stop(sc); 1764 MY_UNLOCK(sc); | 1757my_shutdown(device_t dev) 1758{ 1759 struct my_softc *sc; 1760 1761 sc = device_get_softc(dev); 1762 MY_LOCK(sc); 1763 my_stop(sc); 1764 MY_UNLOCK(sc); |
1765 return; | 1765 return 0; |
1766} | 1766} |