Microchip® Advanced Software Framework

winc_netif.c File Reference

winc Network Interface Driver for lwIP.

Copyright (c) 2019 Microchip Technology Inc. and its subsidiaries.

#include <lwip/opt.h>
#include <lwip/def.h>
#include <lwip/mem.h>
#include <lwip/pbuf.h>
#include <lwip/sys.h>
#include <lwip/ethip6.h>
#include <lwip/stats.h>
#include <lwip/snmp.h>
#include <lwip/tcpip.h>
#include <netif/etharp.h>
#include <winc_netif.h>
#include <sysclk.h>
#include <string.h>
#include <semphr.h>
#include <m2m_wifi_ex.h>
#include <net_init.h>
#include <os_hook.h>

Macros

#define IFNAME0   'e'
 Define those to better describe your network interface. More...
 
#define IFNAME1   'n'
 
#define NET_LINK_SPEED   100000000
 Network link speed. More...
 
#define NET_MTU   1500
 Maximum transfer unit. More...
 
#define WINC_RX_BUF_SZ   (PBUF_POOL_BUFSIZE - ETH_PAD_SIZE)
 
#define WINC_TX_BUF_SIZE   (1536)
 

Functions

void winc_fill_callback_info (tstrEthInitParam *info)
 Configure RX callback and buffer. More...
 
err_t winc_netif_init (struct netif *netif)
 Initialize lwIP network interface. More...
 
static void winc_netif_low_level_init (struct netif *netif)
 Perform low level initialization of the netif driver. More...
 
void winc_netif_rx_callback (uint8 msg_type, void *msg, void *ctrl_buf)
 Receive packets from the winc under HIF thread context. More...
 
static err_t winc_netif_tx (struct netif *netif, struct pbuf *p)
 Send packet from lwIP to HIF task for processing. More...
 
void winc_netif_tx_from_queue (hif_msg_t *msg)
 Send pending packets to the winc under HIF thread context. More...
 

Variables

xQueueHandle hif_queue
 Queue used by HIF task. More...
 
uint32_t os_hif_task_msg_post_counter
 
static uint8_t rx_buf [WINC_RX_BUF_SZ]
 
static struct pbufrx_first
 
static struct pbufrx_last
 
static uint8_t tx_buf [WINC_TX_BUF_SIZE]
 
struct netif winc_netif_c_mode
 The netif for the winc1000 in concurrent (AP or WiFi Direct) mode. More...
 
struct netif winc_netif_sta
 The netif for the winc1000 in station mode. More...
 

#define IFNAME0   'e'

Define those to better describe your network interface.

Referenced by winc_netif_init().

#define IFNAME1   'n'

Referenced by winc_netif_init().

#define NET_LINK_SPEED   100000000

Network link speed.

Referenced by winc_netif_init().

#define NET_MTU   1500

Maximum transfer unit.

Referenced by winc_netif_low_level_init().

#define WINC_RX_BUF_SZ   (PBUF_POOL_BUFSIZE - ETH_PAD_SIZE)
#define WINC_TX_BUF_SIZE   (1536)

Referenced by winc_netif_tx().

static void winc_netif_low_level_init ( struct netif netif)
static

Perform low level initialization of the netif driver.

References netif::flags, netif::hwaddr, netif::hwaddr_len, m2m_wifi_get_mac_address(), netif::mtu, NET_MTU, NETIF_FLAG_BROADCAST, NETIF_FLAG_ETHARP, and NETIF_FLAG_IGMP.

Referenced by winc_netif_init().

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().

xQueueHandle hif_queue

Queue used by HIF task.

uint32_t os_hif_task_msg_post_counter
uint8_t rx_buf[WINC_RX_BUF_SZ]
static
struct pbuf* rx_first
static
struct pbuf* rx_last
static
uint8_t tx_buf[WINC_TX_BUF_SIZE]
static

Referenced by winc_netif_tx().

struct netif winc_netif_c_mode

The netif for the winc1000 in concurrent (AP or WiFi Direct) mode.

Referenced by net_add_winc_netif(), net_interface_down_imp(), net_interface_up_imp(), and net_remove_winc_netif().

struct netif winc_netif_sta