diff --git a/sys/dev/iwx/if_iwx.c b/sys/dev/iwx/if_iwx.c --- a/sys/dev/iwx/if_iwx.c +++ b/sys/dev/iwx/if_iwx.c @@ -195,6 +195,8 @@ #include +#define PCI_CFG_RETRY_TIMEOUT 0x41 + #define PCI_VENDOR_INTEL 0x8086 #define PCI_PRODUCT_INTEL_WL_22500_1 0x2723 /* Wi-Fi 6 AX200 */ #define PCI_PRODUCT_INTEL_WL_22500_2 0x02f0 /* Wi-Fi 6 AX201 */ @@ -10142,7 +10144,6 @@ * We disable the RETRY_TIMEOUT register (0x41) to keep * PCI Tx retries from interfering with C3 CPU state. */ -#define PCI_CFG_RETRY_TIMEOUT 0x41 pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); if (pci_msix_count(dev)) { @@ -10657,8 +10658,11 @@ iwx_suspend(device_t dev) { struct iwx_softc *sc = device_get_softc(dev); + struct ieee80211com *ic = &sc->sc_ic; if (sc->sc_flags & IWX_FLAG_HW_INITED) { + ieee80211_suspend_all(ic); + iwx_stop(sc); sc->sc_flags &= ~IWX_FLAG_HW_INITED; } @@ -10669,8 +10673,15 @@ iwx_resume(device_t dev) { struct iwx_softc *sc = device_get_softc(dev); + struct ieee80211com *ic = &sc->sc_ic; int err; + /* + * We disable the RETRY_TIMEOUT register (0x41) to keep + * PCI Tx retries from interfering with C3 CPU state. + */ + pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); + IWX_LOCK(sc); err = iwx_start_hw(sc); @@ -10684,9 +10695,10 @@ return err; } - ieee80211_start_all(&sc->sc_ic); - + sc->sc_flags |= IWX_FLAG_HW_INITED; IWX_UNLOCK(sc); + + ieee80211_resume_all(ic); return (0); }