core: rename nm_device_can_activate -> nm_device_is_available
Becuase when the device is in >= DISCONNECTED state, that already means it can activate if a connection is available.
This commit is contained in:
@@ -725,7 +725,7 @@ schedule_activate_check (NMPolicy *policy, NMDevice *device, guint delay_seconds
|
|||||||
if (state < NM_DEVICE_STATE_DISCONNECTED)
|
if (state < NM_DEVICE_STATE_DISCONNECTED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!nm_device_can_activate (device) || !nm_device_autoconnect_allowed (device))
|
if (!nm_device_autoconnect_allowed (device))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (iter = policy->pending_activation_checks; iter; iter = g_slist_next (iter)) {
|
for (iter = policy->pending_activation_checks; iter; iter = g_slist_next (iter)) {
|
||||||
|
@@ -491,7 +491,7 @@ real_can_interrupt_activation (NMDevice *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
real_can_activate (NMDevice *dev)
|
real_is_available (NMDevice *dev)
|
||||||
{
|
{
|
||||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev);
|
NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev);
|
||||||
|
|
||||||
@@ -1734,7 +1734,7 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
|
|||||||
parent_class->can_interrupt_activation = real_can_interrupt_activation;
|
parent_class->can_interrupt_activation = real_can_interrupt_activation;
|
||||||
parent_class->update_hw_address = real_update_hw_address;
|
parent_class->update_hw_address = real_update_hw_address;
|
||||||
parent_class->get_best_auto_connection = real_get_best_auto_connection;
|
parent_class->get_best_auto_connection = real_get_best_auto_connection;
|
||||||
parent_class->can_activate = real_can_activate;
|
parent_class->is_available = real_is_available;
|
||||||
parent_class->connection_secrets_updated = real_connection_secrets_updated;
|
parent_class->connection_secrets_updated = real_connection_secrets_updated;
|
||||||
parent_class->check_connection_compatible = real_check_connection_compatible;
|
parent_class->check_connection_compatible = real_check_connection_compatible;
|
||||||
|
|
||||||
|
@@ -1130,7 +1130,7 @@ real_check_connection_compatible (NMDevice *device,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
real_can_activate (NMDevice *dev)
|
real_is_available (NMDevice *dev)
|
||||||
{
|
{
|
||||||
NMDeviceWifi *self = NM_DEVICE_WIFI (dev);
|
NMDeviceWifi *self = NM_DEVICE_WIFI (dev);
|
||||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||||
@@ -2253,7 +2253,7 @@ supplicant_iface_state_cb_handler (gpointer user_data)
|
|||||||
* available, transition to DISCONNECTED.
|
* available, transition to DISCONNECTED.
|
||||||
*/
|
*/
|
||||||
if ( (nm_device_get_state (NM_DEVICE (self)) == NM_DEVICE_STATE_UNAVAILABLE)
|
if ( (nm_device_get_state (NM_DEVICE (self)) == NM_DEVICE_STATE_UNAVAILABLE)
|
||||||
&& nm_device_can_activate (NM_DEVICE (self))) {
|
&& nm_device_is_available (NM_DEVICE (self))) {
|
||||||
nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED,
|
nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED,
|
||||||
NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE);
|
NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE);
|
||||||
}
|
}
|
||||||
@@ -3533,7 +3533,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
|
|||||||
parent_class->take_down = real_take_down;
|
parent_class->take_down = real_take_down;
|
||||||
parent_class->update_hw_address = real_update_hw_address;
|
parent_class->update_hw_address = real_update_hw_address;
|
||||||
parent_class->get_best_auto_connection = real_get_best_auto_connection;
|
parent_class->get_best_auto_connection = real_get_best_auto_connection;
|
||||||
parent_class->can_activate = real_can_activate;
|
parent_class->is_available = real_is_available;
|
||||||
parent_class->connection_secrets_updated = real_connection_secrets_updated;
|
parent_class->connection_secrets_updated = real_connection_secrets_updated;
|
||||||
parent_class->check_connection_compatible = real_check_connection_compatible;
|
parent_class->check_connection_compatible = real_check_connection_compatible;
|
||||||
|
|
||||||
|
@@ -390,10 +390,10 @@ nm_device_get_act_request (NMDevice *self)
|
|||||||
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
nm_device_can_activate (NMDevice *self)
|
nm_device_is_available (NMDevice *self)
|
||||||
{
|
{
|
||||||
if (NM_DEVICE_GET_CLASS (self)->can_activate)
|
if (NM_DEVICE_GET_CLASS (self)->is_available)
|
||||||
return NM_DEVICE_GET_CLASS (self)->can_activate (self);
|
return NM_DEVICE_GET_CLASS (self)->is_available (self);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3077,7 +3077,7 @@ nm_device_state_changed (NMDevice *device,
|
|||||||
* we can't change states again from the state handler for a variety of
|
* we can't change states again from the state handler for a variety of
|
||||||
* reasons.
|
* reasons.
|
||||||
*/
|
*/
|
||||||
if (nm_device_can_activate (device))
|
if (nm_device_is_available (device))
|
||||||
priv->unavailable_to_disconnected_id = g_idle_add (unavailable_to_disconnected, device);
|
priv->unavailable_to_disconnected_id = g_idle_add (unavailable_to_disconnected, device);
|
||||||
break;
|
break;
|
||||||
case NM_DEVICE_STATE_ACTIVATED:
|
case NM_DEVICE_STATE_ACTIVATED:
|
||||||
|
@@ -74,7 +74,7 @@ typedef struct {
|
|||||||
guint32 (* get_type_capabilities) (NMDevice *self);
|
guint32 (* get_type_capabilities) (NMDevice *self);
|
||||||
guint32 (* get_generic_capabilities) (NMDevice *self);
|
guint32 (* get_generic_capabilities) (NMDevice *self);
|
||||||
|
|
||||||
gboolean (* can_activate) (NMDevice *self);
|
gboolean (* is_available) (NMDevice *self);
|
||||||
|
|
||||||
NMConnection * (* get_best_auto_connection) (NMDevice *self,
|
NMConnection * (* get_best_auto_connection) (NMDevice *self,
|
||||||
GSList *connections,
|
GSList *connections,
|
||||||
@@ -152,7 +152,7 @@ void * nm_device_get_system_config_data (NMDevice *dev);
|
|||||||
|
|
||||||
NMActRequest * nm_device_get_act_request (NMDevice *dev);
|
NMActRequest * nm_device_get_act_request (NMDevice *dev);
|
||||||
|
|
||||||
gboolean nm_device_can_activate (NMDevice *dev);
|
gboolean nm_device_is_available (NMDevice *dev);
|
||||||
|
|
||||||
NMConnection * nm_device_get_best_auto_connection (NMDevice *dev,
|
NMConnection * nm_device_get_best_auto_connection (NMDevice *dev,
|
||||||
GSList *connections,
|
GSList *connections,
|
||||||
|
Reference in New Issue
Block a user