Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Fix wm_access_phy_wakeup_reg_bm(). This change has n...
details: https://anonhg.NetBSD.org/src/rev/44930a25a0fc
branches: trunk
changeset: 348802:44930a25a0fc
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Tue Nov 08 10:37:39 2016 +0000
description:
Fix wm_access_phy_wakeup_reg_bm(). This change has no effect because this
function is used for WUC register and our driver currenlty doesn't access
to it.
diffstat:
sys/dev/mii/inbmphyreg.h | 3 ++-
sys/dev/pci/if_wm.c | 27 +++++++++++++++++++++------
2 files changed, 23 insertions(+), 7 deletions(-)
diffs (89 lines):
diff -r e8af20325508 -r 44930a25a0fc sys/dev/mii/inbmphyreg.h
--- a/sys/dev/mii/inbmphyreg.h Tue Nov 08 09:38:36 2016 +0000
+++ b/sys/dev/mii/inbmphyreg.h Tue Nov 08 10:37:39 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: inbmphyreg.h,v 1.7 2016/10/28 05:50:18 msaitoh Exp $ */
+/* $NetBSD: inbmphyreg.h,v 1.8 2016/11/08 10:37:39 msaitoh Exp $ */
/*******************************************************************************
Copyright (c) 2001-2005, Intel Corporation
All rights reserved.
@@ -111,5 +111,6 @@
#define BM_WUC_ENABLE_REG 17
#define BM_WUC_ENABLE_BIT (1 << 2)
#define BM_WUC_HOST_WU_BIT (1 << 4)
+#define BM_WUC_ME_WU_BIT (1 << 5)
#endif /* _DEV_MII_INBMPHYREG_H_ */
diff -r e8af20325508 -r 44930a25a0fc sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c Tue Nov 08 09:38:36 2016 +0000
+++ b/sys/dev/pci/if_wm.c Tue Nov 08 10:37:39 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.440 2016/11/08 09:38:36 msaitoh Exp $ */
+/* $NetBSD: if_wm.c,v 1.441 2016/11/08 10:37:40 msaitoh Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.440 2016/11/08 09:38:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.441 2016/11/08 10:37:40 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -8840,7 +8840,7 @@
{
struct wm_softc *sc = device_private(self);
uint16_t regnum = BM_PHY_REG_NUM(offset);
- uint16_t wuce;
+ uint16_t wuce, reg;
DPRINTF(WM_DEBUG_GMII, ("%s: %s called\n",
device_xname(sc->sc_dev), __func__));
@@ -8849,20 +8849,31 @@
/* XXX e1000 driver do nothing... why? */
}
+ /*
+ * 1) Enable PHY wakeup register first.
+ * See e1000_enable_phy_wakeup_reg_access_bm().
+ */
+
/* Set page 769 */
wm_gmii_mdic_writereg(self, 1, MII_IGPHY_PAGE_SELECT,
BM_WUC_ENABLE_PAGE << BME1000_PAGE_SHIFT);
+ /* Read WUCE and save it */
wuce = wm_gmii_mdic_readreg(self, 1, BM_WUC_ENABLE_REG);
- wuce &= ~BM_WUC_HOST_WU_BIT;
- wm_gmii_mdic_writereg(self, 1, BM_WUC_ENABLE_REG,
- wuce | BM_WUC_ENABLE_BIT);
+ reg = wuce | BM_WUC_ENABLE_BIT;
+ reg &= ~(BM_WUC_ME_WU_BIT | BM_WUC_HOST_WU_BIT);
+ wm_gmii_mdic_writereg(self, 1, BM_WUC_ENABLE_REG, reg);
/* Select page 800 */
wm_gmii_mdic_writereg(self, 1, MII_IGPHY_PAGE_SELECT,
BM_WUC_PAGE << BME1000_PAGE_SHIFT);
+ /*
+ * 2) Access PHY wakeup register.
+ * See e1000_access_phy_wakeup_reg_bm.
+ */
+
/* Write page 800 */
wm_gmii_mdic_writereg(self, 1, BM_WUC_ADDRESS_OPCODE, regnum);
@@ -8871,6 +8882,10 @@
else
wm_gmii_mdic_writereg(self, 1, BM_WUC_DATA_OPCODE, *val);
+ /*
+ * 3) Disable PHY wakeup register.
+ * See e1000_disable_phy_wakeup_reg_access_bm().
+ */
/* Set page 769 */
wm_gmii_mdic_writereg(self, 1, MII_IGPHY_PAGE_SELECT,
BM_WUC_ENABLE_PAGE << BME1000_PAGE_SHIFT);
Home |
Main Index |
Thread Index |
Old Index