Deleted Added
full compact
mlphy.c (95722) mlphy.c (96026)
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

--- 15 unchanged lines hidden (view full) ---

24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
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 *
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

--- 15 unchanged lines hidden (view full) ---

24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
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 * $FreeBSD: head/sys/dev/mii/mlphy.c 95722 2002-04-29 13:07:38Z phk $
32 * $FreeBSD: head/sys/dev/mii/mlphy.c 96026 2002-05-04 11:00:30Z phk $
33 */
34
35/*
36 * driver for Micro Linear 6692 PHYs
37 *
38 * The Micro Linear 6692 is a strange beast, and dealing with it using
39 * this code framework is tricky. The 6692 is actually a 100Mbps-only
40 * device, which means that a second PHY is required to support 10Mbps

--- 192 unchanged lines hidden (view full) ---

233 * companion PHY (if any) and then do NWAY
234 * autonegotiation ourselves.
235 */
236 msc->ml_state = ML_STATE_AUTO_SELF;
237 if (other != NULL) {
238 mii_phy_reset(other);
239 PHY_WRITE(other, MII_BMCR, BMCR_ISO);
240 }
33 */
34
35/*
36 * driver for Micro Linear 6692 PHYs
37 *
38 * The Micro Linear 6692 is a strange beast, and dealing with it using
39 * this code framework is tricky. The 6692 is actually a 100Mbps-only
40 * device, which means that a second PHY is required to support 10Mbps

--- 192 unchanged lines hidden (view full) ---

233 * companion PHY (if any) and then do NWAY
234 * autonegotiation ourselves.
235 */
236 msc->ml_state = ML_STATE_AUTO_SELF;
237 if (other != NULL) {
238 mii_phy_reset(other);
239 PHY_WRITE(other, MII_BMCR, BMCR_ISO);
240 }
241 (void) mii_phy_auto(sc, 1);
241 (void) mii_phy_auto(sc);
242 msc->ml_linked = 0;
243 return(0);
244 break;
245 case IFM_10_T:
246 /*
247 * For 10baseT modes, reset and program the
248 * companion PHY (of any), then program ourselves
249 * to match. This will put us in pass-through

--- 91 unchanged lines hidden (view full) ---

341 msc->ml_linked = 0;
342 mii->mii_media_active = IFM_NONE;
343 mii_phy_reset(sc);
344 msc->ml_state = ML_STATE_AUTO_SELF;
345 if (other != NULL) {
346 mii_phy_reset(other);
347 PHY_WRITE(other, MII_BMCR, BMCR_ISO);
348 }
242 msc->ml_linked = 0;
243 return(0);
244 break;
245 case IFM_10_T:
246 /*
247 * For 10baseT modes, reset and program the
248 * companion PHY (of any), then program ourselves
249 * to match. This will put us in pass-through

--- 91 unchanged lines hidden (view full) ---

341 msc->ml_linked = 0;
342 mii->mii_media_active = IFM_NONE;
343 mii_phy_reset(sc);
344 msc->ml_state = ML_STATE_AUTO_SELF;
345 if (other != NULL) {
346 mii_phy_reset(other);
347 PHY_WRITE(other, MII_BMCR, BMCR_ISO);
348 }
349 if (mii_phy_auto(sc, 0) == EJUSTRETURN)
350 return(0);
351 break;
349 mii_phy_auto(sc);
350 return(0);
352 }
353
354 /* Update the media status. */
355
356 if (msc->ml_state == ML_STATE_AUTO_OTHER) {
357 int other_inst;
358 other_inst = other->mii_inst;
359 other->mii_inst = sc->mii_inst;

--- 60 unchanged lines hidden (view full) ---

420 PHY_WRITE(other, MII_BMCR, BMCR_ISO);
421 }
422
423 if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T) {
424 msc->ml_state = ML_STATE_AUTO_OTHER;
425 mlphy_reset(&msc->ml_mii);
426 PHY_WRITE(&msc->ml_mii, MII_BMCR, BMCR_ISO);
427 mii_phy_reset(other);
351 }
352
353 /* Update the media status. */
354
355 if (msc->ml_state == ML_STATE_AUTO_OTHER) {
356 int other_inst;
357 other_inst = other->mii_inst;
358 other->mii_inst = sc->mii_inst;

--- 60 unchanged lines hidden (view full) ---

419 PHY_WRITE(other, MII_BMCR, BMCR_ISO);
420 }
421
422 if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T) {
423 msc->ml_state = ML_STATE_AUTO_OTHER;
424 mlphy_reset(&msc->ml_mii);
425 PHY_WRITE(&msc->ml_mii, MII_BMCR, BMCR_ISO);
426 mii_phy_reset(other);
428 mii_phy_auto(other, 1);
427 mii_phy_auto(other);
429 }
430
431 return;
432}
428 }
429
430 return;
431}