Deleted Added
full compact
gentbi.c (166263) gentbi.c (173157)
1/* $NetBSD: gentbi.c,v 1.15 2006/03/29 07:05:24 thorpej Exp $ */
2
3/*-
4 * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

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

69/*
70 * Driver for generic ten-bit (1000BASE-SX) interfaces, built in to
71 * many Gigabit Ethernet chips.
72 *
73 * All we have to do here is correctly report speed and duplex.
74 */
75
76#include <sys/cdefs.h>
1/* $NetBSD: gentbi.c,v 1.15 2006/03/29 07:05:24 thorpej Exp $ */
2
3/*-
4 * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

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

69/*
70 * Driver for generic ten-bit (1000BASE-SX) interfaces, built in to
71 * many Gigabit Ethernet chips.
72 *
73 * All we have to do here is correctly report speed and duplex.
74 */
75
76#include <sys/cdefs.h>
77__FBSDID("$FreeBSD: head/sys/dev/mii/gentbi.c 166263 2007-01-26 17:06:02Z dwhite $");
77__FBSDID("$FreeBSD: head/sys/dev/mii/gentbi.c 173157 2007-10-29 21:11:55Z marius $");
78
79/*
80 * Driver for generic unknown ten-bit interfaces(1000BASE-{LX,SX}
81 * fiber interfaces).
82 */
83
84#include <sys/param.h>
85#include <sys/systm.h>

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

177 device_printf(dev, "OUI 0x%06x, model 0x%04x, rev. %d\n",
178 MII_OUI(ma->mii_id1, ma->mii_id2),
179 MII_MODEL(ma->mii_id2), MII_REV(ma->mii_id2));
180
181 sc->mii_inst = mii->mii_instance;
182 sc->mii_phy = ma->mii_phyno;
183 sc->mii_service = gentbi_service;
184 sc->mii_pdata = mii;
78
79/*
80 * Driver for generic unknown ten-bit interfaces(1000BASE-{LX,SX}
81 * fiber interfaces).
82 */
83
84#include <sys/param.h>
85#include <sys/systm.h>

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

177 device_printf(dev, "OUI 0x%06x, model 0x%04x, rev. %d\n",
178 MII_OUI(ma->mii_id1, ma->mii_id2),
179 MII_MODEL(ma->mii_id2), MII_REV(ma->mii_id2));
180
181 sc->mii_inst = mii->mii_instance;
182 sc->mii_phy = ma->mii_phyno;
183 sc->mii_service = gentbi_service;
184 sc->mii_pdata = mii;
185 sc->mii_flags |= MIIF_NOISOLATE;
186
187 mii->mii_instance++;
188
189 mii_phy_reset(sc);
190
191 /*
192 * Mask out all media in the BMSR. We only are really interested
193 * in "auto".

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

282 return;
283 }
284
285 if (bmcr & BMCR_LOOP)
286 mii->mii_media_active |= IFM_LOOP;
287
288 if (bmcr & BMCR_AUTOEN) {
289 /*
185
186 mii->mii_instance++;
187
188 mii_phy_reset(sc);
189
190 /*
191 * Mask out all media in the BMSR. We only are really interested
192 * in "auto".

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

281 return;
282 }
283
284 if (bmcr & BMCR_LOOP)
285 mii->mii_media_active |= IFM_LOOP;
286
287 if (bmcr & BMCR_AUTOEN) {
288 /*
290 * The media status bits are only valid of autonegotiation
289 * The media status bits are only valid if autonegotiation
291 * has completed (or it's disabled).
292 */
293 if ((bmsr & BMSR_ACOMP) == 0) {
294 /* Erg, still trying, I guess... */
295 mii->mii_media_active |= IFM_NONE;
296 return;
297 }
298

--- 13 unchanged lines hidden ---
290 * has completed (or it's disabled).
291 */
292 if ((bmsr & BMSR_ACOMP) == 0) {
293 /* Erg, still trying, I guess... */
294 mii->mii_media_active |= IFM_NONE;
295 return;
296 }
297

--- 13 unchanged lines hidden ---