broadband-modem-qmi: Introduce udev flag for reduced facility lock query

The udev flag "ID_MM_QMI_FACILITY_LOCK_QUERY_REDUCED" allows to skip
facility lock state query "get_ck_status" on the DMS path for devices
where this isn't implemented properly.

On devices that have enabled "device locks", this flag won't work well.
Skipping the query doesn't disable the locks.

Fixes #448
This commit is contained in:
Jakob Hauser
2021-12-20 05:10:14 +01:00
parent f95fb11b93
commit db228b2859

View File

@@ -2314,6 +2314,7 @@ modem_3gpp_load_enabled_facility_locks (MMIfaceModem3gpp *self,
LoadEnabledFacilityLocksContext *ctx; LoadEnabledFacilityLocksContext *ctx;
GTask *task; GTask *task;
QmiClient *client = NULL; QmiClient *client = NULL;
MMPort *port;
if (!MM_BROADBAND_MODEM_QMI (self)->priv->dms_uim_deprecated) { if (!MM_BROADBAND_MODEM_QMI (self)->priv->dms_uim_deprecated) {
if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self),
@@ -2342,8 +2343,20 @@ modem_3gpp_load_enabled_facility_locks (MMIfaceModem3gpp *self,
task = g_task_new (self, NULL, callback, user_data); task = g_task_new (self, NULL, callback, user_data);
g_task_set_task_data (task, ctx, (GDestroyNotify)load_enabled_facility_locks_context_free); g_task_set_task_data (task, ctx, (GDestroyNotify)load_enabled_facility_locks_context_free);
/* DMS uses get_ck_status and get_pin_status to probe facilities /* If tagged by udev, perform a reduced facility lock query via DMS
* UIM uses get_card_status and get_configuration * by skipping get_ck_status and process get_pin_status only
*/
port = MM_PORT (mm_broadband_modem_qmi_peek_port_qmi (MM_BROADBAND_MODEM_QMI (self)));
if (mm_kernel_device_get_global_property_as_boolean (mm_port_peek_kernel_device (port),
"ID_MM_QMI_FACILITY_LOCK_QUERY_REDUCED")) {
mm_obj_dbg (self, "performing reduced facility lock query (DMS)");
get_sim_lock_status_via_pin_status (task);
return;
}
/* Regular facility lock query
* DMS uses get_ck_status and get_pin_status to probe facilities
* UIM uses get_configuration and get_card_status
*/ */
if (!MM_BROADBAND_MODEM_QMI (self)->priv->dms_uim_deprecated) if (!MM_BROADBAND_MODEM_QMI (self)->priv->dms_uim_deprecated)
get_next_facility_lock_status_via_dms (task); get_next_facility_lock_status_via_dms (task);