ath9k: Set IEEE80211_TX_CTL_RATE_CTRL_PROBE in rate control for probe rate
[linux-2.6/cjktty.git] / drivers / staging / epl / EplObduCal.c
blob85b3df0886b12387b0569fef14e0ba0b166b4fd1
1 /****************************************************************************
3 (c) SYSTEC electronic GmbH, D-07973 Greiz, August-Bebel-Str. 29
4 www.systec-electronic.com
6 Project: openPOWERLINK
8 Description: source file for communication abstraction layer
9 for the Epl-Obd-Userspace-Modul
11 License:
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions
15 are met:
17 1. Redistributions of source code must retain the above copyright
18 notice, this list of conditions and the following disclaimer.
20 2. Redistributions in binary form must reproduce the above copyright
21 notice, this list of conditions and the following disclaimer in the
22 documentation and/or other materials provided with the distribution.
24 3. Neither the name of SYSTEC electronic GmbH nor the names of its
25 contributors may be used to endorse or promote products derived
26 from this software without prior written permission. For written
27 permission, please contact info@systec-electronic.com.
29 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
32 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
33 COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
34 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
35 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
37 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
39 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 POSSIBILITY OF SUCH DAMAGE.
42 Severability Clause:
44 If a provision of this License is or becomes illegal, invalid or
45 unenforceable in any jurisdiction, that shall not affect:
46 1. the validity or enforceability in that jurisdiction of any other
47 provision of this License; or
48 2. the validity or enforceability in other jurisdictions of that or
49 any other provision of this License.
51 -------------------------------------------------------------------------
53 $RCSfile: EplObduCal.c,v $
55 $Author: D.Krueger $
57 $Revision: 1.6 $ $Date: 2008/10/17 15:32:32 $
59 $State: Exp $
61 Build Environment:
62 GCC V3.4
64 -------------------------------------------------------------------------
66 Revision History:
68 2006/06/19 k.t.: start of the implementation
70 ****************************************************************************/
71 #include "EplInc.h"
72 #include "user/EplObduCal.h"
73 #include "kernel/EplObdk.h"
75 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDU)) != 0) && (EPL_OBD_USE_KERNEL != FALSE)
77 /***************************************************************************/
78 /* */
79 /* */
80 /* G L O B A L D E F I N I T I O N S */
81 /* */
82 /* */
83 /***************************************************************************/
85 //---------------------------------------------------------------------------
86 // const defines
87 //---------------------------------------------------------------------------
89 //---------------------------------------------------------------------------
90 // local types
91 //---------------------------------------------------------------------------
93 //---------------------------------------------------------------------------
94 // modul globale vars
95 //---------------------------------------------------------------------------
97 //---------------------------------------------------------------------------
98 // local function prototypes
99 //---------------------------------------------------------------------------
101 //=========================================================================//
102 // //
103 // P U B L I C F U N C T I O N S //
104 // //
105 //=========================================================================//
107 //---------------------------------------------------------------------------
109 // Function: EplObduCalWriteEntry()
111 // Description: Function encapsulate access of function EplObdWriteEntry
113 // Parameters: uiIndex_p = Index of the OD entry
114 // uiSubIndex_p = Subindex of the OD Entry
115 // pSrcData_p = Pointer to the data to write
116 // Size_p = Size of the data in Byte
118 // Return: tEplKernel = Errorcode
121 // State:
123 //---------------------------------------------------------------------------
124 EPLDLLEXPORT tEplKernel PUBLIC EplObduCalWriteEntry(unsigned int uiIndex_p,
125 unsigned int uiSubIndex_p,
126 void *pSrcData_p,
127 tEplObdSize Size_p)
129 tEplKernel Ret;
131 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
132 Ret = EplObdWriteEntry(uiIndex_p, uiSubIndex_p, pSrcData_p, Size_p);
133 #else
134 Ret = kEplSuccessful;
135 #endif
137 return Ret;
140 //---------------------------------------------------------------------------
142 // Function: EplObduCalReadEntry()
144 // Description: Function encapsulate access of function EplObdReadEntry
146 // Parameters: uiIndex_p = Index oof the OD entry to read
147 // uiSubIndex_p = Subindex to read
148 // pDstData_p = pointer to the buffer for data
149 // Offset_p = offset in data for read access
150 // pSize_p = IN: Size of the buffer
151 // OUT: number of readed Bytes
153 // Return: tEplKernel = errorcode
155 // State:
157 //---------------------------------------------------------------------------
158 EPLDLLEXPORT tEplKernel PUBLIC EplObduCalReadEntry(unsigned int uiIndex_p,
159 unsigned int uiSubIndex_p,
160 void *pDstData_p,
161 tEplObdSize * pSize_p)
163 tEplKernel Ret;
165 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
166 Ret = EplObdReadEntry(uiIndex_p, uiSubIndex_p, pDstData_p, pSize_p);
167 #else
168 Ret = kEplSuccessful;
169 #endif
171 return Ret;
174 //---------------------------------------------------------------------------
176 // Function: EplObduCalAccessOdPart()
178 // Description: Function encapsulate access of function EplObdAccessOdPart
180 // Parameters: ObdPart_p = od-part to reset
181 // Direction_p = directory flag for
183 // Return: tEplKernel = errorcode
185 // State:
187 //---------------------------------------------------------------------------
188 EPLDLLEXPORT tEplKernel PUBLIC EplObduCalAccessOdPart(tEplObdPart ObdPart_p,
189 tEplObdDir Direction_p)
191 tEplKernel Ret;
193 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
194 Ret = EplObdAccessOdPart(ObdPart_p, Direction_p);
195 #else
196 Ret = kEplSuccessful;
197 #endif
199 return Ret;
202 //---------------------------------------------------------------------------
204 // Function: EplObduCalDefineVar()
206 // Description: Function encapsulate access of function EplObdDefineVar
208 // Parameters: pEplVarParam_p = varentry
210 // Return: tEplKernel = errorcode
212 // State:
214 //---------------------------------------------------------------------------
215 EPLDLLEXPORT tEplKernel PUBLIC EplObduCalDefineVar(tEplVarParam MEM *
216 pVarParam_p)
218 tEplKernel Ret;
220 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
221 Ret = EplObdDefineVar(pVarParam_p);
222 #else
223 Ret = kEplSuccessful;
224 #endif
226 return Ret;
229 //---------------------------------------------------------------------------
231 // Function: EplObduCalGetObjectDataPtr()
233 // Description: Function encapsulate access of function EplObdGetObjectDataPtr
235 // Parameters: uiIndex_p = Index of the entry
236 // uiSubindex_p = Subindex of the entry
238 // Return: void * = pointer to object data
240 // State:
242 //---------------------------------------------------------------------------
243 EPLDLLEXPORT void *PUBLIC EplObduCalGetObjectDataPtr(unsigned int uiIndex_p,
244 unsigned int uiSubIndex_p)
246 void *pData;
248 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
249 pData = EplObdGetObjectDataPtr(uiIndex_p, uiSubIndex_p);
250 #else
251 pData = NULL;
252 #endif
254 return pData;
257 //---------------------------------------------------------------------------
259 // Function: EplObduCalRegisterUserOd()
261 // Description: Function encapsulate access of function EplObdRegisterUserOd
263 // Parameters: pUserOd_p = pointer to user OD
265 // Return: tEplKernel = errorcode
267 // State:
269 //---------------------------------------------------------------------------
270 #if (defined (EPL_OBD_USER_OD) && (EPL_OBD_USER_OD != FALSE))
271 EPLDLLEXPORT tEplKernel PUBLIC EplObduCalRegisterUserOd(tEplObdEntryPtr
272 pUserOd_p)
274 tEplKernel Ret;
276 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
277 Ret = EplObdRegisterUserOd(pUserOd_p);
278 #else
279 Ret = kEplSuccessful;
280 #endif
282 return Ret;
285 #endif
286 //---------------------------------------------------------------------------
288 // Function: EplObduCalInitVarEntry()
290 // Description: Function encapsulate access of function EplObdInitVarEntry
292 // Parameters: pVarEntry_p = pointer to var entry structure
293 // bType_p = object type
294 // ObdSize_p = size of object data
296 // Returns: none
298 // State:
300 //---------------------------------------------------------------------------
301 EPLDLLEXPORT void PUBLIC EplObduCalInitVarEntry(tEplObdVarEntry MEM *
302 pVarEntry_p, BYTE bType_p,
303 tEplObdSize ObdSize_p)
305 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
306 EplObdInitVarEntry(pVarEntry_p, bType_p, ObdSize_p);
307 #endif
310 //---------------------------------------------------------------------------
312 // Function: EplObduCalGetDataSize()
314 // Description: Function encapsulate access of function EplObdGetDataSize
316 // gets the data size of an object
317 // for string objects it returnes the string length
319 // Parameters: uiIndex_p = Index
320 // uiSubIndex_p= Subindex
322 // Return: tEplObdSize
324 // State:
326 //---------------------------------------------------------------------------
327 EPLDLLEXPORT tEplObdSize PUBLIC EplObduCalGetDataSize(unsigned int uiIndex_p,
328 unsigned int uiSubIndex_p)
330 tEplObdSize Size;
332 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
333 Size = EplObdGetDataSize(uiIndex_p, uiSubIndex_p);
334 #else
335 Size = 0;
336 #endif
338 return Size;
341 //---------------------------------------------------------------------------
343 // Function: EplObduCalGetNodeId()
345 // Description: Function encapsulate access of function EplObdGetNodeId
348 // Parameters:
350 // Return: unsigned int = Node Id
352 // State:
354 //---------------------------------------------------------------------------
355 EPLDLLEXPORT unsigned int PUBLIC EplObduCalGetNodeId()
357 unsigned int uiNodeId;
359 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
360 uiNodeId = EplObdGetNodeId();
361 #else
362 uiNodeId = 0;
363 #endif
365 return uiNodeId;
368 //---------------------------------------------------------------------------
370 // Function: EplObduCalSetNodeId()
372 // Description: Function encapsulate access of function EplObdSetNodeId
375 // Parameters: uiNodeId_p = Node Id to set
376 // NodeIdType_p= Type on which way the Node Id was set
378 // Return: tEplKernel = Errorcode
380 // State:
382 //---------------------------------------------------------------------------
383 EPLDLLEXPORT tEplKernel PUBLIC EplObduCalSetNodeId(unsigned int uiNodeId_p,
384 tEplObdNodeIdType
385 NodeIdType_p)
387 tEplKernel Ret;
389 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
390 Ret = EplObdSetNodeId(uiNodeId_p, NodeIdType_p);
391 #else
392 Ret = kEplSuccessful;
393 #endif
395 return Ret;
398 //---------------------------------------------------------------------------
400 // Function: EplObduCalGetAccessType()
402 // Description: Function encapsulate access of function EplObdGetAccessType
404 // Parameters: uiIndex_p = Index of the OD entry
405 // uiSubIndex_p = Subindex of the OD Entry
406 // pAccessTyp_p = pointer to buffer to store accesstype
408 // Return: tEplKernel = errorcode
411 // State:
413 //---------------------------------------------------------------------------
414 EPLDLLEXPORT tEplKernel PUBLIC EplObduCalGetAccessType(unsigned int uiIndex_p,
415 unsigned int
416 uiSubIndex_p,
417 tEplObdAccess *
418 pAccessTyp_p)
420 tEplObdAccess AccesType;
422 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
423 AccesType = EplObdGetAccessType(uiIndex_p, uiSubIndex_p, pAccessTyp_p);
424 #else
425 AccesType = 0;
426 #endif
428 return AccesType;
432 //---------------------------------------------------------------------------
434 // Function: EplObduCalReadEntryToLe()
436 // Description: Function encapsulate access of function EplObdReadEntryToLe
438 // Parameters: uiIndex_p = Index of the OD entry to read
439 // uiSubIndex_p = Subindex to read
440 // pDstData_p = pointer to the buffer for data
441 // Offset_p = offset in data for read access
442 // pSize_p = IN: Size of the buffer
443 // OUT: number of readed Bytes
445 // Return: tEplKernel
447 // State:
449 //---------------------------------------------------------------------------
450 EPLDLLEXPORT tEplKernel PUBLIC EplObduCalReadEntryToLe(unsigned int uiIndex_p,
451 unsigned int
452 uiSubIndex_p,
453 void *pDstData_p,
454 tEplObdSize * pSize_p)
456 tEplKernel Ret;
458 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
459 Ret = EplObdReadEntryToLe(uiIndex_p, uiSubIndex_p, pDstData_p, pSize_p);
460 #else
461 Ret = kEplSuccessful;
462 #endif
464 return Ret;
467 //---------------------------------------------------------------------------
469 // Function: EplObduCalWriteEntryFromLe()
471 // Description: Function encapsulate access of function EplObdWriteEntryFromLe
473 // Parameters: uiIndex_p = Index of the OD entry
474 // uiSubIndex_p = Subindex of the OD Entry
475 // pSrcData_p = Pointer to the data to write
476 // Size_p = Size of the data in Byte
478 // Return: tEplKernel = Errorcode
481 // State:
483 //---------------------------------------------------------------------------
484 EPLDLLEXPORT tEplKernel PUBLIC EplObduCalWriteEntryFromLe(unsigned int
485 uiIndex_p,
486 unsigned int
487 uiSubIndex_p,
488 void *pSrcData_p,
489 tEplObdSize Size_p)
491 tEplKernel Ret;
493 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
494 Ret =
495 EplObdWriteEntryFromLe(uiIndex_p, uiSubIndex_p, pSrcData_p, Size_p);
496 #else
497 Ret = kEplSuccessful;
498 #endif
499 return Ret;
502 //---------------------------------------------------------------------------
504 // Function: EplObduCalSearchVarEntry()
506 // Description: gets variable from OD
508 // Parameters: uiIndex_p = index of the var entry to search
509 // uiSubindex_p = subindex of var entry to search
510 // ppVarEntry_p = pointer to the pointer to the varentry
512 // Return: tEplKernel
514 // State:
516 //---------------------------------------------------------------------------
517 EPLDLLEXPORT tEplKernel PUBLIC
518 EplObduCalSearchVarEntry(EPL_MCO_DECL_INSTANCE_PTR_ unsigned int uiIndex_p,
519 unsigned int uiSubindex_p,
520 tEplObdVarEntry MEM ** ppVarEntry_p)
522 tEplKernel Ret;
524 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
525 Ret = EplObdSearchVarEntry(uiIndex_p, uiSubindex_p, ppVarEntry_p);
526 #else
527 Ret = kEplSuccessful;
528 #endif
529 return Ret;
532 //=========================================================================//
533 // //
534 // P R I V A T E F U N C T I O N S //
535 // //
536 //=========================================================================//
538 //---------------------------------------------------------------------------
540 // Function:
542 // Description:
546 // Parameters:
549 // Returns:
552 // State:
554 //---------------------------------------------------------------------------
556 #endif //(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDU)) != 0)
558 // EOF