20 #ifndef RDK_MOCA_HAL_TYPES_H
21 #define RDK_MOCA_HAL_TYPES_H
31 #define RMH_MAX_NUM_APIS 1024
32 #define RMH_MAX_NUM_TAGS 32
33 #define RMH_MAX_MOCA_NODES 16
35 typedef uint8_t RMH_MacAddress_t[6];
37 #define AS(x,y) x=(y),
38 #define ENUM_RMH_Result \
41 AS(RMH_INVALID_PARAM, 2) \
42 AS(RMH_INVALID_NETWORK_STATE, 3) \
43 AS(RMH_INVALID_INTERNAL_STATE, 4) \
44 AS(RMH_INVALID_ID, 5) \
45 AS(RMH_INVALID_MOCA_VERSION, 6) \
47 AS(RMH_INSUFFICIENT_SPACE, 8) \
48 AS(RMH_NOT_SUPPORTED, 9) \
49 AS(RMH_UNIMPLEMENTED, 10)
50 typedef enum RMH_Result { ENUM_RMH_Result } RMH_Result;
52 #define ENUM_RMH_PowerMode \
53 AS(RMH_POWER_MODE_M0_ACTIVE, 1u << 0) \
54 AS(RMH_POWER_MODE_M1_IDLE, 1u << 1) \
55 AS(RMH_POWER_MODE_M2_STANDBY, 1u << 2) \
56 AS(RMH_POWER_MODE_M3_SLEEP, 1u << 3)
57 typedef enum RMH_PowerMode { ENUM_RMH_PowerMode } RMH_PowerMode;
59 #define ENUM_RMH_PERMode \
60 AS(RMH_PER_MODE_LEGACY, 0) \
61 AS(RMH_PER_MODE_NOMINAL, 1) \
62 AS(RMH_PER_MODE_VERY_LOW, 2)
63 typedef enum RMH_PERMode { ENUM_RMH_PERMode } RMH_PERMode;
65 #define ENUM_RMH_LinkStatus \
66 AS(RMH_LINK_STATUS_DISABLED, 0) \
67 AS(RMH_LINK_STATUS_NO_LINK, 1) \
68 AS(RMH_LINK_STATUS_INTERFACE_DOWN, 2) \
69 AS(RMH_LINK_STATUS_UP, 3)
70 typedef enum RMH_LinkStatus { ENUM_RMH_LinkStatus } RMH_LinkStatus;
72 #define ENUM_RMH_AdmissionStatus \
73 AS(RMH_ADMISSION_STATUS_UNKNOWN, 0) \
74 AS(RMH_ADMISSION_STATUS_STARTED, 1) \
75 AS(RMH_ADMISSION_STATUS_SUCCEEDED, 2) \
76 AS(RMH_ADMISSION_STATUS_FAILED, 3) \
77 AS(RMH_ADMISSION_STATUS_CHANNEL_UNUSABLE, 4) \
78 AS(RMH_ADMISSION_STATUS_TIMEOUT, 5)
79 typedef enum RMH_AdmissionStatus { ENUM_RMH_AdmissionStatus } RMH_AdmissionStatus;
81 #define ENUM_RMH_MoCAResetReason \
82 AS(RMH_MOCA_RESET_REASON_NO_RESET_OCCURRED, 0) \
83 AS(RMH_MOCA_RESET_REASON_REMOTE_NODE_REQUEST, 1) \
84 AS(RMH_MOCA_RESET_REASON_UNKNOWN, 2)
85 typedef enum RMH_MoCAResetReason { ENUM_RMH_MoCAResetReason } RMH_MoCAResetReason;
87 #define ENUM_RMH_SubcarrierProfile \
88 AS(RMH_MOCA_SUBCARRIER_PROFILE_NOT_USABLE, 0x00) \
89 AS(RMH_MOCA_SUBCARRIER_PROFILE_BPSK, 0x01) \
90 AS(RMH_MOCA_SUBCARRIER_PROFILE_QPSK, 0x02) \
91 AS(RMH_MOCA_SUBCARRIER_PROFILE_QAM_8, 0x03) \
92 AS(RMH_MOCA_SUBCARRIER_PROFILE_QAM_16, 0x04) \
93 AS(RMH_MOCA_SUBCARRIER_PROFILE_QAM_32, 0x05) \
94 AS(RMH_MOCA_SUBCARRIER_PROFILE_QAM_64, 0x06) \
95 AS(RMH_MOCA_SUBCARRIER_PROFILE_QAM_128, 0x07) \
96 AS(RMH_MOCA_SUBCARRIER_PROFILE_QAM_256, 0x08) \
97 AS(RMH_MOCA_SUBCARRIER_PROFILE_QAM_512, 0x09) \
98 AS(RMH_MOCA_SUBCARRIER_PROFILE_QAM_1024, 0x0A)
99 typedef enum RMH_SubcarrierProfile { ENUM_RMH_SubcarrierProfile } RMH_SubcarrierProfile;
101 #define ENUM_RMH_MoCAVersion \
102 AS(RMH_MOCA_VERSION_UNKNOWN, 0) \
103 AS(RMH_MOCA_VERSION_10, 0x10) \
104 AS(RMH_MOCA_VERSION_11, 0x11) \
105 AS(RMH_MOCA_VERSION_20, 0x20)
106 typedef enum RMH_MoCAVersion { ENUM_RMH_MoCAVersion } RMH_MoCAVersion;
108 #define RMH_LOG_NONE 0
109 #define RMH_LOG_DEFAULT (RMH_LOG_ERROR | RMH_LOG_WARNING | RMH_LOG_MESSAGE)
111 #define ENUM_RMH_LogLevel \
112 AS(RMH_LOG_ERROR, 1u << 0) \
113 AS(RMH_LOG_WARNING, 1u << 1) \
114 AS(RMH_LOG_MESSAGE, 1u << 2) \
115 AS(RMH_LOG_DEBUG, 1u << 3) \
116 AS(RMH_LOG_TRACE, 1u << 4)
117 typedef enum RMH_LogLevel { ENUM_RMH_LogLevel } RMH_LogLevel;
119 #define ENUM_RMH_Event \
120 AS(RMH_EVENT_LINK_STATUS_CHANGED, 1u << 0) \
121 AS(RMH_EVENT_MOCA_VERSION_CHANGED, 1u << 1) \
122 AS(RMH_EVENT_LOW_BANDWIDTH, 1u << 2) \
123 AS(RMH_EVENT_NODE_JOINED, 1u << 4) \
124 AS(RMH_EVENT_NODE_DROPPED, 1u << 5) \
125 AS(RMH_EVENT_ADMISSION_STATUS_CHANGED, 1u << 6) \
126 AS(RMH_EVENT_NC_ID_CHANGED, 1u << 7) \
127 AS(RMH_EVENT_API_PRINT, 1u << 8) \
128 AS(RMH_EVENT_DRIVER_PRINT, 1u << 9) \
129 AS(RMH_EVENT_MOCA_RESET, 1u << 10)
130 typedef enum RMH_Event { ENUM_RMH_Event } RMH_Event;
132 #define ENUM_RMH_Band \
135 AS(RMH_BAND_D_LOW, 2) \
136 AS(RMH_BAND_D_HIGH, 3) \
137 AS(RMH_BAND_D_EX, 4) \
141 typedef enum RMH_Band { ENUM_RMH_Band } RMH_Band;
143 #define ENUM_RMH_ACAType \
144 AS(RMH_ACA_TYPE_EVM, 0) \
145 AS(RMH_ACA_TYPE_QUIET, 1)
146 typedef enum RMH_ACAType { ENUM_RMH_ACAType } RMH_ACAType;
148 #define ENUM_RMH_ACAStatus \
149 AS(RMH_ACA_STATUS_NOT_REQUESTED, 0) \
150 AS(RMH_ACA_STATUS_SUCCESS, 1) \
151 AS(RMH_ACA_STATUS_IN_PROGRESS, 2) \
152 AS(RMH_ACA_STATUS_FAILURE_GENERIC, 3) \
153 AS(RMH_ACA_STATUS_FAILURE_BAD_CHANNEL, 4) \
154 AS(RMH_ACA_STATUS_FAILURE_NO_EVM_PROBE, 5)
155 typedef enum RMH_ACAStatus { ENUM_RMH_ACAStatus } RMH_ACAStatus;
160 RMH_LinkStatus status;
161 } RMH_EVENT_LINK_STATUS_CHANGED;
163 RMH_AdmissionStatus status;
164 } RMH_EVENT_ADMISSION_STATUS_CHANGED;
166 RMH_MoCAResetReason reason;
167 } RMH_EVENT_MOCA_RESET;
169 RMH_MoCAVersion version;
170 } RMH_EVENT_MOCA_VERSION_CHANGED;
172 } RMH_EVENT_LOW_BANDWIDTH;
176 } RMH_EVENT_NC_ID_CHANGED;
179 } RMH_EVENT_NODE_JOINED;
182 } RMH_EVENT_NODE_DROPPED;
184 RMH_LogLevel logLevel;
186 } RMH_EVENT_API_PRINT;
188 RMH_LogLevel logLevel;
190 } RMH_EVENT_DRIVER_PRINT;
193 typedef void (*RMH_EventCallback)(
const enum RMH_Event event,
const struct RMH_EventData *eventData,
void* userContext);
196 bool nodePresent[RMH_MAX_MOCA_NODES];
197 uint32_t nodeValue[RMH_MAX_MOCA_NODES];
201 bool nodePresent[RMH_MAX_MOCA_NODES];
202 RMH_MacAddress_t nodeValue[RMH_MAX_MOCA_NODES];
206 bool nodePresent[RMH_MAX_MOCA_NODES];
210 typedef enum RMH_APIParamDirection {
213 }RMH_APIParamDirection;
216 const RMH_APIParamDirection direction;
224 const bool socApiExpected;
225 const bool genericApiExpected;
226 const char *socApiName;
227 const char *apiDefinition;
228 const char *apiDescription;
230 const uint32_t apiNumParams;
235 char apiListName[32];
236 uint32_t apiListSize;
237 RMH_API *apiList[RMH_MAX_NUM_APIS];
241 uint32_t tagListSize;