if_rl.c (117126) | if_rl.c (117208) |
---|---|
1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.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 --- 68 unchanged lines hidden (view full) --- 77 * 78 * The 8129 chip is an older version of the 8139 that uses an external PHY 79 * chip. The 8129 has a serial MDIO interface for accessing the MII where 80 * the 8139 lets you directly access the on-board PHY registers. We need 81 * to select which interface to use depending on the chip type. 82 */ 83 84#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.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 --- 68 unchanged lines hidden (view full) --- 77 * 78 * The 8129 chip is an older version of the 8139 that uses an external PHY 79 * chip. The 8129 has a serial MDIO interface for accessing the MII where 80 * the 8139 lets you directly access the on-board PHY registers. We need 81 * to select which interface to use depending on the chip type. 82 */ 83 84#include <sys/cdefs.h> |
85__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 117126 2003-07-01 15:52:06Z scottl $"); | 85__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 117208 2003-07-03 21:39:53Z imp $"); |
86 87#include <sys/param.h> 88#include <sys/endian.h> 89#include <sys/systm.h> 90#include <sys/sockio.h> 91#include <sys/mbuf.h> 92#include <sys/malloc.h> 93#include <sys/kernel.h> --- 34 unchanged lines hidden (view full) --- 128 * can hang the bus. I'm inclined to blame this on crummy design/construction 129 * on the part of RealTek. Memory mapped mode does appear to work on 130 * uniprocessor systems though. 131 */ 132#define RL_USEIOSPACE 133 134#include <pci/if_rlreg.h> 135 | 86 87#include <sys/param.h> 88#include <sys/endian.h> 89#include <sys/systm.h> 90#include <sys/sockio.h> 91#include <sys/mbuf.h> 92#include <sys/malloc.h> 93#include <sys/kernel.h> --- 34 unchanged lines hidden (view full) --- 128 * can hang the bus. I'm inclined to blame this on crummy design/construction 129 * on the part of RealTek. Memory mapped mode does appear to work on 130 * uniprocessor systems though. 131 */ 132#define RL_USEIOSPACE 133 134#include <pci/if_rlreg.h> 135 |
136__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 117126 2003-07-01 15:52:06Z scottl $"); | 136__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 117208 2003-07-03 21:39:53Z imp $"); |
137 138/* 139 * Various supported device vendors/types and their names. 140 */ 141static struct rl_type rl_devs[] = { 142 { RT_VENDORID, RT_DEVICEID_8129, 143 "RealTek 8129 10/100BaseTX" }, 144 { RT_VENDORID, RT_DEVICEID_8139, --- 723 unchanged lines hidden (view full) --- 868 u_int16_t rl_did = 0; 869 int unit, error = 0, rid, i; 870 871 sc = device_get_softc(dev); 872 unit = device_get_unit(dev); 873 874 mtx_init(&sc->rl_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, 875 MTX_DEF | MTX_RECURSE); | 137 138/* 139 * Various supported device vendors/types and their names. 140 */ 141static struct rl_type rl_devs[] = { 142 { RT_VENDORID, RT_DEVICEID_8129, 143 "RealTek 8129 10/100BaseTX" }, 144 { RT_VENDORID, RT_DEVICEID_8139, --- 723 unchanged lines hidden (view full) --- 868 u_int16_t rl_did = 0; 869 int unit, error = 0, rid, i; 870 871 sc = device_get_softc(dev); 872 unit = device_get_unit(dev); 873 874 mtx_init(&sc->rl_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, 875 MTX_DEF | MTX_RECURSE); |
876 | 876#ifndef BURN_BRIDGES |
877 /* 878 * Handle power management nonsense. 879 */ 880 881 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { 882 u_int32_t iobase, membase, irq; 883 884 /* Save important PCI config data. */ --- 8 unchanged lines hidden (view full) --- 893 894 pci_set_powerstate(dev, PCI_POWERSTATE_D0); 895 896 /* Restore PCI config data. */ 897 pci_write_config(dev, RL_PCI_LOIO, iobase, 4); 898 pci_write_config(dev, RL_PCI_LOMEM, membase, 4); 899 pci_write_config(dev, RL_PCI_INTLINE, irq, 4); 900 } | 877 /* 878 * Handle power management nonsense. 879 */ 880 881 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { 882 u_int32_t iobase, membase, irq; 883 884 /* Save important PCI config data. */ --- 8 unchanged lines hidden (view full) --- 893 894 pci_set_powerstate(dev, PCI_POWERSTATE_D0); 895 896 /* Restore PCI config data. */ 897 pci_write_config(dev, RL_PCI_LOIO, iobase, 4); 898 pci_write_config(dev, RL_PCI_LOMEM, membase, 4); 899 pci_write_config(dev, RL_PCI_INTLINE, irq, 4); 900 } |
901 | 901#endif |
902 /* 903 * Map control/status registers. 904 */ 905 pci_enable_busmaster(dev); 906 907 rid = RL_RID; 908 sc->rl_res = bus_alloc_resource(dev, RL_RES, &rid, 909 0, ~0, 1, RF_ACTIVE); --- 1022 unchanged lines hidden --- | 902 /* 903 * Map control/status registers. 904 */ 905 pci_enable_busmaster(dev); 906 907 rid = RL_RID; 908 sc->rl_res = bus_alloc_resource(dev, RL_RES, &rid, 909 0, ~0, 1, RF_ACTIVE); --- 1022 unchanged lines hidden --- |