aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Mazur <mkm@semihalf.com>2022-02-15 23:16:03 +0100
committerAleksander Morgado <aleksander@aleksander.es>2022-02-17 20:27:17 +0000
commita719cb26f4ae9e687c3889be660f81170d6faabb (patch)
tree0a63d9bc9b608de1fec016b9fdcdc664ddf449e8 /src
parent27f6679aa87b7b4a7b214d3f08f83bec16434580 (diff)
modem-helpers-mbim: add pin type to 3gpp facility converter
Diffstat (limited to 'src')
-rw-r--r--src/mm-modem-helpers-mbim.c38
-rw-r--r--src/mm-modem-helpers-mbim.h1
2 files changed, 39 insertions, 0 deletions
diff --git a/src/mm-modem-helpers-mbim.c b/src/mm-modem-helpers-mbim.c
index 0afa9356..50e2dc8a 100644
--- a/src/mm-modem-helpers-mbim.c
+++ b/src/mm-modem-helpers-mbim.c
@@ -340,6 +340,44 @@ mbim_pin_type_from_mm_modem_3gpp_facility (MMModem3gppFacility facility)
/*****************************************************************************/
+MMModem3gppFacility
+mm_modem_3gpp_facility_from_mbim_pin_type (MbimPinType pin_type)
+{
+ switch (pin_type) {
+ case MBIM_PIN_TYPE_PIN1:
+ case MBIM_PIN_TYPE_PUK1:
+ return MM_MODEM_3GPP_FACILITY_SIM;
+ case MBIM_PIN_TYPE_PIN2:
+ case MBIM_PIN_TYPE_PUK2:
+ return MM_MODEM_3GPP_FACILITY_FIXED_DIALING;
+ case MBIM_PIN_TYPE_DEVICE_SIM_PIN:
+ return MM_MODEM_3GPP_FACILITY_PH_SIM;
+ case MBIM_PIN_TYPE_DEVICE_FIRST_SIM_PIN:
+ case MBIM_PIN_TYPE_DEVICE_FIRST_SIM_PUK:
+ return MM_MODEM_3GPP_FACILITY_PH_FSIM;
+ case MBIM_PIN_TYPE_NETWORK_PIN:
+ case MBIM_PIN_TYPE_NETWORK_PUK:
+ return MM_MODEM_3GPP_FACILITY_NET_PERS;
+ case MBIM_PIN_TYPE_NETWORK_SUBSET_PIN:
+ case MBIM_PIN_TYPE_NETWORK_SUBSET_PUK:
+ return MM_MODEM_3GPP_FACILITY_NET_SUB_PERS;
+ case MBIM_PIN_TYPE_SERVICE_PROVIDER_PIN:
+ case MBIM_PIN_TYPE_SERVICE_PROVIDER_PUK:
+ return MM_MODEM_3GPP_FACILITY_PROVIDER_PERS;
+ case MBIM_PIN_TYPE_CORPORATE_PIN:
+ case MBIM_PIN_TYPE_CORPORATE_PUK:
+ return MM_MODEM_3GPP_FACILITY_CORP_PERS;
+ case MBIM_PIN_TYPE_UNKNOWN:
+ case MBIM_PIN_TYPE_CUSTOM:
+ case MBIM_PIN_TYPE_SUBSIDY_PIN:
+ default:
+ return MM_MODEM_3GPP_FACILITY_NONE;
+ }
+}
+
+/*****************************************************************************/
+
+
static const MMMobileEquipmentError mbim_nw_errors[] = {
[MBIM_NW_ERROR_IMSI_UNKNOWN_IN_HLR] = MM_MOBILE_EQUIPMENT_ERROR_IMSI_UNKNOWN_IN_HSS,
[MBIM_NW_ERROR_ILLEGAL_MS] = MM_MOBILE_EQUIPMENT_ERROR_ILLEGAL_UE,
diff --git a/src/mm-modem-helpers-mbim.h b/src/mm-modem-helpers-mbim.h
index abf5413b..c5f51c8f 100644
--- a/src/mm-modem-helpers-mbim.h
+++ b/src/mm-modem-helpers-mbim.h
@@ -51,6 +51,7 @@ MMModem3gppNetworkAvailability mm_modem_3gpp_network_availability_from_mbim_prov
GList *mm_3gpp_network_info_list_from_mbim_providers (const MbimProvider *const *providers, guint n_providers);
MbimPinType mbim_pin_type_from_mm_modem_3gpp_facility (MMModem3gppFacility facility);
+MMModem3gppFacility mm_modem_3gpp_facility_from_mbim_pin_type (MbimPinType pin_type);
GError *mm_mobile_equipment_error_from_mbim_nw_error (MbimNwError nw_error,
gpointer log_object);