blob: c93d457609ff0874673e68664288abcf5f0460eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details:
*
* Copyright (C) 2013 Aleksander Morgado <aleksander@gnu.org>
*/
#include "mm-modem-helpers-mbim.h"
#include "mm-enums-types.h"
#include "mm-log.h"
/*****************************************************************************/
MMModemLock
mm_modem_lock_from_mbim_pin_type (MbimPinType pin_type)
{
switch (pin_type) {
case MBIM_PIN_TYPE_CUSTOM:
break;
case MBIM_PIN_TYPE_PIN1:
return MM_MODEM_LOCK_SIM_PIN;
case MBIM_PIN_TYPE_PIN2:
return MM_MODEM_LOCK_SIM_PIN2;
case MBIM_PIN_TYPE_DEVICE_SIM_PIN:
return MM_MODEM_LOCK_PH_SIM_PIN;
case MBIM_PIN_TYPE_DEVICE_FIRST_SIM_PIN:
return MM_MODEM_LOCK_PH_FSIM_PIN;
case MBIM_PIN_TYPE_NETWORK_PIN:
return MM_MODEM_LOCK_PH_NET_PIN;
case MBIM_PIN_TYPE_NETWORK_SUBSET_PIN:
return MM_MODEM_LOCK_PH_NETSUB_PIN;
case MBIM_PIN_TYPE_SERVICE_PROVIDER_PIN:
return MM_MODEM_LOCK_PH_SP_PIN;
case MBIM_PIN_TYPE_CORPORATE_PIN:
return MM_MODEM_LOCK_PH_CORP_PIN;
case MBIM_PIN_TYPE_SUBSIDY_PIN: /* TODO: Update MM lock list? */
break;
case MBIM_PIN_TYPE_PUK1:
return MM_MODEM_LOCK_SIM_PUK;
case MBIM_PIN_TYPE_PUK2:
return MM_MODEM_LOCK_SIM_PUK2;
case MBIM_PIN_TYPE_DEVICE_FIRST_SIM_PUK:
return MM_MODEM_LOCK_PH_FSIM_PUK;
case MBIM_PIN_TYPE_NETWORK_PUK:
return MM_MODEM_LOCK_PH_NET_PUK;
case MBIM_PIN_TYPE_NETWORK_SUBSET_PUK:
return MM_MODEM_LOCK_PH_NETSUB_PIN;
case MBIM_PIN_TYPE_SERVICE_PROVIDER_PUK:
return MM_MODEM_LOCK_PH_SP_PIN;
case MBIM_PIN_TYPE_CORPORATE_PUK:
return MM_MODEM_LOCK_PH_CORP_PUK;
}
return MM_MODEM_LOCK_UNKNOWN;
}
|