diff options
-rw-r--r-- | cli/mmcli-bearer.c | 8 | ||||
-rw-r--r-- | cli/mmcli-common.c | 129 | ||||
-rw-r--r-- | cli/mmcli-modem.c | 8 | ||||
-rw-r--r-- | cli/mmcli-output.c | 312 | ||||
-rw-r--r-- | cli/mmcli-output.h | 5 | ||||
-rw-r--r-- | docs/reference/libmm-glib/libmm-glib-sections.txt | 11 | ||||
-rw-r--r-- | introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 7 | ||||
-rw-r--r-- | introspection/org.freedesktop.ModemManager1.Modem.xml | 5 | ||||
-rw-r--r-- | libmm-glib/mm-modem-3gpp.c | 179 | ||||
-rw-r--r-- | libmm-glib/mm-modem-3gpp.h | 17 | ||||
-rw-r--r-- | src/mm-base-bearer.c | 28 | ||||
-rw-r--r-- | src/mm-broadband-modem.c | 37 | ||||
-rw-r--r-- | src/mm-iface-modem-3gpp.c | 107 | ||||
-rw-r--r-- | src/mm-iface-modem-3gpp.h | 16 |
14 files changed, 675 insertions, 194 deletions
diff --git a/cli/mmcli-bearer.c b/cli/mmcli-bearer.c index 1752c868..f07fdfbe 100644 --- a/cli/mmcli-bearer.c +++ b/cli/mmcli-bearer.c @@ -163,12 +163,14 @@ print_bearer_info (MMBearer *bearer) if (properties) { apn = mm_bearer_properties_get_apn (properties); - roaming = mm_bearer_properties_get_allow_roaming (properties) ? "allowed" : "forbidden"; ip_family_str = (properties ? mm_bearer_ip_family_build_string_from_mask (mm_bearer_properties_get_ip_type (properties)) : NULL); user = mm_bearer_properties_get_user (properties); password = mm_bearer_properties_get_password (properties); - number = mm_bearer_properties_get_number (properties); - rm_protocol = mm_modem_cdma_rm_protocol_get_string (mm_bearer_properties_get_rm_protocol (properties)); + if (mm_bearer_get_bearer_type (bearer) != MM_BEARER_TYPE_DEFAULT_ATTACH) { + roaming = mm_bearer_properties_get_allow_roaming (properties) ? "allowed" : "forbidden"; + number = mm_bearer_properties_get_number (properties); + rm_protocol = mm_modem_cdma_rm_protocol_get_string (mm_bearer_properties_get_rm_protocol (properties)); + } } mmcli_output_string (MMC_F_BEARER_PROPERTIES_APN, apn); diff --git a/cli/mmcli-common.c b/cli/mmcli-common.c index c5126863..305e91df 100644 --- a/cli/mmcli-common.c +++ b/cli/mmcli-common.c @@ -429,6 +429,74 @@ list_bearers_ready (MMModem *modem, } static void +look_for_bearer_in_modem_bearer_list (GTask *task) +{ + GetBearerContext *ctx; + MMModem *modem; + + ctx = g_task_get_task_data (task); + + g_assert (ctx->current); + modem = mm_object_get_modem (ctx->current); + mm_modem_list_bearers (modem, + g_task_get_cancellable (task), + (GAsyncReadyCallback)list_bearers_ready, + task); + g_object_unref (modem); +} + +static void +get_initial_eps_bearer_ready (MMModem3gpp *modem3gpp, + GAsyncResult *res, + GTask *task) +{ + GetBearerContext *ctx; + MMBearer *bearer; + GetBearerResults *results; + + ctx = g_task_get_task_data (task); + + bearer = mm_modem_3gpp_get_initial_eps_bearer_finish (modem3gpp, res, NULL); + if (!bearer) { + look_for_bearer_in_modem_bearer_list (task); + return; + } + + /* Found! */ + results = g_new (GetBearerResults, 1); + results->manager = g_object_ref (ctx->manager); + results->object = g_object_ref (ctx->current); + results->bearer = bearer; + g_task_return_pointer (task, results, (GDestroyNotify) get_bearer_results_free); + g_object_unref (task); +} + +static void +look_for_bearer_in_modem_3gpp_eps_initial_bearer (GTask *task) +{ + GetBearerContext *ctx; + MMModem3gpp *modem3gpp; + + ctx = g_task_get_task_data (task); + + g_assert (ctx->current); + modem3gpp = mm_object_get_modem_3gpp (ctx->current); + if (!modem3gpp) { + look_for_bearer_in_modem_bearer_list (task); + return; + } + + if (!g_strcmp0 (mm_modem_3gpp_get_initial_eps_bearer_path (modem3gpp), ctx->bearer_path)) + mm_modem_3gpp_get_initial_eps_bearer (modem3gpp, + g_task_get_cancellable (task), + (GAsyncReadyCallback)get_initial_eps_bearer_ready, + task); + else + look_for_bearer_in_modem_bearer_list (task); + g_object_unref (modem3gpp); +} + +static void look_for_bearer_in_modem (GTask *task) { GetBearerContext *ctx; @@ -453,19 +521,14 @@ look_for_bearer_in_modem (GTask *task) g_debug ("Skipping modem '%s' when looking for bearers " "(not fully initialized)", mm_object_get_path (ctx->current)); - g_object_unref (modem); look_for_bearer_in_modem (task); - return; + } else { + g_debug ("Looking for bearer '%s' in modem '%s'...", + ctx->bearer_path, + mm_object_get_path (ctx->current)); + look_for_bearer_in_modem_3gpp_eps_initial_bearer (task); } - g_debug ("Looking for bearer '%s' in modem '%s'...", - ctx->bearer_path, - mm_object_get_path (ctx->current)); - - mm_modem_list_bearers (modem, - g_task_get_cancellable (task), - (GAsyncReadyCallback)list_bearers_ready, - task); g_object_unref (modem); } @@ -562,38 +625,52 @@ mmcli_get_bearer_sync (GDBusConnection *connection, } for (l = modems; !found && l; l = g_list_next (l)) { - GError *error = NULL; - MMObject *object; - MMModem *modem; - GList *bearers; + GError *error = NULL; + MMObject *object; + MMModem *modem; + MMModem3gpp *modem3gpp; object = MM_OBJECT (l->data); modem = mm_object_get_modem (object); + modem3gpp = mm_object_get_modem_3gpp (object); /* Don't look for bearers in modems which are not fully initialized */ if (mm_modem_get_state (modem) < MM_MODEM_STATE_DISABLED) { g_debug ("Skipping modem '%s' when looking for bearers " "(not fully initialized)", mm_object_get_path (object)); - g_object_unref (modem); - continue; + goto next; } - bearers = mm_modem_list_bearers_sync (modem, NULL, &error); - if (error) { - g_printerr ("error: couldn't list bearers at '%s': '%s'\n", - mm_modem_get_path (modem), - error->message); - exit (EXIT_FAILURE); - } + if (modem3gpp && !g_strcmp0 (mm_modem_3gpp_get_initial_eps_bearer_path (modem3gpp), bearer_path)) { + found = mm_modem_3gpp_get_initial_eps_bearer_sync (modem3gpp, NULL, &error); + if (!found) { + g_printerr ("error: couldn't get initial EPS bearer object at '%s': '%s'\n", + mm_modem_get_path (modem), + error->message); + exit (EXIT_FAILURE); + } + } else { + GList *bearers; - found = find_bearer_in_list (bearers, bearer_path); - g_list_free_full (bearers, g_object_unref); + bearers = mm_modem_list_bearers_sync (modem, NULL, &error); + if (error) { + g_printerr ("error: couldn't list bearers at '%s': '%s'\n", + mm_modem_get_path (modem), + error->message); + exit (EXIT_FAILURE); + } + + found = find_bearer_in_list (bearers, bearer_path); + g_list_free_full (bearers, g_object_unref); + } if (found && o_object) *o_object = g_object_ref (object); - g_object_unref (modem); + next: + g_clear_object (&modem); + g_clear_object (&modem3gpp); } if (!found) { diff --git a/cli/mmcli-modem.c b/cli/mmcli-modem.c index 582322bd..a98434b1 100644 --- a/cli/mmcli-modem.c +++ b/cli/mmcli-modem.c @@ -347,6 +347,7 @@ print_modem_info (void) const gchar *registration = NULL; const gchar *eps_ue_mode = NULL; GList *pco_list = NULL; + const gchar *initial_eps_bearer_path = NULL; if (ctx->modem_3gpp) { imei = mm_modem_3gpp_get_imei (ctx->modem_3gpp); @@ -356,6 +357,7 @@ print_modem_info (void) registration = mm_modem_3gpp_registration_state_get_string (mm_modem_3gpp_get_registration_state (ctx->modem_3gpp)); eps_ue_mode = mm_modem_3gpp_eps_ue_mode_operation_get_string (mm_modem_3gpp_get_eps_ue_mode_operation (ctx->modem_3gpp)); pco_list = mm_modem_3gpp_get_pco (ctx->modem_3gpp); + initial_eps_bearer_path = mm_modem_3gpp_get_initial_eps_bearer_path (ctx->modem_3gpp); } mmcli_output_string (MMC_F_3GPP_IMEI, imei); @@ -363,9 +365,13 @@ print_modem_info (void) mmcli_output_string (MMC_F_3GPP_OPERATOR_ID, operator_code); mmcli_output_string (MMC_F_3GPP_OPERATOR_NAME, operator_name); mmcli_output_string (MMC_F_3GPP_REGISTRATION, registration); - mmcli_output_string (MMC_F_3GPP_EPS_UE_MODE, eps_ue_mode); mmcli_output_pco_list (pco_list); + if (mm_modem_get_current_capabilities (ctx->modem) & (MM_MODEM_CAPABILITY_LTE | MM_MODEM_CAPABILITY_LTE_ADVANCED)) { + mmcli_output_string (MMC_F_3GPP_EPS_UE_MODE, eps_ue_mode); + mmcli_output_string (MMC_F_3GPP_EPS_INITIAL_BEARER_PATH, g_strcmp0 (initial_eps_bearer_path, "/") != 0 ? initial_eps_bearer_path : NULL); + } + g_free (facility_locks); mm_pco_list_free (pco_list); } diff --git a/cli/mmcli-output.c b/cli/mmcli-output.c index 79646abc..4bfdf17a 100644 --- a/cli/mmcli-output.c +++ b/cli/mmcli-output.c @@ -42,6 +42,7 @@ static SectionInfo section_infos[] = { [MMC_S_MODEM_BANDS] = { "Bands" }, [MMC_S_MODEM_IP] = { "IP" }, [MMC_S_MODEM_3GPP] = { "3GPP" }, + [MMC_S_MODEM_3GPP_EPS] = { "3GPP EPS" }, [MMC_S_MODEM_3GPP_SCAN] = { "3GPP scan" }, [MMC_S_MODEM_3GPP_USSD] = { "3GPP USSD" }, [MMC_S_MODEM_CDMA] = { "CDMA" }, @@ -90,161 +91,162 @@ typedef struct { } FieldInfo; static FieldInfo field_infos[] = { - [MMC_F_GENERAL_DBUS_PATH] = { "modem.dbus-path", "dbus path", MMC_S_MODEM_GENERAL, }, - [MMC_F_GENERAL_DEVICE_ID] = { "modem.generic.device-identifier", "device id", MMC_S_MODEM_GENERAL, }, - [MMC_F_HARDWARE_MANUFACTURER] = { "modem.generic.manufacturer", "manufacturer", MMC_S_MODEM_HARDWARE, }, - [MMC_F_HARDWARE_MODEL] = { "modem.generic.model", "model", MMC_S_MODEM_HARDWARE, }, - [MMC_F_HARDWARE_REVISION] = { "modem.generic.revision", "revision", MMC_S_MODEM_HARDWARE, }, - [MMC_F_HARDWARE_HW_REVISION] = { "modem.generic.hardware-revision", "h/w revision", MMC_S_MODEM_HARDWARE, }, - [MMC_F_HARDWARE_SUPPORTED_CAPABILITIES] = { "modem.generic.supported-capabilities", "supported", MMC_S_MODEM_HARDWARE, }, - [MMC_F_HARDWARE_CURRENT_CAPABILITIES] = { "modem.generic.current-capabilities", "current", MMC_S_MODEM_HARDWARE, }, - [MMC_F_HARDWARE_EQUIPMENT_ID] = { "modem.generic.equipment-identifier", "equipment id", MMC_S_MODEM_HARDWARE, }, - [MMC_F_SYSTEM_DEVICE] = { "modem.generic.device", "device", MMC_S_MODEM_SYSTEM, }, - [MMC_F_SYSTEM_DRIVERS] = { "modem.generic.drivers", "drivers", MMC_S_MODEM_SYSTEM, }, - [MMC_F_SYSTEM_PLUGIN] = { "modem.generic.plugin", "plugin", MMC_S_MODEM_SYSTEM, }, - [MMC_F_SYSTEM_PRIMARY_PORT] = { "modem.generic.primary-port", "primary port", MMC_S_MODEM_SYSTEM, }, - [MMC_F_SYSTEM_PORTS] = { "modem.generic.ports", "ports", MMC_S_MODEM_SYSTEM, }, - [MMC_F_NUMBERS_OWN] = { "modem.generic.own-numbers", "own", MMC_S_MODEM_NUMBERS, }, - [MMC_F_STATUS_LOCK] = { "modem.generic.unlock-required", "lock", MMC_S_MODEM_STATUS, }, - [MMC_F_STATUS_UNLOCK_RETRIES] = { "modem.generic.unlock-retries", "unlock retries", MMC_S_MODEM_STATUS, }, - [MMC_F_STATUS_STATE] = { "modem.generic.state", "state", MMC_S_MODEM_STATUS, }, - [MMC_F_STATUS_FAILED_REASON] = { "modem.generic.state-failed-reason", "failed reason", MMC_S_MODEM_STATUS, }, - [MMC_F_STATUS_POWER_STATE] = { "modem.generic.power-state", "power state", MMC_S_MODEM_STATUS, }, - [MMC_F_STATUS_ACCESS_TECH] = { "modem.generic.access-technologies", "access tech", MMC_S_MODEM_STATUS, }, - [MMC_F_STATUS_SIGNAL_QUALITY_VALUE] = { "modem.generic.signal-quality.value", "signal quality", MMC_S_MODEM_STATUS, }, - [MMC_F_STATUS_SIGNAL_QUALITY_RECENT] = { "modem.generic.signal-quality.recent", NULL, MMC_S_UNKNOWN, }, - [MMC_F_MODES_SUPPORTED] = { "modem.generic.supported-modes", "supported", MMC_S_MODEM_MODES, }, - [MMC_F_MODES_CURRENT] = { "modem.generic.current-modes", "current", MMC_S_MODEM_MODES, }, - [MMC_F_BANDS_SUPPORTED] = { "modem.generic.supported-bands", "supported", MMC_S_MODEM_BANDS, }, - [MMC_F_BANDS_CURRENT] = { "modem.generic.current-bands", "current", MMC_S_MODEM_BANDS, }, - [MMC_F_IP_SUPPORTED] = { "modem.generic.supported-ip-families", "supported", MMC_S_MODEM_IP, }, - [MMC_F_3GPP_IMEI] = { "modem.3gpp.imei", "imei", MMC_S_MODEM_3GPP, }, - [MMC_F_3GPP_ENABLED_LOCKS] = { "modem.3gpp.enabled-locks", "enabled locks", MMC_S_MODEM_3GPP, }, - [MMC_F_3GPP_OPERATOR_ID] = { "modem.3gpp.operator-code", "operator id", MMC_S_MODEM_3GPP, }, - [MMC_F_3GPP_OPERATOR_NAME] = { "modem.3gpp.operator-name", "operator name", MMC_S_MODEM_3GPP, }, - [MMC_F_3GPP_REGISTRATION] = { "modem.3gpp.registration-state", "registration", MMC_S_MODEM_3GPP, }, - [MMC_F_3GPP_EPS_UE_MODE] = { "modem.3gpp.eps-ue-mode-operation", "eps ue mode", MMC_S_MODEM_3GPP, }, - [MMC_F_3GPP_PCO] = { "modem.3gpp.pco", "pco", MMC_S_MODEM_3GPP, }, - [MMC_F_3GPP_SCAN_NETWORKS] = { "modem.3gpp.scan-networks", "networks", MMC_S_MODEM_3GPP_SCAN, }, - [MMC_F_3GPP_USSD_STATUS] = { "modem.3gpp.ussd.status", "status", MMC_S_MODEM_3GPP_USSD, }, - [MMC_F_3GPP_USSD_NETWORK_REQUEST] = { "modem.3gpp.ussd.network-request", "network request", MMC_S_MODEM_3GPP_USSD, }, - [MMC_F_3GPP_USSD_NETWORK_NOTIFICATION] = { "modem.3gpp.ussd.network-notification", "network notification", MMC_S_MODEM_3GPP_USSD, }, - [MMC_F_CDMA_MEID] = { "modem.cdma.meid", "meid", MMC_S_MODEM_CDMA, }, - [MMC_F_CDMA_ESN] = { "modem.cdma.esn", "esn", MMC_S_MODEM_CDMA, }, - [MMC_F_CDMA_SID] = { "modem.cdma.sid", "sid", MMC_S_MODEM_CDMA, }, - [MMC_F_CDMA_NID] = { "modem.cdma.nid", "nid", MMC_S_MODEM_CDMA, }, - [MMC_F_CDMA_REGISTRATION_CDMA1X] = { "modem.cdma.cdma1x-registration-state", "registration cdma1x", MMC_S_MODEM_CDMA, }, - [MMC_F_CDMA_REGISTRATION_EVDO] = { "modem.cdma.evdo-registration-state", "registration evdo", MMC_S_MODEM_CDMA, }, - [MMC_F_CDMA_ACTIVATION] = { "modem.cdma.activation-state", "activation", MMC_S_MODEM_CDMA, }, - [MMC_F_SIM_PATH] = { "modem.generic.sim", "dbus path", MMC_S_MODEM_SIM, }, - [MMC_F_BEARER_PATHS] = { "modem.generic.bearers", "dbus path", MMC_S_MODEM_BEARER, }, - [MMC_F_TIME_CURRENT] = { "modem.time.current", "current", MMC_S_MODEM_TIME, }, - [MMC_F_TIMEZONE_CURRENT] = { "modem.timezone.current", "current", MMC_S_MODEM_TIMEZONE, }, - [MMC_F_TIMEZONE_DST_OFFSET] = { "modem.time.dst-offset", "dst offset", MMC_S_MODEM_TIMEZONE, }, - [MMC_F_TIMEZONE_LEAP_SECONDS] = { "modem.time.leap-seconds", "leap seconds", MMC_S_MODEM_TIMEZONE, }, - [MMC_F_MESSAGING_SUPPORTED_STORAGES] = { "modem.messaging.supported-storages", "supported storages", MMC_S_MODEM_MESSAGING, }, - [MMC_F_MESSAGING_DEFAULT_STORAGES] = { "modem.messaging.default-storages", "default storages", MMC_S_MODEM_MESSAGING, }, - [MMC_F_SIGNAL_REFRESH_RATE] = { "modem.signal.refresh.rate", "refresh rate", MMC_S_MODEM_SIGNAL, }, - [MMC_F_SIGNAL_CDMA1X_RSSI] = { "modem.signal.cdma1x.rssi", "rssi", MMC_S_MODEM_SIGNAL_CDMA1X, }, - [MMC_F_SIGNAL_CDMA1X_ECIO] = { "modem.signal.cdma1x.ecio", "ecio", MMC_S_MODEM_SIGNAL_CDMA1X, }, - [MMC_F_SIGNAL_EVDO_RSSI] = { "modem.signal.evdo.rssi", "rssi", MMC_S_MODEM_SIGNAL_EVDO, }, - [MMC_F_SIGNAL_EVDO_ECIO] = { "modem.signal.evdo.ecio", "ecio", MMC_S_MODEM_SIGNAL_EVDO, }, - [MMC_F_SIGNAL_EVDO_SINR] = { "modem.signal.evdo.sinr", "sinr", MMC_S_MODEM_SIGNAL_EVDO, }, - [MMC_F_SIGNAL_EVDO_IO] = { "modem.signal.evdo.io", "io", MMC_S_MODEM_SIGNAL_EVDO, }, - [MMC_F_SIGNAL_GSM_RSSI] = { "modem.signal.gsm.rssi", "rssi", MMC_S_MODEM_SIGNAL_GSM, }, - [MMC_F_SIGNAL_UMTS_RSSI] = { "modem.signal.umts.rssi", "rssi", MMC_S_MODEM_SIGNAL_UMTS, }, - [MMC_F_SIGNAL_UMTS_RSCP] = { "modem.signal.umts.rscp", "rscp", MMC_S_MODEM_SIGNAL_UMTS, }, - [MMC_F_SIGNAL_UMTS_ECIO] = { "modem.signal.umts.ecio", "ecio", MMC_S_MODEM_SIGNAL_UMTS, }, - [MMC_F_SIGNAL_LTE_RSSI] = { "modem.signal.lte.rssi", "rssi", MMC_S_MODEM_SIGNAL_LTE, }, - [MMC_F_SIGNAL_LTE_RSRQ] = { "modem.signal.lte.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_LTE, }, - [MMC_F_SIGNAL_LTE_RSRP] = { "modem.signal.lte.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_LTE, }, - [MMC_F_SIGNAL_LTE_SNR] = { "modem.signal.lte.snr", "s/n", MMC_S_MODEM_SIGNAL_LTE, }, - [MMC_F_OMA_FEATURES] = { "modem.oma.features", "features", MMC_S_MODEM_OMA, }, - [MMC_F_OMA_CURRENT_TYPE] = { "modem.oma.current.type", "type", MMC_S_MODEM_OMA_CURRENT, }, - [MMC_F_OMA_CURRENT_STATE] = { "modem.oma.current.state", "state", MMC_S_MODEM_OMA_CURRENT, }, - [MMC_F_OMA_PENDING_SESSIONS] = { "modem.oma.pending-sessions", "sessions", MMC_S_MODEM_OMA_PENDING, }, - [MMC_F_LOCATION_CAPABILITIES] = { "modem.location.capabilities", "capabilities", MMC_S_MODEM_LOCATION, }, - [MMC_F_LOCATION_ENABLED] = { "modem.location.enabled", "enabled", MMC_S_MODEM_LOCATION, }, - [MMC_F_LOCATION_SIGNALS] = { "modem.location.signals", "signals", MMC_S_MODEM_LOCATION, }, - [MMC_F_LOCATION_GPS_REFRESH_RATE] = { "modem.location.gps.refresh-rate", "refresh rate", MMC_S_MODEM_LOCATION_GPS, }, - [MMC_F_LOCATION_GPS_SUPL_SERVER] = { "modem.location.gps.supl-server", "a-gps supl server", MMC_S_MODEM_LOCATION_GPS, }, - [MMC_F_LOCATION_GPS_ASSISTANCE] = { "modem.location.gps.assistance", "supported assistance", MMC_S_MODEM_LOCATION_GPS, }, - [MMC_F_LOCATION_GPS_ASSISTANCE_SERVERS] = { "modem.location.gps.assistance-servers", "assistance servers", MMC_S_MODEM_LOCATION_GPS, }, - [MMC_F_LOCATION_3GPP_MCC] = { "modem.location.3gpp.mcc", "operator code", MMC_S_MODEM_LOCATION_3GPP, }, - [MMC_F_LOCATION_3GPP_MNC] = { "modem.location.3gpp.mnc", "operator name", MMC_S_MODEM_LOCATION_3GPP, }, - [MMC_F_LOCATION_3GPP_LAC] = { "modem.location.3gpp.lac", "location area code", MMC_S_MODEM_LOCATION_3GPP, }, - [MMC_F_LOCATION_3GPP_TAC] = { "modem.location.3gpp.tac", "tracking area code", MMC_S_MODEM_LOCATION_3GPP, }, - [MMC_F_LOCATION_3GPP_CID] = { "modem.location.3gpp.cid", "cell id", MMC_S_MODEM_LOCATION_3GPP, }, - [MMC_F_LOCATION_GPS_NMEA] = { "modem.location.gps.nmea", "nmea", MMC_S_MODEM_LOCATION_GPS, }, - [MMC_F_LOCATION_GPS_UTC] = { "modem.location.gps.utc", "utc", MMC_S_MODEM_LOCATION_GPS, }, - [MMC_F_LOCATION_GPS_LONG] = { "modem.location.gps.longitude", "longitude", MMC_S_MODEM_LOCATION_GPS, }, - [MMC_F_LOCATION_GPS_LAT] = { "modem.location.gps.latitude", "latitude", MMC_S_MODEM_LOCATION_GPS, }, - [MMC_F_LOCATION_GPS_ALT] = { "modem.location.gps.altitude", "altitude", MMC_S_MODEM_LOCATION_GPS, }, - [MMC_F_LOCATION_CDMABS_LONG] = { "modem.location.cdma-bs.longitude", "longitude", MMC_S_MODEM_LOCATION_CDMABS, }, - [MMC_F_LOCATION_CDMABS_LAT] = { "modem.location.cdma-bs.latitude", "latitude", MMC_S_MODEM_LOCATION_CDMABS, }, - [MMC_F_FIRMWARE_LIST] = { "modem.firmware-list", "list", MMC_S_MODEM_FIRMWARE, }, - [MMC_F_BEARER_GENERAL_DBUS_PATH] = { "bearer.dbus-path", "dbus path", MMC_S_BEARER_GENERAL, }, - [MMC_F_BEARER_GENERAL_TYPE] = { "bearer.type", "type", MMC_S_BEARER_GENERAL, }, - [MMC_F_BEARER_STATUS_CONNECTED] = { "bearer.status.connected", "connected", MMC_S_BEARER_STATUS, }, - [MMC_F_BEARER_STATUS_SUSPENDED] = { "bearer.status.suspended", "suspended", MMC_S_BEARER_STATUS, }, - [MMC_F_BEARER_STATUS_INTERFACE] = { "bearer.status.interface", "interface", MMC_S_BEARER_STATUS, }, - [MMC_F_BEARER_STATUS_IP_TIMEOUT] = { "bearer.status.ip-timeout", "ip timeout", MMC_S_BEARER_STATUS, }, - [MMC_F_BEARER_PROPERTIES_APN] = { "bearer.properties.apn", "apn", MMC_S_BEARER_PROPERTIES, }, - [MMC_F_BEARER_PROPERTIES_ROAMING] = { "bearer.properties.roaming", "roaming", MMC_S_BEARER_PROPERTIES, }, - [MMC_F_BEARER_PROPERTIES_IP_TYPE] = { "bearer.properties.ip-type", "ip type", MMC_S_BEARER_PROPERTIES, }, - [MMC_F_BEARER_PROPERTIES_USER] = { "bearer.properties.user", "user", MMC_S_BEARER_PROPERTIES, }, - [MMC_F_BEARER_PROPERTIES_PASSWORD] = { "bearer.properties.password", "password", MMC_S_BEARER_PROPERTIES, }, - [MMC_F_BEARER_PROPERTIES_NUMBER] = { "bearer.properties.number", "number", MMC_S_BEARER_PROPERTIES, }, - [MMC_F_BEARER_PROPERTIES_RM_PROTOCOL] = { "bearer.properties.rm-protocol", "rm protocol", MMC_S_BEARER_PROPERTIES, }, - [MMC_F_BEARER_IPV4_CONFIG_METHOD] = { "bearer.ipv4-config.method", "method", MMC_S_BEARER_IPV4_CONFIG, }, - [MMC_F_BEARER_IPV4_CONFIG_ADDRESS] = { "bearer.ipv4-config.address", "address", MMC_S_BEARER_IPV4_CONFIG, }, - [MMC_F_BEARER_IPV4_CONFIG_PREFIX] = { "bearer.ipv4-config.prefix", "prefix", MMC_S_BEARER_IPV4_CONFIG, }, - [MMC_F_BEARER_IPV4_CONFIG_GATEWAY] = { "bearer.ipv4-config.gateway", "gateway", MMC_S_BEARER_IPV4_CONFIG, }, - [MMC_F_BEARER_IPV4_CONFIG_DNS] = { "bearer.ipv4-config.dns", "dns", MMC_S_BEARER_IPV4_CONFIG, }, - [MMC_F_BEARER_IPV4_CONFIG_MTU] = { "bearer.ipv4-config.mtu", "mtu", MMC_S_BEARER_IPV4_CONFIG, }, - [MMC_F_BEARER_IPV6_CONFIG_METHOD] = { "bearer.ipv6-config.method", "method", MMC_S_BEARER_IPV6_CONFIG, }, - [MMC_F_BEARER_IPV6_CONFIG_ADDRESS] = { "bearer.ipv6-config.address", "address", MMC_S_BEARER_IPV6_CONFIG, }, - [MMC_F_BEARER_IPV6_CONFIG_PREFIX] = { "bearer.ipv6-config.prefix", "prefix", MMC_S_BEARER_IPV6_CONFIG, }, - [MMC_F_BEARER_IPV6_CONFIG_GATEWAY] = { "bearer.ipv6-config.gateway", "gateway", MMC_S_BEARER_IPV6_CONFIG, }, - [MMC_F_BEARER_IPV6_CONFIG_DNS] = { "bearer.ipv6-config.dns", "dns", MMC_S_BEARER_IPV6_CONFIG, }, - [MMC_F_BEARER_IPV6_CONFIG_MTU] = { "bearer.ipv6-config.mtu", "mtu", MMC_S_BEARER_IPV6_CONFIG, }, - [MMC_F_BEARER_STATS_DURATION] = { "bearer.stats.duration", "duration", MMC_S_BEARER_STATS, }, - [MMC_F_BEARER_STATS_BYTES_RX] = { "bearer.stats.bytes-rx", "bytes rx", MMC_S_BEARER_STATS, }, - [MMC_F_BEARER_STATS_BYTES_TX] = { "bearer.stats.bytes-tx", "bytes tx", MMC_S_BEARER_STATS, }, - [MMC_F_CALL_GENERAL_DBUS_PATH] = { "call.dbus-path", "dbus path", MMC_S_CALL_GENERAL, }, - [MMC_F_CALL_PROPERTIES_NUMBER] = { "call.properties.number", "number", MMC_S_CALL_PROPERTIES, }, - [MMC_F_CALL_PROPERTIES_DIRECTION] = { "call.properties.direction", "direction", MMC_S_CALL_PROPERTIES, }, - [MMC_F_CALL_PROPERTIES_STATE] = { "call.properties.state", "state", MMC_S_CALL_PROPERTIES, }, - [MMC_F_CALL_PROPERTIES_STATE_REASON] = { "call.properties.state-reason", "state reason", MMC_S_CALL_PROPERTIES, }, - [MMC_F_CALL_PROPERTIES_AUDIO_PORT] = { "call.properties.audio-port", "audio port", MMC_S_CALL_PROPERTIES, }, - [MMC_F_CALL_AUDIO_FORMAT_ENCODING] = { "call.audio-format.encoding", "encoding", MMC_S_CALL_AUDIO_FORMAT, }, - [MMC_F_CALL_AUDIO_FORMAT_RESOLUTION] = { "call.audio-format.resolution", "resolution", MMC_S_CALL_AUDIO_FORMAT, }, - [MMC_F_CALL_AUDIO_FORMAT_RATE] = { "call.audio-format.rate", "rate", MMC_S_CALL_AUDIO_FORMAT, }, - [MMC_F_SMS_GENERAL_DBUS_PATH] = { "sms.dbus-path", "dbus path", MMC_S_SMS_GENERAL, }, - [MMC_F_SMS_CONTENT_NUMBER] = { "sms.content.number", "number", MMC_S_SMS_CONTENT, }, - [MMC_F_SMS_CONTENT_TEXT] = { "sms.content.text", "text", MMC_S_SMS_CONTENT, }, - [MMC_F_SMS_CONTENT_DATA] = { "sms.content.data", "data", MMC_S_SMS_CONTENT, }, - [MMC_F_SMS_PROPERTIES_PDU_TYPE] = { "sms.properties.pdu-type", "pdu type", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_STATE] = { "sms.properties.state", "state", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_VALIDITY] = { "sms.properties.validity", "validity", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_STORAGE] = { "sms.properties.storage", "storage", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_SMSC] = { "sms.properties.smsc", "smsc", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_CLASS] = { "sms.properties.class", "class", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_TELESERVICE_ID] = { "sms.properties.teleservice-id", "teleservice id", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_SERVICE_CATEGORY] = { "sms.properties.service-category", "service category", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_DELIVERY_REPORT] = { "sms.properties.delivery-report", "delivery report", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_MSG_REFERENCE] = { "sms.properties.message-reference", "message reference", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_TIMESTAMP] = { "sms.properties.timestamp", "timestamp", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_DELIVERY_STATE] = { "sms.properties.delivery-state", "delivery state", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SMS_PROPERTIES_DISCH_TIMESTAMP] = { "sms.properties.discharge-timestamp", "discharge timestamp", MMC_S_SMS_PROPERTIES, }, - [MMC_F_SIM_GENERAL_DBUS_PATH] = { "sim.dbus-path", "dbus path", MMC_S_SIM_GENERAL, }, - [MMC_F_SIM_PROPERTIES_IMSI] = { "sim.properties.imsi", "imsi", MMC_S_SIM_PROPERTIES, }, - [MMC_F_SIM_PROPERTIES_ICCID] = { "sim.properties.iccid", "iccid", MMC_S_SIM_PROPERTIES, }, - [MMC_F_SIM_PROPERTIES_OPERATOR_ID] = { "sim.properties.operator-code", "operator id", MMC_S_SIM_PROPERTIES, }, - [MMC_F_SIM_PROPERTIES_OPERATOR_NAME] = { "sim.properties.operator-name", "operator name", MMC_S_SIM_PROPERTIES, }, - [MMC_F_MODEM_LIST_DBUS_PATH] = { "modem-list", "modems", MMC_S_UNKNOWN, }, - [MMC_F_SMS_LIST_DBUS_PATH] = { "modem.messaging.sms", "sms messages", MMC_S_UNKNOWN, }, - [MMC_F_CALL_LIST_DBUS_PATH] = { "modem.voice.call", "calls", MMC_S_UNKNOWN, }, + [MMC_F_GENERAL_DBUS_PATH] = { "modem.dbus-path", "dbus path", MMC_S_MODEM_GENERAL, }, + [MMC_F_GENERAL_DEVICE_ID] = { "modem.generic.device-identifier", "device id", MMC_S_MODEM_GENERAL, }, + [MMC_F_HARDWARE_MANUFACTURER] = { "modem.generic.manufacturer", "manufacturer", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_MODEL] = { "modem.generic.model", "model", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_REVISION] = { "modem.generic.revision", "revision", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_HW_REVISION] = { "modem.generic.hardware-revision", "h/w revision", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_SUPPORTED_CAPABILITIES] = { "modem.generic.supported-capabilities", "supported", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_CURRENT_CAPABILITIES] = { "modem.generic.current-capabilities", "current", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_EQUIPMENT_ID] = { "modem.generic.equipment-identifier", "equipment id", MMC_S_MODEM_HARDWARE, }, + [MMC_F_SYSTEM_DEVICE] = { "modem.generic.device", "device", MMC_S_MODEM_SYSTEM, }, + [MMC_F_SYSTEM_DRIVERS] = { "modem.generic.drivers", "drivers", MMC_S_MODEM_SYSTEM, }, + [MMC_F_SYSTEM_PLUGIN] = { "modem.generic.plugin", "plugin", MMC_S_MODEM_SYSTEM, }, + [MMC_F_SYSTEM_PRIMARY_PORT] = { "modem.generic.primary-port", "primary port", MMC_S_MODEM_SYSTEM, }, + [MMC_F_SYSTEM_PORTS] = { "modem.generic.ports", "ports", MMC_S_MODEM_SYSTEM, }, + [MMC_F_NUMBERS_OWN] = { "modem.generic.own-numbers", "own", MMC_S_MODEM_NUMBERS, }, + [MMC_F_STATUS_LOCK] = { "modem.generic.unlock-required", "lock", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_UNLOCK_RETRIES] = { "modem.generic.unlock-retries", "unlock retries", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_STATE] = { "modem.generic.state", "state", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_FAILED_REASON] = { "modem.generic.state-failed-reason", "failed reason", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_POWER_STATE] = { "modem.generic.power-state", "power state", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_ACCESS_TECH] = { "modem.generic.access-technologies", "access tech", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_SIGNAL_QUALITY_VALUE] = { "modem.generic.signal-quality.value", "signal quality", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_SIGNAL_QUALITY_RECENT] = { "modem.generic.signal-quality.recent", NULL, MMC_S_UNKNOWN, }, + [MMC_F_MODES_SUPPORTED] = { "modem.generic.supported-modes", "supported", MMC_S_MODEM_MODES, }, + [MMC_F_MODES_CURRENT] = { "modem.generic.current-modes", "current", MMC_S_MODEM_MODES, }, + [MMC_F_BANDS_SUPPORTED] = { "modem.generic.supported-bands", "supported", MMC_S_MODEM_BANDS, }, + [MMC_F_BANDS_CURRENT] = { "modem.generic.current-bands", "current", MMC_S_MODEM_BANDS, }, + [MMC_F_IP_SUPPORTED] = { "modem.generic.supported-ip-families", "supported", MMC_S_MODEM_IP, }, + [MMC_F_3GPP_IMEI] = { "modem.3gpp.imei", "imei", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_ENABLED_LOCKS] = { "modem.3gpp.enabled-locks", "enabled locks", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_OPERATOR_ID] = { "modem.3gpp.operator-code", "operator id", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_OPERATOR_NAME] = { "modem.3gpp.operator-name", "operator name", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_REGISTRATION] = { "modem.3gpp.registration-state", "registration", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_PCO] = { "modem.3gpp.pco", "pco", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_EPS_UE_MODE] = { "modem.3gpp.eps.ue-mode-operation", "ue mode of operation", MMC_S_MODEM_3GPP_EPS, }, + [MMC_F_3GPP_EPS_INITIAL_BEARER_PATH] = { "modem.3gpp.eps.initial-bearer.dbus-path", "initial bearer dbus path", MMC_S_MODEM_3GPP_EPS, }, + [MMC_F_3GPP_SCAN_NETWORKS] = { "modem.3gpp.scan-networks", "networks", MMC_S_MODEM_3GPP_SCAN, }, + [MMC_F_3GPP_USSD_STATUS] = { "modem.3gpp.ussd.status", "status", MMC_S_MODEM_3GPP_USSD, }, + [MMC_F_3GPP_USSD_NETWORK_REQUEST] = { "modem.3gpp.ussd.network-request", "network request", MMC_S_MODEM_3GPP_USSD, }, + [MMC_F_3GPP_USSD_NETWORK_NOTIFICATION] = { "modem.3gpp.ussd.network-notification", "network notification", MMC_S_MODEM_3GPP_USSD, }, + [MMC_F_CDMA_MEID] = { "modem.cdma.meid", "meid", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_ESN] = { "modem.cdma.esn", "esn", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_SID] = { "modem.cdma.sid", "sid", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_NID] = { "modem.cdma.nid", "nid", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_REGISTRATION_CDMA1X] = { "modem.cdma.cdma1x-registration-state", "registration cdma1x", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_REGISTRATION_EVDO] = { "modem.cdma.evdo-registration-state", "registration evdo", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_ACTIVATION] = { "modem.cdma.activation-state", "activation", MMC_S_MODEM_CDMA, }, + [MMC_F_SIM_PATH] = { "modem.generic.sim", "dbus path", MMC_S_MODEM_SIM, }, + [MMC_F_BEARER_PATHS] = { "modem.generic.bearers", "dbus path", MMC_S_MODEM_BEARER, }, + [MMC_F_TIME_CURRENT] = { "modem.time.current", "current", MMC_S_MODEM_TIME, }, + [MMC_F_TIMEZONE_CURRENT] = { "modem.timezone.current", "current", MMC_S_MODEM_TIMEZONE, }, + [MMC_F_TIMEZONE_DST_OFFSET] = { "modem.time.dst-offset", "dst offset", MMC_S_MODEM_TIMEZONE, }, + [MMC_F_TIMEZONE_LEAP_SECONDS] = { "modem.time.leap-seconds", "leap seconds", MMC_S_MODEM_TIMEZONE, }, + [MMC_F_MESSAGING_SUPPORTED_STORAGES] = { "modem.messaging.supported-storages", "supported storages", MMC_S_MODEM_MESSAGING, }, + [MMC_F_MESSAGING_DEFAULT_STORAGES] = { "modem.messaging.default-storages", "default storages", MMC_S_MODEM_MESSAGING, }, + [MMC_F_SIGNAL_REFRESH_RATE] = { "modem.signal.refresh.rate", "refresh rate", MMC_S_MODEM_SIGNAL, }, + [MMC_F_SIGNAL_CDMA1X_RSSI] = { "modem.signal.cdma1x.rssi", "rssi", MMC_S_MODEM_SIGNAL_CDMA1X, }, + [MMC_F_SIGNAL_CDMA1X_ECIO] = { "modem.signal.cdma1x.ecio", "ecio", MMC_S_MODEM_SIGNAL_CDMA1X, }, + [MMC_F_SIGNAL_EVDO_RSSI] = { "modem.signal.evdo.rssi", "rssi", MMC_S_MODEM_SIGNAL_EVDO, }, + [MMC_F_SIGNAL_EVDO_ECIO] = { "modem.signal.evdo.ecio", "ecio", MMC_S_MODEM_SIGNAL_EVDO, }, + [MMC_F_SIGNAL_EVDO_SINR] = { "modem.signal.evdo.sinr", "sinr", MMC_S_MODEM_SIGNAL_EVDO, }, + [MMC_F_SIGNAL_EVDO_IO] = { "modem.signal.evdo.io", "io", MMC_S_MODEM_SIGNAL_EVDO, }, + [MMC_F_SIGNAL_GSM_RSSI] = { "modem.signal.gsm.rssi", "rssi", MMC_S_MODEM_SIGNAL_GSM, }, + [MMC_F_SIGNAL_UMTS_RSSI] = { "modem.signal.umts.rssi", "rssi", MMC_S_MODEM_SIGNAL_UMTS, }, + [MMC_F_SIGNAL_UMTS_RSCP] = { "modem.signal.umts.rscp", "rscp", MMC_S_MODEM_SIGNAL_UMTS, }, + [MMC_F_SIGNAL_UMTS_ECIO] = { "modem.signal.umts.ecio", "ecio", MMC_S_MODEM_SIGNAL_UMTS, }, + [MMC_F_SIGNAL_LTE_RSSI] = { "modem.signal.lte.rssi", "rssi", MMC_S_MODEM_SIGNAL_LTE, }, + [MMC_F_SIGNAL_LTE_RSRQ] = { "modem.signal.lte.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_LTE, }, + [MMC_F_SIGNAL_LTE_RSRP] = { "modem.signal.lte.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_LTE, }, + [MMC_F_SIGNAL_LTE_SNR] = { "modem.signal.lte.snr", "s/n", MMC_S_MODEM_SIGNAL_LTE, }, + [MMC_F_OMA_FEATURES] = { "modem.oma.features", "features", MMC_S_MODEM_OMA, }, + [MMC_F_OMA_CURRENT_TYPE] = { "modem.oma.current.type", "type", MMC_S_MODEM_OMA_CURRENT, }, + [MMC_F_OMA_CURRENT_STATE] = { "modem.oma.current.state", "state", MMC_S_MODEM_OMA_CURRENT, }, + [MMC_F_OMA_PENDING_SESSIONS] = { "modem.oma.pending-sessions", "sessions", MMC_S_MODEM_OMA_PENDING, }, + [MMC_F_LOCATION_CAPABILITIES] = { "modem.location.capabilities", "capabilities", MMC_S_MODEM_LOCATION, }, + [MMC_F_LOCATION_ENABLED] = { "modem.location.enabled", "enabled", MMC_S_MODEM_LOCATION, }, + [MMC_F_LOCATION_SIGNALS] = { "modem.location.signals", "signals", MMC_S_MODEM_LOCATION, }, + [MMC_F_LOCATION_GPS_REFRESH_RATE] = { "modem.location.gps.refresh-rate", "refresh rate", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_SUPL_SERVER] = { "modem.location.gps.supl-server", "a-gps supl server", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_ASSISTANCE] = { "modem.location.gps.assistance", "supported assistance", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_ASSISTANCE_SERVERS] = { "modem.location.gps.assistance-servers", "assistance servers", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_3GPP_MCC] = { "modem.location.3gpp.mcc", "operator code", MMC_S_MODEM_LOCATION_3GPP, }, + [MMC_F_LOCATION_3GPP_MNC] = { "modem.location.3gpp.mnc", "operator name", MMC_S_MODEM_LOCATION_3GPP, }, + [MMC_F_LOCATION_3GPP_LAC] = { "modem.location.3gpp.lac", "location area code", MMC_S_MODEM_LOCATION_3GPP, }, + [MMC_F_LOCATION_3GPP_TAC] = { "modem.location.3gpp.tac", "tracking area code", MMC_S_MODEM_LOCATION_3GPP, }, + [MMC_F_LOCATION_3GPP_CID] = { "modem.location.3gpp.cid", "cell id", MMC_S_MODEM_LOCATION_3GPP, }, + [MMC_F_LOCATION_GPS_NMEA] = { "modem.location.gps.nmea", "nmea", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_UTC] = { "modem.location.gps.utc", "utc", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_LONG] = { "modem.location.gps.longitude", "longitude", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_LAT] = { "modem.location.gps.latitude", "latitude", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_ALT] = { "modem.location.gps.altitude", "altitude", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_CDMABS_LONG] = { "modem.location.cdma-bs.longitude", "longitude", MMC_S_MODEM_LOCATION_CDMABS, }, + [MMC_F_LOCATION_CDMABS_LAT] = { "modem.location.cdma-bs.latitude", "latitude", MMC_S_MODEM_LOCATION_CDMABS, }, + [MMC_F_FIRMWARE_LIST] = { "modem.firmware-list", "list", MMC_S_MODEM_FIRMWARE, }, + [MMC_F_BEARER_GENERAL_DBUS_PATH] = { "bearer.dbus-path", "dbus path", MMC_S_BEARER_GENERAL, }, + [MMC_F_BEARER_GENERAL_TYPE] = { "bearer.type", "type", MMC_S_BEARER_GENERAL, }, + [MMC_F_BEARER_STATUS_CONNECTED] = { "bearer.status.connected", "connected", MMC_S_BEARER_STATUS, }, + [MMC_F_BEARER_STATUS_SUSPENDED] = { "bearer.status.suspended", "suspended", MMC_S_BEARER_STATUS, }, + [MMC_F_BEARER_STATUS_INTERFACE] = { "bearer.status.interface", "interface", MMC_S_BEARER_STATUS, }, + [MMC_F_BEARER_STATUS_IP_TIMEOUT] = { "bearer.status.ip-timeout", "ip timeout", MMC_S_BEARER_STATUS, }, + [MMC_F_BEARER_PROPERTIES_APN] = { "bearer.properties.apn", "apn", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_ROAMING] = { "bearer.properties.roaming", "roaming", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_IP_TYPE] = { "bearer.properties.ip-type", "ip type", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_USER] = { "bearer.properties.user", "user", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_PASSWORD] = { "bearer.properties.password", "password", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_NUMBER] = { "bearer.properties.number", "number", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_RM_PROTOCOL] = { "bearer.properties.rm-protocol", "rm protocol", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_IPV4_CONFIG_METHOD] = { "bearer.ipv4-config.method", "method", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV4_CONFIG_ADDRESS] = { "bearer.ipv4-config.address", "address", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV4_CONFIG_PREFIX] = { "bearer.ipv4-config.prefix", "prefix", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV4_CONFIG_GATEWAY] = { "bearer.ipv4-config.gateway", "gateway", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV4_CONFIG_DNS] = { "bearer.ipv4-config.dns", "dns", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV4_CONFIG_MTU] = { "bearer.ipv4-config.mtu", "mtu", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_METHOD] = { "bearer.ipv6-config.method", "method", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_ADDRESS] = { "bearer.ipv6-config.address", "address", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_PREFIX] = { "bearer.ipv6-config.prefix", "prefix", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_GATEWAY] = { "bearer.ipv6-config.gateway", "gateway", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_DNS] = { "bearer.ipv6-config.dns", "dns", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_MTU] = { "bearer.ipv6-config.mtu", "mtu", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_STATS_DURATION] = { "bearer.stats.duration", "duration", MMC_S_BEARER_STATS, }, + [MMC_F_BEARER_STATS_BYTES_RX] = { "bearer.stats.bytes-rx", "bytes rx", MMC_S_BEARER_STATS, }, + [MMC_F_BEARER_STATS_BYTES_TX] = { "bearer.stats.bytes-tx", "bytes tx", MMC_S_BEARER_STATS, }, + [MMC_F_CALL_GENERAL_DBUS_PATH] = { "call.dbus-path", "dbus path", MMC_S_CALL_GENERAL, }, + [MMC_F_CALL_PROPERTIES_NUMBER] = { "call.properties.number", "number", MMC_S_CALL_PROPERTIES, }, + [MMC_F_CALL_PROPERTIES_DIRECTION] = { "call.properties.direction", "direction", MMC_S_CALL_PROPERTIES, }, + [MMC_F_CALL_PROPERTIES_STATE] = { "call.properties.state", "state", MMC_S_CALL_PROPERTIES, }, + [MMC_F_CALL_PROPERTIES_STATE_REASON] = { "call.properties.state-reason", "state reason", MMC_S_CALL_PROPERTIES, }, + [MMC_F_CALL_PROPERTIES_AUDIO_PORT] = { "call.properties.audio-port", "audio port", MMC_S_CALL_PROPERTIES, }, + [MMC_F_CALL_AUDIO_FORMAT_ENCODING] = { "call.audio-format.encoding", "encoding", MMC_S_CALL_AUDIO_FORMAT, }, + [MMC_F_CALL_AUDIO_FORMAT_RESOLUTION] = { "call.audio-format.resolution", "resolution", MMC_S_CALL_AUDIO_FORMAT, }, + [MMC_F_CALL_AUDIO_FORMAT_RATE] = { "call.audio-format.rate", "rate", MMC_S_CALL_AUDIO_FORMAT, }, + [MMC_F_SMS_GENERAL_DBUS_PATH] = { "sms.dbus-path", "dbus path", MMC_S_SMS_GENERAL, }, + [MMC_F_SMS_CONTENT_NUMBER] = { "sms.content.number", "number", MMC_S_SMS_CONTENT, }, + [MMC_F_SMS_CONTENT_TEXT] = { "sms.content.text", "text", MMC_S_SMS_CONTENT, }, + [MMC_F_SMS_CONTENT_DATA] = { "sms.content.data", "data", MMC_S_SMS_CONTENT, }, + [MMC_F_SMS_PROPERTIES_PDU_TYPE] = { "sms.properties.pdu-type", "pdu type", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_STATE] = { "sms.properties.state", "state", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_VALIDITY] = { "sms.properties.validity", "validity", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_STORAGE] = { "sms.properties.storage", "storage", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_SMSC] = { "sms.properties.smsc", "smsc", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_CLASS] = { "sms.properties.class", "class", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_TELESERVICE_ID] = { "sms.properties.teleservice-id", "teleservice id", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_SERVICE_CATEGORY] = { "sms.properties.service-category", "service category", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_DELIVERY_REPORT] = { "sms.properties.delivery-report", "delivery report", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_MSG_REFERENCE] = { "sms.properties.message-reference", "message reference", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_TIMESTAMP] = { "sms.properties.timestamp", "timestamp", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_DELIVERY_STATE] = { "sms.properties.delivery-state", "delivery state", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_DISCH_TIMESTAMP] = { "sms.properties.discharge-timestamp", "discharge timestamp", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SIM_GENERAL_DBUS_PATH] = { "sim.dbus-path", "dbus path", MMC_S_SIM_GENERAL, }, + [MMC_F_SIM_PROPERTIES_IMSI] = { "sim.properties.imsi", "imsi", MMC_S_SIM_PROPERTIES, }, + [MMC_F_SIM_PROPERTIES_ICCID] = { "sim.properties.iccid", "iccid", MMC_S_SIM_PROPERTIES, }, + [MMC_F_SIM_PROPERTIES_OPERATOR_ID] = { "sim.properties.operator-code", "operator id", MMC_S_SIM_PROPERTIES, }, + [MMC_F_SIM_PROPERTIES_OPERATOR_NAME] = { "sim.properties.operator-name", "operator name", MMC_S_SIM_PROPERTIES, }, + [MMC_F_MODEM_LIST_DBUS_PATH] = { "modem-list", "modems", MMC_S_UNKNOWN, }, + [MMC_F_SMS_LIST_DBUS_PATH] = { "modem.messaging.sms", "sms messages", MMC_S_UNKNOWN, }, + [MMC_F_CALL_LIST_DBUS_PATH] = { "modem.voice.call", "calls", MMC_S_UNKNOWN, }, }; /******************************************************************************/ diff --git a/cli/mmcli-output.h b/cli/mmcli-output.h index 9264537c..80fbda0a 100644 --- a/cli/mmcli-output.h +++ b/cli/mmcli-output.h @@ -39,6 +39,7 @@ typedef enum { MMC_S_MODEM_BANDS, MMC_S_MODEM_IP, MMC_S_MODEM_3GPP, + MMC_S_MODEM_3GPP_EPS, MMC_S_MODEM_3GPP_SCAN, MMC_S_MODEM_3GPP_USSD, MMC_S_MODEM_CDMA, @@ -124,8 +125,10 @@ typedef enum { MMC_F_3GPP_OPERATOR_ID, MMC_F_3GPP_OPERATOR_NAME, MMC_F_3GPP_REGISTRATION, - MMC_F_3GPP_EPS_UE_MODE, MMC_F_3GPP_PCO, + /* 3GPP EPS section */ + MMC_F_3GPP_EPS_UE_MODE, + MMC_F_3GPP_EPS_INITIAL_BEARER_PATH, /* 3GPP scan section */ MMC_F_3GPP_SCAN_NETWORKS, /* USSD section */ diff --git a/docs/reference/libmm-glib/libmm-glib-sections.txt b/docs/reference/libmm-glib/libmm-glib-sections.txt index bd169db6..5d60c952 100644 --- a/docs/reference/libmm-glib/libmm-glib-sections.txt +++ b/docs/reference/libmm-glib/libmm-glib-sections.txt @@ -277,8 +277,13 @@ mm_modem_3gpp_dup_operator_name mm_modem_3gpp_get_enabled_facility_locks mm_modem_3gpp_get_registration_state mm_modem_3gpp_get_subscription_state -mm_modem_3gpp_get_eps_ue_mode_operation mm_modem_3gpp_get_pco +mm_modem_3gpp_get_eps_ue_mode_operation +mm_modem_3gpp_get_initial_eps_bearer_path +mm_modem_3gpp_dup_initial_eps_bearer_path +mm_modem_3gpp_get_initial_eps_bearer +mm_modem_3gpp_get_initial_eps_bearer_finish +mm_modem_3gpp_get_initial_eps_bearer_sync <SUBSECTION Methods> mm_modem_3gpp_register mm_modem_3gpp_register_finish @@ -291,6 +296,7 @@ mm_modem_3gpp_set_eps_ue_mode_operation_finish mm_modem_3gpp_set_eps_ue_mode_operation_sync <SUBSECTION Standard> MMModem3gppClass +MMModem3gppPrivate MM_IS_MODEM_3GPP MM_IS_MODEM_3GPP_CLASS MM_MODEM_3GPP @@ -1762,6 +1768,8 @@ mm_gdbus_modem3gpp_get_subscription_state mm_gdbus_modem3gpp_get_eps_ue_mode_operation mm_gdbus_modem3gpp_get_pco mm_gdbus_modem3gpp_dup_pco +mm_gdbus_modem3gpp_get_initial_eps_bearer +mm_gdbus_modem3gpp_dup_initial_eps_bearer <SUBSECTION Methods> mm_gdbus_modem3gpp_call_register mm_gdbus_modem3gpp_call_register_finish @@ -1786,6 +1794,7 @@ mm_gdbus_modem3gpp_set_registration_state mm_gdbus_modem3gpp_set_subscription_state mm_gdbus_modem3gpp_set_eps_ue_mode_operation mm_gdbus_modem3gpp_set_pco +mm_gdbus_modem3gpp_set_initial_eps_bearer <SUBSECTION Standard> MM_GDBUS_IS_MODEM3GPP MM_GDBUS_MODEM3GPP diff --git a/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml b/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml index 5542fb6b..758fb32d 100644 --- a/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml +++ b/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml @@ -175,5 +175,12 @@ --> <property name="Pco" type="a(ubay)" access="read" /> + <!-- + InitialEpsBearer: + + The object path for the initial default EPS bearer. + --> + <property name="InitialEpsBearer" type="o" access="read" /> + </interface> </node> diff --git a/introspection/org.freedesktop.ModemManager1.Modem.xml b/introspection/org.freedesktop.ModemManager1.Modem.xml index 37cdb941..34a74feb 100644 --- a/introspection/org.freedesktop.ModemManager1.Modem.xml +++ b/introspection/org.freedesktop.ModemManager1.Modem.xml @@ -216,7 +216,10 @@ Bearers: The list of bearer object paths (EPS Bearers, PDP Contexts, or - CDMA2000 Packet Data Sessions). + CDMA2000 Packet Data Sessions) as requested by the user. + + This list does not include the initial EPS bearer details (see + #org.freedesktop.ModemManager1.Modem.Modem3gpp:InitialEpsBearer). --> <property name="Bearers" type="ao" access="read" /> diff --git a/libmm-glib/mm-modem-3gpp.c b/libmm-glib/mm-modem-3gpp.c index 0c93ae04..a30f2a6c 100644 --- a/libmm-glib/mm-modem-3gpp.c +++ b/libmm-glib/mm-modem-3gpp.c @@ -26,6 +26,7 @@ #include "mm-helpers.h" #include "mm-errors-types.h" #include "mm-modem-3gpp.h" +#include "mm-bearer.h" #include "mm-pco.h" /** @@ -345,6 +346,46 @@ mm_modem_3gpp_get_pco (MMModem3gpp *self) /*****************************************************************************/ /** + * mm_modem_3gpp_get_initial_eps_bearer_path: (skip) + * @self: A #MMModem3gpp. + * + * Gets the DBus path of the initial EPS #MMBearer exposed in this #MMModem3gpp. + * + * <warning>The returned value is only valid until the property changes so + * it is only safe to use this function on the thread where + * @self was constructed. Use mm_modem_3gpp_dup_initial_eps_bearer_path() if on another + * thread.</warning> + * + * Returns: (transfer none): The DBus path of the #MMBearer, or %NULL if none available. Do not free the returned value, it belongs to @self. + */ +const gchar * +mm_modem_3gpp_get_initial_eps_bearer_path (MMModem3gpp *self) +{ + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + RETURN_NON_EMPTY_CONSTANT_STRING (mm_gdbus_modem3gpp_get_initial_eps_bearer (MM_GDBUS_MODEM3GPP (self))); +} + +/** + * mm_modem_3gpp_dup_initial_eps_bearer_path: + * @self: A #MMModem3gpp. + * + * Gets a copy of the DBus path of the initial EPS #MMBearer exposed in this #MMModem3gpp. + * + * Returns: (transfer full): The DBus path of the #MMBearer, or %NULL if none available. The returned value should be freed with g_free(). + */ +gchar * +mm_modem_3gpp_dup_initial_eps_bearer_path (MMModem3gpp *self) +{ + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + RETURN_NON_EMPTY_STRING ( + mm_gdbus_modem3gpp_dup_initial_eps_bearer (MM_GDBUS_MODEM3GPP (self))); +} + +/*****************************************************************************/ + +/** * mm_modem_3gpp_register_finish: * @self: A #MMModem3gpp. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_3gpp_register(). @@ -732,6 +773,144 @@ mm_modem_3gpp_set_eps_ue_mode_operation_sync (MMModem3gpp *se /*****************************************************************************/ +/** + * mm_modem_3gpp_get_initial_eps_bearer_finish: + * @self: A #MMModem3gpp. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_3gpp_get_initial_eps_bearer(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with mm_modem_3gpp_get_initial_eps_bearer(). + * + * Returns: (transfer full): a #MMSim or #NULL if @error is set. The returned value should be freed with g_object_unref(). + */ +MMBearer * +mm_modem_3gpp_get_initial_eps_bearer_finish (MMModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +modem_3gpp_get_initial_eps_bearer_ready (GDBusConnection *connection, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + GObject *sim; + GObject *source_object; + + source_object = g_async_result_get_source_object (res); + sim = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, &error); + g_object_unref (source_object); + + if (error) + g_task_return_error (task, error); + else + g_task_return_pointer (task, sim, g_object_unref); + + g_object_unref (task); +} + +/** + * mm_modem_3gpp_get_initial_eps_bearer: + * @self: A #MMModem3gpp. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously gets the initial EPS #MMBearer object exposed by this #MMModem3gpp. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call mm_modem_3gpp_get_initial_eps_bearer_finish() to get the result of the operation. + * + * See mm_modem_3gpp_get_initial_eps_bearer_sync() for the synchronous, blocking version of this method. + */ +void +mm_modem_3gpp_get_initial_eps_bearer (MMModem3gpp *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + const gchar *bearer_path; + + g_return_if_fail (MM_IS_MODEM_3GPP (self)); + + task = g_task_new (self, cancellable, callback, user_data); + + bearer_path = mm_modem_3gpp_get_initial_eps_bearer_path (self); + if (!bearer_path || g_str_equal (bearer_path, "/")) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No initial EPS bearer object available"); + g_object_unref (task); + return; + } + + g_async_initable_new_async (MM_TYPE_BEARER, + G_PRIORITY_DEFAULT, + cancellable, + (GAsyncReadyCallback)modem_3gpp_get_initial_eps_bearer_ready, + task, + "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + "g-name", MM_DBUS_SERVICE, + "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), + "g-object-path", bearer_path, + "g-interface-name", "org.freedesktop.ModemManager1.Bearer", + NULL); +} + +/** + * mm_modem_3gpp_get_initial_eps_bearer_sync: + * @self: A #MMModem3gpp. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously gets the initial EPS #MMBearer object exposed by this #MMModem3gpp. + * + * The calling thread is blocked until a reply is received. See mm_modem_3gpp_get_initial_eps_bearer() + * for the asynchronous version of this method. + * + * Returns: (transfer full): a #MMBearer or #NULL if @error is set. The returned value should be freed with g_object_unref(). + */ +MMBearer * +mm_modem_3gpp_get_initial_eps_bearer_sync (MMModem3gpp *self, + GCancellable *cancellable, + GError **error) +{ + GObject *bearer; + const gchar *bearer_path; + + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + bearer_path = mm_modem_3gpp_get_initial_eps_bearer_path (self); + if (!bearer_path || g_str_equal (bearer_path, "/")) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No initial EPS bearer object available"); + return NULL; + } + + bearer = g_initable_new (MM_TYPE_BEARER, + cancellable, + error, + "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + "g-name", MM_DBUS_SERVICE, + "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), + "g-object-path", bearer_path, + "g-interface-name", "org.freedesktop.ModemManager1.Bearer", + NULL); + + return (bearer ? MM_BEARER (bearer) : NULL); +} + +/*****************************************************************************/ + static void mm_modem_3gpp_init (MMModem3gpp *self) { diff --git a/libmm-glib/mm-modem-3gpp.h b/libmm-glib/mm-modem-3gpp.h index f71d8a61..6d87a47d 100644 --- a/libmm-glib/mm-modem-3gpp.h +++ b/libmm-glib/mm-modem-3gpp.h @@ -30,6 +30,7 @@ #include <ModemManager.h> +#include "mm-bearer.h" #include "mm-gdbus-modem.h" G_BEGIN_DECLS @@ -81,7 +82,10 @@ MMModem3gppFacility mm_modem_3gpp_get_enabled_facility_locks (MMModem3 MMModem3gppEpsUeModeOperation mm_modem_3gpp_get_eps_ue_mode_operation (MMModem3gpp *self); -GList *mm_modem_3gpp_get_pco (MMModem3gpp *self); +GList *mm_modem_3gpp_get_pco (MMModem3gpp *self); + +const gchar *mm_modem_3gpp_get_initial_eps_bearer_path (MMModem3gpp *self); +gchar *mm_modem_3gpp_dup_initial_eps_bearer_path (MMModem3gpp *self); void mm_modem_3gpp_register (MMModem3gpp *self, const gchar *network_id, @@ -135,6 +139,17 @@ gboolean mm_modem_3gpp_set_eps_ue_mode_operation_sync (MMModem3gpp GCancellable *cancellable, GError **error); +void mm_modem_3gpp_get_initial_eps_bearer (MMModem3gpp *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMBearer *mm_modem_3gpp_get_initial_eps_bearer_finish (MMModem3gpp *self, + GAsyncResult *res, + GError **error); +MMBearer *mm_modem_3gpp_get_initial_eps_bearer_sync (MMModem3gpp *self, + GCancellable *cancellable, + GError **error); + /* Deprecated APIs */ G_DEPRECATED MMModem3gppSubscriptionState mm_modem_3gpp_get_subscription_state (MMModem3gpp *self); diff --git a/src/mm-base-bearer.c b/src/mm-base-bearer.c index b2e07e19..6b7e1e5d 100644 --- a/src/mm-base-bearer.c +++ b/src/mm-base-bearer.c @@ -764,8 +764,18 @@ mm_base_bearer_connect (MMBaseBearer *self, { GTask *task; - g_assert (MM_BASE_BEARER_GET_CLASS (self)->connect != NULL); - g_assert (MM_BASE_BEARER_GET_CLASS (self)->connect_finish != NULL); + if (!MM_BASE_BEARER_GET_CLASS (self)->connect) { + g_assert (!MM_BASE_BEARER_GET_CLASS (self)->connect_finish); + g_task_report_new_error ( + self, + callback, + user_data, + mm_base_bearer_connect, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Bearer doesn't allow explicit connection requests"); + return; + } /* If already connecting, return error, don't allow a second request. */ if (self->priv->status == MM_BEARER_STATUS_CONNECTING) { @@ -975,11 +985,19 @@ mm_base_bearer_disconnect (MMBaseBearer *self, { GTask *task; - g_assert (MM_BASE_BEARER_GET_CLASS (self)->disconnect != NULL); - g_assert (MM_BASE_BEARER_GET_CLASS (self)->disconnect_finish != NULL); - task = g_task_new (self, NULL, callback, user_data); + if (!MM_BASE_BEARER_GET_CLASS (self)->disconnect) { + g_assert (!MM_BASE_BEARER_GET_CLASS (self)->disconnect_finish); + g_task_return_new_error ( + task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Bearer doesn't allow explicit disconnection requests"); + g_object_unref (task); + return; + } + /* If already disconnected, done */ if (self->priv->status == MM_BEARER_STATUS_DISCONNECTED) { g_task_return_boolean (task, TRUE); diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 7c7250e6..952bc30a 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -106,6 +106,7 @@ enum { PROP_MODEM_3GPP_PS_NETWORK_SUPPORTED, PROP_MODEM_3GPP_EPS_NETWORK_SUPPORTED, PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS, + PROP_MODEM_3GPP_INITIAL_EPS_BEARER, PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE, PROP_MODEM_CDMA_EVDO_REGISTRATION_STATE, PROP_MODEM_CDMA_CDMA1X_NETWORK_SUPPORTED, @@ -171,6 +172,7 @@ struct _MMBroadbandModemPrivate { /* Implementation helpers */ GPtrArray *modem_3gpp_registration_regex; MMModem3gppFacility modem_3gpp_ignored_facility_locks; + MMBaseBearer *modem_3gpp_initial_eps_bearer; /*<--- Modem 3GPP USSD interface --->*/ /* Properties */ @@ -4870,6 +4872,28 @@ modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self, } /*****************************************************************************/ +/* Create initial EPS bearer object */ + +static MMBaseBearer * +modem_3gpp_create_initial_eps_bearer (MMIfaceModem3gpp *self, + MMBearerProperties *config) +{ + MMBaseBearer *bearer; + + /* NOTE: by default we create a bearer object that is CONNECTED but which doesn't + * have an associated data interface already set. This is so that upper layers don't + * attempt connection through this bearer object. */ + bearer = g_object_new (MM_TYPE_BASE_BEARER, + MM_BASE_BEARER_MODEM, MM_BASE_MODEM (self), + MM_BASE_BEARER_CONFIG, config, + "bearer-type", MM_BEARER_TYPE_DEFAULT_ATTACH, + "connected", TRUE, + NULL); + mm_base_bearer_export (bearer); + return bearer; +} + +/*****************************************************************************/ /* Enable/Disable unsolicited registration events (3GPP interface) */ typedef struct { @@ -11117,6 +11141,10 @@ set_property (GObject *object, case PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS: self->priv->modem_3gpp_ignored_facility_locks = g_value_get_flags (value); break; + case PROP_MODEM_3GPP_INITIAL_EPS_BEARER: + g_clear_object (&self->priv->modem_3gpp_initial_eps_bearer); + self->priv->modem_3gpp_initial_eps_bearer = g_value_dup_object (value); + break; case PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE: self->priv->modem_cdma_cdma1x_registration_state = g_value_get_enum (value); break; @@ -11234,6 +11262,9 @@ get_property (GObject *object, case PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS: g_value_set_flags (value, self->priv->modem_3gpp_ignored_facility_locks); break; + case PROP_MODEM_3GPP_INITIAL_EPS_BEARER: + g_value_set_object (value, self->priv->modem_3gpp_initial_eps_bearer); + break; case PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE: g_value_set_enum (value, self->priv->modem_cdma_cdma1x_registration_state); break; @@ -11381,6 +11412,7 @@ dispose (GObject *object) g_clear_object (&self->priv->modem_simple_dbus_skeleton); } + g_clear_object (&self->priv->modem_3gpp_initial_eps_bearer); g_clear_object (&self->priv->modem_sim); g_clear_object (&self->priv->modem_bearer_list); g_clear_object (&self->priv->modem_messaging_sms_list); @@ -11489,6 +11521,7 @@ iface_modem_3gpp_init (MMIfaceModem3gpp *iface) iface->scan_networks_finish = modem_3gpp_scan_networks_finish; iface->set_eps_ue_mode_operation = modem_3gpp_set_eps_ue_mode_operation; iface->set_eps_ue_mode_operation_finish = modem_3gpp_set_eps_ue_mode_operation_finish; + iface->create_initial_eps_bearer = modem_3gpp_create_initial_eps_bearer; } static void @@ -11745,6 +11778,10 @@ mm_broadband_modem_class_init (MMBroadbandModemClass *klass) MM_IFACE_MODEM_3GPP_IGNORED_FACILITY_LOCKS); g_object_class_override_property (object_class, + PROP_MODEM_3GPP_INITIAL_EPS_BEARER, + MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER); + + g_object_class_override_property (object_class, PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE, MM_IFACE_MODEM_CDMA_CDMA1X_REGISTRATION_STATE); diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c index 9e626126..a90c7204 100644 --- a/src/mm-iface-modem-3gpp.c +++ b/src/mm-iface-modem-3gpp.c @@ -1488,11 +1488,56 @@ mm_iface_modem_3gpp_update_pco_list (MMIfaceModem3gpp *self, /*****************************************************************************/ +void +mm_iface_modem_3gpp_update_initial_eps_bearer (MMIfaceModem3gpp *self, + MMBearerProperties *properties) +{ + MmGdbusModem3gpp *skeleton = NULL; + MMBaseBearer *attach = NULL; + gboolean skip_update = FALSE; + + g_object_get (self, + MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &skeleton, + MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, &attach, + NULL); + g_assert (skeleton); + + if (attach) { + skip_update = (properties && mm_bearer_properties_cmp (properties, mm_base_bearer_peek_config (MM_BASE_BEARER (attach)))); + g_object_unref (attach); + } + + if (skip_update) { + mm_dbg ("skipping initial EPS bearer update: configuration didn't change"); + } else if (properties) { + mm_dbg ("updating initial EPS bearer..."); + + g_assert (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_initial_eps_bearer); + attach = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_initial_eps_bearer (self, properties); + g_object_set (self, + MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, attach, + NULL); + mm_gdbus_modem3gpp_set_initial_eps_bearer (skeleton, mm_base_bearer_get_path (attach)); + g_object_unref (attach); + } else { + mm_dbg ("clearing initial EPS bearer..."); + g_object_set (self, + MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, NULL, + NULL); + mm_gdbus_modem3gpp_set_initial_eps_bearer (skeleton, NULL); + } + + g_object_unref (skeleton); +} + +/*****************************************************************************/ + typedef struct _DisablingContext DisablingContext; static void interface_disabling_step (GTask *task); typedef enum { DISABLING_STEP_FIRST, + DISABLING_STEP_INITIAL_EPS_BEARER, DISABLING_STEP_PERIODIC_REGISTRATION_CHECKS, DISABLING_STEP_DISABLE_UNSOLICITED_REGISTRATION_EVENTS, DISABLING_STEP_CLEANUP_UNSOLICITED_REGISTRATION_EVENTS, @@ -1568,6 +1613,11 @@ interface_disabling_step (GTask *task) /* Fall down to next step */ ctx->step++; + case DISABLING_STEP_INITIAL_EPS_BEARER: + mm_iface_modem_3gpp_update_initial_eps_bearer (self, NULL); + /* Fall down to next step */ + ctx->step++; + case DISABLING_STEP_PERIODIC_REGISTRATION_CHECKS: /* Disable periodic registration checks, if they were set */ periodic_registration_check_disable (self); @@ -1693,6 +1743,7 @@ typedef enum { ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS, ENABLING_STEP_SETUP_UNSOLICITED_REGISTRATION_EVENTS, ENABLING_STEP_ENABLE_UNSOLICITED_REGISTRATION_EVENTS, + ENABLING_STEP_INITIAL_EPS_BEARER, ENABLING_STEP_LAST } EnablingStep; @@ -1820,6 +1871,33 @@ enable_unsolicited_registration_events_ready (MMIfaceModem3gpp *self, } static void +load_initial_eps_bearer_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + GTask *task) +{ + MMBearerProperties *properties; + EnablingContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + properties = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_finish (self, res, &error); + if (!properties) { + mm_dbg ("couldn't load initial default bearer properties: '%s'", error->message); + g_error_free (error); + goto out; + } + + mm_iface_modem_3gpp_update_initial_eps_bearer (self, properties); + g_object_unref (properties); + +out: + /* Go on to next step */ + ctx->step++; + interface_enabling_step (task); +} + +static void interface_enabling_step (GTask *task) { MMIfaceModem3gpp *self; @@ -1901,6 +1979,26 @@ interface_enabling_step (GTask *task) ctx->step++; } + case ENABLING_STEP_INITIAL_EPS_BEARER: { + gboolean eps_supported = FALSE; + + g_object_get (self, + MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED, &eps_supported, + NULL); + + if (eps_supported && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer ( + self, + (GAsyncReadyCallback)load_initial_eps_bearer_ready, + task); + return; + } + /* Fall down to next step */ + ctx->step++; + } + case ENABLING_STEP_LAST: /* We are done without errors! */ g_task_return_boolean (task, TRUE); @@ -2191,6 +2289,7 @@ mm_iface_modem_3gpp_initialize (MMIfaceModem3gpp *self, mm_gdbus_modem3gpp_set_enabled_facility_locks (skeleton, MM_MODEM_3GPP_FACILITY_NONE); mm_gdbus_modem3gpp_set_subscription_state (skeleton, MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN); mm_gdbus_modem3gpp_set_pco (skeleton, NULL); + mm_gdbus_modem3gpp_set_initial_eps_bearer (skeleton, NULL); /* Bind our RegistrationState property */ g_object_bind_property (self, MM_IFACE_MODEM_3GPP_REGISTRATION_STATE, @@ -2301,6 +2400,14 @@ iface_modem_3gpp_init (gpointer g_iface) MM_MODEM_3GPP_FACILITY_NONE, G_PARAM_READWRITE)); + g_object_interface_install_property + (g_iface, + g_param_spec_object (MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, + "Initial EPS bearer", + "Initial EPS bearer setup during registration", + MM_TYPE_BASE_BEARER, + G_PARAM_READWRITE)); + initialized = TRUE; } diff --git a/src/mm-iface-modem-3gpp.h b/src/mm-iface-modem-3gpp.h index 920d01a0..90b3eedd 100644 --- a/src/mm-iface-modem-3gpp.h +++ b/src/mm-iface-modem-3gpp.h @@ -21,6 +21,7 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> +#include "mm-base-bearer.h" #include "mm-port-serial-at.h" #define MM_TYPE_IFACE_MODEM_3GPP (mm_iface_modem_3gpp_get_type ()) @@ -34,6 +35,7 @@ #define MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED "iface-modem-3gpp-ps-network-supported" #define MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED "iface-modem-3gpp-eps-network-supported" #define MM_IFACE_MODEM_3GPP_IGNORED_FACILITY_LOCKS "iface-modem-3gpp-ignored-facility-locks" +#define MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER "iface-modem-3gpp-initial-eps-bearer" #define MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK \ (MM_MODEM_ACCESS_TECHNOLOGY_GSM | \ @@ -145,6 +147,18 @@ struct _MMIfaceModem3gpp { GAsyncResult *res, GError **error); + /* Asynchronous initial default EPS bearer loading */ + void (*load_initial_eps_bearer) (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data); + MMBearerProperties * (*load_initial_eps_bearer_finish) (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error); + + /* Create initial default EPS bearer object */ + MMBaseBearer * (*create_initial_eps_bearer) (MMIfaceModem3gpp *self, + MMBearerProperties *properties); + /* Run CS/PS/EPS registration state checks.. * Note that no registration state is returned, implementations should call * mm_iface_modem_3gpp_update_registration_state(). */ @@ -253,6 +267,8 @@ void mm_iface_modem_3gpp_update_location (MMIfaceModem3gpp *self, gulong cell_id); void mm_iface_modem_3gpp_update_pco_list (MMIfaceModem3gpp *self, const GList *pco_list); +void mm_iface_modem_3gpp_update_initial_eps_bearer (MMIfaceModem3gpp *self, + MMBearerProperties *properties); /* Run all registration checks */ void mm_iface_modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self, |