Deleted Added
sdiff udiff text old ( 95667 ) new ( 95722 )
full compact
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ee.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/dc/pnphy.c 95722 2002-04-29 13:07:38Z phk $
33 */
34
35/*
36 * Pseudo-driver for media selection on the Lite-On PNIC 82c168
37 * chip. The NWAY support on this chip is horribly broken, so we
38 * only support manual mode selection. This is lame, but getting
39 * NWAY to work right is amazingly difficult.
40 */

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

64#include <sys/bus.h>
65
66#include <pci/if_dcreg.h>
67
68#include "miibus_if.h"
69
70#if !defined(lint)
71static const char rcsid[] =
72 "$FreeBSD: head/sys/dev/dc/pnphy.c 95722 2002-04-29 13:07:38Z phk $";
73#endif
74
75#define DC_SETBIT(sc, reg, x) \
76 CSR_WRITE_4(sc, reg, \
77 CSR_READ_4(sc, reg) | x)
78
79#define DC_CLRBIT(sc, reg, x) \
80 CSR_WRITE_4(sc, reg, \
81 CSR_READ_4(sc, reg) & ~x)
82
83static int pnphy_probe (device_t);
84static int pnphy_attach (device_t);
85
86static device_method_t pnphy_methods[] = {
87 /* device interface */
88 DEVMETHOD(device_probe, pnphy_probe),
89 DEVMETHOD(device_attach, pnphy_attach),
90 DEVMETHOD(device_detach, mii_phy_detach),
91 DEVMETHOD(device_shutdown, bus_generic_shutdown),
92 { 0, 0 }
93};
94
95static devclass_t pnphy_devclass;
96
97static driver_t pnphy_driver = {
98 "pnphy",

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

161 BMCR_LOOP|BMCR_S100);
162
163#undef ADD
164
165 MIIBUS_MEDIAINIT(sc->mii_dev);
166 return(0);
167}
168
169static int
170pnphy_service(sc, mii, cmd)
171 struct mii_softc *sc;
172 struct mii_data *mii;
173 int cmd;
174{
175 struct dc_softc *dc_sc;
176 struct ifmedia_entry *ife = mii->mii_media.ifm_cur;

--- 108 unchanged lines hidden ---