Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / platform / EFR32 / CHIPPlatformConfig.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    Copyright (c) 2019 Google LLC.
5  *
6  *    Licensed under the Apache License, Version 2.0 (the "License");
7  *    you may not use this file except in compliance with the License.
8  *    You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *    Unless required by applicable law or agreed to in writing, software
13  *    distributed under the License is distributed on an "AS IS" BASIS,
14  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *    See the License for the specific language governing permissions and
16  *    limitations under the License.
17  */
18
19 /**
20  *    @file
21  *          Platform-specific configuration overrides for CHIP on
22  *          Silcon Labs EFR32 platforms.
23  */
24
25 #pragma once
26
27 #include <stdint.h>
28
29 // ==================== General Platform Adaptations ====================
30
31 #define CHIP_CONFIG_ERROR_TYPE int32_t
32 #define CHIP_CONFIG_NO_ERROR 0
33 #define CHIP_CONFIG_ERROR_MIN 4000000
34 #define CHIP_CONFIG_ERROR_MAX 4000999
35
36 #define ASN1_CONFIG_ERROR_TYPE int32_t
37 #define ASN1_CONFIG_NO_ERROR 0
38 #define ASN1_CONFIG_ERROR_MIN 5000000
39 #define ASN1_CONFIG_ERROR_MAX 5000999
40
41 #define ChipDie() abort()
42
43 #define CHIP_CONFIG_PERSISTED_STORAGE_KEY_TYPE uint8_t
44 #define CHIP_CONFIG_PERSISTED_STORAGE_ENC_MSG_CNTR_ID 1
45 #define CHIP_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH 2
46
47 #define CHIP_CONFIG_LIFETIIME_PERSISTED_COUNTER_KEY 0x01
48
49 #define CHIP_CONFIG_TIME_ENABLE_CLIENT 1
50 #define CHIP_CONFIG_TIME_ENABLE_SERVER 0
51
52 // ==================== Security Adaptations ====================
53
54 #define CHIP_CONFIG_USE_OPENSSL_ECC 0
55 #define CHIP_CONFIG_USE_MICRO_ECC 0
56
57 #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0
58 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1
59 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0
60 #define CHIP_CONFIG_HASH_IMPLEMENTATION_PLATFORM 0
61
62 // FIXME: EFR32 set to MBED-TLS (But this is third-party repo in CHIP, not SDK)
63
64 #define CHIP_CONFIG_AES_IMPLEMENTATION_OPENSSL 0
65 #define CHIP_CONFIG_AES_IMPLEMENTATION_AESNI 0
66 #define CHIP_CONFIG_AES_IMPLEMENTATION_MBEDTLS 1
67 #define CHIP_CONFIG_AES_IMPLEMENTATION_PLATFORM 0
68
69 // FIXME: EFR32 currently set to CHIP (Does this use Entropy.cpp ?)
70
71 #define CHIP_CONFIG_RNG_IMPLEMENTATION_OPENSSL 0
72 #define CHIP_CONFIG_RNG_IMPLEMENTATION_CHIPDRBG 1
73 #define CHIP_CONFIG_RNG_IMPLEMENTATION_PLATFORM 0
74
75 #define CHIP_CONFIG_ENABLE_PASE_INITIATOR 0
76 #define CHIP_CONFIG_ENABLE_PASE_RESPONDER 1
77 #define CHIP_CONFIG_ENABLE_CASE_INITIATOR 1
78
79 #define CHIP_CONFIG_SUPPORT_PASE_CONFIG0 0
80 #define CHIP_CONFIG_SUPPORT_PASE_CONFIG1 0
81 #define CHIP_CONFIG_SUPPORT_PASE_CONFIG2 0
82 #define CHIP_CONFIG_SUPPORT_PASE_CONFIG3 0
83 #define CHIP_CONFIG_SUPPORT_PASE_CONFIG4 1
84
85 #define CHIP_CONFIG_ENABLE_KEY_EXPORT_INITIATOR 0
86
87 #define CHIP_CONFIG_ENABLE_PROVISIONING_BUNDLE_SUPPORT 0
88
89 // ==================== General Configuration Overrides ====================
90
91 #ifndef CHIP_CONFIG_MAX_PEER_NODES
92 #define CHIP_CONFIG_MAX_PEER_NODES 16
93 #endif // CHIP_CONFIG_MAX_PEER_NODES
94
95 #ifndef CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS
96 #define CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS 16
97 #endif // CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS
98
99 #ifndef CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS
100 #define CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS 8
101 #endif // CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS
102
103 #ifndef CHIP_CONFIG_RMP_TIMER_DEFAULT_PERIOD_SHIFT
104 #define CHIP_CONFIG_RMP_TIMER_DEFAULT_PERIOD_SHIFT 6
105 #endif // CHIP_CONFIG_RMP_TIMER_DEFAULT_PERIOD_SHIFT
106
107 #ifndef CHIP_LOG_FILTERING
108 #define CHIP_LOG_FILTERING 0
109 #endif // CHIP_LOG_FILTERING
110
111 #ifndef CHIP_CONFIG_MAX_INTERFACES
112 #define CHIP_CONFIG_MAX_INTERFACES 4
113 #endif // CHIP_CONFIG_MAX_INTERFACES
114
115 #ifndef CHIP_CONFIG_MAX_LOCAL_ADDR_UDP_ENDPOINTS
116 #define CHIP_CONFIG_MAX_LOCAL_ADDR_UDP_ENDPOINTS 4
117 #endif // CHIP_CONFIG_MAX_LOCAL_ADDR_UDP_ENDPOINTS
118
119 // ==================== Security Configuration Overrides ====================
120
121 #ifndef CHIP_CONFIG_MAX_APPLICATION_GROUPS
122 #define CHIP_CONFIG_MAX_APPLICATION_GROUPS 4
123 #endif // CHIP_CONFIG_MAX_APPLICATION_GROUPS
124
125 #ifndef CHIP_CONFIG_DEBUG_CERT_VALIDATION
126 #define CHIP_CONFIG_DEBUG_CERT_VALIDATION 0
127 #endif // CHIP_CONFIG_DEBUG_CERT_VALIDATION
128
129 #ifndef CHIP_CONFIG_ENABLE_CASE_RESPONDER
130 #define CHIP_CONFIG_ENABLE_CASE_RESPONDER 1
131 #endif // CHIP_CONFIG_ENABLE_CASE_RESPONDER
132
133 // ==================== FreeRTOS Configuration Overrides ====================
134 #ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_TASK
135 #define CHIP_CONFIG_FREERTOS_USE_STATIC_TASK 1
136 #endif
137
138 #ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE
139 #define CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE 1
140 #endif