summaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-iface-modem.h')
-rw-r--r--src/mm-iface-modem.h157
1 files changed, 144 insertions, 13 deletions
diff --git a/src/mm-iface-modem.h b/src/mm-iface-modem.h
index 74ea9f92..34f3297b 100644
--- a/src/mm-iface-modem.h
+++ b/src/mm-iface-modem.h
@@ -26,16 +26,23 @@
#include "mm-port-serial-at.h"
#include "mm-base-bearer.h"
#include "mm-base-sim.h"
+#include "mm-bearer-list.h"
#define MM_TYPE_IFACE_MODEM (mm_iface_modem_get_type ())
#define MM_IFACE_MODEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_IFACE_MODEM, MMIfaceModem))
#define MM_IS_IFACE_MODEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_IFACE_MODEM))
#define MM_IFACE_MODEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_IFACE_MODEM, MMIfaceModem))
-#define MM_IFACE_MODEM_DBUS_SKELETON "iface-modem-dbus-skeleton"
-#define MM_IFACE_MODEM_STATE "iface-modem-state"
-#define MM_IFACE_MODEM_SIM "iface-modem-sim"
-#define MM_IFACE_MODEM_BEARER_LIST "iface-modem-bearer-list"
+#define MM_IFACE_MODEM_DBUS_SKELETON "iface-modem-dbus-skeleton"
+#define MM_IFACE_MODEM_STATE "iface-modem-state"
+#define MM_IFACE_MODEM_SIM "iface-modem-sim"
+#define MM_IFACE_MODEM_SIM_SLOTS "iface-modem-sim-slots"
+#define MM_IFACE_MODEM_BEARER_LIST "iface-modem-bearer-list"
+#define MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED "iface-modem-sim-hot-swap-supported"
+#define MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED "iface-modem-sim-hot-swap-configured"
+#define MM_IFACE_MODEM_CARRIER_CONFIG_MAPPING "iface-modem-carrier-config-mapping"
+#define MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED "iface-modem-periodic-signal-check-disabled"
+#define MM_IFACE_MODEM_PERIODIC_ACCESS_TECH_CHECK_DISABLED "iface-modem-periodic-access-tech-check-disabled"
typedef struct _MMIfaceModem MMIfaceModem;
@@ -82,6 +89,14 @@ struct _MMIfaceModem {
GAsyncResult *res,
GError **error);
+ /* Loading of the HardwareRevision property */
+ void (*load_hardware_revision) (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gchar * (*load_hardware_revision_finish) (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error);
+
/* Loading of the EquipmentIdentifier property */
void (*load_equipment_identifier) (MMIfaceModem *self,
GAsyncReadyCallback callback,
@@ -108,6 +123,7 @@ struct _MMIfaceModem {
/* Loading of the UnlockRequired property */
void (*load_unlock_required) (MMIfaceModem *self,
+ gboolean last_attempt,
GAsyncReadyCallback callback,
gpointer user_data);
MMModemLock (*load_unlock_required_finish) (MMIfaceModem *self,
@@ -254,6 +270,14 @@ struct _MMIfaceModem {
GAsyncResult *res,
GError **error);
+ /* Asynchronous FCC unlock operation */
+ void (* fcc_unlock) (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* fcc_unlock_finish) (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error);
+
/* Asynchronous modem power-up operation */
void (*modem_power_up) (MMIfaceModem *self,
GAsyncReadyCallback callback,
@@ -271,6 +295,17 @@ struct _MMIfaceModem {
GAsyncResult *res,
GError **error);
+ /* Asynchronous check to see if the SIM was swapped.
+ * Useful for when the modem changes power states since we might
+ * not get the relevant notifications from the modem. */
+ void (*check_for_sim_swap) (MMIfaceModem *self,
+ const gchar *iccid,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (*check_for_sim_swap_finish) (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error);
+
/* Asynchronous flow control setup */
void (*setup_flow_control) (MMIfaceModem *self,
GAsyncReadyCallback callback,
@@ -319,6 +354,25 @@ struct _MMIfaceModem {
GAsyncResult *res,
GError **error);
+ /* Create SIMs in all SIM slots */
+ void (* load_sim_slots) (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* load_sim_slots_finish) (MMIfaceModem *self,
+ GAsyncResult *res,
+ GPtrArray **sim_slots,
+ guint *primary_sim_slot,
+ GError **error);
+
+ /* Set primary SIM slot */
+ void (* set_primary_sim_slot) (MMIfaceModem *self,
+ guint sim_slot,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* set_primary_sim_slot_finish) (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error);
+
/* Create bearer */
void (*create_bearer) (MMIfaceModem *self,
MMBearerProperties *properties,
@@ -327,9 +381,42 @@ struct _MMIfaceModem {
MMBaseBearer * (*create_bearer_finish) (MMIfaceModem *self,
GAsyncResult *res,
GError **error);
+
+ /* Create new bearer list object */
+ MMBearerList * (* create_bearer_list) (MMIfaceModem *self);
+
+ /* Setup SIM hot swap */
+ void (*setup_sim_hot_swap) (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ gboolean (*setup_sim_hot_swap_finish) (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error);
+
+ /* Load carrier config */
+ void (* load_carrier_config) (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* load_carrier_config_finish) (MMIfaceModem *self,
+ GAsyncResult *res,
+ gchar **carrier_config_name,
+ gchar **carrier_config_revision,
+ GError **error);
+
+ /* Setup carrier config based on IMSI */
+ void (* setup_carrier_config) (MMIfaceModem *self,
+ const gchar *imsi,
+ const gchar *carrier_config_mapping,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* setup_carrier_config_finish) (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error);
};
GType mm_iface_modem_get_type (void);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModem, g_object_unref)
/* Helpers to query access technologies */
MMModemAccessTechnology mm_iface_modem_get_access_technologies (MMIfaceModem *self);
@@ -339,7 +426,7 @@ MMModemCapability mm_iface_modem_get_current_capabilities (MMIfaceModem *self);
gboolean mm_iface_modem_is_3gpp (MMIfaceModem *self);
gboolean mm_iface_modem_is_3gpp_only (MMIfaceModem *self);
gboolean mm_iface_modem_is_3gpp_lte (MMIfaceModem *self);
-gboolean mm_iface_modem_is_3gpp_lte_only (MMIfaceModem *self);
+gboolean mm_iface_modem_is_3gpp_5gnr (MMIfaceModem *self);
gboolean mm_iface_modem_is_cdma (MMIfaceModem *self);
gboolean mm_iface_modem_is_cdma_only (MMIfaceModem *self);
@@ -350,9 +437,15 @@ gboolean mm_iface_modem_is_3g (MMIfaceModem *self);
gboolean mm_iface_modem_is_3g_only (MMIfaceModem *self);
gboolean mm_iface_modem_is_4g (MMIfaceModem *self);
gboolean mm_iface_modem_is_4g_only (MMIfaceModem *self);
+gboolean mm_iface_modem_is_5g (MMIfaceModem *self);
+gboolean mm_iface_modem_is_5g_only (MMIfaceModem *self);
-/* Helper to query model */
-const gchar *mm_iface_modem_get_model (MMIfaceModem *self);
+/* Helpers to query properties */
+const gchar *mm_iface_modem_get_model (MMIfaceModem *self);
+const gchar *mm_iface_modem_get_revision (MMIfaceModem *self);
+gboolean mm_iface_modem_get_carrier_config (MMIfaceModem *self,
+ const gchar **name,
+ const gchar **revision);
/* Initialize Modem interface (async) */
void mm_iface_modem_initialize (MMIfaceModem *self,
@@ -380,6 +473,27 @@ gboolean mm_iface_modem_disable_finish (MMIfaceModem *self,
GAsyncResult *res,
GError **error);
+/* Shutdown Modem interface */
+void mm_iface_modem_shutdown (MMIfaceModem *self);
+
+/* Helper to return an error when the modem is in failed state and so it
+ * cannot process a given method invocation
+ */
+gboolean mm_iface_modem_abort_invocation_if_state_not_reached (MMIfaceModem *self,
+ GDBusMethodInvocation *invocation,
+ MMModemState minimum_required);
+#if defined WITH_SYSTEMD_SUSPEND_RESUME
+
+/* Sync Modem interface (async) */
+void mm_iface_modem_sync (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean mm_iface_modem_sync_finish (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error);
+
+#endif
+
/* Allow setting power state */
void mm_iface_modem_set_power_state (MMIfaceModem *self,
MMModemPowerState power_state,
@@ -389,9 +503,6 @@ gboolean mm_iface_modem_set_power_state_finish (MMIfaceModem *self,
GAsyncResult *res,
GError **error);
-/* Shutdown Modem interface */
-void mm_iface_modem_shutdown (MMIfaceModem *self);
-
/* Request lock info update.
* It will not only return the lock status, but also set the property values
* in the DBus interface. If 'known_lock' is given, that lock status will be
@@ -404,6 +515,12 @@ MMModemLock mm_iface_modem_update_lock_info_finish (MMIfaceModem *self,
GAsyncResult *res,
GError **error);
+MMModemLock mm_iface_modem_get_unlock_required (MMIfaceModem *self);
+MMUnlockRetries *mm_iface_modem_get_unlock_retries (MMIfaceModem *self);
+
+void mm_iface_modem_update_unlock_retries (MMIfaceModem *self,
+ MMUnlockRetries *unlock_retries);
+
/* Request signal quality check update.
* It will not only return the signal quality status, but also set the property
* values in the DBus interface. */
@@ -435,13 +552,13 @@ void mm_iface_modem_update_access_technologies (MMIfaceModem *self,
MMModemAccessTechnology access_tech,
guint32 mask);
-/* Allow requesting to refresh access tech */
-void mm_iface_modem_refresh_access_technologies (MMIfaceModem *self);
-
/* Allow updating signal quality */
void mm_iface_modem_update_signal_quality (MMIfaceModem *self,
guint signal_quality);
+/* Allow requesting to refresh signal via polling */
+void mm_iface_modem_refresh_signal (MMIfaceModem *self);
+
/* Allow setting allowed modes */
void mm_iface_modem_set_current_modes (MMIfaceModem *self,
MMModemMode allowed,
@@ -482,4 +599,18 @@ MMModemState mm_iface_modem_wait_for_final_state_finish (MMIfaceModem *self,
void mm_iface_modem_bind_simple_status (MMIfaceModem *self,
MMSimpleStatus *status);
+/* Check if the SIM or eSIM profile has changed */
+void mm_iface_modem_check_for_sim_swap (MMIfaceModem *self,
+ guint slot_index,
+ const gchar *iccid,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean mm_iface_modem_check_for_sim_swap_finish (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error);
+
+void mm_iface_modem_modify_sim (MMIfaceModem *self,
+ guint slot_index,
+ MMBaseSim *new_sim);
+
#endif /* MM_IFACE_MODEM_H */