Deleted Added
full compact
rlphy.c (139749) rlphy.c (150763)
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

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

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
33#include <sys/cdefs.h>
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

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

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
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/mii/rlphy.c 139749 2005-01-06 01:43:34Z imp $");
34__FBSDID("$FreeBSD: head/sys/dev/mii/rlphy.c 150763 2005-09-30 19:39:27Z imp $");
35
36/*
37 * driver for RealTek 8139 internal PHYs
38 */
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

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

78};
79
80DRIVER_MODULE(rlphy, miibus, rlphy_driver, rlphy_devclass, 0, 0);
81
82static int rlphy_service(struct mii_softc *, struct mii_data *, int);
83static void rlphy_status(struct mii_softc *);
84
85static int
35
36/*
37 * driver for RealTek 8139 internal PHYs
38 */
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

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

78};
79
80DRIVER_MODULE(rlphy, miibus, rlphy_driver, rlphy_devclass, 0, 0);
81
82static int rlphy_service(struct mii_softc *, struct mii_data *, int);
83static void rlphy_status(struct mii_softc *);
84
85static int
86rlphy_probe(dev)
87 device_t dev;
86rlphy_probe(device_t dev)
88{
89 struct mii_attach_args *ma;
90 device_t parent;
91
92 ma = device_get_ivars(dev);
93 parent = device_get_parent(device_get_parent(dev));
94
95 /* Test for RealTek 8201L PHY */

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

115 return (ENXIO);
116
117 device_set_desc(dev, "RealTek internal media interface");
118
119 return (0);
120}
121
122static int
87{
88 struct mii_attach_args *ma;
89 device_t parent;
90
91 ma = device_get_ivars(dev);
92 parent = device_get_parent(device_get_parent(dev));
93
94 /* Test for RealTek 8201L PHY */

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

114 return (ENXIO);
115
116 device_set_desc(dev, "RealTek internal media interface");
117
118 return (0);
119}
120
121static int
123rlphy_attach(dev)
124 device_t dev;
122rlphy_attach(device_t dev)
125{
126 struct mii_softc *sc;
127 struct mii_attach_args *ma;
128 struct mii_data *mii;
129
130 sc = device_get_softc(dev);
131 ma = device_get_ivars(dev);
132 sc->mii_dev = device_get_parent(dev);

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

169 mii_add_media(sc);
170 printf("\n");
171#undef ADD
172 MIIBUS_MEDIAINIT(sc->mii_dev);
173 return(0);
174}
175
176static int
123{
124 struct mii_softc *sc;
125 struct mii_attach_args *ma;
126 struct mii_data *mii;
127
128 sc = device_get_softc(dev);
129 ma = device_get_ivars(dev);
130 sc->mii_dev = device_get_parent(dev);

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

167 mii_add_media(sc);
168 printf("\n");
169#undef ADD
170 MIIBUS_MEDIAINIT(sc->mii_dev);
171 return(0);
172}
173
174static int
177rlphy_service(sc, mii, cmd)
178 struct mii_softc *sc;
179 struct mii_data *mii;
180 int cmd;
175rlphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
181{
182 struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
183
184 /*
185 * We can't isolate the RealTek PHY, so it has to be the only one!
186 */
187 if (IFM_INST(ife->ifm_media) != sc->mii_inst)
188 panic("rlphy_service: can't isolate RealTek PHY");

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

246 rlphy_status(sc);
247
248 /* Callback if something changed. */
249 mii_phy_update(sc, cmd);
250 return (0);
251}
252
253static void
176{
177 struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
178
179 /*
180 * We can't isolate the RealTek PHY, so it has to be the only one!
181 */
182 if (IFM_INST(ife->ifm_media) != sc->mii_inst)
183 panic("rlphy_service: can't isolate RealTek PHY");

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

241 rlphy_status(sc);
242
243 /* Callback if something changed. */
244 mii_phy_update(sc, cmd);
245 return (0);
246}
247
248static void
254rlphy_status(phy)
255 struct mii_softc *phy;
249rlphy_status(struct mii_softc *phy)
256{
257 struct mii_data *mii = phy->mii_pdata;
258 int bmsr, bmcr, anlpar;
259 device_t parent;
260
261 mii->mii_media_status = IFM_AVALID;
262 mii->mii_media_active = IFM_ETHER;
263

--- 87 unchanged lines hidden ---
250{
251 struct mii_data *mii = phy->mii_pdata;
252 int bmsr, bmcr, anlpar;
253 device_t parent;
254
255 mii->mii_media_status = IFM_AVALID;
256 mii->mii_media_active = IFM_ETHER;
257

--- 87 unchanged lines hidden ---