aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/xl
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2025-03-27 20:55:12 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2025-03-27 20:55:12 +0000
commitddaf6524682b3ab9e50f7575db319814dbbd053a (patch)
treeaaedcdfef0419f6a6694474f08e0bbff5cff299e /sys/dev/xl
parente5cbf0e881fa1851912be77c62aa7ab17f844c3d (diff)
Diffstat (limited to 'sys/dev/xl')
-rw-r--r--sys/dev/xl/if_xl.c16
-rw-r--r--sys/dev/xl/if_xlreg.h1
2 files changed, 4 insertions, 13 deletions
diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c
index 8e12ba7d67b2..0d1e05833f1e 100644
--- a/sys/dev/xl/if_xl.c
+++ b/sys/dev/xl/if_xl.c
@@ -1063,7 +1063,7 @@ xl_attach(device_t dev)
u_int16_t sinfo2, xcvr[2];
struct xl_softc *sc;
if_t ifp;
- int media, pmcap;
+ int media;
int error = 0, phy, rid, res;
uint16_t did;
@@ -1314,9 +1314,7 @@ xl_attach(device_t dev)
sc->xl_type = XL_TYPE_90X;
/* Check availability of WOL. */
- if ((sc->xl_caps & XL_CAPS_PWRMGMT) != 0 &&
- pci_find_cap(dev, PCIY_PMG, &pmcap) == 0) {
- sc->xl_pmcap = pmcap;
+ if ((sc->xl_caps & XL_CAPS_PWRMGMT) != 0 && pci_has_pm(dev)) {
sc->xl_flags |= XL_FLAG_WOL;
sinfo2 = 0;
xl_read_eeprom(sc, (caddr_t)&sinfo2, XL_EE_SOFTINFO2, 1, 0);
@@ -3256,7 +3254,7 @@ static void
xl_setwol(struct xl_softc *sc)
{
if_t ifp;
- u_int16_t cfg, pmstat;
+ u_int16_t cfg;
if ((sc->xl_flags & XL_FLAG_WOL) == 0)
return;
@@ -3273,12 +3271,6 @@ xl_setwol(struct xl_softc *sc)
if ((if_getcapenable(ifp) & IFCAP_WOL_MAGIC) != 0)
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_ENABLE);
/* Request PME. */
- pmstat = pci_read_config(sc->xl_dev,
- sc->xl_pmcap + PCIR_POWER_STATUS, 2);
if ((if_getcapenable(ifp) & IFCAP_WOL_MAGIC) != 0)
- pmstat |= PCIM_PSTAT_PMEENABLE;
- else
- pmstat &= ~PCIM_PSTAT_PMEENABLE;
- pci_write_config(sc->xl_dev,
- sc->xl_pmcap + PCIR_POWER_STATUS, pmstat, 2);
+ pci_enable_pme(sc->xl_dev);
}
diff --git a/sys/dev/xl/if_xlreg.h b/sys/dev/xl/if_xlreg.h
index 7cdd7a889e0d..8249622a0e79 100644
--- a/sys/dev/xl/if_xlreg.h
+++ b/sys/dev/xl/if_xlreg.h
@@ -603,7 +603,6 @@ struct xl_softc {
u_int16_t xl_media;
u_int16_t xl_caps;
u_int16_t xl_tx_thresh;
- int xl_pmcap;
int xl_if_flags;
struct xl_list_data xl_ldata;
struct xl_chain_data xl_cdata;