Re: [PATCH] qmi: sim: Implement query_facility_lock(LockedPins property)

Ivaylo Dimitrov <[email protected]>
Newsgroups dev.linux.lists.ofono
Message-ID <[email protected]>
Hi Denis,

On 18.11.24 г. 18:43 ч., Denis Kenzior wrote:
> Hi Ivo,
> 
> On 11/17/24 5:04 AM, Ivaylo Dimitrov wrote:
>> ---
>>   drivers/qmimodem/sim.c | 93 
>> ++++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 93 insertions(+)
>>
>> diff --git a/drivers/qmimodem/sim.c b/drivers/qmimodem/sim.c
>> index 1fffae2..b1d8f22 100644
>> --- a/drivers/qmimodem/sim.c
>> +++ b/drivers/qmimodem/sim.c
>> @@ -41,6 +41,8 @@ struct sim_status {
>>       uint8_t app_type;
>>       uint8_t passwd_state;
>>       int retries[OFONO_SIM_PASSWORD_INVALID];
>> +    uint8_t pin1_state;
>> +    uint8_t pin2_state;
>>   };
>>   struct sim_data {
>> @@ -52,6 +54,20 @@ struct sim_data {
>>       struct l_timeout *retry_timer;
>>   };
>> +struct query_locked_data {
>> +    enum ofono_sim_password_type passwd_type;
>> +};
> 
> Why is this structure needed?  Can't you simply stuff this into 
> cb_data::user using L_UINT_TO_PTR and L_PTR_TO_UINT?
> 

I was wondering what is GUINT_TO_POINTER() replacement in ell, however...

>> +
>> +static inline void cb_user_data_unref(void *user_data)
>> +{
>> +    struct cb_data *cbd = user_data;
>> +
>> +    if (cbd->ref == 1 && cbd->user)
>> +        l_free(cbd->user);
>> +
>> +    cb_data_unref(user_data);
>> +}
>> +
> 
> That way this could also be dropped
> 

I introduced that for the future (sim pin change functionality), 
however, looking now at the code, I wonder why I decided it will be needed.

Will drop and resend.

Thanks and regards,
Ivo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.