Deleted Added
full compact
pnphy.c (213384) pnphy.c (213893)
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ee.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@ee.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/dc/pnphy.c 213384 2010-10-03 17:00:57Z marius $");
34__FBSDID("$FreeBSD: head/sys/dev/dc/pnphy.c 213893 2010-10-15 14:52:11Z marius $");
35
36/*
37 * Pseudo-driver for media selection on the Lite-On PNIC 82c168
38 * chip. The NWAY support on this chip is horribly broken, so we
39 * only support manual mode selection. This is lame, but getting
40 * NWAY to work right is amazingly difficult.
41 */
42

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

127 struct mii_data *mii;
128
129 sc = device_get_softc(dev);
130 ma = device_get_ivars(dev);
131 sc->mii_dev = device_get_parent(dev);
132 mii = ma->mii_data;
133 LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
134
35
36/*
37 * Pseudo-driver for media selection on the Lite-On PNIC 82c168
38 * chip. The NWAY support on this chip is horribly broken, so we
39 * only support manual mode selection. This is lame, but getting
40 * NWAY to work right is amazingly difficult.
41 */
42

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

127 struct mii_data *mii;
128
129 sc = device_get_softc(dev);
130 ma = device_get_ivars(dev);
131 sc->mii_dev = device_get_parent(dev);
132 mii = ma->mii_data;
133 LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
134
135 sc->mii_flags = miibus_get_flags(dev);
135 sc->mii_inst = mii->mii_instance++;
136 sc->mii_phy = ma->mii_phyno;
137 sc->mii_service = pnphy_service;
138 sc->mii_pdata = mii;
139
140 /*
141 * Apparently, we can neither isolate nor do loopback.
142 */

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

164
165 case MII_MEDIACHG:
166 /*
167 * If the interface is not up, don't do anything.
168 */
169 if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
170 break;
171
136 sc->mii_inst = mii->mii_instance++;
137 sc->mii_phy = ma->mii_phyno;
138 sc->mii_service = pnphy_service;
139 sc->mii_pdata = mii;
140
141 /*
142 * Apparently, we can neither isolate nor do loopback.
143 */

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

165
166 case MII_MEDIACHG:
167 /*
168 * If the interface is not up, don't do anything.
169 */
170 if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
171 break;
172
172 sc->mii_flags = 0;
173
174 switch (IFM_SUBTYPE(ife->ifm_media)) {
175 case IFM_AUTO:
176 /* NWAY is busted on this chip */
177 case IFM_100_T4:
178 /*
179 * XXX Not supported as a manual setting right now.
180 */
181 return (EINVAL);

--- 61 unchanged lines hidden ---
173 switch (IFM_SUBTYPE(ife->ifm_media)) {
174 case IFM_AUTO:
175 /* NWAY is busted on this chip */
176 case IFM_100_T4:
177 /*
178 * XXX Not supported as a manual setting right now.
179 */
180 return (EINVAL);

--- 61 unchanged lines hidden ---