ciphy.c (183488) | ciphy.c (183489) |
---|---|
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 183488 2008-09-30 07:19:01Z yongari $"); | 34__FBSDID("$FreeBSD: head/sys/dev/mii/ciphy.c 183489 2008-09-30 07:20:26Z 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> --- 220 unchanged lines hidden (view full) --- 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; 270 /* | 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> --- 220 unchanged lines hidden (view full) --- 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; 270 /* |
271 * Only retry autonegotiation every 5 seconds. | 271 * Only retry autonegotiation every mii_anegticks seconds. |
272 */ | 272 */ |
273 if (sc->mii_ticks <= MII_ANEGTICKS) | 273 if (sc->mii_ticks <= sc->mii_anegticks) |
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 --- | 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 --- |