if_ti.c (227311) | if_ti.c (227312) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 63 unchanged lines hidden (view full) --- 72 * - Raymond Lee of Netgear, for providing a pair of Netgear 73 * GA620 Tigon 2 boards for testing 74 * - Ulf Zimmermann, for bringing the GA260 to my attention and 75 * convincing me to write this driver. 76 * - Andrew Gallatin for providing FreeBSD/Alpha support. 77 */ 78 79#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 63 unchanged lines hidden (view full) --- 72 * - Raymond Lee of Netgear, for providing a pair of Netgear 73 * GA620 Tigon 2 boards for testing 74 * - Ulf Zimmermann, for bringing the GA260 to my attention and 75 * convincing me to write this driver. 76 * - Andrew Gallatin for providing FreeBSD/Alpha support. 77 */ 78 79#include <sys/cdefs.h> |
80__FBSDID("$FreeBSD: head/sys/dev/ti/if_ti.c 227311 2011-11-07 18:19:20Z yongari $"); | 80__FBSDID("$FreeBSD: head/sys/dev/ti/if_ti.c 227312 2011-11-07 18:26:38Z yongari $"); |
81 82#include "opt_ti.h" 83 84#include <sys/param.h> 85#include <sys/systm.h> 86#include <sys/sockio.h> 87#include <sys/mbuf.h> 88#include <sys/malloc.h> --- 2997 unchanged lines hidden (view full) --- 3086 TI_UNLOCK(sc); 3087} 3088 3089static void 3090ti_init_locked(void *xsc) 3091{ 3092 struct ti_softc *sc = xsc; 3093 | 81 82#include "opt_ti.h" 83 84#include <sys/param.h> 85#include <sys/systm.h> 86#include <sys/sockio.h> 87#include <sys/mbuf.h> 88#include <sys/malloc.h> --- 2997 unchanged lines hidden (view full) --- 3086 TI_UNLOCK(sc); 3087} 3088 3089static void 3090ti_init_locked(void *xsc) 3091{ 3092 struct ti_softc *sc = xsc; 3093 |
3094 if (sc->ti_ifp->if_drv_flags & IFF_DRV_RUNNING) 3095 return; 3096 |
|
3094 /* Cancel pending I/O and flush buffers. */ 3095 ti_stop(sc); 3096 3097 /* Init the gen info block, ring control blocks and firmware. */ 3098 if (ti_gibinit(sc)) { 3099 device_printf(sc->ti_dev, "initialization failure\n"); 3100 return; 3101 } --- 262 unchanged lines hidden (view full) --- 3364 3365 switch (command) { 3366 case SIOCSIFMTU: 3367 TI_LOCK(sc); 3368 if (ifr->ifr_mtu > TI_JUMBO_MTU) 3369 error = EINVAL; 3370 else { 3371 ifp->if_mtu = ifr->ifr_mtu; | 3097 /* Cancel pending I/O and flush buffers. */ 3098 ti_stop(sc); 3099 3100 /* Init the gen info block, ring control blocks and firmware. */ 3101 if (ti_gibinit(sc)) { 3102 device_printf(sc->ti_dev, "initialization failure\n"); 3103 return; 3104 } --- 262 unchanged lines hidden (view full) --- 3367 3368 switch (command) { 3369 case SIOCSIFMTU: 3370 TI_LOCK(sc); 3371 if (ifr->ifr_mtu > TI_JUMBO_MTU) 3372 error = EINVAL; 3373 else { 3374 ifp->if_mtu = ifr->ifr_mtu; |
3372 ti_init_locked(sc); | 3375 if (ifp->if_drv_flags & IFF_DRV_RUNNING) { 3376 ifp->if_drv_flags &= ~IFF_DRV_RUNNING; 3377 ti_init_locked(sc); 3378 } |
3373 } 3374 TI_UNLOCK(sc); 3375 break; 3376 case SIOCSIFFLAGS: 3377 TI_LOCK(sc); 3378 if (ifp->if_flags & IFF_UP) { 3379 /* 3380 * If only the state of the PROMISC flag changed, --- 397 unchanged lines hidden (view full) --- 3778 * of time, and that would normally cause the watchdog timer to fire. 3779 * Since that impedes debugging, we don't want to do that. 3780 */ 3781 if (sc->ti_flags & TI_FLAG_DEBUGING) 3782 return; 3783 3784 ifp = sc->ti_ifp; 3785 if_printf(ifp, "watchdog timeout -- resetting\n"); | 3379 } 3380 TI_UNLOCK(sc); 3381 break; 3382 case SIOCSIFFLAGS: 3383 TI_LOCK(sc); 3384 if (ifp->if_flags & IFF_UP) { 3385 /* 3386 * If only the state of the PROMISC flag changed, --- 397 unchanged lines hidden (view full) --- 3784 * of time, and that would normally cause the watchdog timer to fire. 3785 * Since that impedes debugging, we don't want to do that. 3786 */ 3787 if (sc->ti_flags & TI_FLAG_DEBUGING) 3788 return; 3789 3790 ifp = sc->ti_ifp; 3791 if_printf(ifp, "watchdog timeout -- resetting\n"); |
3786 ti_stop(sc); | 3792 ifp->if_drv_flags &= ~IFF_DRV_RUNNING; |
3787 ti_init_locked(sc); 3788 3789 ifp->if_oerrors++; 3790} 3791 3792/* 3793 * Stop the adapter and free any mbufs allocated to the 3794 * RX and TX lists. --- 62 unchanged lines hidden --- | 3793 ti_init_locked(sc); 3794 3795 ifp->if_oerrors++; 3796} 3797 3798/* 3799 * Stop the adapter and free any mbufs allocated to the 3800 * RX and TX lists. --- 62 unchanged lines hidden --- |