Deleted Added
sdiff udiff text old ( 215716 ) new ( 221407 )
full compact
1/* $NetBSD: nsphyter.c,v 1.28 2008/01/20 07:58:19 msaitoh Exp $ */
2
3/*-
4 * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

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

50 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
51 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
52 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
53 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
54 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 */
56
57#include <sys/cdefs.h>
58__FBSDID("$FreeBSD: head/sys/dev/mii/nsphyter.c 221407 2011-05-03 19:51:29Z marius $");
59
60/*
61 * driver for National Semiconductor's DP83843 `PHYTER' ethernet 10/100 PHY
62 * Data Sheet available from www.national.com
63 *
64 * We also support the DP83815 `MacPHYTER' internal PHY since, for our
65 * purposes, they are compatible.
66 */

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

105};
106
107DRIVER_MODULE(nsphyter, miibus, nsphyter_driver, nsphyter_devclass, 0, 0);
108
109static int nsphyter_service(struct mii_softc *, struct mii_data *, int);
110static void nsphyter_status(struct mii_softc *);
111static void nsphyter_reset(struct mii_softc *);
112
113static const struct mii_phydesc nsphyters[] = {
114 MII_PHY_DESC(xxNATSEMI, DP83815),
115 MII_PHY_DESC(xxNATSEMI, DP83843),
116 MII_PHY_DESC(xxNATSEMI, DP83847),
117 MII_PHY_END
118};
119
120static const struct mii_phy_funcs nsphyter_funcs = {
121 nsphyter_service,
122 nsphyter_status,
123 nsphyter_reset
124};
125
126static int
127nsphyter_probe(device_t dev)
128{
129
130 return (mii_phy_dev_probe(dev, nsphyters, BUS_PROBE_DEFAULT));
131}
132
133static int
134nsphyter_attach(device_t dev)
135{
136
137 mii_phy_dev_attach(dev, MIIF_NOMANPAUSE, &nsphyter_funcs, 1);
138 return (0);
139}
140
141static int
142nsphyter_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
143{
144
145 switch (cmd) {

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

158
159 case MII_TICK:
160 if (mii_phy_tick(sc) == EJUSTRETURN)
161 return (0);
162 break;
163 }
164
165 /* Update the media status. */
166 PHY_STATUS(sc);
167
168 /* Callback if something changed. */
169 mii_phy_update(sc, cmd);
170 return (0);
171}
172
173static void
174nsphyter_status(struct mii_softc *sc)

--- 92 unchanged lines hidden ---