Switchtec Userspace  PROJECT_NUMBER = 3.1
errors.h
1 /*
2  * Microsemi Switchtec(tm) PCIe Management Library
3  * Copyright (c) 2017, Microsemi Corporation
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21  * OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 
25 #ifndef LIBSWITCHTEC_ERRORS_H
26 #define LIBSWITCHTEC_ERRORS_H
27 
28 extern int mrpc_error_cmd;
29 
30 #define SWITCHTEC_ERRNO_GENERAL_FLAG_BIT (1 << 29)
31 #define SWITCHTEC_ERRNO_MRPC_FLAG_BIT (1 << 30)
32 #define ERRNO_MRPC(x) (x & (~SWITCHTEC_ERRNO_MRPC_FLAG_BIT))
33 
34 enum {
35  SWITCHTEC_ERR_LOG_DEF_READ_ERROR = SWITCHTEC_ERRNO_GENERAL_FLAG_BIT,
36  SWITCHTEC_ERR_BIN_LOG_READ_ERROR,
37  SWITCHTEC_ERR_PARSED_LOG_WRITE_ERROR,
38  SWITCHTEC_ERR_LOG_DEF_DATA_INVAL,
39  SWITCHTEC_ERR_INVALID_PORT,
40  SWITCHTEC_ERR_INVALID_LANE,
41 };
42 
43 enum {
44  ERR_PHYC_PORT_ARDY_BIND = 0x00000001,
45  ERR_LOGC_PORT_ARDY_BIND = 0x00000002,
46  ERR_BIND_PRTT_NOT_EXIST = 0x00000003,
47  ERR_PHYC_PORT_NOT_EXIST = 0x00000004,
48  ERR_PHYC_PORT_DIS = 0x00000005,
49  ERR_NO_LOGC_PORT = 0x00000006,
50  ERR_BIND_IN_PROGRESS = 0x00000007,
51  ERR_BIND_TGT_IS_USP = 0x00000008,
52  ERR_BIND_SUBCMD_INVALID = 0x00000009,
53  ERR_PHYC_PORT_LINK_ACT = 0x0000000a,
54  ERR_LOGC_PORT_NOT_BIND_PHYC_PORT = 0x0000000b,
55  ERR_UNBIND_OPT_INVALID = 0x0000000c,
56  ERR_BIND_CHECK_FAIL = 0x0000000d,
57  ERR_MPRC_UNSUPPORTED = 0x0000004a,
58  ERR_XML_VERSION_MISMATCH = 0x0000f011,
59 
60  ERR_STACKBIF_STACK_ID_INVALID = 0x54003,
61  ERR_STACKBIF_SUBCMD_INVALID = 0x54040,
62  ERR_STACKBIF_CODE_INVALID = 0x54042,
63  ERR_STACKBIF_PORT_BOUND = 0x54043,
64 
65  ERR_REFCLK_SUBCMD_INVALID = 0x54130,
66  ERR_REFCLK_STACK_ID_INVALID = 0x54131,
67 
68  ERR_NO_AVAIL_MRPC_THREAD = 0x64001,
69  ERR_HANDLER_THREAD_NOT_IDLE = 0x64002,
70  ERR_NO_BG_THREAD = 0x64003,
71  ERR_SUBCMD_INVALID = 0x64004,
72  ERR_CMD_INVALID = 0x64005,
73  ERR_PARAM_INVALID = 0x64006,
74  ERR_BAD_FW_STATE = 0x64007,
75  ERR_MRPC_DENIED = 0x64010,
76  ERR_MRPC_NO_PREV_DATA = 0x64012,
77 
78  ERR_LOOPBACK_PORT_INVALID = 0x2,
79 
80  ERR_STACK_INVALID = 0x100001,
81  ERR_PORT_INVALID = 0x100002,
82  ERR_EVENT_INVALID = 0x100003,
83  ERR_RST_RULE_FAILED = 0x100005,
84  ERR_UART_NOT_SUPPORTED = 0x100072f1,
85  ERR_ACCESS_REFUSED = 0xFFFF0001,
86 };
87 
88 #endif
int mrpc_error_cmd
The MRPC command ID when errno is set.
Definition: switchtec.c:601