1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef MESSAGE_CONFIG_H
10 #define MESSAGE_CONFIG_H
11 #include "message_types.h"
12 
13 #ifndef MESSAGE_ENGINE_MAX_SERVICE
14 #define MESSAGE_ENGINE_MAX_SERVICE 15
15 #endif
16 
17 #ifndef MESSAGE_ENGINE_MAX_DISPATCHER
18 #define MESSAGE_ENGINE_MAX_DISPATCHER 10
19 #endif
20 
21 #ifndef MESSAGE_ENGINE_DISPATCHERID_ASSIGN_START
22 #define MESSAGE_ENGINE_DISPATCHERID_ASSIGN_START 5
23 #endif
24 
25 #ifndef DEFAULT_DISPATCHER_QUEUE_SIZE
26 #define DEFAULT_DISPATCHER_QUEUE_SIZE 128
27 #endif
28 
29 #ifndef DEFAULT_DISPATCHER_PRIORITY_COUNT
30 #define DEFAULT_DISPATCHER_PRIORITY_COUNT 2
31 #endif
32 
33 #define IOCTL_SEND_QUEUE_SIZE 300
34 #define IOCTL_SEND_QUEUE_PROPIRTY_LEVEL 1
35 
36 #define MAX_OBJ_REF_COUNT 200
37 
38 #define MAX_NODE_REF_COUNT 200
39 
40 #define MESSAGE_DEVICE "/dev/msg_engine"
41 #define MESSAGE_DEVICE_MODE 0660
42 
43 #define QUEUE_OPER_TIMEOUT 1000
44 
45 #define MAX_BLOCK_SIZE 16380L
46 
47 #define SYSTEM_ALIGN_WIDTH (sizeof(void*))
48 
49 #define USER_TO_KERNEL_SYNC_MESSAGE_TIMEOUT 10000L
50 
51 typedef struct DispatcherConfig_ {
52     DispatcherId dispatcherId;
53     uint8_t priorityLevelCount;
54     uint16_t queueSize;
55 } DispatcherConfig;
56 
57 #endif