sl_wifi_status.h

1 /*
2 * Copyright 2018, Silicon Laboratories Inc. All rights reserved.
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 #pragma once
18 
19 #define SL_WIFI_ENUM_OFFSET 1000
20 #define SL_STATUS_ENUM( prefix, name, value ) prefix ## _ ## name = (prefix##_ENUM_OFFSET + value)
21 #define UNUSED_VARIABLE(x) (void)(x)
22 #define UNUSED_PARAMETER(x) (void)(x)
23 
24 #define ARRAY_COUNT(x) (sizeof (x) / sizeof *(x))
25 
26 #ifndef ROUND_UP
27 #define ROUND_UP(x,y) ((x) % (y) ? (x) + (y)-((x)%(y)) : (x))
28 #endif /* ifndef ROUND_UP */
29 
30 #define SL_WAIT_FOREVER 0xFFFFFFFF
31 
32 #define SL_WIFI_STATUS_LIST( prefix ) \
33  SL_STATUS_ENUM( prefix, INVALID_KEY, 4 ), \
34  SL_STATUS_ENUM( prefix, DOES_NOT_EXIST, 5 ), \
35  SL_STATUS_ENUM( prefix, NOT_AUTHENTICATED, 6 ), \
36  SL_STATUS_ENUM( prefix, NOT_KEYED, 7 ), \
37  SL_STATUS_ENUM( prefix, IOCTL_FAIL, 8 ), \
38  SL_STATUS_ENUM( prefix, BUFFER_UNAVAILABLE_TEMPORARY, 9 ), \
39  SL_STATUS_ENUM( prefix, BUFFER_UNAVAILABLE_PERMANENT, 10 ), \
40  SL_STATUS_ENUM( prefix, WPS_PBC_OVERLAP, 11 ), \
41  SL_STATUS_ENUM( prefix, CONNECTION_LOST, 12 ), \
42  SL_STATUS_ENUM( prefix, OUT_OF_EVENT_HANDLER_SPACE, 13 ), \
43  SL_STATUS_ENUM( prefix, SEMAPHORE_ERROR, 14 ), \
44  SL_STATUS_ENUM( prefix, FLOW_CONTROLLED, 15 ), \
45  SL_STATUS_ENUM( prefix, NO_CREDITS, 16 ), \
46  SL_STATUS_ENUM( prefix, NO_PACKET_TO_SEND, 17 ), \
47  SL_STATUS_ENUM( prefix, CORE_CLOCK_NOT_ENABLED, 18 ), \
48  SL_STATUS_ENUM( prefix, CORE_IN_RESET, 19 ), \
49  SL_STATUS_ENUM( prefix, UNSUPPORTED, 20 ), \
50  SL_STATUS_ENUM( prefix, BUS_WRITE_REGISTER_ERROR, 21 ), \
51  SL_STATUS_ENUM( prefix, SDIO_BUS_UP_FAIL, 22 ), \
52  SL_STATUS_ENUM( prefix, JOIN_IN_PROGRESS, 23 ), \
53  SL_STATUS_ENUM( prefix, NETWORK_NOT_FOUND, 24 ), \
54  SL_STATUS_ENUM( prefix, INVALID_JOIN_STATUS, 25 ), \
55  SL_STATUS_ENUM( prefix, UNKNOWN_INTERFACE, 26 ), \
56  SL_STATUS_ENUM( prefix, SDIO_RX_FAIL, 27 ), \
57  SL_STATUS_ENUM( prefix, HWTAG_MISMATCH, 28 ), \
58  SL_STATUS_ENUM( prefix, RX_BUFFER_ALLOC_FAIL, 29 ), \
59  SL_STATUS_ENUM( prefix, BUS_READ_REGISTER_ERROR, 30 ), \
60  SL_STATUS_ENUM( prefix, THREAD_CREATE_FAILED, 31 ), \
61  SL_STATUS_ENUM( prefix, QUEUE_ERROR, 32 ), \
62  SL_STATUS_ENUM( prefix, BUFFER_POINTER_MOVE_ERROR, 33 ), \
63  SL_STATUS_ENUM( prefix, BUFFER_SIZE_SET_ERROR, 34 ), \
64  SL_STATUS_ENUM( prefix, THREAD_STACK_NULL, 35 ), \
65  SL_STATUS_ENUM( prefix, THREAD_DELETE_FAIL, 36 ), \
66  SL_STATUS_ENUM( prefix, SLEEP_ERROR, 37 ), \
67  SL_STATUS_ENUM( prefix, BUFFER_ALLOC_FAIL, 38 ), \
68  SL_STATUS_ENUM( prefix, NO_PACKET_TO_RECEIVE, 39 ), \
69  SL_STATUS_ENUM( prefix, INTERFACE_NOT_UP, 40 ), \
70  SL_STATUS_ENUM( prefix, DELAY_TOO_LONG, 41 ), \
71  SL_STATUS_ENUM( prefix, INVALID_DUTY_CYCLE, 42 ), \
72  SL_STATUS_ENUM( prefix, PMK_WRONG_LENGTH, 43 ), \
73  SL_STATUS_ENUM( prefix, UNKNOWN_SECURITY_TYPE, 44 ), \
74  SL_STATUS_ENUM( prefix, WEP_NOT_ALLOWED, 45 ), \
75  SL_STATUS_ENUM( prefix, WPA_KEYLEN_BAD, 46 ), \
76  SL_STATUS_ENUM( prefix, FILTER_NOT_FOUND, 47 ), \
77  SL_STATUS_ENUM( prefix, SPI_ID_READ_FAIL, 48 ), \
78  SL_STATUS_ENUM( prefix, SPI_SIZE_MISMATCH, 49 ), \
79  SL_STATUS_ENUM( prefix, ADDRESS_ALREADY_REGISTERED, 50 ), \
80  SL_STATUS_ENUM( prefix, SDIO_RETRIES_EXCEEDED, 51 ), \
81  SL_STATUS_ENUM( prefix, NULL_PTR_ARG, 52 ), \
82  SL_STATUS_ENUM( prefix, THREAD_FINISH_FAIL, 53 ), \
83  SL_STATUS_ENUM( prefix, WAIT_ABORTED, 54 ), \
84  SL_STATUS_ENUM( prefix, QUEUE_MESSAGE_UNALIGNED, 55 ), \
85  SL_STATUS_ENUM( prefix, MUTEX_ERROR, 56 ), \
86  SL_STATUS_ENUM( prefix, FIRMWARE_DOWNLOAD_TIMEOUT, 57 ),