Deleted Added
full compact
mlphy.c (95705) mlphy.c (95722)
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 95705 2002-04-29 06:48:20Z phk $
32 * $FreeBSD: head/sys/dev/mii/mlphy.c 95722 2002-04-29 13:07:38Z 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

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

69struct mlphy_softc {
70 struct mii_softc ml_mii;
71 int ml_state;
72 int ml_linked;
73};
74
75static int mlphy_probe (device_t);
76static int mlphy_attach (device_t);
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

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

69struct mlphy_softc {
70 struct mii_softc ml_mii;
71 int ml_state;
72 int ml_linked;
73};
74
75static int mlphy_probe (device_t);
76static int mlphy_attach (device_t);
77static int mlphy_detach (device_t);
78
79static device_method_t mlphy_methods[] = {
80 /* device interface */
81 DEVMETHOD(device_probe, mlphy_probe),
82 DEVMETHOD(device_attach, mlphy_attach),
77
78static device_method_t mlphy_methods[] = {
79 /* device interface */
80 DEVMETHOD(device_probe, mlphy_probe),
81 DEVMETHOD(device_attach, mlphy_attach),
83 DEVMETHOD(device_detach, mlphy_detach),
82 DEVMETHOD(device_detach, mii_phy_detach),
84 DEVMETHOD(device_shutdown, bus_generic_shutdown),
85 { 0, 0 }
86};
87
88static devclass_t mlphy_devclass;
89
90static driver_t mlphy_driver = {
91 "mlphy",

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

169 device_printf(dev, " ");
170 mii_add_media(sc);
171 printf("\n");
172#undef ADD
173 MIIBUS_MEDIAINIT(sc->mii_dev);
174 return(0);
175}
176
83 DEVMETHOD(device_shutdown, bus_generic_shutdown),
84 { 0, 0 }
85};
86
87static devclass_t mlphy_devclass;
88
89static driver_t mlphy_driver = {
90 "mlphy",

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

168 device_printf(dev, " ");
169 mii_add_media(sc);
170 printf("\n");
171#undef ADD
172 MIIBUS_MEDIAINIT(sc->mii_dev);
173 return(0);
174}
175
177static int mlphy_detach(dev)
178 device_t dev;
179{
180 struct mlphy_softc *sc;
181 struct mii_data *mii;
182
183 sc = device_get_softc(dev);
184 mii = device_get_softc(device_get_parent(dev));
185 mii_phy_auto_stop(&sc->ml_mii);
186 sc->ml_mii.mii_dev = NULL;
187 LIST_REMOVE(&sc->ml_mii, mii_list);
188
189 return(0);
190}
191
192static int
193mlphy_service(xsc, mii, cmd)
194 struct mii_softc *xsc;
195 struct mii_data *mii;
196 int cmd;
197{
198 struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
199 int reg;

--- 249 unchanged lines hidden ---
176static int
177mlphy_service(xsc, mii, cmd)
178 struct mii_softc *xsc;
179 struct mii_data *mii;
180 int cmd;
181{
182 struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
183 int reg;

--- 249 unchanged lines hidden ---