[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree
zrouter-src-freebsd at zrouter.org
zrouter-src-freebsd at zrouter.org
Fri Mar 2 15:40:17 UTC 2012
details: http://zrouter.org/hg/FreeBSD/head//rev/c81d2e364ab8
changeset: 407:c81d2e364ab8
user: ray at terran.dlink.ua
date: Fri Mar 02 17:18:35 2012 +0200
description:
Update to FreeBSD-HEAD @232391
diffstat:
head/sys/pci/if_rl.c | 39 ++++++++++++++++++++++++---------------
head/sys/pci/if_rlreg.h | 16 +++++++++++++++-
2 files changed, 39 insertions(+), 16 deletions(-)
diffs (144 lines):
diff -r aa9c9bb008fc -r c81d2e364ab8 head/sys/pci/if_rl.c
--- a/head/sys/pci/if_rl.c Fri Mar 02 17:18:27 2012 +0200
+++ b/head/sys/pci/if_rl.c Fri Mar 02 17:18:35 2012 +0200
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 227843 2011-11-22 21:28:20Z marius $");
+__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 232145 2012-02-25 04:54:51Z yongari $");
/*
* RealTek 8129/8139 PCI NIC driver
@@ -717,6 +717,13 @@
goto fail;
}
+ sc->rl_cfg0 = RL_8139_CFG0;
+ sc->rl_cfg1 = RL_8139_CFG1;
+ sc->rl_cfg2 = 0;
+ sc->rl_cfg3 = RL_8139_CFG3;
+ sc->rl_cfg4 = RL_8139_CFG4;
+ sc->rl_cfg5 = RL_8139_CFG5;
+
/*
* Reset the adapter. Only take the lock here as it's needed in
* order to call rl_reset().
@@ -818,6 +825,7 @@
}
}
ifp->if_capenable = ifp->if_capabilities;
+ ifp->if_capenable &= ~(IFCAP_WOL_UCAST | IFCAP_WOL_MCAST);
#ifdef DEVICE_POLLING
ifp->if_capabilities |= IFCAP_POLLING;
#endif
@@ -1754,7 +1762,7 @@
sc->rl_flags &= ~RL_FLAG_LINK;
mii_mediachg(mii);
- CSR_WRITE_1(sc, RL_CFG1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX);
+ CSR_WRITE_1(sc, sc->rl_cfg1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX);
ifp->if_drv_flags |= IFF_DRV_RUNNING;
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
@@ -2055,22 +2063,19 @@
CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE);
/* Enable PME. */
- v = CSR_READ_1(sc, RL_CFG1);
+ v = CSR_READ_1(sc, sc->rl_cfg1);
v &= ~RL_CFG1_PME;
if ((ifp->if_capenable & IFCAP_WOL) != 0)
v |= RL_CFG1_PME;
- CSR_WRITE_1(sc, RL_CFG1, v);
+ CSR_WRITE_1(sc, sc->rl_cfg1, v);
- v = CSR_READ_1(sc, RL_CFG3);
+ v = CSR_READ_1(sc, sc->rl_cfg3);
v &= ~(RL_CFG3_WOL_LINK | RL_CFG3_WOL_MAGIC);
if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
v |= RL_CFG3_WOL_MAGIC;
- CSR_WRITE_1(sc, RL_CFG3, v);
+ CSR_WRITE_1(sc, sc->rl_cfg3, v);
- /* Config register write done. */
- CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
-
- v = CSR_READ_1(sc, RL_CFG5);
+ v = CSR_READ_1(sc, sc->rl_cfg5);
v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST);
v &= ~RL_CFG5_WOL_LANWAKE;
if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0)
@@ -2079,7 +2084,11 @@
v |= RL_CFG5_WOL_MCAST | RL_CFG5_WOL_BCAST;
if ((ifp->if_capenable & IFCAP_WOL) != 0)
v |= RL_CFG5_WOL_LANWAKE;
- CSR_WRITE_1(sc, RL_CFG5, v);
+ CSR_WRITE_1(sc, sc->rl_cfg5, v);
+
+ /* Config register write done. */
+ CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
+
/* Request PME if WOL is requested. */
pmstat = pci_read_config(sc->rl_dev, pmc + PCIR_POWER_STATUS, 2);
pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE);
@@ -2101,15 +2110,15 @@
/* Enable config register write. */
CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE);
- v = CSR_READ_1(sc, RL_CFG3);
+ v = CSR_READ_1(sc, sc->rl_cfg3);
v &= ~(RL_CFG3_WOL_LINK | RL_CFG3_WOL_MAGIC);
- CSR_WRITE_1(sc, RL_CFG3, v);
+ CSR_WRITE_1(sc, sc->rl_cfg3, v);
/* Config register write done. */
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
- v = CSR_READ_1(sc, RL_CFG5);
+ v = CSR_READ_1(sc, sc->rl_cfg5);
v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST);
v &= ~RL_CFG5_WOL_LANWAKE;
- CSR_WRITE_1(sc, RL_CFG5, v);
+ CSR_WRITE_1(sc, sc->rl_cfg5, v);
}
diff -r aa9c9bb008fc -r c81d2e364ab8 head/sys/pci/if_rlreg.h
--- a/head/sys/pci/if_rlreg.h Fri Mar 02 17:18:27 2012 +0200
+++ b/head/sys/pci/if_rlreg.h Fri Mar 02 17:18:35 2012 +0200
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: head/sys/pci/if_rlreg.h 227916 2011-11-23 23:29:18Z yongari $
+ * $FreeBSD: head/sys/pci/if_rlreg.h 232145 2012-02-25 04:54:51Z yongari $
*/
/*
@@ -74,6 +74,14 @@
#define RL_TIMERCNT 0x0048 /* timer count register */
#define RL_MISSEDPKT 0x004C /* missed packet counter */
#define RL_EECMD 0x0050 /* EEPROM command register */
+
+/* RTL8139/RTL8139C+ only */
+#define RL_8139_CFG0 0x0051 /* config register #0 */
+#define RL_8139_CFG1 0x0052 /* config register #1 */
+#define RL_8139_CFG3 0x0059 /* config register #3 */
+#define RL_8139_CFG4 0x005A /* config register #4 */
+#define RL_8139_CFG5 0x00D8 /* config register #5 */
+
#define RL_CFG0 0x0051 /* config register #0 */
#define RL_CFG1 0x0052 /* config register #1 */
#define RL_CFG2 0x0053 /* config register #2 */
@@ -873,6 +881,12 @@
int rl_eewidth;
int rl_expcap;
int rl_txthresh;
+ bus_size_t rl_cfg0;
+ bus_size_t rl_cfg1;
+ bus_size_t rl_cfg2;
+ bus_size_t rl_cfg3;
+ bus_size_t rl_cfg4;
+ bus_size_t rl_cfg5;
struct rl_chain_data rl_cdata;
struct rl_list_data rl_ldata;
struct callout rl_stat_callout;
More information about the Zrouter-src-freebsd
mailing list