1 /*
2 * Copyright (c) 2013, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 /*!
33 * @file NameServerDrvDefs.h
34 *
35 * @brief Definitions of NameServerDrv types and structures.
36 *
37 */
40 #ifndef NAMESERVER_DRVDEFS_H
41 #define NAMESERVER_DRVDEFS_H
44 #include <ti/ipc/NameServer.h>
45 #include "UtilsCmdBase.h"
46 #include "_NameServer.h"
47 #include "_MultiProc.h"
48 #include <ti/syslink/inc/IoctlDefs.h>
51 #if defined (__cplusplus)
52 extern "C" {
53 #endif
56 /* ----------------------------------------------------------------------------
57 * IOCTL command IDs for NameServer
58 * ----------------------------------------------------------------------------
59 */
60 /*!
61 * @brief Base command ID for NameServer
62 */
63 #define NAMESERVER_BASE_CMD (0x130)
65 /*!
66 * @brief Command for NameServer_setup
67 */
68 #define CMD_NAMESERVER_SETUP _IOWR(UTILSCMDBASE,\
69 NAMESERVER_BASE_CMD + 2u,\
70 NameServerDrv_CmdArgs)
71 /*!
72 * @brief Command for NameServer_setup
73 */
74 #define CMD_NAMESERVER_DESTROY _IOWR(UTILSCMDBASE,\
75 NAMESERVER_BASE_CMD + 3u,\
76 NameServerDrv_CmdArgs)
77 /*!
78 * @brief Command for NameServer_destroy
79 */
80 #define CMD_NAMESERVER_PARAMS_INIT _IOWR(UTILSCMDBASE,\
81 NAMESERVER_BASE_CMD + 4u,\
82 NameServerDrv_CmdArgs)
83 /*!
84 * @brief Command for NameServer_create
85 */
86 #define CMD_NAMESERVER_CREATE _IOWR(UTILSCMDBASE,\
87 NAMESERVER_BASE_CMD + 5u,\
88 NameServerDrv_CmdArgs)
89 /*!
90 * @brief Command for NameServer_delete
91 */
92 #define CMD_NAMESERVER_DELETE _IOWR(UTILSCMDBASE,\
93 NAMESERVER_BASE_CMD + 6u,\
94 NameServerDrv_CmdArgs)
95 /*!
96 * @brief Command for NameServer_addUInt32
97 */
98 #define CMD_NAMESERVER_ADDUINT32 _IOWR(UTILSCMDBASE,\
99 NAMESERVER_BASE_CMD + 7u,\
100 NameServerDrv_CmdArgs)
101 /*!
102 * @brief Command for NameServer_remove
103 */
104 #define CMD_NAMESERVER_REMOVE _IOWR(UTILSCMDBASE,\
105 NAMESERVER_BASE_CMD + 8u,\
106 NameServerDrv_CmdArgs)
107 /*!
108 * @brief Command for NameServer_removeEntry
109 */
110 #define CMD_NAMESERVER_REMOVEENTRY _IOWR(UTILSCMDBASE,\
111 NAMESERVER_BASE_CMD + 9u,\
112 NameServerDrv_CmdArgs)
113 /*!
114 * @brief Command for NameServer_getUInt32
115 */
116 #define CMD_NAMESERVER_GETUINT32 _IOWR(UTILSCMDBASE,\
117 NAMESERVER_BASE_CMD + 10u,\
118 NameServerDrv_CmdArgs)
120 /*!
121 * @brief Command for NameServer_add
122 */
123 #define CMD_NAMESERVER_ADD _IOWR(UTILSCMDBASE,\
124 NAMESERVER_BASE_CMD + 11u,\
125 NameServerDrv_CmdArgs)
127 /*!
128 * @brief Command for NameServer_get
129 */
130 #define CMD_NAMESERVER_GET _IOWR(UTILSCMDBASE,\
131 NAMESERVER_BASE_CMD + 12u,\
132 NameServerDrv_CmdArgs)
134 /* ----------------------------------------------------------------------------
135 * Command arguments for NameServer
136 * ----------------------------------------------------------------------------
137 */
138 /*!
139 * @brief Command arguments for NameServer
140 */
141 typedef struct NameServerDrv_CmdArgs {
142 union {
143 struct {
144 NameServer_Params * params;
145 } ParamsInit;
147 struct {
148 NameServer_Handle handle;
149 String name;
150 UInt32 nameLen;
151 NameServer_Params * params;
152 } create;
154 struct {
155 NameServer_Handle handle;
156 } delete;
158 struct {
159 NameServer_Handle handle;
160 String name;
161 UInt32 nameLen;
162 Ptr buf;
163 UInt32 len;
164 Ptr entry;
165 } add;
167 struct {
168 NameServer_Handle handle;
169 String name;
170 UInt32 nameLen;
171 Ptr buf;
172 UInt32 len;
173 UInt16 * procId;
174 UInt32 procLen;
175 } get;
177 struct {
178 NameServer_Handle handle;
179 String name;
180 UInt32 nameLen;
181 UInt32 value;
182 Ptr entry;
183 } addUInt32;
185 struct {
186 NameServer_Handle handle;
187 String name;
188 UInt32 value;
189 UInt16 procId[MultiProc_MAXPROCESSORS];
190 } getUInt32;
192 struct {
193 NameServer_Handle handle;
194 String name;
195 UInt32 nameLen;
196 } remove;
198 struct {
199 NameServer_Handle handle;
200 Ptr entry;
201 } removeEntry;
202 } args;
204 Int32 apiStatus;
205 } NameServerDrv_CmdArgs;
208 #if defined (__cplusplus)
209 }
210 #endif /* defined (__cplusplus) */
213 #endif /* NameServer_DrvDefs_H */