Home | History | Annotate | Download | only in inc
      1 /*
      2  * osApi.h
      3  *
      4  * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  *
     11  *  * Redistributions of source code must retain the above copyright
     12  *    notice, this list of conditions and the following disclaimer.
     13  *  * Redistributions in binary form must reproduce the above copyright
     14  *    notice, this list of conditions and the following disclaimer in
     15  *    the documentation and/or other materials provided with the
     16  *    distribution.
     17  *  * Neither the name Texas Instruments nor the names of its
     18  *    contributors may be used to endorse or promote products derived
     19  *    from this software without specific prior written permission.
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  */
     33 
     34 
     35 /*--------------------------------------------------------------------------*/
     36 /* Module:      OSAPI.H*/
     37 /**/
     38 /* Purpose:     This module defines unified interface to the OS specific*/
     39 /*              sources and services.*/
     40 /**/
     41 /*--------------------------------------------------------------------------*/
     42 
     43 #ifndef __OS_API_H__
     44 #define __OS_API_H__
     45 
     46 /** \file  osApi.h
     47  * \brief Operating System APIs	\n
     48  * This module defines unified interface to the OS specific sources and services
     49  */
     50 
     51 #include "tidef.h"
     52 #include "TI_IPC_Api.h"
     53 
     54 #ifdef __cplusplus
     55 extern "C" {
     56 #endif
     57 
     58 
     59 /** \struct TI_CONNECTION_STATUS
     60  * \struct *PTI_CONNECTION_STATUS
     61  * \brief Ti Connection Status
     62  *
     63  * \par Description
     64  *
     65  * \sa
     66  */
     67 typedef struct
     68 {
     69     TI_UINT32      Event;
     70     TI_UINT8*      Data;
     71 } TI_CONNECTION_STATUS, *PTI_CONNECTION_STATUS;
     72 
     73 typedef struct
     74 {
     75     TI_UINT8 	uFormat;
     76     TI_UINT8 	uLevel;
     77     TI_UINT8 	uParamsNum;
     78     TI_UINT8 	uReserved;
     79     TI_UINT16 	uFileId;
     80     TI_UINT16 	uLineNum;
     81 } TTraceMsg;
     82 
     83 #define OS_PAGE_SIZE            4096
     84 #define MAX_MESSAGE_SIZE        500
     85 #define MICROSECOND_IN_SECONDS  1000000
     86 
     87 #define UINT16_MAX_VAL					0xffff
     88 #define UINT8_MAX_VAL					0xff
     89 
     90 #define TRACE_FORMAT_8_BITS_PARAMS		2
     91 #define TRACE_FORMAT_16_BITS_PARAMS		4
     92 #define TRACE_FORMAT_32_BITS_PARAMS		6
     93 
     94 #define TRACE_MSG_MAX_PARAMS			32
     95 #define TRACE_MSG_MIN_LENGTH			(sizeof(TTraceMsg))
     96 #define TRACE_MSG_MAX_LENGTH			((TRACE_MSG_MAX_PARAMS * 4) + sizeof(TTraceMsg))
     97 
     98 #define INSERT_BYTE(pBuf, dataByte)     (*((TI_UINT8  *)pBuf) = (TI_UINT8 )dataByte ); pBuf++;
     99 #define INSERT_2_BYTES(pBuf, dataBytes) (*((TI_UINT16 *)pBuf) = (TI_UINT16)dataBytes); pBuf+=2;
    100 #define INSERT_4_BYTES(pBuf, dataBytes) (*((TI_UINT32 *)pBuf) = (TI_UINT32)dataBytes); pBuf+=4;
    101 
    102 
    103 /****************************************************************************************
    104 						START OF OS API (Common to all GWSI LIB, Driver and TI Driver)
    105 *****************************************************************************************/
    106 
    107 
    108 /****************************************************************************************
    109                         OS HW API NEEDED BY DRIVER
    110 *****************************************************************************************/
    111 
    112 /** \brief  OS Disable IRQ
    113  *
    114  * \param  OsContext 	- Handle to the OS object
    115  * \return void
    116  *
    117  * \par Description
    118  * This function disables the Interrupts
    119  *
    120  * \sa
    121  */
    122 void os_disableIrq (TI_HANDLE OsContext);
    123 
    124 /** \brief  OS Enable IRQ
    125  *
    126  * \param  OsContext 	- Handle to the OS object
    127  * \return void
    128  *
    129  * \par Description
    130  * This function enables the Interrupts
    131  *
    132  * \sa
    133  */
    134 void os_enableIrq (TI_HANDLE OsContext);
    135 
    136 /** \brief  OS  IRQ Serviced
    137  *
    138  * \param  OsContext 	- Handle to the OS object
    139  * \return void
    140  *
    141  * \par Description
    142  * This function is used in Level IRQ only. At this point the interrupt line is not asserted anymore
    143  * and we can inform the OS to enable IRQ again.
    144  *
    145  * \sa
    146  */
    147 void os_InterruptServiced (TI_HANDLE OsContext);
    148 
    149 /****************************************************************************************
    150  *						OS Report API													*
    151  ****************************************************************************************/
    152 
    153 /** \brief  OS Set Debug Mode
    154  *
    155  * \param  enable 	- Indicates if debug mode should be enabled or disabled ( TI_TRUE | TI_FALSE )
    156  * \return void
    157  *
    158  * \par Description
    159  * This function sets the Debug Mode flag to True or False - according to user's request
    160  *
    161  * \sa
    162  */
    163 void os_setDebugMode (TI_BOOL enable);
    164 
    165 /** \brief  OS Printf
    166  *
    167  * \param  format 	- String to print (with formatted parametrs in string if needed) and parameters values
    168  *					  if formatted parameters are used in string
    169  * \return void
    170  *
    171  * \par Description
    172  * This function prints formatted output using OS available printf method
    173  *
    174  * \sa
    175  */
    176 void os_printf (const char *format ,...);
    177 
    178 /****************************************************************************************
    179  *						OS Memory API													*
    180  ****************************************************************************************/
    181 
    182 /** \brief  OS Memory Allocation
    183  *
    184  * \param  OsContext 	- Handle to the OS object
    185  * \param  Size 		- Size (in bytes) to be allocated
    186  * \return Pointer to the allocated memory on success	;  NULL on failure (there isn't enough memory available)
    187  *
    188  * \par Description
    189  * This function allocates resident (nonpaged) system-space memory with calling specific OS allocation function.	\n
    190  * It is assumed that this function will never be called in an interrupt context since the OS allocation function
    191  * has the potential to put the caller to sleep  while waiting for memory to become available.
    192  *
    193  * \sa
    194  */
    195 void *os_memoryAlloc (TI_HANDLE OsContext,TI_UINT32 Size);
    196 
    197 /** \brief  OS Memory CAllocation
    198  *
    199  * \param  OsContext 	- Handle to the OS object
    200  * \param  Number 		- Number of element to be allocated
    201  * \param  Size 		- Size (in bytes) of one element
    202  * \return Pointer to the allocated memory on success	;  NULL on failure (there isn't enough memory available)
    203  *
    204  * \par Description
    205  * This function allocates an array in memory with elements initialized to 0.
    206  * Allocates resident (nonpaged) system-space memory for an array with elements initialized to 0,
    207  * with specific OS allocation function.
    208  * It is assumed that this function will never be called in an interrupt context since the OS allocation function
    209  * has the potential to put the caller to sleep  while waiting for memory to become available.
    210  *
    211  * \sa
    212  */
    213 void *os_memoryCAlloc (TI_HANDLE OsContext, TI_UINT32 Number, TI_UINT32 Size);
    214 
    215 /** \brief  OS Memory Set
    216  *
    217  * \param  OsContext 	- Handle to the OS object
    218  * \param  pMemPtr 		- Pointer to the base address of a memory block
    219  * \param  Value 		- Value to set to memory block
    220  * \param  Length 		- Length (in bytes) of memory block
    221  * \return void
    222  *
    223  * \par Description
    224  * This function fills a block of memory with a given value
    225  *
    226  * \sa
    227  */
    228 void os_memorySet (TI_HANDLE OsContext, void *pMemPtr, TI_INT32 Value, TI_UINT32 Length);
    229 
    230 /** \brief  OS Memory Zero
    231  *
    232  * \param  OsContext 	- Handle to the OS object
    233  * \param  pMemPtr 		- Pointer to the base address of a memory block
    234  * \param  Length 		- Length (in bytes) of memory block
    235  * \return void
    236  *
    237  * \par Description
    238  * This function fills a block of memory with zeros
    239  *
    240  * \sa
    241  */
    242 void os_memoryZero (TI_HANDLE OsContext, void *pMemPtr, TI_UINT32 Length);
    243 
    244 /** \brief  OS Memory Copy
    245  *
    246  * \param  OsContext 	- Handle to the OS object
    247  * \param  pDestination - Pointer to destination buffer
    248  * \param  pSource 		- Pointer to Source buffer
    249  * \param  Size 		- Size (in bytes) to copy
    250  * \return void
    251  *
    252  * \par Description
    253  * This function copies a specified number of bytes from one caller-supplied location (source buffer) to another (destination buffer)
    254  *
    255  * \sa
    256  */
    257 void os_memoryCopy (TI_HANDLE OsContext, void *pDestination, void *pSource, TI_UINT32 Size);
    258 
    259 /** \brief  OS Memory Free
    260  *
    261  * \param  OsContext 	- Handle to the OS object
    262  * \param  pMemPtr 		- Pointer to the base address of a memory block
    263  * \param  Size 		- Size (in bytes) to free
    264  * \return void
    265  *
    266  * \par Description
    267  * This function releases a block of memory which was previously allocated by user
    268  *
    269  * \sa
    270  */
    271 void os_memoryFree (TI_HANDLE OsContext, void *pMemPtr, TI_UINT32 Size);
    272 
    273 /** \brief  OS Memory Compare
    274  *
    275  * \param  OsContext 	- Handle to the OS object
    276  * \param  Buf1 		- Pointer to the first buffer in comperation
    277  * \param  Buf2 		- Pointer to the second buffer in comperation
    278  * \param  Count 		- Count (in bytes) to compare
    279  * \return A value which indicates the relationship between the two compared buffers:
    280  *         value < 0:	Buf1 less than Buf2
    281  *         value == 0: 	Buf1 identical to Buf2
    282  *         value > 0: 	Buf1 greater than Buf2
    283  *
    284  * \par Description
    285  * This function compares between two given buffers
    286  *
    287  * \sa
    288  */
    289 TI_INT32 os_memoryCompare (TI_HANDLE OsContext, TI_UINT8* Buf1, TI_UINT8* Buf2, TI_INT32 Count);
    290 
    291 /** \brief  OS Memory Allocation for HW DMA
    292  *
    293  * \param  pOsContext 	- Handle to the OS object
    294  * \param  Size 		- Size (in bytes) to allocate
    295  * \return Pointer to the allocated memory on success	;  NULL on failure (there isn't enough memory available)
    296  *
    297  * \par Description
    298  * This function allocates resident (nonpaged) system-space memory for HW DMA operations
    299  *
    300  * \sa
    301  */
    302 void *os_memoryAlloc4HwDma (TI_HANDLE pOsContext, TI_UINT32 Size);
    303 
    304 /** \brief  OS Memory for HW DMA Free
    305  *
    306  * \param  pOsContext 	- Handle to the OS object
    307  * \param  pMem_ptr 	- Pointer to the base virtual address of allocated memory block
    308  *                        This is the address that was returned to user when he allocated the memory for HW DMA usage
    309  * \param  Size 		- Size (in bytes) of the memory block to be released. This parameter must be identical to the Length
    310  *						  which was given by the user when he allocated the memory block for HW DMA usage
    311  * \return Pointer to the allocated memory on success	;  NULL on failure (there isn't enough memory available)
    312  *
    313  * \par Description
    314  * This function releases a block of memory previously allocated by user for HW DMA operations
    315  *
    316  * \sa
    317  */
    318 void os_memory4HwDmaFree (TI_HANDLE pOsContext, void *pMem_ptr, TI_UINT32 Size);
    319 
    320 /** \brief  OS Memory Copy from User
    321  *
    322  * \param  OsContext 	- Handle to the OS object
    323  * \param  pDstPtr 		- Pointer to destination buffer
    324  * \param  pSrcPtr 		- Pointer to Source buffer
    325  * \param  Size 		- Size (in bytes) to copy
    326  * \return TI_OK on success	;  TI_NOK otherwise
    327  *
    328  * \par Description
    329  * This function copies a specified number of bytes from one caller-supplied location (Source) to another (Destination)
    330  *
    331  * \sa
    332  */
    333 int os_memoryCopyFromUser (TI_HANDLE OsContext, void *pDstPtr, void *pSrcPtr, TI_UINT32 Size);
    334 
    335 /** \brief  OS Memory Copy To User
    336  *
    337  * \param  OsContext 	- Handle to the OS object
    338  * \param  pDstPtr 		- Pointer to destination buffer
    339  * \param  pSrcPtr 		- Pointer to Source buffer
    340  * \param  Size 		- Size (in bytes) to copy
    341  * \return TI_OK on success	;  TI_NOK otherwise
    342  *
    343  * \par Description
    344  * This function copies a specified number of bytes from one caller-supplied location (Source) to another (Destination)
    345  *
    346  * \sa
    347  */
    348 int os_memoryCopyToUser (TI_HANDLE OsContext, void *pDstPtr, void *pSrcPtr, TI_UINT32 Size);
    349 
    350 /****************************************************************************************
    351  *							OS TIMER API												*
    352  ****************************************************************************************/
    353 /** \brief  Timer Callback Function
    354  *
    355  * \param  Context 	- Handle to the OS object
    356  * \return void
    357  *
    358  * \par Description
    359  * This callback is passed by user to OS timer when created, and is called directly from OS timer context when expired.
    360  * E.g. the user user the timer in order to operate this function after a defined time expires
    361  *
    362  */
    363 typedef void (*fTimerFunction)(TI_HANDLE Context);
    364 
    365 /** \brief  OS Timer Create
    366  *
    367  * \param  OsContext 	- Handle to the OS object
    368  * \param  pRoutine 	- Pointer to user's Timer Callback function
    369  * \param  hFuncHandle 	- Handle to user's Timer Callback function parameters
    370  * \return Handle to timer object on success	;  NULL on failure
    371  *
    372  * \par Description
    373  * This function creates and initializes an OS timer object associated with a user's Timer Callback function	\n
    374  * \note   1) The user's callback is called directly from OS timer context when expired.
    375  * \note   2) In some OSs, it may be needed to use an intermediate callback in the
    376  * \note      osapi layer (use os_timerHandlr for that).
    377  *
    378  * \sa
    379  */
    380 TI_HANDLE os_timerCreate (TI_HANDLE OsContext, fTimerFunction pRoutine, TI_HANDLE hFuncHandle);
    381 
    382 /** \brief  OS Timer Destroy
    383  *
    384  * \param  OsContext 	- Handle to the OS object
    385  * \param  TimerHandle 	- Handle to timer object which user got when created the timer
    386  * \return void
    387  *
    388  * \par Description
    389  * This function destroys the OS timer object which was previously created by user
    390  *
    391  * \sa
    392  */
    393 void os_timerDestroy (TI_HANDLE OsContext, TI_HANDLE TimerHandle);
    394 
    395 /** \brief  OS Timer Start
    396  *
    397  * \param  OsContext 	- Handle to the OS object
    398  * \param  TimerHandle 	- Handle to timer object which user got when created the timer
    399  * \param  DelayMs 		- The time in MS untill the timer is awaken
    400  * \return void
    401  *
    402  * \par Description
    403  * This function Start the OS timer object which was previously created by user
    404  *
    405  * \sa
    406  */
    407 void os_timerStart (TI_HANDLE OsContext, TI_HANDLE TimerHandle, TI_UINT32 DelayMs);
    408 
    409 /** \brief  OS Timer Stop
    410  *
    411  * \param  OsContext 	- Handle to the OS object
    412  * \param  TimerHandle 	- Handle to timer object which user got when created the timer
    413  * \return void
    414  *
    415  * \par Description
    416  * This function Stops the OS timer object which was previously created by user
    417  *
    418  * \sa
    419  */
    420 void os_timerStop (TI_HANDLE OsContext, TI_HANDLE TimerHandle);
    421 
    422 /** \brief  OS Periodic Interrupt Timer Start
    423  *
    424  * \param  OsContext 	- Handle to the OS object
    425  * \return void
    426  *
    427  * \par Description
    428  * This function starts the periodic interrupt mechanism. This function is used when PRIODIC_INTERRUPT mode is used.
    429  * This Mode is enabled when interrupts that are usually received from the FW are masked,
    430  * and there is need to check- in a given time periods - if handling of any FW interrupt is needed.
    431  *
    432  * \sa
    433  */
    434 #ifdef PRIODIC_INTERRUPT
    435 void os_periodicIntrTimerStart (TI_HANDLE OsContext);
    436 #endif
    437 
    438 /** \brief  OS Time Stamp Ms
    439  *
    440  * \param  OsContext 	- Handle to the OS object
    441  * \return The number of milliseconds that have elapsed since the system was booted
    442  *
    443  * \par Description
    444  * This function returns the number of milliseconds that have elapsed since the system was booted.
    445  */
    446 TI_UINT32 os_timeStampMs (TI_HANDLE OsContext);
    447 
    448 /** \brief  OS Time Stamp Us
    449  *
    450  * \param  OsContext 	- Handle to the OS object
    451  * \return The number of microseconds that have elapsed since the system was booted
    452  *
    453  * \par Description
    454  * This function returns the number of microseconds that have elapsed since the system was booted.	\n
    455  * Note that sometimes this function will be called with NULL(!!!) as argument!
    456  */
    457 TI_UINT32 os_timeStampUs (TI_HANDLE OsContext);
    458 
    459 /** \brief  OS Stall uSec
    460  *
    461  * \param  OsContext 	- Handle to the OS object
    462  * \param  uSec 		- The time to delay in microseconds
    463  * \return void
    464  *
    465  * \par Description
    466  * This function makes delay in microseconds
    467  *
    468  * \sa
    469  */
    470 void os_StalluSec (TI_HANDLE OsContext, TI_UINT32 uSec);
    471 
    472 
    473 /****************************************************************************************
    474  *							Protection services	API										*
    475  ****************************************************************************************/
    476 
    477 /** \brief  OS Protect Create
    478  *
    479  * \param  OsContext 	- Handle to the OS object
    480  * \return Handle of the created mutex/spin lock object on Success	; NULL on Failure (not enough memory available or problems to initializing the mutex)
    481  *
    482  * \par Description
    483  * This function allocates a mutex/spin lock object.
    484  * The mutex/spinlock object which is created by this function is used for mutual-exclusion and protection of resources which are shared between
    485  * multi-Tasks/Threads
    486  *
    487  * \sa
    488  */
    489 TI_HANDLE os_protectCreate (TI_HANDLE OsContext);
    490 
    491 /** \brief  OS Protect Destroy
    492  *
    493  * \param  OsContext 		- Handle to the OS object
    494  * \param  ProtectContext 	- Handle to the mutex/spin lock object
    495  * \return void
    496  *
    497  * \par Description
    498  * This function destroys s a mutex/spin lock object which was previously created by user:
    499  * it frees the mutex/spin lock and then frees the object's memory
    500  *
    501  * \sa
    502  */
    503 void os_protectDestroy (TI_HANDLE OsContext, TI_HANDLE ProtectContext);
    504 
    505 /** \brief  OS Protect Lock
    506  *
    507  * \param  OsContext 		- Handle to the OS object
    508  * \param  ProtectContext 	- Handle to the mutex/spin lock object
    509  * \return void
    510  *
    511  * \par Description
    512  * This function locks the mutex/spin lock object. E.g. the caller acquires a mutex/spin lock and gains exclusive
    513  * access to the shared resources, that the mutex/spin lock protects of.
    514  *
    515  * \sa
    516  */
    517 void os_protectLock (TI_HANDLE OsContext, TI_HANDLE ProtectContext);
    518 
    519 /** \brief  OS Protect Unlock
    520  *
    521  * \param  OsContext 		- Handle to the OS object
    522  * \param  ProtectContext 	- Handle to the mutex/spin lock object
    523  * \return void
    524  *
    525  * \par Description
    526  * This function unlocks the mutex/spin lock object.
    527  *
    528  * \sa
    529  */
    530 void os_protectUnlock (TI_HANDLE OsContext, TI_HANDLE ProtectContext);
    531 
    532 /* Wakelock functionality */
    533 int os_wake_lock (TI_HANDLE OsContext);
    534 int os_wake_unlock (TI_HANDLE OsContext);
    535 int os_wake_lock_timeout (TI_HANDLE OsContext);
    536 int os_wake_lock_timeout_enable (TI_HANDLE OsContext);
    537 
    538 #define os_profile(hos,fn,par)
    539 
    540 
    541 /****************************************************************************************
    542 						START OF GWSI DRIVER API
    543 *****************************************************************************************/
    544 
    545 /** \brief  OS Signaling Object Create
    546  *
    547  * \param  OsContext 		- Handle to the OS object
    548  * \return Pointer to Signal Object on Success	;	NULL on Failure
    549  *
    550  * \par Description
    551  * This function creates a new Signaling Object or opens an already exists Signaling Object.
    552  * The Signaling Object created by this function is used for mutual-exclusion and protection
    553  * of resources which are shared between multi-Tasks/Threads by using a signaling mechanism
    554  *
    555  * \sa
    556  */
    557 void *os_SignalObjectCreate (TI_HANDLE OsContext);
    558 
    559 /** \brief  OS Signaling Object Wait
    560  *
    561  * \param  OsContext 	- Handle to the OS object
    562  * \param  ptr 			- Pointer to Signaling Object previously created by user
    563  * \return TI_OK (0) on Success	;	TI_NOK (1) on Failure
    564  *
    565  * \par Description
    566  * This function perform waiting on Signaling Object. The coller waits until signaled or until timeout
    567  *
    568  * \sa
    569  */
    570 int os_SignalObjectWait (TI_HANDLE OsContext, void *ptr);
    571 
    572 /** \brief  OS Signaling Object Set
    573  *
    574  * \param  OsContext 	- Handle to the OS object
    575  * \param  ptr 			- Pointer to Signaling Object previously created by user
    576  * \return TI_OK (0) on Success	;	TI_NOK (1) on Failure
    577  *
    578  * \par Description
    579  * This function sets a Signaling Object to signaled state (e.g the siganeling object is released)
    580  *
    581  * \sa
    582  */
    583 int os_SignalObjectSet (TI_HANDLE OsContext, void *ptr);
    584 
    585 /** \brief  OS Signaling Object Free
    586  *
    587  * \param  OsContext 	- Handle to the OS object
    588  * \param  ptr 			- Pointer to Signaling Object previously created by user
    589  * \return TI_OK (0) on Success	;	TI_NOK (1) on Failure
    590  *
    591  * \par Description
    592  * This function frees (closes) a Signaling Object Handle
    593  *
    594  * \sa
    595  */
    596 int os_SignalObjectFree (TI_HANDLE OsContext, void *ptr);
    597 
    598 /** \brief  OS Schedule Request
    599  *
    600  * \param  OsContext 	- Handle to the OS object
    601  * \return TI_OK (0) on Success	;	TI_NOK (1) on Failure
    602  *
    603  * \par Description
    604  * This function performs scheduling (context switch) according to user request
    605  *
    606  * \sa
    607  */
    608 int os_RequestSchedule (TI_HANDLE OsContext);
    609 
    610 
    611 /****************************************************************************************
    612 						START OF TI DRIVER API
    613 *****************************************************************************************/
    614 
    615 /** \brief  OS Read Memory Register UINT32
    616  *
    617  * \param  OsContext 	- Handle to the OS object
    618  * \param  Register		- Pointer to register address
    619  * \param  Data			- Pointer to output read data
    620  * \return void
    621  *
    622  * \par Description
    623  * This function reads register in 32 bit length
    624  *
    625  * \sa
    626  */
    627 void os_hwReadMemRegisterUINT32 (TI_HANDLE OsContext, TI_UINT32* Register, TI_UINT32* Data);
    628 
    629 /** \brief  OS Write Memory Register UINT32
    630  *
    631  * \param  OsContext 	- Handle to the OS object
    632  * \param  Register		- Pointer to register address
    633  * \param  Data			- Data to write to register
    634  * \return void
    635  *
    636  * \par Description
    637  * This function reads register in 32 bit length
    638  *
    639  * \sa
    640  */
    641 void os_hwWriteMemRegisterUINT32 (TI_HANDLE OsContext, TI_UINT32* Register, TI_UINT32 Data);
    642 
    643 /** \brief  OS Receive Packet
    644  *
    645  * \param  OsContext 	- Handle to the OS object
    646  * \param  pPacket 		- Pointer to received packet data
    647  * \param  Length 		- Length of received packet
    648  * \return TI_TRUE on Success	;	TI_FALSE on Failure
    649  *
    650  * \par Description
    651  * This function transfers a packet from WLAN driver to OS
    652  *
    653  * \sa
    654  */
    655 TI_BOOL os_receivePacket(TI_HANDLE OsContext, void *pRxDesc ,void *pPacket, TI_UINT16 Length);
    656 
    657 /** \brief  OS Indicate Event
    658  *
    659  * \param  OsContext 	- Handle to the OS object
    660  * \param  pData 		- Pointer to event data
    661  * \return TI_OK (0) on Success	;
    662  *
    663  * \par Description
    664  * This function indicate the OS about different connection driver's events,
    665  * The function performs the rewuired operations for the event - in the OS side
    666  *
    667  * \sa
    668  */
    669 TI_INT32 os_IndicateEvent (TI_HANDLE OsContext, IPC_EV_DATA *pData);
    670 
    671 /** \brief  OS Send Trace Message to Logger
    672  *
    673  * \param  OsContext    - The OS handle
    674  * \param  uLevel   	- Severity level of the trace message
    675  * \param  uFileId  	- Source file ID of the trace message
    676  * \param  uLineNum 	- Line number of the trace message
    677  * \param  uParamsNum   - Number of parameters in the trace message
    678  * \param  ...          - The trace message parameters
    679  * \return void
    680  *
    681  * \par Description
    682  * This function sends trace message to logger
    683  *
    684  * \sa
    685  */
    686 void os_Trace (TI_HANDLE OsContext, TI_UINT32 uLevel, TI_UINT32 uFileId, TI_UINT32 uLineNum, TI_UINT32 uParamsNum, ...);
    687 
    688 /**
    689  * \fn     os_SetDrvThreadPriority
    690  * \brief  Called upon init to set WLAN driver thread priority.
    691  *
    692  * \param  OsContext              - The OS handle
    693  * \param  uWlanDrvThreadPriority - The WLAN driver thread priority
    694  * \return
    695  */
    696 void os_SetDrvThreadPriority (TI_HANDLE OsContext, TI_UINT32 uWlanDrvThreadPriority);
    697 
    698 
    699 #ifdef __cplusplus
    700 }
    701 #endif
    702 
    703 #endif /* __OS_API_H__ */
    704