Deleted Added
full compact
if_re.c (174203) if_re.c (174428)
1/*-
2 * Copyright (c) 1997, 1998-2003
3 * Bill Paul <wpaul@windriver.com>. 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-2003
3 * Bill Paul <wpaul@windriver.com>. 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/re/if_re.c 174203 2007-12-03 01:28:08Z yongari $");
34__FBSDID("$FreeBSD: head/sys/dev/re/if_re.c 174428 2007-12-08 00:14:09Z yongari $");
35
36/*
37 * RealTek 8139C+/8169/8169S/8110S/8168/8111/8101E PCI NIC driver
38 *
39 * Written by Bill Paul <wpaul@windriver.com>
40 * Senior Networking Software Engineer
41 * Wind River Systems
42 */

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

177 { RT_VENDORID, RT_DEVICEID_8139, RL_HWREV_8139CPLUS,
178 "RealTek 8139C+ 10/100BaseTX" },
179 { RT_VENDORID, RT_DEVICEID_8101E, RL_HWREV_8101E,
180 "RealTek 8101E PCIe 10/100baseTX" },
181 { RT_VENDORID, RT_DEVICEID_8168, RL_HWREV_8168_SPIN1,
182 "RealTek 8168/8111B PCIe Gigabit Ethernet" },
183 { RT_VENDORID, RT_DEVICEID_8168, RL_HWREV_8168_SPIN2,
184 "RealTek 8168/8111B PCIe Gigabit Ethernet" },
35
36/*
37 * RealTek 8139C+/8169/8169S/8110S/8168/8111/8101E PCI NIC driver
38 *
39 * Written by Bill Paul <wpaul@windriver.com>
40 * Senior Networking Software Engineer
41 * Wind River Systems
42 */

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

177 { RT_VENDORID, RT_DEVICEID_8139, RL_HWREV_8139CPLUS,
178 "RealTek 8139C+ 10/100BaseTX" },
179 { RT_VENDORID, RT_DEVICEID_8101E, RL_HWREV_8101E,
180 "RealTek 8101E PCIe 10/100baseTX" },
181 { RT_VENDORID, RT_DEVICEID_8168, RL_HWREV_8168_SPIN1,
182 "RealTek 8168/8111B PCIe Gigabit Ethernet" },
183 { RT_VENDORID, RT_DEVICEID_8168, RL_HWREV_8168_SPIN2,
184 "RealTek 8168/8111B PCIe Gigabit Ethernet" },
185 { RT_VENDORID, RT_DEVICEID_8168, RL_HWREV_8168_SPIN3,
186 "RealTek 8168/8111B PCIe Gigabit Ethernet" },
185 { RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169,
186 "RealTek 8169 Gigabit Ethernet" },
187 { RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169S,
188 "RealTek 8169S Single-chip Gigabit Ethernet" },
189 { RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169_8110SB,
190 "RealTek 8169SB/8110SB Single-chip Gigabit Ethernet" },
191 { RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169_8110SC,
192 "RealTek 8169SC/8110SC Single-chip Gigabit Ethernet" },

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

218 { RL_HWREV_8110S, RL_8169, "8110S"},
219 { RL_HWREV_8169_8110SB, RL_8169, "8169SB"},
220 { RL_HWREV_8169_8110SC, RL_8169, "8169SC"},
221 { RL_HWREV_8100, RL_8139, "8100"},
222 { RL_HWREV_8101, RL_8139, "8101"},
223 { RL_HWREV_8100E, RL_8169, "8100E"},
224 { RL_HWREV_8101E, RL_8169, "8101E"},
225 { RL_HWREV_8168_SPIN2, RL_8169, "8168"},
187 { RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169,
188 "RealTek 8169 Gigabit Ethernet" },
189 { RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169S,
190 "RealTek 8169S Single-chip Gigabit Ethernet" },
191 { RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169_8110SB,
192 "RealTek 8169SB/8110SB Single-chip Gigabit Ethernet" },
193 { RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169_8110SC,
194 "RealTek 8169SC/8110SC Single-chip Gigabit Ethernet" },

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

