mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 16:30:07 +01:00
device/wifi: replace cancel_pending_scan() with nm_clear_g_source()
This commit is contained in:
parent
0a2ff1d16d
commit
84828960ff
1 changed files with 8 additions and 16 deletions
|
|
@ -125,8 +125,6 @@ static gboolean check_scanning_allowed (NMDeviceWifi *self);
|
|||
|
||||
static void schedule_scan (NMDeviceWifi *self, gboolean backoff);
|
||||
|
||||
static void cancel_pending_scan (NMDeviceWifi *self);
|
||||
|
||||
static void cleanup_association_attempt (NMDeviceWifi * self,
|
||||
gboolean disconnect);
|
||||
|
||||
|
|
@ -249,7 +247,7 @@ supplicant_interface_release (NMDeviceWifi *self)
|
|||
|
||||
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||
|
||||
cancel_pending_scan (self);
|
||||
nm_clear_g_source (&priv->pending_scan_id);
|
||||
|
||||
/* Reset the scan interval to be pretty frequent when disconnected */
|
||||
priv->scan_interval = SCAN_INTERVAL_MIN + SCAN_INTERVAL_STEP;
|
||||
|
|
@ -513,7 +511,7 @@ deactivate (NMDevice *device)
|
|||
|
||||
/* Ensure we trigger a scan after deactivating a Hotspot */
|
||||
if (old_mode == NM_802_11_MODE_AP) {
|
||||
cancel_pending_scan (self);
|
||||
nm_clear_g_source (&priv->pending_scan_id);
|
||||
request_wireless_scan (self, NULL);
|
||||
}
|
||||
}
|
||||
|
|
@ -1027,6 +1025,7 @@ request_scan_cb (NMDevice *device,
|
|||
gpointer user_data)
|
||||
{
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI (device);
|
||||
NMDeviceWifiPrivate *priv;
|
||||
gs_unref_variant GVariant *new_scan_options = user_data;
|
||||
|
||||
if (error) {
|
||||
|
|
@ -1042,7 +1041,9 @@ request_scan_cb (NMDevice *device,
|
|||
return;
|
||||
}
|
||||
|
||||
cancel_pending_scan (self);
|
||||
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||
|
||||
nm_clear_g_source (&priv->pending_scan_id);
|
||||
request_wireless_scan (self, new_scan_options);
|
||||
g_dbus_method_invocation_return_value (context, NULL);
|
||||
}
|
||||
|
|
@ -1366,7 +1367,7 @@ schedule_scan (NMDeviceWifi *self, gboolean backoff)
|
|||
/* Cancel the pending scan if it would happen later than (now + the scan_interval) */
|
||||
if (priv->pending_scan_id) {
|
||||
if (now + priv->scan_interval < priv->scheduled_scan_time)
|
||||
cancel_pending_scan (self);
|
||||
nm_clear_g_source (&priv->pending_scan_id);
|
||||
}
|
||||
|
||||
if (!priv->pending_scan_id) {
|
||||
|
|
@ -1399,15 +1400,6 @@ schedule_scan (NMDeviceWifi *self, gboolean backoff)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cancel_pending_scan (NMDeviceWifi *self)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||
|
||||
nm_clear_g_source (&priv->pending_scan_id);
|
||||
}
|
||||
|
||||
static void
|
||||
supplicant_iface_scan_done_cb (NMSupplicantInterface *iface,
|
||||
gboolean success,
|
||||
|
|
@ -2817,7 +2809,7 @@ device_state_changed (NMDevice *device,
|
|||
case NM_DEVICE_STATE_DISCONNECTED:
|
||||
/* Kick off a scan to get latest results */
|
||||
priv->scan_interval = SCAN_INTERVAL_MIN;
|
||||
cancel_pending_scan (self);
|
||||
nm_clear_g_source (&priv->pending_scan_id);
|
||||
request_wireless_scan (self, NULL);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue