Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Sync the wm_enable_mng_pass_thru() function with...
details: https://anonhg.NetBSD.org/src/rev/bbe569a3c93a
branches: trunk
changeset: 787599:bbe569a3c93a
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Tue Jun 25 17:38:38 2013 +0000
description:
Sync the wm_enable_mng_pass_thru() function with FreeBSD. Don't check
MANC_EN_MAC_ADDR_FILTER bit. Add 82574 and 82583 specific check. This
modification may change the setting of WM_F_HAS_MANAGE flag on some machines.
Sync the wm_release_manageablilty() fucntion with FreeBSD. Set MANC_ARP_EN.
This change enables HW ARP function when entering suspend.
When the chip is 82580(ER) or I350, set WM_F_ASF_FIRMWARE_PRES flag and
check for the WM_F_ARC_SUBSYS_VALID flag. Same as FreeBSD.
diffstat:
sys/dev/pci/if_wm.c | 21 +++++++++++++++------
sys/dev/pci/if_wmreg.h | 10 ++++++++--
2 files changed, 23 insertions(+), 8 deletions(-)
diffs (99 lines):
diff -r b2f3bb61d2ff -r bbe569a3c93a sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c Tue Jun 25 17:38:06 2013 +0000
+++ b/sys/dev/pci/if_wm.c Tue Jun 25 17:38:38 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.259 2013/06/25 02:34:00 msaitoh Exp $ */
+/* $NetBSD: if_wm.c,v 1.260 2013/06/25 17:38:38 msaitoh Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.259 2013/06/25 02:34:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.260 2013/06/25 17:38:38 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -7968,8 +7968,7 @@
DPRINTF(WM_DEBUG_MANAGE, ("%s: MANC (%08x)\n",
device_xname(sc->sc_dev), manc));
- if (((manc & MANC_RECV_TCO_EN) == 0)
- || ((manc & MANC_EN_MAC_ADDR_FILTER) == 0))
+ if ((manc & MANC_RECV_TCO_EN) == 0)
return 0;
if ((sc->sc_flags & WM_F_ARC_SUBSYS_VALID) != 0) {
@@ -7979,6 +7978,17 @@
&& ((fwsm & FWSM_MODE_MASK)
== (MNG_ICH_IAMT_MODE << FWSM_MODE_SHIFT)))
return 1;
+ } else if ((sc->sc_type == WM_T_82574) || (sc->sc_type == WM_T_82583)){
+ uint16_t data;
+
+ factps = CSR_READ(sc, WMREG_FACTPS);
+ wm_read_eeprom(sc, EEPROM_OFF_CFG2, 1, &data);
+ DPRINTF(WM_DEBUG_MANAGE, ("%s: CFG2 (%04x)\n",
+ device_xname(sc->sc_dev), data));
+ if (((factps & FACTPS_MNGCG) == 0)
+ && ((data & EEPROM_CFG2_MNGM_MASK)
+ == (EEPROM_CFG2_MNGM_PT << EEPROM_CFG2_MNGM_SHIFT)))
+ return 1;
} else if (((manc & MANC_SMBUS_EN) != 0)
&& ((manc & MANC_ASF_EN) == 0))
return 1;
@@ -8471,6 +8481,7 @@
if (sc->sc_flags & WM_F_HAS_MANAGE) {
uint32_t manc = CSR_READ(sc, WMREG_MANC);
+ manc |= MANC_ARP_EN;
if (sc->sc_type >= WM_T_82571)
manc &= ~MANC_EN_MNG2HOST;
@@ -8496,11 +8507,9 @@
case WM_T_82574:
case WM_T_82575:
case WM_T_82576:
-#if 0 /* XXX */
case WM_T_82580:
case WM_T_82580ER:
case WM_T_I350:
-#endif
if ((CSR_READ(sc, WMREG_FWSM) & FWSM_MODE_MASK) != 0)
sc->sc_flags |= WM_F_ARC_SUBSYS_VALID;
sc->sc_flags |= WM_F_ASF_FIRMWARE_PRES;
diff -r b2f3bb61d2ff -r bbe569a3c93a sys/dev/pci/if_wmreg.h
--- a/sys/dev/pci/if_wmreg.h Tue Jun 25 17:38:06 2013 +0000
+++ b/sys/dev/pci/if_wmreg.h Tue Jun 25 17:38:38 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wmreg.h,v 1.53 2013/06/19 10:38:51 msaitoh Exp $ */
+/* $NetBSD: if_wmreg.h,v 1.54 2013/06/25 17:38:38 msaitoh Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -350,7 +350,11 @@
#define EEPROM_CFG2_APM_PME (1U << 15)
#define EEPROM_CFG2_SWDPIO_SHIFT 4
#define EEPROM_CFG2_SWDPIO_MASK (0xf << EEPROM_CFG2_SWDPIO_SHIFT)
-#define EEPROM_CFG2_MNGM_MASK (3U << 13) /* Manageability Operation mode */
+#define EEPROM_CFG2_MNGM_SHIFT 13 /* Manageability Operation mode */
+#define EEPROM_CFG2_MNGM_MASK (3U << EEPROM_CFG2_MNGM_SHIFT)
+#define EEPROM_CFG2_MNGM_DIS 0
+#define EEPROM_CFG2_MNGM_NCSI 1
+#define EEPROM_CFG2_MNGM_PT 2
#define EEPROM_K1_CONFIG_ENABLE 0x01
@@ -870,8 +874,10 @@
#define MANC_SMBUS_EN 0x00000001
#define MANC_ASF_EN 0x00000002
#define MANC_ARP_EN 0x00002000
+#define MANC_RECV_TCO_RESET 0x00010000
#define MANC_RECV_TCO_EN 0x00020000
#define MANC_BLK_PHY_RST_ON_IDE 0x00040000
+#define MANC_RECV_ALL 0x00080000
#define MANC_EN_MAC_ADDR_FILTER 0x00100000
#define MANC_EN_MNG2HOST 0x00200000
Home |
Main Index |
Thread Index |
Old Index