Re: [PATCH] qmi: sim: implement lock(LockPin method)

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

<please insert commit description here>


> On Nov 17, 2024, at 13:03, Ivaylo Dimitrov <[email protected]> wrote:
> 
> ---
> drivers/qmimodem/sim.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++
> drivers/qmimodem/uim.h |  1 +
> 2 files changed, 71 insertions(+)
> 
> diff --git a/drivers/qmimodem/sim.c b/drivers/qmimodem/sim.c
> index b1d8f22..65c0fa6 100644
> --- a/drivers/qmimodem/sim.c
> +++ b/drivers/qmimodem/sim.c
> @@ -844,6 +844,75 @@ static void qmi_query_locked(struct ofono_sim *sim,
> l_free(cbd);
> }
> 
> +static void qmi_lock(struct ofono_sim *sim,
> + enum ofono_sim_password_type passwd_type,
> + int enable, const char *passwd,
> + ofono_sim_lock_unlock_cb_t cb, void *user_data)
> +{
> + struct sim_data *data = ofono_sim_get_data(sim);
> + struct cb_data *cbd = cb_data_new(cb, user_data);
> + int passwd_len;
> + uint16_t info_len;
> + uint8_t pin_id;
> + struct qmi_param *param;
> + uint8_t session[2];
> + struct {
> + uint8_t id;
> + uint8_t enabled;
> + uint8_t length;
> + uint8_t pin[0];
> + } __attribute__((__packed__)) *info;

Is this a good idea to define this inline with the function and not better as some QMI generic define?

Regards

Marcel
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.