From 46853f08211269b7fcfb45e4d7b814afaf378a2d Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 3 Jun 2013 12:20:15 +0200 Subject: [PATCH] libnm-util: deprecate 'network-type' and 'allowed-bands' in GSM settings When requesting connections to ModemManager, NetworkManager shouldn't try to request specific bands or network types to use. Leave those requests to other system configuration tools talking directly to ModemManager. https://bugzilla.gnome.org/show_bug.cgi?id=701504 --- libnm-util/nm-setting-gsm.c | 40 ++++++++++++++++++++++++------------- libnm-util/nm-setting-gsm.h | 18 ++++++++++++----- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c index 297bd434cb..d9f80079de 100644 --- a/libnm-util/nm-setting-gsm.c +++ b/libnm-util/nm-setting-gsm.c @@ -203,6 +203,8 @@ nm_setting_gsm_get_network_id (NMSettingGsm *setting) * @setting: the #NMSettingGsm * * Returns: the #NMSettingGsm:network-type property of the setting + * + * Deprecated: 0.9.10: No longer used. Network type setting should be done talking to ModemManager directly. **/ int nm_setting_gsm_get_network_type (NMSettingGsm *setting) @@ -217,6 +219,8 @@ nm_setting_gsm_get_network_type (NMSettingGsm *setting) * @setting: the #NMSettingGsm * * Returns: the #NMSettingGsm:allowed-bands property of the setting + * + * Deprecated: 0.9.10: No longer used. Bands setting should be done talking to ModemManager directly. **/ guint32 nm_setting_gsm_get_allowed_bands (NMSettingGsm *setting) @@ -504,10 +508,10 @@ get_property (GObject *object, guint prop_id, g_value_set_string (value, nm_setting_gsm_get_network_id (setting)); break; case PROP_NETWORK_TYPE: - g_value_set_int (value, nm_setting_gsm_get_network_type (setting)); + g_value_set_int (value, NM_SETTING_GSM_GET_PRIVATE (setting)->network_type); break; case PROP_ALLOWED_BANDS: - g_value_set_uint (value, nm_setting_gsm_get_allowed_bands (setting)); + g_value_set_uint (value, NM_SETTING_GSM_GET_PRIVATE (setting)->allowed_bands); break; case PROP_PIN: g_value_set_string (value, nm_setting_gsm_get_pin (setting)); @@ -667,20 +671,24 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class) * technologies. Permitted values are those specified by * #NMSettingGsmNetworkType. Note that not all devices allow network * preference control. + * + * Deprecated: 0.9.10: No longer used. Network type setting should be done talking to ModemManager directly. **/ g_object_class_install_property (object_class, PROP_NETWORK_TYPE, g_param_spec_int (NM_SETTING_GSM_NETWORK_TYPE, - "Network type", - "Network preference to force the device to only use " - "specific network technologies. The permitted values " - "are: -1: any, 0: 3G only, 1: GPRS/EDGE only, " - "2: prefer 3G, 3: prefer 2G, 4: prefer 4G/LTE, 5: 4G/LTE only. " - "Note that not all devices allow network preference control.", - NM_SETTING_GSM_NETWORK_TYPE_ANY, - NM_SETTING_GSM_NETWORK_TYPE_4G, - NM_SETTING_GSM_NETWORK_TYPE_ANY, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + "Network type", + "Network preference to force the device to only use " + "specific network technologies. The permitted values " + "are: -1: any, 0: 3G only, 1: GPRS/EDGE only, " + "2: prefer 3G, 3: prefer 2G, 4: prefer 4G/LTE, 5: 4G/LTE only. " + "Notes: This property is deprecated and NetworkManager from 0.9.10 " + "onwards doesn't use this property when talking to ModemManager." + "Also, not all devices allow network preference control.", + NM_SETTING_GSM_NETWORK_TYPE_ANY, + NM_SETTING_GSM_NETWORK_TYPE_4G, + NM_SETTING_GSM_NETWORK_TYPE_ANY, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); /** * NMSettingGsm:allowed-bands: @@ -688,13 +696,17 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class) * Bitfield of allowed frequency bands. Note that not all devices allow * frequency band control. Permitted values are those specified by * #NMSettingGsmNetworkBand. + * + * Deprecated: 0.9.10: No longer used. Band setting should be done talking to ModemManager directly. **/ g_object_class_install_property (object_class, PROP_ALLOWED_BANDS, g_param_spec_uint (NM_SETTING_GSM_ALLOWED_BANDS, "Allowed Bands", - "Bitfield of allowed frequency bands. Note that " - "not all devices allow frequency band control.", + "Bitfield of allowed frequency bands." + "Notes: This property is deprecated and NetworkManager from 0.9.10 " + "onwards doesn't use this property when talking to ModemManager." + "Also, not all devices allow frequency band control.", NM_SETTING_GSM_BAND_UNKNOWN, NM_SETTING_GSM_BANDS_MAX, NM_SETTING_GSM_BAND_ANY, diff --git a/libnm-util/nm-setting-gsm.h b/libnm-util/nm-setting-gsm.h index 306f62802f..3bd234e0e0 100644 --- a/libnm-util/nm-setting-gsm.h +++ b/libnm-util/nm-setting-gsm.h @@ -64,12 +64,14 @@ GQuark nm_setting_gsm_error_quark (void); #define NM_SETTING_GSM_PASSWORD_FLAGS "password-flags" #define NM_SETTING_GSM_APN "apn" #define NM_SETTING_GSM_NETWORK_ID "network-id" -#define NM_SETTING_GSM_NETWORK_TYPE "network-type" -#define NM_SETTING_GSM_ALLOWED_BANDS "allowed-bands" #define NM_SETTING_GSM_PIN "pin" #define NM_SETTING_GSM_PIN_FLAGS "pin-flags" #define NM_SETTING_GSM_HOME_ONLY "home-only" +/* Deprecated */ +#define NM_SETTING_GSM_ALLOWED_BANDS "allowed-bands" +#define NM_SETTING_GSM_NETWORK_TYPE "network-type" + /** * NMSettingGsmNetworkType: * @NM_SETTING_GSM_NETWORK_TYPE_ANY: any access technology may be used @@ -88,6 +90,8 @@ GQuark nm_setting_gsm_error_quark (void); * * #NMSettingGsmNetworkType values indicate the allowed access technologies * the device may use when connecting to this network. + * + * Deprecated: 0.9.10: No longer used. */ typedef enum { NM_SETTING_GSM_NETWORK_TYPE_ANY = -1, @@ -119,6 +123,8 @@ typedef enum { * * #NMSettingGsmNetworkBand values indicate the allowed frequency bands * the device may use when connecting to this network. + * + * Deprecated: 0.9.10: No longer used. */ typedef enum { NM_SETTING_GSM_BAND_UNKNOWN = 0x00000000, @@ -144,7 +150,7 @@ typedef enum { * #NM_SETTING_GSM_BANDS_MAX macro indicate the maximal value that can be used * as the allowed frequency bands (#NMSettingGsm:allowed-bands property). * - * Since: 0.9.10 + * Deprecated: 0.9.10: No longer used. */ #define NM_SETTING_GSM_BANDS_MAX ( NM_SETTING_GSM_BAND_UNKNOWN \ | NM_SETTING_GSM_BAND_ANY \ @@ -184,14 +190,16 @@ const char *nm_setting_gsm_get_username (NMSettingGsm *setting); const char *nm_setting_gsm_get_password (NMSettingGsm *setting); const char *nm_setting_gsm_get_apn (NMSettingGsm *setting); const char *nm_setting_gsm_get_network_id (NMSettingGsm *setting); -int nm_setting_gsm_get_network_type (NMSettingGsm *setting); -guint32 nm_setting_gsm_get_allowed_bands (NMSettingGsm *setting); const char *nm_setting_gsm_get_pin (NMSettingGsm *setting); gboolean nm_setting_gsm_get_home_only (NMSettingGsm *setting); NMSettingSecretFlags nm_setting_gsm_get_pin_flags (NMSettingGsm *setting); NMSettingSecretFlags nm_setting_gsm_get_password_flags (NMSettingGsm *setting); +/* Deprecated */ +G_DEPRECATED int nm_setting_gsm_get_network_type (NMSettingGsm *setting); +G_DEPRECATED guint32 nm_setting_gsm_get_allowed_bands (NMSettingGsm *setting); + G_END_DECLS #endif /* NM_SETTING_GSM_H */