220 { RL_HWREV_8110S, RL_8169, "8110S"},
221 { RL_HWREV_8169_8110SB, RL_8169, "8169SB"},
222 { RL_HWREV_8169_8110SC, RL_8169, "8169SC"},
223 { RL_HWREV_8100, RL_8139, "8100"},
224 { RL_HWREV_8101, RL_8139, "8101"},
225 { RL_HWREV_8100E, RL_8169, "8100E"},
226 { RL_HWREV_8101E, RL_8169, "8101E"},
227 { RL_HWREV_8168_SPIN2, RL_8169, "8168"},
228 { RL_HWREV_8168_SPIN3, RL_8169, "8168"},
226 { 0, 0, NULL }
227};
228
229static int re_probe (device_t);
230static int re_attach (device_t);
231static int re_detach (device_t);
232
233static int re_encap (struct rl_softc *, struct mbuf **, int *);

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

678 * For some unfathomable reason, RealTek decided to reverse
679 * the order of the multicast hash registers in the PCI Express
680 * parts. This means we have to write the hash pattern in reverse
681 * order for those devices.
682 */
683
684 hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV;
685
229 { 0, 0, NULL }
230};
231
232static int re_probe (device_t);
233static int re_attach (device_t);
234static int re_detach (device_t);
235
236static int re_encap (struct rl_softc *, struct mbuf **, int *);

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

681 * For some unfathomable reason, RealTek decided to reverse
682 * the order of the multicast hash registers in the PCI Express
683 * parts. This means we have to write the hash pattern in reverse
684 * order for those devices.
685 */
686
687 hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV;
688
686 if (hwrev == RL_HWREV_8100E || hwrev == RL_HWREV_8101E ||
687 hwrev == RL_HWREV_8168_SPIN1 || hwrev == RL_HWREV_8168_SPIN2) {
689 switch (hwrev) {
690 case RL_HWREV_8100E:
691 case RL_HWREV_8101E:
692 case RL_HWREV_8168_SPIN1:
693 case RL_HWREV_8168_SPIN2:
694 case RL_HWREV_8168_SPIN3:
688 CSR_WRITE_4(sc, RL_MAR0, bswap32(hashes[1]));
689 CSR_WRITE_4(sc, RL_MAR4, bswap32(hashes[0]));
695 CSR_WRITE_4(sc, RL_MAR0, bswap32(hashes[1]));
696 CSR_WRITE_4(sc, RL_MAR4, bswap32(hashes[0]));
690 } else {
697 break;
698 default:
691 CSR_WRITE_4(sc, RL_MAR0, hashes[0]);
692 CSR_WRITE_4(sc, RL_MAR4, hashes[1]);
699 CSR_WRITE_4(sc, RL_MAR0, hashes[0]);
700 CSR_WRITE_4(sc, RL_MAR4, hashes[1]);
701 break;
693 }
694}
695
696static void
697re_reset(sc)
698 struct rl_softc *sc;
699{
700 register int i;

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

1315 /* HWVERID 0, 1 and 2 : bit26-30, bit23 */
1316 rev &= 0x7c800000;
1317 if (rev != 0) {
1318 /* RTL8169S single chip */
1319 switch (rev) {
1320 case RL_HWREV_8169_8110SB:
1321 case RL_HWREV_8169_8110SC:
1322 case RL_HWREV_8168_SPIN2:
702 }
703}
704
705static void
706re_reset(sc)
707 struct rl_softc *sc;
708{
709 register int i;

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

1324 /* HWVERID 0, 1 and 2 : bit26-30, bit23 */
1325 rev &= 0x7c800000;
1326 if (rev != 0) {
1327 /* RTL8169S single chip */
1328 switch (rev) {
1329 case RL_HWREV_8169_8110SB:
1330 case RL_HWREV_8169_8110SC:
1331 case RL_HWREV_8168_SPIN2:
1332 case RL_HWREV_8168_SPIN3:
1323 re_gmii_writereg(dev, 1, 0x1f, 0);
1324 re_gmii_writereg(dev, 1, 0x0e, 0);
1325 break;
1326 default:
1327 break;
1328 }
1329 }
1330 }

--- 1502 unchanged lines hidden ---
1333 re_gmii_writereg(dev, 1, 0x1f, 0);
1334 re_gmii_writereg(dev, 1, 0x0e, 0);
1335 break;
1336 default:
1337 break;
1338 }
1339 }
1340 }

--- 1502 unchanged lines hidden ---