Deleted Added
full compact
if_re.c (185900) if_re.c (185901)
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 185900 2008-12-11 01:26:18Z yongari $");
34__FBSDID("$FreeBSD: head/sys/dev/re/if_re.c 185901 2008-12-11 01:41:38Z 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 */

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

695 for (i = 0; i < RL_TIMEOUT; i++) {
696 DELAY(10);
697 if (!(CSR_READ_1(sc, RL_COMMAND) & RL_CMD_RESET))
698 break;
699 }
700 if (i == RL_TIMEOUT)
701 device_printf(sc->rl_dev, "reset never completed!\n");
702
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 */

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

695 for (i = 0; i < RL_TIMEOUT; i++) {
696 DELAY(10);
697 if (!(CSR_READ_1(sc, RL_COMMAND) & RL_CMD_RESET))
698 break;
699 }
700 if (i == RL_TIMEOUT)
701 device_printf(sc->rl_dev, "reset never completed!\n");
702
703 CSR_WRITE_1(sc, 0x82, 1);
703 if ((sc->rl_flags & RL_FLAG_PHY8169) != 0)
704 CSR_WRITE_1(sc, 0x82, 1);
705 if ((sc->rl_flags & RL_FLAG_PHY8110S) != 0) {
706 CSR_WRITE_1(sc, 0x82, 1);
707 re_gmii_writereg(sc->rl_dev, 1, 0x0B, 0);
708 }
704}
705
706#ifdef RE_DIAG
707
708/*
709 * The following routine is designed to test for a defect on some
710 * 32-bit 8169 cards. Some of these NICs have the REQ64# and ACK64#
711 * lines connected to the bus, however for a 32-bit only card, they

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

1230 error = ENXIO;
1231 goto fail;
1232 }
1233
1234 switch (hw_rev->rl_rev) {
1235 case RL_HWREV_8139CPLUS:
1236 sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER;
1237 break;
709}
710
711#ifdef RE_DIAG
712
713/*
714 * The following routine is designed to test for a defect on some
715 * 32-bit 8169 cards. Some of these NICs have the REQ64# and ACK64#
716 * lines connected to the bus, however for a 32-bit only card, they

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

1235 error = ENXIO;
1236 goto fail;
1237 }
1238
1239 switch (hw_rev->rl_rev) {
1240 case RL_HWREV_8139CPLUS:
1241 sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER;
1242 break;
1243 case RL_HWREV_8110S:
1244 sc->rl_flags |= RL_FLAG_PHY8110S;
1245 break;
1238 case RL_HWREV_8100E:
1239 case RL_HWREV_8101E:
1240 sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR |
1241 RL_FLAG_PHYWAKE | RL_FLAG_FASTETHER;
1242 break;
1243 case RL_HWREV_8102E:
1244 case RL_HWREV_8102EL:
1245 sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR |

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

1266 * controllers need to disable checksum offload. So
1267 * disable jumbo frame until I have better idea what
1268 * it really requires to make it support.
1269 * RTL8168C/CP : supports up to 6KB jumbo frame.
1270 * RTL8111C/CP : supports up to 9KB jumbo frame.
1271 */
1272 sc->rl_flags |= RL_FLAG_NOJUMBO;
1273 break;
1246 case RL_HWREV_8100E:
1247 case RL_HWREV_8101E:
1248 sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR |
1249 RL_FLAG_PHYWAKE | RL_FLAG_FASTETHER;
1250 break;
1251 case RL_HWREV_8102E:
1252 case RL_HWREV_8102EL:
1253 sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR |

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

1274 * controllers need to disable checksum offload. So
1275 * disable jumbo frame until I have better idea what
1276 * it really requires to make it support.
1277 * RTL8168C/CP : supports up to 6KB jumbo frame.
1278 * RTL8111C/CP : supports up to 9KB jumbo frame.
1279 */
1280 sc->rl_flags |= RL_FLAG_NOJUMBO;
1281 break;
1282 case RL_HWREV_8169:
1283 case RL_HWREV_8169S:
1284 sc->rl_flags |= RL_FLAG_PHY8169;
1285 break;
1274 case RL_HWREV_8169_8110SB:
1275 case RL_HWREV_8169_8110SC:
1276 case RL_HWREV_8169_8110SBL:
1286 case RL_HWREV_8169_8110SB:
1287 case RL_HWREV_8169_8110SC:
1288 case RL_HWREV_8169_8110SBL:
1277 sc->rl_flags |= RL_FLAG_PHYWAKE;
1289 sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHY8169;
1278 break;
1279 default:
1280 break;
1281 }
1282
1283 /* Enable PME. */
1284 CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE);
1285 cfg = CSR_READ_1(sc, RL_CFG1);

--- 1791 unchanged lines hidden ---
1290 break;
1291 default:
1292 break;
1293 }
1294
1295 /* Enable PME. */
1296 CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE);
1297 cfg = CSR_READ_1(sc, RL_CFG1);

--- 1791 unchanged lines hidden ---