1 /*
2  * Copyright (C) 2010-2014 NXP Semiconductors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * Firmware Download Status Values
19  */
20 #ifndef PHDNLDNFC_STATUS_H
21 #define PHDNLDNFC_STATUS_H
22 
23 #include <phNfcStatus.h>
24 
25 /* reusing LibNfcStatus.h value below as a placeholder for now, need to find
26    the right value */
27 #define NFCSTATUS_ABORTED (0x0096) /* Command aborted */
28 
29 /*
30  * Enum definition contains Firmware Download Status codes
31  */
32 typedef enum phDnldNfc_Status {
33   PH_DL_STATUS_PLL_ERROR = 0x0D,
34   PH_DL_STATUS_LC_WRONG = 0x13,
35   PH_DL_STATUS_LC_TERMINATION_NOT_SUPPORTED = 0x14,
36   PH_DL_STATUS_LC_CREATION_NOT_SUPPORTED = 0x15,
37   PH_DL_STATUS_LC_UNKNOWN = 0x16,
38   PH_DL_STATUS_AUTHENTICATION_ERROR = 0x19,
39   PH_DL_STATUS_NOT_AUTHENTICATED = 0x1A,
40   PH_DL_STATUS_AUTHENTICATION_LOST = 0x1B,
41   PH_DL_STATUS_WRITE_PROTECTED = 0x1C,
42   PH_DL_STATUS_READ_PROTECTED = 0x1D,
43   PH_DL_STATUS_ADDR_RANGE_OFL_ERROR = 0x1E,
44   PH_DL_STATUS_BUFFER_OFL_ERROR = 0x1F,
45   PH_DL_STATUS_MEM_BSY = 0x20,
46   PH_DL_STATUS_SIGNATURE_ERROR = 0x21,
47   PH_DL_STATUS_SESSION_WAS_OPEN = 0x22,
48   PH_DL_STATUS_SESSION_WAS_CLOSED = 0x23,
49   /* the Firmware version passed to CommitSession is not greater than
50       the EEPROM resident stored Firmware version number */
51   PH_DL_STATUS_FIRMWARE_VERSION_ERROR = 0x24,
52   PH_DL_STATUS_LOOPBACK_DATA_MISSMATCH_ERROR = 0x25,
53   /*****************************/
54   PH_DL_STATUS_HOST_PAYLOAD_UFL_ERROR = 0x26,
55   PH_DL_STATUS_HOST_PAYLOAD_OFL_ERROR = 0x27,
56   PH_DL_STATUS_PROTOCOL_ERROR = 0x28,
57   /* Download codes re-mapped to generic entries */
58   PH_DL_STATUS_INVALID_ADDR = NFCSTATUS_INVALID_PARAMETER,
59   PH_DL_STATUS_GENERIC_ERROR = NFCSTATUS_FAILED,
60   PH_DL_STATUS_ABORTED_CMD = NFCSTATUS_ABORTED,
61   PH_DL_STATUS_FLASH_WRITE_PROTECTED = PH_DL_STATUS_WRITE_PROTECTED,
62   PH_DL_STATUS_FLASH_READ_PROTECTED = PH_DL_STATUS_READ_PROTECTED,
63   PH_DL_STATUS_USERDATA_WRITE_PROTECTED = PH_DL_STATUS_WRITE_PROTECTED,
64   PH_DL_STATUS_USERDATA_READ_PROTECTED = PH_DL_STATUS_READ_PROTECTED,
65   PH_DL_STATUS_OK = NFCSTATUS_SUCCESS
66 } phDnldNfc_Status_t;
67 
68 #endif /* PHDNLDNFC_STATUS_H */
69