| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ukphy.c,v 1.45 2013/06/09 09:24:29 msaitoh Exp $ */ | | 1 | /* $NetBSD: ukphy.c,v 1.46 2013/06/11 16:18:48 msaitoh Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | | 8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, |
9 | * NASA Ames Research Center, and by Frank van der Linden. | | 9 | * NASA Ames Research Center, and by Frank van der Linden. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -49,27 +49,27 @@ | | | @@ -49,27 +49,27 @@ |
49 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 49 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
50 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 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 | | 51 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
52 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 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 | | 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. | | 54 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
55 | */ | | 55 | */ |
56 | | | 56 | |
57 | /* | | 57 | /* |
58 | * driver for generic unknown PHYs | | 58 | * driver for generic unknown PHYs |
59 | */ | | 59 | */ |
60 | | | 60 | |
61 | #include <sys/cdefs.h> | | 61 | #include <sys/cdefs.h> |
62 | __KERNEL_RCSID(0, "$NetBSD: ukphy.c,v 1.45 2013/06/09 09:24:29 msaitoh Exp $"); | | 62 | __KERNEL_RCSID(0, "$NetBSD: ukphy.c,v 1.46 2013/06/11 16:18:48 msaitoh Exp $"); |
63 | | | 63 | |
64 | #include "opt_mii.h" | | 64 | #include "opt_mii.h" |
65 | | | 65 | |
66 | #include <sys/param.h> | | 66 | #include <sys/param.h> |
67 | #include <sys/systm.h> | | 67 | #include <sys/systm.h> |
68 | #include <sys/kernel.h> | | 68 | #include <sys/kernel.h> |
69 | #include <sys/device.h> | | 69 | #include <sys/device.h> |
70 | #include <sys/socket.h> | | 70 | #include <sys/socket.h> |
71 | #include <sys/errno.h> | | 71 | #include <sys/errno.h> |
72 | | | 72 | |
73 | #include <net/if.h> | | 73 | #include <net/if.h> |
74 | #include <net/if_media.h> | | 74 | #include <net/if_media.h> |
75 | | | 75 | |
| @@ -178,32 +178,26 @@ ukphy_service(struct mii_softc *sc, stru | | | @@ -178,32 +178,26 @@ ukphy_service(struct mii_softc *sc, stru |
178 | if ((mii->mii_ifp->if_flags & IFF_UP) == 0) | | 178 | if ((mii->mii_ifp->if_flags & IFF_UP) == 0) |
179 | break; | | 179 | break; |
180 | | | 180 | |
181 | mii_phy_setmedia(sc); | | 181 | mii_phy_setmedia(sc); |
182 | break; | | 182 | break; |
183 | | | 183 | |
184 | case MII_TICK: | | 184 | case MII_TICK: |
185 | /* | | 185 | /* |
186 | * If we're not currently selected, just return. | | 186 | * If we're not currently selected, just return. |
187 | */ | | 187 | */ |
188 | if (IFM_INST(ife->ifm_media) != sc->mii_inst) | | 188 | if (IFM_INST(ife->ifm_media) != sc->mii_inst) |
189 | return (0); | | 189 | return (0); |
190 | | | 190 | |
191 | /* | | | |
192 | * Only used for autonegotiation. | | | |
193 | */ | | | |
194 | if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) | | | |
195 | break; | | | |
196 | | | | |
197 | if (mii_phy_tick(sc) == EJUSTRETURN) | | 191 | if (mii_phy_tick(sc) == EJUSTRETURN) |
198 | return (0); | | 192 | return (0); |
199 | break; | | 193 | break; |
200 | | | 194 | |
201 | case MII_DOWN: | | 195 | case MII_DOWN: |
202 | mii_phy_down(sc); | | 196 | mii_phy_down(sc); |
203 | return (0); | | 197 | return (0); |
204 | } | | 198 | } |
205 | | | 199 | |
206 | /* Update the media status. */ | | 200 | /* Update the media status. */ |
207 | mii_phy_status(sc); | | 201 | mii_phy_status(sc); |
208 | | | 202 | |
209 | /* Callback if something changed. */ | | 203 | /* Callback if something changed. */ |