diff options
author | Thomas Haller <thaller@redhat.com> | 2017-02-23 11:53:53 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-02-23 12:33:41 +0100 |
commit | 20b17910d04e2ba09891b09e59bb221c426a43fd (patch) | |
tree | eb07fe5333ab418e6bdd13c3945da27001bd5206 | |
parent | 0a1fd88d5a0c4f266f1983fe7582ff32e16a0ca3 (diff) | |
download | NetworkManager-20b17910d04e2ba09891b09e59bb221c426a43fd.tar.gz |
modem: add nm_modem_emit_ppp_failed() function
... instead of emitting the signal by name.
-rw-r--r-- | src/devices/bluetooth/nm-device-bt.c | 5 | ||||
-rw-r--r-- | src/devices/wwan/nm-device-modem.c | 5 | ||||
-rw-r--r-- | src/devices/wwan/nm-modem-ofono.c | 2 | ||||
-rw-r--r-- | src/devices/wwan/nm-modem.c | 12 | ||||
-rw-r--r-- | src/devices/wwan/nm-modem.h | 2 |
5 files changed, 21 insertions, 5 deletions
diff --git a/src/devices/bluetooth/nm-device-bt.c b/src/devices/bluetooth/nm-device-bt.c index ae1a521a6d..7528237a69 100644 --- a/src/devices/bluetooth/nm-device-bt.c +++ b/src/devices/bluetooth/nm-device-bt.c @@ -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: diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c index a84768eef9..3c4ed4d9df 100644 --- a/src/devices/wwan/nm-device-modem.c +++ b/src/devices/wwan/nm-device-modem.c @@ -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: diff --git a/src/devices/wwan/nm-modem-ofono.c b/src/devices/wwan/nm-modem-ofono.c index 4fa05b1996..5f11f739ce 100644 --- a/src/devices/wwan/nm-modem-ofono.c +++ b/src/devices/wwan/nm-modem-ofono.c @@ -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); } } diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c index f6405cc530..805435676e 100644 --- a/src/devices/wwan/nm-modem.c +++ b/src/devices/wwan/nm-modem.c @@ -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; diff --git a/src/devices/wwan/nm-modem.h b/src/devices/wwan/nm-modem.h index 5b6aedbd88..df437b317f 100644 --- a/src/devices/wwan/nm-modem.h +++ b/src/devices/wwan/nm-modem.h @@ -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); |