add UIM verify pin commands
[project/uqmi.git] / commands-uim.c
1 /*
2  * uqmi -- tiny QMI support implementation
3  *
4  * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301 USA.
20  */
21
22 #define cmd_uim_verify_pin1_cb no_cb
23 static enum qmi_cmd_result
24 cmd_uim_verify_pin1_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
25 {
26         struct qmi_uim_verify_pin_request data = {
27                 QMI_INIT_SEQUENCE(info,
28                         .pin_id = QMI_UIM_PIN_ID_PIN1,
29                         .pin_value = arg
30                 )
31         };
32         qmi_set_uim_verify_pin_request(msg, &data);
33         return QMI_CMD_REQUEST;
34 }
35
36 #define cmd_uim_verify_pin2_cb no_cb
37 static enum qmi_cmd_result
38 cmd_uim_verify_pin2_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
39 {
40         struct qmi_uim_verify_pin_request data = {
41                 QMI_INIT_SEQUENCE(info,
42                         .pin_id = QMI_UIM_PIN_ID_PIN2,
43                         .pin_value = arg
44                 )
45         };
46         qmi_set_uim_verify_pin_request(msg, &data);
47         return QMI_CMD_REQUEST;
48 }