Copyright (c) 2016-2018 Microchip Technology Inc.
and its subsidiaries.
#include <os/include/os_hook.h>
#include <FreeRTOS.h>
#include <queue.h>
#include <semphr.h>
#include <task.h>
#include <lwip/tcpip.h>
Functions | |
uint8_t | m2m_wifi_handle_events (void *p) |
static void | os_hif_task (void *pv) |
HIF thread entry function. More... | |
uint8_t | os_hook_dispatch_no_wait (wifi_task_cb handler, void *p) |
Run handler function in the netif thread context and return immediately. More... | |
void | os_hook_dispatch_wait (wifi_task_cb handler, struct params_dispatch *p, void *pv) |
Run handler function in the netif thread context and wait for function return. More... | |
void | os_hook_init (void) |
Initialize netif thread. More... | |
void | os_hook_isr (void) |
Put interrupt request in netif queue for later processing. More... | |
void | os_hook_notify (void) |
Release lock to notify calling thread that netif job is done. More... | |
void | os_hook_send_start (wifi_task_cb handler, struct params_dispatch *p, void *pv) |
Start WiFi in the netif thread context and wait for function return. More... | |
void | os_hook_set_handle (void *task) |
void | wilc_netif_tx_from_queue (hif_msg_t *msg) |
Send pending packets to the WILC under HIF thread context. More... | |
Variables | |
static uint8_t | has_init = 0 |
static xSemaphoreHandle | hif_notify_sem |
xQueueHandle | hif_queue = NULL |
Queue used by HIF task. More... | |
xTaskHandle | hif_thread |
uint8_t m2m_wifi_handle_events | ( | void * | arg | ) |
HIF thread entry function.
References hif_msg_t::handler, hif_queue, hif_msg_t::id, m2m_wifi_handle_events(), MSG_CMD, MSG_RX, MSG_START, MSG_TX_AP, MSG_TX_STA, NULL, osprintf(), pdFALSE, hif_msg_t::priv, wilc_netif_tx_from_queue(), and xQueueReceive.
Referenced by os_hook_init().
uint8_t os_hook_dispatch_no_wait | ( | wifi_task_cb | handler, |
void * | p | ||
) |
Run handler function in the netif thread context and return immediately.
References hif_msg_t::handler, hif_queue, hif_thread, hif_msg_t::id, MSG_CMD, hif_msg_t::priv, xQueueSend, and xTaskGetCurrentTaskHandle().
void os_hook_dispatch_wait | ( | wifi_task_cb | handler, |
struct params_dispatch * | p, | ||
void * | pv | ||
) |
Run handler function in the netif thread context and wait for function return.
References hif_msg_t::handler, hif_notify_sem, hif_queue, hif_thread, hif_msg_t::id, MSG_CMD, hif_msg_t::priv, params_dispatch::signal_semaphore, xQueueSend, xSemaphoreTake, and xTaskGetCurrentTaskHandle().
Initialize netif thread.
References configMAX_PRIORITIES, has_init, hif_notify_sem, hif_queue, hif_thread, NULL, os_hif_task(), vSemaphoreCreateBinary, xQueueCreate, xSemaphoreTake, and xTaskCreate.
Referenced by os_m2m_wifi_init().
Put interrupt request in netif queue for later processing.
References hif_queue, hif_msg_t::id, MSG_RX, NULL, osprintf(), hif_msg_t::payload, hif_msg_t::payload_size, hif_msg_t::pbuf, pdFALSE, pdTRUE, and xQueueSendFromISR.
Release lock to notify calling thread that netif job is done.
References hif_notify_sem, and xSemaphoreGive.
Referenced by os_m2m_wifi_connect_imp(), os_m2m_wifi_enable_ap_imp(), os_m2m_wifi_init_imp(), and os_m2m_wifi_set_max_tx_rate_imp().
void os_hook_send_start | ( | wifi_task_cb | handler, |
struct params_dispatch * | p, | ||
void * | pv | ||
) |
Start WiFi in the netif thread context and wait for function return.
References hif_msg_t::handler, hif_notify_sem, hif_queue, hif_msg_t::id, MSG_START, hif_msg_t::priv, params_dispatch::signal_semaphore, xQueueSend, and xSemaphoreTake.
Referenced by os_m2m_wifi_init().
References hif_thread.
Referenced by os_m2m_wifi_init_imp().
Send pending packets to the WILC under HIF thread context.
References AP_INTERFACE, hif_msg_t::id, M2M_SUCCESS, m2m_wifi_send_ethernet_pkt(), MSG_TX_STA, hif_msg_t::payload, hif_msg_t::payload_size, hif_msg_t::pbuf, pbuf_free(), STATION_INTERFACE, and vTaskDelay().
Referenced by os_hif_task().
|
static |
Referenced by os_hook_init().
|
static |
Referenced by os_hook_dispatch_wait(), os_hook_init(), os_hook_notify(), and os_hook_send_start().
xQueueHandle hif_queue = NULL |
Queue used by HIF task.
Referenced by os_hif_task(), os_hook_dispatch_no_wait(), os_hook_dispatch_wait(), os_hook_init(), os_hook_isr(), os_hook_send_start(), and wilc_netif_tx().
xTaskHandle hif_thread |
Referenced by os_hook_dispatch_no_wait(), os_hook_dispatch_wait(), os_hook_init(), and os_hook_set_handle().