-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathst_graphite_api.h
126 lines (108 loc) · 4.23 KB
/
st_graphite_api.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/* st_graphite_api.h
*
* This file defines all the APIs for interacting with Graphite service and
* modules.
*
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "graphite_common.h"
#define GCS_DETECTION_ENGINE_CONFIG_KW_DET_ENABLE 0x1
#define GCS_DETECTION_ENGINE_CONFIG_USER_VER_ENABLE 0x2
#define GCS_DETECTION_ENGINE_CONFIG_FAILURE_DET_ENABLE 0x4
#define GCS_DETECTION_ENGINE_EVENT_DETECTED 0
#define GCS_DETECTION_ENGINE_EVENT_FAILED 1
#define GCS_READ_CMDRSP_STATUS_SUCCESS 0
struct gcs_det_engine_config_param {
struct graphite_cal_header cal_hdr;
uint16_t mode;
uint16_t custom_payload_sz;
} __packed;
struct gcs_det_engine_custom_config_param {
struct graphite_cal_header cal_hdr;
};
struct gcs_det_engine_event {
uint16_t status;
uint16_t custom_payload_sz;
/* followed by uint8_t*custom_payload_sz for conf levels */
};
struct gcs_cmd_read_payload_t {
uint32_t size_in_bytes;
};
struct gcs_cmd_readrsp_payload_t {
uint32_t status;
uint32_t flags;
uint32_t timestamp_lsw;
uint32_t timestapm_msw;
};
struct gcs_data_cmd_t {
struct graphite_data_cmd_hdr hdr;
union {
struct gcs_cmd_read_payload_t read;
} payload;
} __packed;
#define MAX_BRDIGE_BUF_PORTS (8)
struct gcs_bridge_buf_payload {
uint32_t minor_version;
uint32_t addr_circbuf_info[MAX_BRDIGE_BUF_PORTS];
} __packed;
struct gcs_bridge_buf_params {
struct graphite_cal_header cal_hdr;
struct gcs_bridge_buf_payload payload;
} __packed;
/* custom params defined by STHAL to VA engine */
/*
* start and stop individual engines in single
* module
*/
struct gcs_det_engine_start_custom_config {
struct graphite_cal_header cal_hdr;
uint16_t minor_version; /* Param version. Currently fixed value 1 */
uint16_t enable; /* 1: start engine 0: stop engine */
uint32_t token; /* unique token per engine */
} __packed;
struct gcs_det_engine_start_params {
uint16_t minor_version; /* Param version. Currently fixed value 1 */
uint32_t token; /* unique token per engine sent in
@gcs_det_engine_start_custom_config*/
} __packed;
struct gcs_det_event_type_custom_config {
struct graphite_cal_header cal_hdr;
uint32_t minor_version; /* Param version. Currently fixed value 1 */
uint32_t event_type; /* Value 1 selects generic event */
uint32_t mode; /* Bit 0 enables confidence levels. Bit 1 enables
keyword start/end indices */
} __packed;
/*
* Expected format of event when used with
* @gcs_det_engine_start_custom_config
*/
struct gcs_det_engine_extended_event {
struct gcs_det_engine_event ev_params;
struct gcs_det_engine_start_params start_params;
/* followed by VA engine specific custom payload */
} __packed;