-
Notifications
You must be signed in to change notification settings - Fork 609
Expand file tree
/
Copy pathsaisynce.h
More file actions
187 lines (164 loc) · 5.23 KB
/
Copy pathsaisynce.h
File metadata and controls
187 lines (164 loc) · 5.23 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/**
* Copyright (c) 2014 Microsoft Open Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
* LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS
* FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing
* permissions and limitations under the License.
*
* Microsoft would like to thank the following companies for their review and
* assistance with these files: Intel Corporation, Mellanox Technologies Ltd,
* Dell Products, L.P., Facebook, Inc., Marvell International Ltd.
*
* @file saisynce.h
*
* @brief This module defines SAI Synchronous Ethernet interface
*/
#if !defined (__SAISYNCE_H_)
#define __SAISYNCE_H_
#include <saitypes.h>
/**
* @defgroup SAISYNCE SAI - SYNCE specific API definitions
*
* @{
*/
/**
* @brief Attribute data for #SAI_SYNCE_CLOCK_ATTR_DEBUG_FORCE_SYNCE_RECOVERED_CLOCK_STATE
*/
typedef enum _sai_synce_recovered_clock_state_t
{
/** Valid signal set as per device fault status */
SAI_SYNCE_RECOVERED_CLOCK_STATE_FORCE_VALID_DISABLE,
/** Valid signal forced to valid */
SAI_SYNCE_RECOVERED_CLOCK_STATE_FORCE_ENABLE_VALID,
/** Valid signal forced to invalid */
SAI_SYNCE_RECOVERED_CLOCK_STATE_FORCE_ENABLE_INVALID,
} sai_synce_recovered_clock_state_t;
/**
* @brief Enum defining SYNCE attributes.
*/
typedef enum _sai_synce_clock_attr_t
{
/**
* @brief Start of attributes
*/
SAI_SYNCE_CLOCK_ATTR_START = 0x00000000,
/**
* @brief Synchronous ethernet(SYNCE) clock source port
*
* Sets the Port to be the source for SYNCE
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_PORT
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_SYNCE_CLOCK_ATTR_SRC_PORT = SAI_SYNCE_CLOCK_ATTR_START,
/**
* @brief Synchronous ethernet (SYNCE) clock status
*
* Gets recovered clock signal with respect to hardware
* (valid only after attaching the clock to a clock source port)
*
* @type bool
* @flags READ_ONLY
*/
SAI_SYNCE_CLOCK_ATTR_CLOCK_VALID,
/**
* @brief Hardware clock-id
*
* Returns the hardware clock-id associated
*
* @type sai_uint64_t
* @flags READ_ONLY
*/
SAI_SYNCE_CLOCK_ATTR_CLOCK_HARDWARE_ID,
/**
* @brief Synchronous ethernet (SYNCE) clock status
*
* Force set the recovered clock signal state (for debugging)
*
* @type sai_synce_recovered_clock_state_t
* @flags CREATE_AND_SET
* @default SAI_SYNCE_RECOVERED_CLOCK_STATE_FORCE_VALID_DISABLE
*/
SAI_SYNCE_CLOCK_ATTR_DEBUG_FORCE_SYNCE_RECOVERED_CLOCK_STATE,
/**
* @brief End of attributes
*/
SAI_SYNCE_CLOCK_ATTR_END,
/** Custom range base value */
SAI_SYNCE_CLOCK_ATTR_CUSTOM_RANGE_START = 0x10000000,
/** End of custom range base */
SAI_SYNCE_CLOCK_ATTR_CUSTOM_RANGE_END
} sai_synce_clock_attr_t;
/**
* @brief Create SYNCE clock
*
* @param[out] synce_clock_id SYNCE clock id
* @param[in] switch_id The Switch id
* @param[in] attr_count Number of attributes
* @param[in] attr_list Array of attributes
*
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
*/
typedef sai_status_t (*sai_create_synce_clock_fn)(
_Out_ sai_object_id_t *synce_clock_id,
_In_ sai_object_id_t switch_id,
_In_ uint32_t attr_count,
_In_ const sai_attribute_t *attr_list);
/**
* @brief Remove SYNCE clock
*
* @param[in] synce_clock_id SYNCE clock id
*
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
*/
typedef sai_status_t (*sai_remove_synce_clock_fn)(
_In_ sai_object_id_t synce_clock_id);
/**
* @brief Set SYNCE clock Attribute
*
* @param[in] synce_clock_id SYNCE clock id
* @param[in] attr Attribute to set
*
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
*/
typedef sai_status_t (*sai_set_synce_clock_attribute_fn)(
_In_ sai_object_id_t synce_clock_id,
_In_ const sai_attribute_t *attr);
/**
* @brief Get SYNCE clock attribute
*
* @param[in] synce_clock_id SYNCE clock id
* @param[in] attr_count Number of attributes
* @param[inout] attr_list Array of attributes
*
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
*/
typedef sai_status_t (*sai_get_synce_clock_attribute_fn)(
_In_ sai_object_id_t synce_clock_id,
_In_ uint32_t attr_count,
_Inout_ sai_attribute_t *attr_list);
/**
* @brief SYNCE methods table retrieved with sai_api_query()
*/
typedef struct _sai_synce_api_t
{
sai_create_synce_clock_fn create_synce_clock;
sai_remove_synce_clock_fn remove_synce_clock;
sai_set_synce_clock_attribute_fn set_synce_clock_attribute;
sai_get_synce_clock_attribute_fn get_synce_clock_attribute;
} sai_synce_api_t;
/**
* @}
*/
#endif /** __SAISYNCE_H_ */