mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 19:30:37 +01:00
modem: add nm_modem_emit_ppp_failed() function
... instead of emitting the signal by name.
This commit is contained in:
parent
0a1fd88d5a
commit
20b17910d0
5 changed files with 21 additions and 5 deletions
|
|
@ -370,10 +370,13 @@ ppp_stats (NMModem *modem,
|
|||
}
|
||||
|
||||
static void
|
||||
ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data)
|
||||
ppp_failed (NMModem *modem,
|
||||
guint i_reason,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDevice *device = NM_DEVICE (user_data);
|
||||
NMDeviceBt *self = NM_DEVICE_BT (user_data);
|
||||
NMDeviceStateReason reason = i_reason;
|
||||
|
||||
switch (nm_device_get_state (device)) {
|
||||
case NM_DEVICE_STATE_PREPARE:
|
||||
|
|
|
|||
|
|
@ -68,10 +68,13 @@ G_DEFINE_TYPE (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data)
|
||||
ppp_failed (NMModem *modem,
|
||||
guint i_reason,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDevice *device = NM_DEVICE (user_data);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM (user_data);
|
||||
NMDeviceStateReason reason = i_reason;
|
||||
|
||||
switch (nm_device_get_state (device)) {
|
||||
case NM_DEVICE_STATE_PREPARE:
|
||||
|
|
|
|||
|
|
@ -915,7 +915,7 @@ out:
|
|||
nm_modem_emit_prepare_result (NM_MODEM (self), ret, reason);
|
||||
} else {
|
||||
_LOGW ("MODEM_PPP_FAILED");
|
||||
g_signal_emit_by_name (self, NM_MODEM_PPP_FAILED, NM_DEVICE_STATE_REASON_PPP_FAILED);
|
||||
nm_modem_emit_ppp_failed (NM_MODEM (self), NM_DEVICE_STATE_REASON_PPP_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,6 +230,14 @@ nm_modem_emit_prepare_result (NMModem *self, gboolean success, NMDeviceStateReas
|
|||
g_signal_emit (self, signals[PREPARE_RESULT], 0, success, (guint) reason);
|
||||
}
|
||||
|
||||
void
|
||||
nm_modem_emit_ppp_failed (NMModem *self, NMDeviceStateReason reason)
|
||||
{
|
||||
nm_assert (NM_IS_MODEM (self));
|
||||
|
||||
g_signal_emit (self, signals[PPP_FAILED], 0, (guint) reason);
|
||||
}
|
||||
|
||||
NMModemIPType
|
||||
nm_modem_get_supported_ip_types (NMModem *self)
|
||||
{
|
||||
|
|
@ -390,10 +398,10 @@ ppp_state_changed (NMPPPManager *ppp_manager, NMPPPStatus status, gpointer user_
|
|||
{
|
||||
switch (status) {
|
||||
case NM_PPP_STATUS_DISCONNECT:
|
||||
g_signal_emit (NM_MODEM (user_data), signals[PPP_FAILED], 0, NM_DEVICE_STATE_REASON_PPP_DISCONNECT);
|
||||
nm_modem_emit_ppp_failed (user_data, NM_DEVICE_STATE_REASON_PPP_DISCONNECT);
|
||||
break;
|
||||
case NM_PPP_STATUS_DEAD:
|
||||
g_signal_emit (NM_MODEM (user_data), signals[PPP_FAILED], 0, NM_DEVICE_STATE_REASON_PPP_FAILED);
|
||||
nm_modem_emit_ppp_failed (user_data, NM_DEVICE_STATE_REASON_PPP_FAILED);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -241,6 +241,8 @@ void nm_modem_emit_removed (NMModem *self);
|
|||
|
||||
void nm_modem_emit_prepare_result (NMModem *self, gboolean success, NMDeviceStateReason reason);
|
||||
|
||||
void nm_modem_emit_ppp_failed (NMModem *self, NMDeviceStateReason reason);
|
||||
|
||||
GArray *nm_modem_get_connection_ip_type (NMModem *self,
|
||||
NMConnection *connection,
|
||||
GError **error);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue