Deleted Added
full compact
rlphy.c (50702) rlphy.c (50758)
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/rlphy.c 50702 1999-08-31 14:43:30Z wpaul $
32 * $FreeBSD: head/sys/dev/mii/rlphy.c 50758 1999-09-01 17:07:27Z wpaul $
33 */
34
35/*
36 * driver for RealTek 8139 internal PHYs
37 */
38
39#include <sys/param.h>
40#include <sys/systm.h>

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

48
49#include <dev/mii/mii.h>
50#include <dev/mii/miivar.h>
51
52#include "miibus_if.h"
53
54#if !defined(lint)
55static const char rcsid[] =
33 */
34
35/*
36 * driver for RealTek 8139 internal PHYs
37 */
38
39#include <sys/param.h>
40#include <sys/systm.h>

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

48
49#include <dev/mii/mii.h>
50#include <dev/mii/miivar.h>
51
52#include "miibus_if.h"
53
54#if !defined(lint)
55static const char rcsid[] =
56 "$FreeBSD: head/sys/dev/mii/rlphy.c 50702 1999-08-31 14:43:30Z wpaul $";
56 "$FreeBSD: head/sys/dev/mii/rlphy.c 50758 1999-09-01 17:07:27Z wpaul $";
57#endif
58
59static int rlphy_probe __P((device_t));
60static int rlphy_attach __P((device_t));
61static int rlphy_detach __P((device_t));
62
63static device_method_t rlphy_methods[] = {
64 /* device interface */

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

116 struct mii_softc *sc;
117 struct mii_attach_args *ma;
118 struct mii_data *mii;
119
120 sc = device_get_softc(dev);
121 ma = device_get_ivars(dev);
122 sc->mii_dev = device_get_parent(dev);
123 mii = device_get_softc(sc->mii_dev);
57#endif
58
59static int rlphy_probe __P((device_t));
60static int rlphy_attach __P((device_t));
61static int rlphy_detach __P((device_t));
62
63static device_method_t rlphy_methods[] = {
64 /* device interface */

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

116 struct mii_softc *sc;
117 struct mii_attach_args *ma;
118 struct mii_data *mii;
119
120 sc = device_get_softc(dev);
121 ma = device_get_ivars(dev);
122 sc->mii_dev = device_get_parent(dev);
123 mii = device_get_softc(sc->mii_dev);
124 LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
125
124
126 sc->mii_inst = mii->mii_instance;
127 sc->mii_phy = ma->mii_phyno;
128 sc->mii_service = rlphy_service;
129 sc->mii_pdata = mii;
130
131 /*
132 * The RealTek PHY can never be isolated, so never allow non-zero
133 * instances!
134 */
135 if (mii->mii_instance != 0) {
136 device_printf(dev, "ignoring this PHY, non-zero instance\n");
137 return(ENXIO);
138 }
139
125 /*
126 * The RealTek PHY can never be isolated, so never allow non-zero
127 * instances!
128 */
129 if (mii->mii_instance != 0) {
130 device_printf(dev, "ignoring this PHY, non-zero instance\n");
131 return(ENXIO);
132 }
133
134 LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
135
136 sc->mii_inst = mii->mii_instance;
137 sc->mii_phy = ma->mii_phyno;
138 sc->mii_service = rlphy_service;
139 sc->mii_pdata = mii;
140 mii->mii_instance++;
141
142 sc->mii_flags |= MIIF_NOISOLATE;
143
144#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL)
145
146#if 0 /* See above. */
147 ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst),

--- 137 unchanged lines hidden ---
140 mii->mii_instance++;
141
142 sc->mii_flags |= MIIF_NOISOLATE;
143
144#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL)
145
146#if 0 /* See above. */
147 ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst),

--- 137 unchanged lines hidden ---