<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/source/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in linuxkpi_80211_pm.c</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>11d69a4558de2a5427d8191caed315c5f7e9a5d6 - LinuxKPI: 802.11: add support for suspend/resume</title>
        <link>http://kernelsources.org:8080/source/history/freebsd/sys/compat/linuxkpi/common/src/linuxkpi_80211_pm.c#11d69a4558de2a5427d8191caed315c5f7e9a5d6</link>
        <description>LinuxKPI: 802.11: add support for suspend/resumeAdd support for automatic suspend/resume as we know it for wireless.The problem is that the PCI driver which would normally gets the codeis the LinuxKPI PCI framework/Linux wireless driver, which we cannotammend or generally add extra suspend/resume code to.A further problem is that with growing support, the LinuxKPI 802.11(mac80211) layer also is involved in suspend/resume for WoWLAN (notyet supported) meaning that we need to hook the suspend/resumeframework into that as well.  Unlike Linux we do not have a generalsuspend/resume &quot;hook&quot; we can hang into and we need to tie this oneto the hardware so cannot indepedently (after the driver one) run it.The solution for FreeBSD, in order to not mangle the Linux nativedrivers and get extra maintanace overhead, is to add a bus childwhich inherits the general framework and thus is 2 lines + #includesfor each driver extra to add to.The general suspend/resume framework lives in LinuxKPI (linuxkpi_80211_pm)and imitates the normal suspend/resume path overloading it (there isa slight code/logic duplication from the PCI code).Given we are passed the LinuxKPI p(ci)dev, we can go and peel out thenet80211 ic from the native bsddev and that way get access to thewireless stack.  We then call into LinuxKPI 802.11 in order to dothe suspend/resume dance there, and, if needed also call theofficial suspend/resume routine from the device driver after(reverse for resume).If any in this fails, suspend will be blocked as we will return theerror (no different to any native driver could do).The LinuxKPI 802.11 suspend/resume code has the initial code fordoing a WoWLAN suspend (one could change the sysctl) but other bitslike access to ifnet flags etc. has to be sorted out before we cango and support that.The default code path calles into net80211 to clear everythinglike native wireless drivers do.  The one thing we need to do inaddition is to remove the vif devices from the firmware and restorethem prior to net80211 resume.We also check for a possible HW SCAN to still be runinng on resumeand warn as that may cause problems though the scan should be stoppedbefore suspend (we may still get a callback).  You can easily seethese problems if you suspend/resume without stopping the wlan.Enable the PM framework for iwlwifi in the module Makefile tobe able to use all this; others can follow as tested.In case anyone has problems with this, they can change the sysctlback to 0 until we can figure out any further problems.The linuxkpi_wlan.4 man page got adjusted to document this.Sponsored by:	The FreeBSD FoundationTested on:	Dell XPS 13 (AX200), Lenovo TP X270 (AX210)MFC after:	3 daysPR:		263632

            List of files:
            /freebsd/sys/compat/linuxkpi/common/src/linuxkpi_80211_pm.c</description>
        <pubDate>Wed, 09 Apr 2025 20:00:20 +0200</pubDate>
        <dc:creator>Bjoern A. Zeeb &lt;bz@FreeBSD.org&gt;</dc:creator>
    </item>
</channel>
</rss>
