Deleted Added
full compact
inphy.c (95718) inphy.c (95722)
1/*-
2 * Copyright (c) 2001 Jonathan Lemon
3 * 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

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2001 Jonathan Lemon
3 * 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

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/dev/mii/inphy.c 95718 2002-04-29 11:57:30Z phk $
29 * $FreeBSD: head/sys/dev/mii/inphy.c 95722 2002-04-29 13:07:38Z phk $
30 */
31
32/*
33 * driver for Intel 82553 and 82555 PHYs
34 */
35
36#include <sys/param.h>
37#include <sys/systm.h>

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

48#include <dev/mii/miidevs.h>
49
50#include <dev/mii/inphyreg.h>
51
52#include "miibus_if.h"
53
54static int inphy_probe(device_t dev);
55static int inphy_attach(device_t dev);
30 */
31
32/*
33 * driver for Intel 82553 and 82555 PHYs
34 */
35
36#include <sys/param.h>
37#include <sys/systm.h>

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

48#include <dev/mii/miidevs.h>
49
50#include <dev/mii/inphyreg.h>
51
52#include "miibus_if.h"
53
54static int inphy_probe(device_t dev);
55static int inphy_attach(device_t dev);
56static int inphy_detach(device_t dev);
57
58static device_method_t inphy_methods[] = {
59 /* device interface */
60 DEVMETHOD(device_probe, inphy_probe),
61 DEVMETHOD(device_attach, inphy_attach),
56
57static device_method_t inphy_methods[] = {
58 /* device interface */
59 DEVMETHOD(device_probe, inphy_probe),
60 DEVMETHOD(device_attach, inphy_attach),
62 DEVMETHOD(device_detach, inphy_detach),
61 DEVMETHOD(device_detach, mii_phy_detach),
63 DEVMETHOD(device_shutdown, bus_generic_shutdown),
64 { 0, 0 }
65};
66
67static devclass_t inphy_devclass;
68
69static driver_t inphy_driver = {
70 "inphy",

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

148 printf("\n");
149
150 MIIBUS_MEDIAINIT(sc->mii_dev);
151
152 return (0);
153}
154
155static int
62 DEVMETHOD(device_shutdown, bus_generic_shutdown),
63 { 0, 0 }
64};
65
66static devclass_t inphy_devclass;
67
68static driver_t inphy_driver = {
69 "inphy",

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

147 printf("\n");
148
149 MIIBUS_MEDIAINIT(sc->mii_dev);
150
151 return (0);
152}
153
154static int
156inphy_detach(device_t dev)
157{
158 struct mii_softc *sc;
159 struct mii_data *mii;
160
161 sc = device_get_softc(dev);
162 mii = device_get_softc(device_get_softc(dev));
163 mii_phy_auto_stop(sc);
164 sc->mii_dev = NULL;
165 LIST_REMOVE(sc, mii_list);
166
167 return (0);
168}
169
170static int
171inphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
172{
173 struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
174 int reg;
175
176 switch (cmd) {
177 case MII_POLLSTAT:
178 if (IFM_INST(ife->ifm_media) != sc->mii_inst)

--- 75 unchanged lines hidden ---
155inphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
156{
157 struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
158 int reg;
159
160 switch (cmd) {
161 case MII_POLLSTAT:
162 if (IFM_INST(ife->ifm_media) != sc->mii_inst)

--- 75 unchanged lines hidden ---