Copyright (c) 2019 Microchip Technology Inc.
and its subsidiaries.
#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) |
Synchronous M2M event handler function. More... | |
static void | os_hif_task (void *pv) |
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 | winc_netif_tx_from_queue (hif_msg_t *msg) |
Send pending packets to the winc under HIF thread context. More... | |
Variables | |
uint8_t | g_WifiConnSent |
static uint8_t | has_init = 0 |
static xSemaphoreHandle | hif_notify_sem |
xQueueHandle | hif_queue = NULL |
Queue used by HIF task. More... | |
xTaskHandle | hif_thread |
uint32_t | os_hif_task_counter |
HIF thread entry function. More... | |
uint32_t | os_hif_task_false_intrpt_counter |
uint32_t | os_hif_task_msg_post_counter |
uint32_t | os_hif_task_msg_post_counter_rx |
uint32_t | os_hif_task_msg_rec_counter |
uint32_t | os_hif_task_set_rx_done_counter |
|
static |
References hif_msg_t::handler, hif_msg_t::id, m2m_wifi_handle_events(), MSG_CMD, MSG_RX, MSG_START, MSG_TX_AP, MSG_TX_STA, NULL, os_hif_task_counter, os_hif_task_msg_rec_counter, osprintf(), pdFALSE, hif_msg_t::priv, winc_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_thread, hif_msg_t::id, MSG_CMD, os_hif_task_msg_post_counter, 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_thread, hif_msg_t::id, MSG_CMD, os_hif_task_msg_post_counter, hif_msg_t::priv, params_dispatch::signal_semaphore, xQueueSend, xSemaphoreTake, and xTaskGetCurrentTaskHandle().
void os_hook_init | ( | void | ) |
Initialize netif thread.
References configMAX_PRIORITIES, has_init, hif_thread, NULL, os_hif_task(), vSemaphoreCreateBinary, xQueueCreate, xSemaphoreTake, and xTaskCreate.
void os_hook_isr | ( | void | ) |
Put interrupt request in netif queue for later processing.
References hif_msg_t::id, MSG_RX, NULL, os_hif_task_msg_post_counter_rx, osprintf(), hif_msg_t::payload, hif_msg_t::payload_size, hif_msg_t::pbuf, pdFALSE, pdTRUE, and xQueueSendFromISR.
void os_hook_notify | ( | void | ) |
Release lock to notify calling thread that netif job is done.
References xSemaphoreGive.
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_msg_t::id, MSG_START, os_hif_task_msg_post_counter, hif_msg_t::priv, params_dispatch::signal_semaphore, xQueueSend, and xSemaphoreTake.
void os_hook_set_handle | ( | void * | task | ) |
References hif_thread.
void winc_netif_tx_from_queue | ( | hif_msg_t * | msg | ) |
Send pending packets to the winc under HIF thread context.
References pbuf::len, M2M_SUCCESS, m2m_wifi_send_ethernet_pkt(), hif_msg_t::payload, pbuf::payload, hif_msg_t::payload_size, hif_msg_t::pbuf, pbuf_free(), and vTaskDelay().
Referenced by os_hif_task().
uint8_t g_WifiConnSent |
|
static |
Referenced by os_hook_init().
|
static |
xQueueHandle hif_queue = NULL |
Queue used by HIF task.
xTaskHandle hif_thread |
uint32_t os_hif_task_counter |
HIF thread entry function.
Referenced by os_hif_task().
uint32_t os_hif_task_false_intrpt_counter |
uint32_t os_hif_task_msg_post_counter |
Referenced by os_hook_dispatch_no_wait(), os_hook_dispatch_wait(), os_hook_send_start(), and winc_netif_tx().
uint32_t os_hif_task_msg_post_counter_rx |
Referenced by os_hook_isr().
uint32_t os_hif_task_msg_rec_counter |
Referenced by os_hif_task().
uint32_t os_hif_task_set_rx_done_counter |