8.13.1 Host Suspend/Resume Mechanism
Upon suspending, Linux disconnects the Access Point. To maintain the connection after
suspending, modify the Linux code by removing the following code from the
\net\wireless\sysfs.c
file.
//Prevent disconnecting from connected AP's on suspension
//if (!rdev->wiphy.wowlan_config)
//cfg80211_leave_all(rdev);
The following is the sample of the \net\wireless\sysfs.c
file:
static int wiphy_suspend(struct device *dev, pm_message_t state)
{
struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
int ret = 0;
rdev->suspend_at = get_seconds();
rtnl_lock();
if (rdev->wiphy.registered) {
//Prevent disconnecting from connected AP's on suspension
//if (!rdev->wiphy.wowlan_config)
//cfg80211_leave_all(rdev);
if (rdev->ops->suspend)
ret = rdev_suspend(rdev, rdev->wiphy.wowlan_config);
if (ret == 1) {
/* Driver refuse to configure wowlan */
cfg80211_leave_all(rdev);
ret = rdev_suspend(rdev, NULL);
}
}
rtnl_unlock();
return ret;
}
The user can configure Linux in Suspend mode, using mem string in the
/sys/power/state
path. For more information, see https://www.kernel.org/doc/Documentation/power/interface.txt.
The controller then wakes up the host on certain wake-up on wireless LAN triggers that can be configured using the iw tool. The controller then asserts a wake-up signal on a dedicated wake-up General Purpose Input/output (GPIO) pin on the host board which is connected to the IRQ pin on ATWILC device board.
The ATWILC only supports the ANY option in the Wake on Wireless (WoW) mode from the set of allowed wake-up triggers. The host wakes up the ATWILC device upon receiving any type of packets from the connected access point if the triggers are set by the user. If it is not set by the user, the controller must not wake up the host.
To configure the host wake-up triggers as ANY, use the following any command argument:
#iw phy0 wowlan enable any
Where phy0
resembles wireless hardware interface name, and
any is the required trigger.
To disable all the triggers, use the disable
argument as
shown in the following command:
#iw phy0 wowlan disable
To show the configured triggers, use the show
argument as
shown in the following command:
#iw phy0 wowlan show
To configure the host into Suspend mode, use the following command:
#echo mem > /sys/power/state