Add suspend/resume notifications
wpa_supplicant can now be notified of suspend/resume events, e.g., from pm-action scripts. This allows wpa_supplicant to clear information that may become invalid during a suspend operation.
This commit is contained in:
parent
be8be6717d
commit
207ef3fb12
11 changed files with 126 additions and 5 deletions
|
@ -1731,6 +1731,18 @@ struct wpa_driver_ops {
|
|||
* normal station operations like scanning to be completed.
|
||||
*/
|
||||
int (*deinit_ap)(void *priv);
|
||||
|
||||
/**
|
||||
* suspend - Notification on system suspend/hibernate event
|
||||
* @priv: Private driver interface data
|
||||
*/
|
||||
void (*suspend)(void *priv);
|
||||
|
||||
/**
|
||||
* resume - Notification on system resume/thaw event
|
||||
* @priv: Private driver interface data
|
||||
*/
|
||||
void (*resume)(void *priv);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -3272,5 +3272,7 @@ const struct wpa_driver_ops wpa_driver_ndis_ops = {
|
|||
NULL /* cancel_remain_on_channel */,
|
||||
NULL /* probe_req_report */,
|
||||
NULL /* disable_11b_rates */,
|
||||
NULL /* deinit_ap */
|
||||
NULL /* deinit_ap */,
|
||||
NULL /* suspend */,
|
||||
NULL /* resume */
|
||||
};
|
||||
|
|
|
@ -4996,6 +4996,16 @@ static int wpa_driver_nl80211_deinit_ap(void *priv)
|
|||
}
|
||||
|
||||
|
||||
static void wpa_driver_nl80211_resume(void *priv)
|
||||
{
|
||||
struct wpa_driver_nl80211_data *drv = priv;
|
||||
if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1)) {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Failed to set interface up on "
|
||||
"resume event");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
|
||||
.name = "nl80211",
|
||||
.desc = "Linux nl80211/cfg80211",
|
||||
|
@ -5053,4 +5063,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
|
|||
.release_interface_addr = wpa_driver_nl80211_release_interface_addr,
|
||||
.disable_11b_rates = wpa_driver_nl80211_disable_11b_rates,
|
||||
.deinit_ap = wpa_driver_nl80211_deinit_ap,
|
||||
.resume = wpa_driver_nl80211_resume,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue