mm_modem_3gpp_get_enabled_facility_locks always empty when the QMI modem doesn't support DMS UIM
In order to check whether the SIM pin is enabled or not, mm_modem_3gpp_get_enabled_facility_locks
can be called, which uses DMS UIM messages to retrieve that information. However, seems like some modems don't support those messages and UIM messages should be used instead.
purism@pureos:~$ sudo qmicli -p -d /dev/cdc-wdm0 --dms-uim-get-pin-status
error: couldn't get PIN status: QMI protocol error (94): 'NotSupported'
purism@pureos:~$ sudo qmicli -p -d /dev/cdc-wdm0 --uim-get-card-status
[/dev/cdc-wdm0] Successfully got card status
Provisioning applications:
Primary GW: slot '1', application '1'
Primary 1X: session doesn't exist
Secondary GW: session doesn't exist
Secondary 1X: session doesn't exist
Slot [1]:
Card state: 'present'
UPIN state: 'not-initialized'
UPIN retries: '0'
UPUK retries: '0'
Application [1]:
Application type: 'usim (2)'
Application state: 'ready'
Application ID:
<REDACTED>
Personalization state: 'ready'
UPIN replaces PIN1: 'no'
PIN1 state: 'disabled'
PIN1 retries: '3'
PUK1 retries: '10'
PIN2 state: 'enabled-not-verified'
PIN2 retries: '3'
PUK2 retries: '10'
Same thing happens when trying to manipulate the SIM lock:
purism@pureos:~$ sudo qmicli -p -d /dev/cdc-wdm0 --dms-uim-set-pin-protection=PIN,disable,1234
error: couldn't set PIN protection: QMI protocol error (94): 'NotSupported'
purism@pureos:~$ sudo qmicli -p -d /dev/cdc-wdm0 --uim-set-pin-protection=PIN1,disable,1234
[/dev/cdc-wdm0] PIN protection updated
However, mm-sim-qmi.c
can use both interfaces, so this works from the MM API:
mm_obj_dbg (self, "changing PIN...");
if (!self->priv->dms_uim_deprecated)
dms_uim_change_pin (self, task);
else
uim_change_pin (self, task);
So looks like retrieving enabled facility locks lacks a similar fallback to UIM interface.
I see this happening with Broadmobi BM818 and Quectel EC25.