ciphy.c (178598) | ciphy.c (183488) |
---|---|
1/*- 2 * Copyright (c) 2004 3 * Bill Paul <wpaul@windriver.com>. 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 --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 3 * Bill Paul <wpaul@windriver.com>. 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 --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/dev/mii/ciphy.c 178598 2008-04-26 18:07:24Z raj $"); | 34__FBSDID("$FreeBSD: head/sys/dev/mii/ciphy.c 183488 2008-09-30 07:19:01Z yongari $"); |
35 36/* 37 * Driver for the Cicada/Vitesse CS/VSC8xxx 10/100/1000 copper PHY. 38 */ 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> --- 216 unchanged lines hidden (view full) --- 259 * Check to see if we have link. If we do, we don't 260 * need to restart the autonegotiation process. Read 261 * the BMSR twice in case it's latched. 262 */ 263 reg = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); 264 if (reg & BMSR_LINK) 265 break; 266 | 35 36/* 37 * Driver for the Cicada/Vitesse CS/VSC8xxx 10/100/1000 copper PHY. 38 */ 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> --- 216 unchanged lines hidden (view full) --- 259 * Check to see if we have link. If we do, we don't 260 * need to restart the autonegotiation process. Read 261 * the BMSR twice in case it's latched. 262 */ 263 reg = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); 264 if (reg & BMSR_LINK) 265 break; 266 |
267 /* Announce link loss right after it happens. */ 268 if (++sc->mii_ticks == 0) 269 break; |
|
267 /* 268 * Only retry autonegotiation every 5 seconds. 269 */ | 270 /* 271 * Only retry autonegotiation every 5 seconds. 272 */ |
270 if (++sc->mii_ticks <= MII_ANEGTICKS) | 273 if (sc->mii_ticks <= MII_ANEGTICKS) |
271 break; 272 273 sc->mii_ticks = 0; 274 mii_phy_auto(sc); 275 return (0); 276 } 277 278 /* Update the media status. */ --- 150 unchanged lines hidden --- | 274 break; 275 276 sc->mii_ticks = 0; 277 mii_phy_auto(sc); 278 return (0); 279 } 280 281 /* Update the media status. */ --- 150 unchanged lines hidden --- |