SDK3.5
This document shows Ameba SDK 3.5 APIs
|
RTOS functions. More...
Data Structures | |
struct | timer_list |
struct | task_struct |
struct | rtw_worker_thread_t |
struct | rtw_event_message_t |
struct | worker_timer_entry |
struct | work_struct |
struct | delayed_work |
struct | mem_entry |
struct | osdep_service_ops |
Functions | |
void | init_mem_monitor (_list *pmem_table, int *used_num) |
This function initializes a memory table. More... | |
void | deinit_mem_monitor (_list *pmem_table, int *used_num) |
This function deinitializes a memory table. More... | |
void | add_mem_usage (_list *pmem_table, void *ptr, int size, int *used_num, int flag) |
This function alloc mem_entry to the memory table. More... | |
void | del_mem_usage (_list *pmem_table, void *ptr, int *used_num, int flag) |
This function frees memory from the memory table. More... | |
int | get_mem_usage (_list *pmem_table) |
This function get the memory usage of a memory table. More... | |
u8 * | _rtw_vmalloc (u32 sz) |
u8 * | _rtw_zvmalloc (u32 sz) |
void | _rtw_vmfree (u8 *pbuf, u32 sz) |
u8 * | _rtw_zmalloc (u32 sz) |
u8 * | _rtw_malloc (u32 sz) |
void | _rtw_mfree (u8 *pbuf, u32 sz) |
u8 * | rtw_vmalloc (u32 sz) |
This function allocates the virtually contiguous memory. More... | |
u8 * | rtw_zvmalloc (u32 sz) |
This function allocates the virtually contiguous memory and the values of the memory are setted to 0. More... | |
void | rtw_vmfree (u8 *pbuf, u32 sz) |
This function frees the virtually contiguous memory. More... | |
u8 * | rtw_zmalloc (u32 sz) |
This function allocates the memory and the values of the memory are setted to 0. More... | |
u8 * | rtw_malloc (u32 sz) |
This function allocates the memory. More... | |
void | rtw_mfree (u8 *pbuf, u32 sz) |
This function frees the virtually contiguous memory. More... | |
void * | rtw_malloc2d (int h, int w, int size) |
This function allocates a 2 dimensional array memory. More... | |
void | rtw_mfree2d (void *pbuf, int h, int w, int size) |
This function deallocates the block of memory previously allocated to make it available again. More... | |
void | rtw_memcpy (void *dst, void *src, u32 sz) |
This function copies the values of "sz" bytes from the location pointed to by "src" directly to the memory block pointed to by "des". More... | |
int | rtw_memcmp (void *dst, void *src, u32 sz) |
This function compares the first "sz" bytes of the block of memory pointed by "dst" to the first "sz" bytes pointed by "src". More... | |
void | rtw_memset (void *pbuf, int c, u32 sz) |
This function sets the first "sz" bytes of the block of memory pointed by "pbuf" to the specified "c". More... | |
void | rtw_init_listhead (_list *list) |
This function initializes the head of the list. More... | |
u32 | rtw_is_list_empty (_list *phead) |
This function tests whether a list is empty. More... | |
void | rtw_list_insert_head (_list *plist, _list *phead) |
This function adds a new entry after "phead" for the list. More... | |
void | rtw_list_insert_tail (_list *plist, _list *phead) |
This function adds a new entry before "phead" for the list. More... | |
void | rtw_list_delete (_list *plist) |
This function deletes entry from list and reinitialize it. More... | |
void | rtw_init_sema (_sema *sema, int init_val) |
This function initializes the unnamed semaphore referred to by "sema" to the value "init_val". More... | |
void | rtw_free_sema (_sema *sema) |
This function deletes the semaphore. More... | |
void | rtw_up_sema (_sema *sema) |
This function releases the semaphore. This macro must not be used from an ISR. More... | |
void | rtw_up_sema_from_isr (_sema *sema) |
This function releases the semaphore. This macro can be used from an ISR. More... | |
u32 | rtw_down_sema (_sema *sema) |
This function acquires the semaphore. If no more tasks are allowed to acquire the semaphore, calling this function will put the task to sleep until the semaphore is up. More... | |
u32 | rtw_down_timeout_sema (_sema *sema, u32 timeout) |
This function acquires the semaphore. If no more tasks are allowed to acquire the semaphore, calling this function will put the task to sleep until the semaphore is up. More... | |
void | rtw_mutex_init (_mutex *pmutex) |
This function implements a mutex semaphore by using the existing queue mechanism. More... | |
void | rtw_mutex_free (_mutex *pmutex) |
This function deletes the mutex semaphore. More... | |
void | rtw_mutex_put (_mutex *pmutex) |
This function releases a mutex semaphore. More... | |
void | rtw_mutex_get (_mutex *pmutex) |
This function obtains a mutex semaphore. More... | |
int | rtw_mutex_get_timeout (_mutex *pmutex, u32 timeout_ms) |
This function obtains a mutex semaphore with a timeout setting. More... | |
void | rtw_enter_critical (_lock *plock, _irqL *pirqL) |
This function marks the start of a critical code region. Preemptive context switches cannot occur when in a critical region. More... | |
void | rtw_exit_critical (_lock *plock, _irqL *pirqL) |
This function marks end of a critical code region. Preemptive context switches cannot occur when in a critical region. More... | |
void | rtw_enter_critical_from_isr (_lock *plock, _irqL *pirqL) |
This function marks the start of a critical code region from isr. More... | |
void | rtw_exit_critical_from_isr (_lock *plock, _irqL *pirqL) |
This function marks the end of a critical code region from isr. More... | |
void | rtw_enter_critical_bh (_lock *plock, _irqL *pirqL) |
This function obtains a spin lock semaphore. More... | |
void | rtw_exit_critical_bh (_lock *plock, _irqL *pirqL) |
This function releases a spin lock semaphore. More... | |
int | rtw_enter_critical_mutex (_mutex *pmutex, _irqL *pirqL) |
This function obtains a semaphore. More... | |
void | rtw_exit_critical_mutex (_mutex *pmutex, _irqL *pirqL) |
This function releases a semaphore. More... | |
void | rtw_spinlock_init (_lock *plock) |
This function implements a spin lock semaphore by using the existing queue mechanism. More... | |
void | rtw_spinlock_free (_lock *plock) |
This function deletes the spin lock semaphore. More... | |
void | rtw_spin_lock (_lock *plock) |
This function obtains a spin lock semaphore. More... | |
void | rtw_spin_unlock (_lock *plock) |
This function releases a spin lock semaphore. More... | |
void | rtw_spinlock_irqsave (_lock *plock, _irqL *irqL) |
This function marks the start of a critical code region and obtains a spin lock semaphore. More... | |
void | rtw_spinunlock_irqsave (_lock *plock, _irqL *irqL) |
This function releases a spin lock semaphore and marks the end of a critical code region. More... | |
int | rtw_init_xqueue (_xqueue *queue, const char *name, u32 message_size, u32 number_of_messages) |
This function creates a new queue instance. More... | |
int | rtw_push_to_xqueue (_xqueue *queue, void *message, u32 timeout_ms) |
This function posts a message to the back of a queue. The message is queued by copy, not by reference. More... | |
int | rtw_pop_from_xqueue (_xqueue *queue, void *message, u32 timeout_ms) |
This function receives a message from a queue. The message is recieved by copy so a buffer adequate size must be provided. More... | |
int | rtw_deinit_xqueue (_xqueue *queue) |
Delete a queue - freeing all the memory allocated for storing of messages placed on the queue. More... | |
void | rtw_init_queue (_queue *pqueue) |
This function creates a new queue instance. More... | |
void | rtw_deinit_queue (_queue *pqueue) |
u32 | rtw_is_queue_empty (_queue *pqueue) |
u32 | rtw_queue_empty (_queue *pqueue) |
This function tests whether the queue is empty. More... | |
u32 | rtw_end_of_queue_search (_list *queue, _list *pelement) |
This function tests whether the "pelement" is at the "queue". More... | |
_list * | rtw_get_queue_head (_queue *queue) |
u32 | rtw_get_current_time (void) |
Get the count of ticks since the vTaskStartScheduler was called. More... | |
u32 | rtw_systime_to_ms (u32 systime) |
Convert system time to milliseconds. More... | |
u32 | rtw_systime_to_sec (u32 systime) |
Convert system time to seconds. More... | |
u32 | rtw_ms_to_systime (u32 ms) |
Convert milliseconds to system time. More... | |
u32 | rtw_sec_to_systime (u32 sec) |
Convert seconds to system time. More... | |
s32 | rtw_get_passing_time_ms (u32 start) |
Get the passing time from the "start" in milliseconds. More... | |
s32 | rtw_get_time_interval_ms (u32 start, u32 end) |
Get the interval time from the "start" to "end" in milliseconds. More... | |
void | rtw_msleep_os (int ms) |
This function suspends execution of the calling thread for "ms" milliseconds. More... | |
void | rtw_usleep_os (int us) |
This function suspends execution of the calling thread for "us" microseconds. More... | |
u32 | rtw_atoi (u8 *s) |
This function converts the initial portion of the string to integer. More... | |
void | rtw_mdelay_os (int ms) |
This function delays a task for the giving time in milliseconds. More... | |
void | rtw_udelay_os (int us) |
This function delays a task for the giving time in microseconds. More... | |
void | rtw_yield_os (void) |
This function for forcing a context switch. More... | |
void | ATOMIC_SET (ATOMIC_T *v, int i) |
This function atomically sets the value of the variable. More... | |
int | ATOMIC_READ (ATOMIC_T *v) |
This function atomically reads the value of the variable. More... | |
void | ATOMIC_ADD (ATOMIC_T *v, int i) |
This function adds "i" to the contained "v". More... | |
void | ATOMIC_SUB (ATOMIC_T *v, int i) |
This function subtracts "i" from th econtained "v". More... | |
void | ATOMIC_INC (ATOMIC_T *v) |
This function adds 1 to the contained "v". More... | |
void | ATOMIC_DEC (ATOMIC_T *v) |
This function subtracts 1 from th econtained "v". More... | |
int | ATOMIC_ADD_RETURN (ATOMIC_T *v, int i) |
This function adds "i" to the contained "v" and returns the result. More... | |
int | ATOMIC_SUB_RETURN (ATOMIC_T *v, int i) |
This function subtracts "i" from th econtained "v" and returns the result. More... | |
int | ATOMIC_INC_RETURN (ATOMIC_T *v) |
This function adds 1 to the contained "v" and returns the result. More... | |
int | ATOMIC_DEC_RETURN (ATOMIC_T *v) |
This function subtracts 1 from th econtained "v" and returns the result. More... | |
int | ATOMIC_DEC_AND_TEST (ATOMIC_T *v) |
This function subtracts 1 from th econtained "v" and test if the result equals 0. More... | |
u64 | rtw_modular64 (u64 x, u64 y) |
int | rtw_get_random_bytes (void *dst, u32 size) |
This function generates random bytes. More... | |
u32 | rtw_getFreeHeapSize (void) |
This function gets the available heap size. More... | |
void | flush_signals_thread (void) |
void | rtw_acquire_wakelock (void) |
This function indicates that the WLAN needs to stay on which means cannot go into power saving mode. More... | |
void | rtw_release_wakelock (void) |
This function indicates that the WLAN does not need to stay on which means can go into power saving mode. More... | |
void | rtw_wakelock_timeout (u32 timeout) |
int | rtw_create_task (struct task_struct *task, const char *name, u32 stack_size, u32 priority, thread_func_t func, void *thctx) |
This function creates a new task and adds it to the list of tasks that are ready to run. More... | |
void | rtw_delete_task (struct task_struct *task) |
This function deletes a task. More... | |
void | rtw_wakeup_task (struct task_struct *task) |
This function wake up a task. More... | |
int | rtw_create_worker_thread (rtw_worker_thread_t *worker_thread, u8 priority, u32 stack_size, u32 event_queue_size) |
This function creates a new worker thread. More... | |
int | rtw_delete_worker_thread (rtw_worker_thread_t *worker_thread) |
This function deletes a worker thread. More... | |
void | rtw_init_delayed_work (struct delayed_work *dwork, work_func_t func, const char *name) |
void | rtw_deinit_delayed_work (struct delayed_work *dwork) |
int | rtw_queue_delayed_work (struct workqueue_struct *wq, struct delayed_work *dwork, u32 delay, void *context) |
BOOLEAN | rtw_cancel_delayed_work (struct delayed_work *dwork) |
void | rtw_thread_enter (char *name) |
This function prints the name of the thread in DBG_INFO. More... | |
void | rtw_thread_exit (void) |
This function exits the calling thread. More... | |
u8 | rtw_get_scheduler_state (void) |
This function gets the scheduler state of the calling thread. More... | |
_timerHandle | rtw_timerCreate (const signed char *pcTimerName, osdepTickType xTimerPeriodInTicks, u32 uxAutoReload, void *pvTimerID, TIMER_FUN pxCallbackFunction) |
This function creates a new software timer instance. More... | |
u32 | rtw_timerDelete (_timerHandle xTimer, osdepTickType xBlockTime) |
This function deletes a timer that was previously created using rtw_timerCreate. More... | |
u32 | rtw_timerIsTimerActive (_timerHandle xTimer) |
This function queries a timer to see if it is active or dormant. More... | |
u32 | rtw_timerStop (_timerHandle xTimer, osdepTickType xBlockTime) |
This function stops a timer that was previously started. More... | |
u32 | rtw_timerChangePeriod (_timerHandle xTimer, osdepTickType xNewPeriod, osdepTickType xBlockTime) |
This function changes the period of a timer that was previously created. More... | |
void * | rtw_timerGetID (_timerHandle xTimer) |
u32 | rtw_timerStart (_timerHandle xTimer, osdepTickType xBlockTime) |
u32 | rtw_timerStartFromISR (_timerHandle xTimer, osdepBASE_TYPE *pxHigherPriorityTaskWoken) |
u32 | rtw_timerStopFromISR (_timerHandle xTimer, osdepBASE_TYPE *pxHigherPriorityTaskWoken) |
u32 | rtw_timerResetFromISR (_timerHandle xTimer, osdepBASE_TYPE *pxHigherPriorityTaskWoken) |
u32 | rtw_timerChangePeriodFromISR (_timerHandle xTimer, osdepTickType xNewPeriod, osdepBASE_TYPE *pxHigherPriorityTaskWoken) |
u32 | rtw_timerReset (_timerHandle xTimer, osdepTickType xBlockTime) |
Variables | |
_timerHandle | timer_hdl |
unsigned long | data |
void(* | function )(void *) |
const char * | task_name |
_thread_hdl_ | task |
const char * | name |
u32 | queue_num |
u32 | cur_queue_num |
_sema | wakeup_sema |
_sema | terminate_sema |
u32 | blocked |
u32 | callback_running |
_xqueue | event_queue |
struct task_struct | thread |
event_handler_t | function |
char * | buf |
int | buf_len |
int | flags |
void * | user_data |
struct list_head | list |
_timerHandle | timer_hdl |
rtw_event_message_t | message |
rtw_worker_thread_t * | worker_thread |
u32 | timeout |
_list | list |
u32 | data |
work_func_t | func |
void * | context |
struct task_struct * | used_wq |
struct work_struct | work |
struct timer_list | timer |
struct list_head | list |
int | size |
void * | ptr |
u8 *(* | rtw_vmalloc )(u32 sz) |
u8 *(* | rtw_zvmalloc )(u32 sz) |
void(* | rtw_vmfree )(u8 *pbuf, u32 sz) |
u8 *(* | rtw_malloc )(u32 sz) |
u8 *(* | rtw_zmalloc )(u32 sz) |
void(* | rtw_mfree )(u8 *pbuf, u32 sz) |
void(* | rtw_memcpy )(void *dst, void *src, u32 sz) |
int(* | rtw_memcmp )(void *dst, void *src, u32 sz) |
void(* | rtw_memset )(void *pbuf, int c, u32 sz) |
void(* | rtw_init_sema )(_sema *sema, int init_val) |
void(* | rtw_free_sema )(_sema *sema) |
void(* | rtw_up_sema )(_sema *sema) |
void(* | rtw_up_sema_from_isr )(_sema *sema) |
u32(* | rtw_down_timeout_sema )(_sema *sema, u32 timeout) |
void(* | rtw_mutex_init )(_mutex *pmutex) |
void(* | rtw_mutex_free )(_mutex *pmutex) |
void(* | rtw_mutex_get )(_mutex *pmutex) |
int(* | rtw_mutex_get_timeout )(_mutex *pmutex, u32 timeout_ms) |
void(* | rtw_mutex_put )(_mutex *pmutex) |
void(* | rtw_enter_critical )(_lock *plock, _irqL *pirqL) |
void(* | rtw_exit_critical )(_lock *plock, _irqL *pirqL) |
void(* | rtw_enter_critical_from_isr )(_lock *plock, _irqL *pirqL) |
void(* | rtw_exit_critical_from_isr )(_lock *plock, _irqL *pirqL) |
void(* | rtw_enter_critical_bh )(_lock *plock, _irqL *pirqL) |
void(* | rtw_exit_critical_bh )(_lock *plock, _irqL *pirqL) |
int(* | rtw_enter_critical_mutex )(_mutex *pmutex, _irqL *pirqL) |
void(* | rtw_exit_critical_mutex )(_mutex *pmutex, _irqL *pirqL) |
void(* | rtw_spinlock_init )(_lock *plock) |
void(* | rtw_spinlock_free )(_lock *plock) |
void(* | rtw_spin_lock )(_lock *plock) |
void(* | rtw_spin_unlock )(_lock *plock) |
void(* | rtw_spinlock_irqsave )(_lock *plock, _irqL *irqL) |
void(* | rtw_spinunlock_irqsave )(_lock *plock, _irqL *irqL) |
int(* | rtw_init_xqueue )(_xqueue *queue, const char *name, u32 message_size, u32 number_of_messages) |
int(* | rtw_push_to_xqueue )(_xqueue *queue, void *message, u32 timeout_ms) |
int(* | rtw_pop_from_xqueue )(_xqueue *queue, void *message, u32 timeout_ms) |
int(* | rtw_deinit_xqueue )(_xqueue *queue) |
u32(* | rtw_get_current_time )(void) |
u32(* | rtw_systime_to_ms )(u32 systime) |
u32(* | rtw_systime_to_sec )(u32 systime) |
u32(* | rtw_ms_to_systime )(u32 ms) |
u32(* | rtw_sec_to_systime )(u32 sec) |
void(* | rtw_msleep_os )(int ms) |
void(* | rtw_usleep_os )(int us) |
void(* | rtw_mdelay_os )(int ms) |
void(* | rtw_udelay_os )(int us) |
void(* | rtw_yield_os )(void) |
void(* | ATOMIC_SET )(ATOMIC_T *v, int i) |
int(* | ATOMIC_READ )(ATOMIC_T *v) |
void(* | ATOMIC_ADD )(ATOMIC_T *v, int i) |
void(* | ATOMIC_SUB )(ATOMIC_T *v, int i) |
void(* | ATOMIC_INC )(ATOMIC_T *v) |
void(* | ATOMIC_DEC )(ATOMIC_T *v) |
int(* | ATOMIC_ADD_RETURN )(ATOMIC_T *v, int i) |
int(* | ATOMIC_SUB_RETURN )(ATOMIC_T *v, int i) |
int(* | ATOMIC_INC_RETURN )(ATOMIC_T *v) |
int(* | ATOMIC_DEC_RETURN )(ATOMIC_T *v) |
u64(* | rtw_modular64 )(u64 x, u64 y) |
int(* | rtw_get_random_bytes )(void *dst, u32 size) |
u32(* | rtw_getFreeHeapSize )(void) |
int(* | rtw_create_task )(struct task_struct *task, const char *name, u32 stack_size, u32 priority, thread_func_t func, void *thctx) |
void(* | rtw_delete_task )(struct task_struct *task) |
void(* | rtw_wakeup_task )(struct task_struct *task) |
void(* | rtw_init_delayed_work )(struct delayed_work *dwork, work_func_t func, const char *name) |
void(* | rtw_deinit_delayed_work )(struct delayed_work *dwork) |
int(* | rtw_queue_delayed_work )(struct workqueue_struct *wq, struct delayed_work *dwork, unsigned long delay, void *context) |
BOOLEAN(* | rtw_cancel_delayed_work )(struct delayed_work *dwork) |
void(* | rtw_thread_enter )(char *name) |
void(* | rtw_thread_exit )(void) |
_timerHandle(* | rtw_timerCreate )(const signed char *pcTimerName, osdepTickType xTimerPeriodInTicks, u32 uxAutoReload, void *pvTimerID, TIMER_FUN pxCallbackFunction) |
u32(* | rtw_timerDelete )(_timerHandle xTimer, osdepTickType xBlockTime) |
u32(* | rtw_timerIsTimerActive )(_timerHandle xTimer) |
u32(* | rtw_timerStop )(_timerHandle xTimer, osdepTickType xBlockTime) |
u32(* | rtw_timerChangePeriod )(_timerHandle xTimer, osdepTickType xNewPeriod, osdepTickType xBlockTime) |
void *(* | rtw_timerGetID )(_timerHandle xTimer) |
u32(* | rtw_timerStart )(_timerHandle xTimer, osdepTickType xBlockTime) |
u32(* | rtw_timerStartFromISR )(_timerHandle xTimer, osdepBASE_TYPE *pxHigherPriorityTaskWoken) |
u32(* | rtw_timerStopFromISR )(_timerHandle xTimer, osdepBASE_TYPE *pxHigherPriorityTaskWoken) |
u32(* | rtw_timerResetFromISR )(_timerHandle xTimer, osdepBASE_TYPE *pxHigherPriorityTaskWoken) |
u32(* | rtw_timerChangePeriodFromISR )(_timerHandle xTimer, osdepTickType xNewPeriod, osdepBASE_TYPE *pxHigherPriorityTaskWoken) |
u32(* | rtw_timerReset )(_timerHandle xTimer, osdepTickType xBlockTime) |
void(* | rtw_acquire_wakelock )(void) |
void(* | rtw_release_wakelock )(void) |
void(* | rtw_wakelock_timeout )(u32 timeoutMs) |
u8(* | rtw_get_scheduler_state )(void) |
RTOS functions.
void add_mem_usage | ( | _list * | pmem_table, |
void * | ptr, | ||
int | size, | ||
int * | used_num, | ||
int | flag | ||
) |
This function alloc mem_entry to the memory table.
[in] | pmem_table | The pointer to the memory table to be added. |
[in] | ptr | The pointer to the position to be added. |
[in] | size | The size of added memory. |
[in] | used_num | The number of mem_entry kept in monitor which will add 1 after. |
[in] | flag | MEM_MONITOR_FLAG_WPAS/MEM_MONITOR_FLAG_WIFI_DRV |
void ATOMIC_ADD | ( | ATOMIC_T * | v, |
int | i | ||
) |
This function adds "i" to the contained "v".
[in] | v | Pointer of type atomic_t. |
[in] | i | value to add. |
int ATOMIC_ADD_RETURN | ( | ATOMIC_T * | v, |
int | i | ||
) |
This function adds "i" to the contained "v" and returns the result.
[in] | v | Pointer of type atomic_t. |
[in] | i | value to add. |
void ATOMIC_DEC | ( | ATOMIC_T * | v | ) |
This function subtracts 1 from th econtained "v".
[in] | v | Pointer of type atomic_t. |
int ATOMIC_DEC_AND_TEST | ( | ATOMIC_T * | v | ) |
This function subtracts 1 from th econtained "v" and test if the result equals 0.
[in] | v | Pointer of type atomic_t. |
int ATOMIC_DEC_RETURN | ( | ATOMIC_T * | v | ) |
This function subtracts 1 from th econtained "v" and returns the result.
[in] | v | Pointer of type atomic_t. |
void ATOMIC_INC | ( | ATOMIC_T * | v | ) |
This function adds 1 to the contained "v".
[in] | v | Pointer of type atomic_t. |
int ATOMIC_INC_RETURN | ( | ATOMIC_T * | v | ) |
This function adds 1 to the contained "v" and returns the result.
[in] | v | Pointer of type atomic_t. |
int ATOMIC_READ | ( | ATOMIC_T * | v | ) |
This function atomically reads the value of the variable.
[in] | v | Pointer of type atomic_t that to be read. |
void ATOMIC_SET | ( | ATOMIC_T * | v, |
int | i | ||
) |
This function atomically sets the value of the variable.
[in] | v | Pointer of type atomic_t that to be set value. |
[in] | i | Required value. |
void ATOMIC_SUB | ( | ATOMIC_T * | v, |
int | i | ||
) |
This function subtracts "i" from th econtained "v".
[in] | v | Pointer of type atomic_t. |
[in] | i | value to subtract. |
int ATOMIC_SUB_RETURN | ( | ATOMIC_T * | v, |
int | i | ||
) |
This function subtracts "i" from th econtained "v" and returns the result.
[in] | v | Pointer of type atomic_t. |
[in] | i | value to subtract. |
void deinit_mem_monitor | ( | _list * | pmem_table, |
int * | used_num | ||
) |
This function deinitializes a memory table.
[in] | pmem_table | The pointer to the memory table. |
[in] | used_num | The number of mem_entry kept in monitor. |
void del_mem_usage | ( | _list * | pmem_table, |
void * | ptr, | ||
int * | used_num, | ||
int | flag | ||
) |
This function frees memory from the memory table.
[in] | pmem_table | The pointer to the memory table |
[in] | ptr | The pointer to the position to be free. |
[in] | used_num | The number of mem_entry kept in monitor. |
[in] | flag | MEM_MONITOR_FLAG_WPAS/MEM_MONITOR_FLAG_WIFI_DRV |
int get_mem_usage | ( | _list * | pmem_table | ) |
This function get the memory usage of a memory table.
[in] | pmem_table | The pointer to the memory table. |
void init_mem_monitor | ( | _list * | pmem_table, |
int * | used_num | ||
) |
This function initializes a memory table.
[in] | pmem_table | The pointer to the memory table. |
[in] | used_num | The number of mem_entry kept in monitor which will be set to 0. |
void rtw_acquire_wakelock | ( | void | ) |
This function indicates that the WLAN needs to stay on which means cannot go into power saving mode.
u32 rtw_atoi | ( | u8 * | s | ) |
This function converts the initial portion of the string to integer.
[in] | s | The pointer to the string to be converted. |
int rtw_create_task | ( | struct task_struct * | task, |
const char * | name, | ||
u32 | stack_size, | ||
u32 | priority, | ||
thread_func_t | func, | ||
void * | thctx | ||
) |
This function creates a new task and adds it to the list of tasks that are ready to run.
[in] | task | The task stucture which will store the task related infomation. |
[in] | name | A descriptive name for the task. |
[in] | stack_size | The size of the task stack specified as the variables the stack can hold. |
[in] | priority | The priority at which the task should run. |
[in] | func | The task entry function. |
[in] | thctx | The pointer that will be used as the parameter for the task being created. |
int rtw_create_worker_thread | ( | rtw_worker_thread_t * | worker_thread, |
u8 | priority, | ||
u32 | stack_size, | ||
u32 | event_queue_size | ||
) |
This function creates a new worker thread.
[in] | worker_thread | The pointer to the worker thread stucture. |
[in] | priority | The priority of the thread. |
[in] | stack_size | The size of the thread stack specified as the variables the stack can hold. |
[in] | event_queue_size | The queue size of events. |
int rtw_deinit_xqueue | ( | _xqueue * | queue | ) |
Delete a queue - freeing all the memory allocated for storing of messages placed on the queue.
[in] | queue | The handle to the queue to be deleted. |
void rtw_delete_task | ( | struct task_struct * | task | ) |
This function deletes a task.
[in] | task | The task stucture which will be deleted. |
int rtw_delete_worker_thread | ( | rtw_worker_thread_t * | worker_thread | ) |
This function deletes a worker thread.
[in] | worker_thread | The pointer to the worker thread stucture to be deleted. |
u32 rtw_down_sema | ( | _sema * | sema | ) |
This function acquires the semaphore. If no more tasks are allowed to acquire the semaphore, calling this function will put the task to sleep until the semaphore is up.
[in] | sema | The semaphore to be acquired. |
u32 rtw_down_timeout_sema | ( | _sema * | sema, |
u32 | timeout | ||
) |
This function acquires the semaphore. If no more tasks are allowed to acquire the semaphore, calling this function will put the task to sleep until the semaphore is up.
[in] | sema | The semaphore to be acquired. |
[in] | timeout | The time in ms to wait for the semaphore to become available. |
u32 rtw_end_of_queue_search | ( | _list * | queue, |
_list * | pelement | ||
) |
This function tests whether the "pelement" is at the "queue".
[in] | queue | The pointer to the queue that to be tested. |
[in] | pelement | The element that to be tested. |
void rtw_enter_critical | ( | _lock * | plock, |
_irqL * | pirqL | ||
) |
This function marks the start of a critical code region. Preemptive context switches cannot occur when in a critical region.
[in] | plock | Pointer to the spin lock semaphore. |
[in] | pirqL | Pointer to the IRQ. |
void rtw_enter_critical_bh | ( | _lock * | plock, |
_irqL * | pirqL | ||
) |
This function obtains a spin lock semaphore.
[in] | plock | Pointer to the spin lock semaphore being taken - obtained when the mutex semaphore was created. |
[in] | pirqL | Pointer to the IRQ. |
void rtw_enter_critical_from_isr | ( | _lock * | plock, |
_irqL * | pirqL | ||
) |
This function marks the start of a critical code region from isr.
[in] | plock | Pointer to the spin lock semaphore. |
[in] | pirqL | Pointer to the IRQ. |
int rtw_enter_critical_mutex | ( | _mutex * | pmutex, |
_irqL * | pirqL | ||
) |
This function obtains a semaphore.
[in] | pmutex | The handle to the mutex semaphore to be obtained. |
[in] | pirqL | Pointer to the IRQ. |
void rtw_exit_critical | ( | _lock * | plock, |
_irqL * | pirqL | ||
) |
This function marks end of a critical code region. Preemptive context switches cannot occur when in a critical region.
[in] | plock | Pointer to the spin lock semaphore. |
[in] | pirqL | Pointer to the IRQ. |
void rtw_exit_critical_bh | ( | _lock * | plock, |
_irqL * | pirqL | ||
) |
This function releases a spin lock semaphore.
[in] | plock | Pointer to the spin lock semaphore to be released. |
[in] | pirqL | Pointer to the IRQ. |
void rtw_exit_critical_from_isr | ( | _lock * | plock, |
_irqL * | pirqL | ||
) |
This function marks the end of a critical code region from isr.
[in] | plock | Pointer to the spin lock semaphore. |
[in] | pirqL | Pointer to the IRQ. |
void rtw_exit_critical_mutex | ( | _mutex * | pmutex, |
_irqL * | pirqL | ||
) |
This function releases a semaphore.
[in] | pmutex | The handle to the mutex semaphore to be released. |
[in] | pirqL | Pointer to the IRQ. |
void rtw_free_sema | ( | _sema * | sema | ) |
This function deletes the semaphore.
[in] | sema | The semaphore to be deleted. |
u32 rtw_get_current_time | ( | void | ) |
Get the count of ticks since the vTaskStartScheduler was called.
s32 rtw_get_passing_time_ms | ( | u32 | start | ) |
Get the passing time from the "start" in milliseconds.
[in] | start | The start time which is in system time format. |
int rtw_get_random_bytes | ( | void * | dst, |
u32 | size | ||
) |
This function generates random bytes.
[in] | dst | The pointer to the buffer to store the random bytes. |
[in] | size | The size of the random bytes. |
u8 rtw_get_scheduler_state | ( | void | ) |
This function gets the scheduler state of the calling thread.
s32 rtw_get_time_interval_ms | ( | u32 | start, |
u32 | end | ||
) |
Get the interval time from the "start" to "end" in milliseconds.
[in] | start | The start time which is in system time format. |
[in] | end | The end time which is in system time format. |
u32 rtw_getFreeHeapSize | ( | void | ) |
This function gets the available heap size.
void rtw_init_listhead | ( | _list * | list | ) |
This function initializes the head of the list.
[in] | list | Pointer to the list to be initialized. |
void rtw_init_queue | ( | _queue * | pqueue | ) |
This function creates a new queue instance.
[in] | pqueue | The handle to the newly created queue. |
void rtw_init_sema | ( | _sema * | sema, |
int | init_val | ||
) |
This function initializes the unnamed semaphore referred to by "sema" to the value "init_val".
[in] | sema | Pointer to the semaphore handle to be initialized. |
[in] | init_val | Initial value for semaphore. |
int rtw_init_xqueue | ( | _xqueue * | queue, |
const char * | name, | ||
u32 | message_size, | ||
u32 | number_of_messages | ||
) |
This function creates a new queue instance.
[in] | queue | The handle to the newly created queue. |
[in] | name | The name of the queue |
[in] | message_size | The number of bytes each message in the queue will require. |
[in] | number_of_messages | The maximum number of messages that kthe queue can contain. |
u32 rtw_is_list_empty | ( | _list * | phead | ) |
This function tests whether a list is empty.
[in] | phead | Pointer to the list to test. |
void rtw_list_delete | ( | _list * | plist | ) |
This function deletes entry from list and reinitialize it.
[in] | plist | The element to delete from the list. |
void rtw_list_insert_head | ( | _list * | plist, |
_list * | phead | ||
) |
This function adds a new entry after "phead" for the list.
[in] | plist | Pointer to the list to be added. |
[in] | phead | List head to add it after. |
void rtw_list_insert_tail | ( | _list * | plist, |
_list * | phead | ||
) |
This function adds a new entry before "phead" for the list.
[in] | plist | Pointer to the list to be added. |
[in] | phead | List head to add it before. |
u8* rtw_malloc | ( | u32 | sz | ) |
This function allocates the memory.
[in] | sz | The size of memory to be allocated. |
void* rtw_malloc2d | ( | int | h, |
int | w, | ||
int | size | ||
) |
This function allocates a 2 dimensional array memory.
[in] | h | The height of the 2D array. |
[in] | w | The width of the 2D array. |
[in] | size | The size of the each charactor in array. |
void rtw_mdelay_os | ( | int | ms | ) |
This function delays a task for the giving time in milliseconds.
[in] | ms | The amount of time, in milliseconds, that the calling task should block. |
int rtw_memcmp | ( | void * | dst, |
void * | src, | ||
u32 | sz | ||
) |
This function compares the first "sz" bytes of the block of memory pointed by "dst" to the first "sz" bytes pointed by "src".
[in] | dst | Pointer to block of memory to be compared. |
[in] | src | pointer to block of memory to compare. |
[in] | sz | Size of memory to compare. |
void rtw_memcpy | ( | void * | dst, |
void * | src, | ||
u32 | sz | ||
) |
This function copies the values of "sz" bytes from the location pointed to by "src" directly to the memory block pointed to by "des".
[in] | dst | Pointer to the destination array where the content is to be copied, type-casted to a pointer of type void*. |
[in] | src | Pointer to the source of data to be copied, type-casted to a pointer of type void*. |
[in] | sz | Size of memory to copy. |
void rtw_memset | ( | void * | pbuf, |
int | c, | ||
u32 | sz | ||
) |
This function sets the first "sz" bytes of the block of memory pointed by "pbuf" to the specified "c".
[in] | pbuf | Pointer to the block of memory to fill. |
[in] | c | Value to be set. |
[in] | sz | Size of memory to be set to the value "c". |
void rtw_mfree | ( | u8 * | pbuf, |
u32 | sz | ||
) |
This function frees the virtually contiguous memory.
[in] | pbuf | The pointer to the beginning of the memory to be free |
[in] | sz | The size of memory allocated. |
void rtw_mfree2d | ( | void * | pbuf, |
int | h, | ||
int | w, | ||
int | size | ||
) |
This function deallocates the block of memory previously allocated to make it available again.
[in] | pbuf | Pointer to a memory block previously allocated. |
[in] | h | The height of the 2D array. |
[in] | w | The width of the 2D array. |
[in] | size | The size of the each charactor in array. |
u32 rtw_ms_to_systime | ( | u32 | ms | ) |
Convert milliseconds to system time.
[in] | systime | The milliseconds to be converted. |
void rtw_msleep_os | ( | int | ms | ) |
This function suspends execution of the calling thread for "ms" milliseconds.
[in] | ms | The time that the function sleep in milliseconds |
void rtw_mutex_free | ( | _mutex * | pmutex | ) |
This function deletes the mutex semaphore.
[in] | pmutex | Pointer to the mutex semaphore to be deleted. |
void rtw_mutex_get | ( | _mutex * | pmutex | ) |
This function obtains a mutex semaphore.
[in] | pmutex | Pointer to the mutex semaphore being taken - obtained when the mutex semaphore was created. |
int rtw_mutex_get_timeout | ( | _mutex * | pmutex, |
u32 | timeout_ms | ||
) |
This function obtains a mutex semaphore with a timeout setting.
[in] | pmutex | Pointer to the mutex semaphore being taken - obtained when the mutex semaphore was created. |
[in] | timeout | The time in ms to wait for the semaphore to become available. |
void rtw_mutex_init | ( | _mutex * | pmutex | ) |
This function implements a mutex semaphore by using the existing queue mechanism.
[in] | pmutex | Pointer to the created mutex semaphore. |
void rtw_mutex_put | ( | _mutex * | pmutex | ) |
This function releases a mutex semaphore.
[in] | pmutex | Pointer to the mutex semaphore to be released. |
int rtw_pop_from_xqueue | ( | _xqueue * | queue, |
void * | message, | ||
u32 | timeout_ms | ||
) |
This function receives a message from a queue. The message is recieved by copy so a buffer adequate size must be provided.
[in] | queue | The handle to the queue from which the message is to be received. |
[in] | message | The pointer to the buffer into which the received message will be copied. |
[in] | timeout_ms | The maximum amout of time the task should block waiting for a message to receive should the queue be empty at the time of the call. The time is defined in ms. |
int rtw_push_to_xqueue | ( | _xqueue * | queue, |
void * | message, | ||
u32 | timeout_ms | ||
) |
This function posts a message to the back of a queue. The message is queued by copy, not by reference.
[in] | queue | The handle to the queue on which the message is to be posted. |
[in] | message | The pointer to the message that is to be placed on the queue. |
[in] | timeout_ms | The maximum amout of time the task should block waiting for the space to become available on the queue, should it already be full. The time is defined in ms. |
u32 rtw_queue_empty | ( | _queue * | pqueue | ) |
This function tests whether the queue is empty.
[in] | pqueue | The handle to the queue to be tested. |
void rtw_release_wakelock | ( | void | ) |
This function indicates that the WLAN does not need to stay on which means can go into power saving mode.
u32 rtw_sec_to_systime | ( | u32 | sec | ) |
Convert seconds to system time.
[in] | systime | The seconds to be converted. |
void rtw_spin_lock | ( | _lock * | plock | ) |
This function obtains a spin lock semaphore.
[in] | plock | Pointer to the spin lock semaphore being taken - obtained when the mutex semaphore was created. |
void rtw_spin_unlock | ( | _lock * | plock | ) |
This function releases a spin lock semaphore.
[in] | plock | Pointer to the spin lock semaphore to be released. |
void rtw_spinlock_free | ( | _lock * | plock | ) |
This function deletes the spin lock semaphore.
[in] | pmutex | Pointer to the spin lock semaphore to be deleted. |
void rtw_spinlock_init | ( | _lock * | plock | ) |
This function implements a spin lock semaphore by using the existing queue mechanism.
[in] | plock | Pointer to the created spin lock semaphore. |
void rtw_spinlock_irqsave | ( | _lock * | plock, |
_irqL * | irqL | ||
) |
This function marks the start of a critical code region and obtains a spin lock semaphore.
[in] | plock | Pointer to the spin lock semaphore being taken - obtained when the mutex semaphore was created. |
[in] | irqL | Pointer to the IRQ. |
void rtw_spinunlock_irqsave | ( | _lock * | plock, |
_irqL * | irqL | ||
) |
This function releases a spin lock semaphore and marks the end of a critical code region.
[in] | plock | Pointer to the spin lock semaphore to be released. |
[in] | irqL | Pointer to the IRQ. |
u32 rtw_systime_to_ms | ( | u32 | systime | ) |
Convert system time to milliseconds.
[in] | systime | The system time to be converted. |
u32 rtw_systime_to_sec | ( | u32 | systime | ) |
Convert system time to seconds.
[in] | systime | The system time to be converted. |
void rtw_thread_enter | ( | char * | name | ) |
This function prints the name of the thread in DBG_INFO.
[in] | name | The name of the thread. |
void rtw_thread_exit | ( | void | ) |
This function exits the calling thread.
u32 rtw_timerChangePeriod | ( | _timerHandle | xTimer, |
osdepTickType | xNewPeriod, | ||
osdepTickType | xBlockTime | ||
) |
This function changes the period of a timer that was previously created.
[in] | xTimer | The handle of the timer that is having its period changed. |
[in] | xNewPeriod | The new period for xTimer. |
[in] | xBlockTime | Specifies the time, in ticks, that the calling task should be held in the Blocked state to wait for the change period command to be successfully sent to the timer command queue, should the queue already be full when rtw_timerChangePeriod() was called. |
_timerHandle rtw_timerCreate | ( | const signed char * | pcTimerName, |
osdepTickType | xTimerPeriodInTicks, | ||
u32 | uxAutoReload, | ||
void * | pvTimerID, | ||
TIMER_FUN | pxCallbackFunction | ||
) |
This function creates a new software timer instance.
[in] | pcTimerName | A text name that is assigned to the timer. |
[in] | xTimerPeriodInTicks | The timer period which is defined in tick periods. |
[in] | uxAutoReload | If uxAutoReload is set to pdTRUE then the timer will expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter. If uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and enter the dormant state after it expires. |
[in] | pvTimerID | An identifier that is assigned to the timer being created. |
[in] | pxCallbackFunction | The function to call when the timer expires. |
u32 rtw_timerDelete | ( | _timerHandle | xTimer, |
osdepTickType | xBlockTime | ||
) |
This function deletes a timer that was previously created using rtw_timerCreate.
[in] | xTimer | The handle of the timer being deleted. |
[in] | xBlockTime | Specifies th etime, in ticks, that the calling task should be held in the Blocked State to wait for the delete command to be successfully sent to the timer command queue, should the queue already be full when rtw_timerDelete was called. |
u32 rtw_timerIsTimerActive | ( | _timerHandle | xTimer | ) |
This function queries a timer to see if it is active or dormant.
[in] | xTimer | The timer being queried. |
u32 rtw_timerStop | ( | _timerHandle | xTimer, |
osdepTickType | xBlockTime | ||
) |
This function stops a timer that was previously started.
[in] | xTimer | The handle of the timer being stopped. |
[in] | xBlockTime | Specifies the time, in ticks, that the calling task should be held in the Blocked state to wait for the stop command to be successfully sent to the timer command queue, should the queue already be full when rtw_timerStop() was called. |
void rtw_udelay_os | ( | int | us | ) |
This function delays a task for the giving time in microseconds.
[in] | ms | The amount of time, in microseconds, that the calling task should block. |
void rtw_up_sema | ( | _sema * | sema | ) |
This function releases the semaphore. This macro must not be used from an ISR.
[in] | sema | The semaphore to be released. |
void rtw_up_sema_from_isr | ( | _sema * | sema | ) |
This function releases the semaphore. This macro can be used from an ISR.
[in] | sema | The semaphore to be released. |
void rtw_usleep_os | ( | int | us | ) |
This function suspends execution of the calling thread for "us" microseconds.
[in] | ms | The time that the function sleep in microseconds |
u8* rtw_vmalloc | ( | u32 | sz | ) |
This function allocates the virtually contiguous memory.
[in] | sz | The size of memory to be allocated. |
void rtw_vmfree | ( | u8 * | pbuf, |
u32 | sz | ||
) |
This function frees the virtually contiguous memory.
[in] | pbuf | The pointer to the beginning of the memory to be free |
[in] | sz | The size of memory allocated. |
void rtw_wakeup_task | ( | struct task_struct * | task | ) |
This function wake up a task.
[in] | task | The task stucture which will be waked up. |
void rtw_yield_os | ( | void | ) |
This function for forcing a context switch.
u8* rtw_zmalloc | ( | u32 | sz | ) |
This function allocates the memory and the values of the memory are setted to 0.
[in] | sz | The size of memory to be allocated. |
u8* rtw_zvmalloc | ( | u32 | sz | ) |
This function allocates the virtually contiguous memory and the values of the memory are setted to 0.
[in] | sz | The size of memory to be allocated. |