From c4a85acf80ba9c2c0c3017f8ffa9bc06ec325e7e Mon Sep 17 00:00:00 2001 From: "Marius B. Kotsbak" Date: Sat, 8 Sep 2012 15:37:46 +0200 Subject: core: add settings for 4G (LTE) network modes NM_SETTING_GSM_NETWORK_TYPE_PREFER_4G and NM_SETTING_GSM_NETWORK_TYPE_4G added. --- libnm-util/nm-setting-gsm.c | 6 +++--- libnm-util/nm-setting-gsm.h | 8 +++++++- src/modem-manager/nm-modem-gsm.c | 12 +++++++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c index 2264d008..98ec27a7 100644 --- a/libnm-util/nm-setting-gsm.c +++ b/libnm-util/nm-setting-gsm.c @@ -658,10 +658,10 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class) "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, and 3: prefer 2G. Note that not all " - "devices allow network preference control.", + "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_PREFER_GPRS_EDGE, + NM_SETTING_GSM_NETWORK_TYPE_4G, NM_SETTING_GSM_NETWORK_TYPE_ANY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); diff --git a/libnm-util/nm-setting-gsm.h b/libnm-util/nm-setting-gsm.h index 12114e32..2303f762 100644 --- a/libnm-util/nm-setting-gsm.h +++ b/libnm-util/nm-setting-gsm.h @@ -81,6 +81,10 @@ GQuark nm_setting_gsm_error_quark (void); * preferred but 2G-type technologies may be used as a fallback * @NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE: 2G-type technologies are * preferred but 3G-type technologies may be used as a fallback + * @NM_SETTING_GSM_NETWORK_TYPE_PREFER_4G: 4G/LTE-type technologies are + * preferred but 3G/2/-type technologies may be used as a fallback + * @NM_SETTING_GSM_NETWORK_TYPE_4G: only 4G/LTE type + * technologies may be used * * #NMSettingGsmNetworkType values indicate the allowed access technologies * the device may use when connecting to this network. @@ -90,7 +94,9 @@ typedef enum { NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA = 0, NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE = 1, NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA = 2, - NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE = 3 + NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE = 3, + NM_SETTING_GSM_NETWORK_TYPE_PREFER_4G = 4, + NM_SETTING_GSM_NETWORK_TYPE_4G = 5 } NMSettingGsmNetworkType; /** diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index c0a8f2e5..26ad8f01 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -58,8 +58,10 @@ typedef enum { MM_MODEM_GSM_ALLOWED_MODE_3G_PREFERRED = 2, MM_MODEM_GSM_ALLOWED_MODE_2G_ONLY = 3, MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY = 4, + MM_MODEM_GSM_ALLOWED_MODE_4G_PREFERRED = 5, + MM_MODEM_GSM_ALLOWED_MODE_4G_ONLY = 6, - MM_MODEM_GSM_ALLOWED_MODE_LAST = MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY + MM_MODEM_GSM_ALLOWED_MODE_LAST = MM_MODEM_GSM_ALLOWED_MODE_4G_ONLY } MMModemGsmAllowedMode; typedef enum { @@ -389,6 +391,14 @@ create_connect_properties (NMConnection *connection) value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_PREFERRED); value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_2G_PREFERRED); break; + case NM_SETTING_GSM_NETWORK_TYPE_PREFER_4G: + /* deprecated modes not extended for 4G, so no need to set them here */ + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_4G_PREFERRED); + break; + case NM_SETTING_GSM_NETWORK_TYPE_4G: + /* deprecated modes not extended for 4G, so no need to set them here */ + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_4G_ONLY); + break; default: value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_ANY); value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_ANY); -- cgit v1.2.3