Lines Matching defs:netif
35 * This file is built upon the file: src/arch/rtxc/netif/sioslip.c
46 * This is an arch independent SLIP netif. The specific serial hooks must be
49 * Usage: This netif can be used in three ways:\n
53 * completed packets are fed into netif->input().\n
62 #include "netif/slipif.h"
77 /** Maximum packet size that is received by this netif */
111 * @param netif the lwip network interface structure for this slipif
116 slipif_output(struct netif *netif, struct pbuf *p)
123 LWIP_ASSERT("netif != NULL", (netif != NULL));
124 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
128 priv = (struct slipif_priv *)netif->state;
166 * @param netif the lwip network interface structure for this slipif
172 slipif_output_v4(struct netif *netif, struct pbuf *p, const ip4_addr_t *ipaddr)
175 return slipif_output(netif, p);
185 * @param netif the lwip network interface structure for this slipif
191 slipif_output_v6(struct netif *netif, struct pbuf *p, const ip6_addr_t *ipaddr)
194 return slipif_output(netif, p);
201 * @param netif the lwip network interface structure for this slipif
207 slipif_rxbyte(struct netif *netif, u8_t c)
212 LWIP_ASSERT("netif != NULL", (netif != NULL));
213 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
215 priv = (struct slipif_priv *)netif->state;
304 /** Like slipif_rxbyte, but passes completed packets to netif->input
306 * @param netif The lwip network interface structure for this slipif
310 slipif_rxbyte_input(struct netif *netif, u8_t c)
313 p = slipif_rxbyte(netif, c);
315 if (netif->input(p, netif) != ERR_OK) {
333 struct netif *netif = (struct netif *)nf;
334 struct slipif_priv *priv = (struct slipif_priv *)netif->state;
338 slipif_rxbyte_input(netif, c);
346 * SLIP netif initialization
349 * the opened device in the state field of the netif.
351 * @param netif the lwip network interface structure for this slipif
356 * @note If netif->state is interpreted as an u8_t serial port number.
360 slipif_init(struct netif *netif)
365 LWIP_ASSERT("slipif needs an input callback", netif->input != NULL);
367 /* netif->state contains serial port number */
368 sio_num = LWIP_PTR_NUMERIC_CAST(u8_t, netif->state);
370 LWIP_DEBUGF(SLIP_DEBUG, ("slipif_init: netif->num=%"U16_F"\n", (u16_t)sio_num));
378 netif->name[0] = 's';
379 netif->name[1] = 'l';
381 netif->output = slipif_output_v4;
384 netif->output_ip6 = slipif_output_v6;
386 netif->mtu = SLIP_MAX_SIZE;
406 netif->state = priv;
408 /* initialize the snmp variables and counters inside the struct netif */
409 MIB2_INIT_NETIF(netif, snmp_ifType_slip, SLIP_SIO_SPEED(priv->sd));
413 sys_thread_new(SLIPIF_THREAD_NAME, slipif_loop_thread, netif,
423 * @param netif The lwip network interface structure for this slipif
426 slipif_poll(struct netif *netif)
431 LWIP_ASSERT("netif != NULL", (netif != NULL));
432 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
434 priv = (struct slipif_priv *)netif->state;
437 slipif_rxbyte_input(netif, c);
446 * @param netif The lwip network interface structure for this slipif
449 slipif_process_rxqueue(struct netif *netif)
454 LWIP_ASSERT("netif != NULL", (netif != NULL));
455 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
457 priv = (struct slipif_priv *)netif->state;
474 if (netif->input(p, netif) != ERR_OK) {
484 * @param netif The lwip network interface structure for this slipif
488 slipif_rxbyte_enqueue(struct netif *netif, u8_t data)
491 struct slipif_priv *priv = (struct slipif_priv *)netif->state;
494 p = slipif_rxbyte(netif, data);
524 * @param netif The lwip network interface structure for this slipif
528 slipif_received_byte(struct netif *netif, u8_t data)
530 LWIP_ASSERT("netif != NULL", (netif != NULL));
531 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
532 slipif_rxbyte_enqueue(netif, data);
542 * @param netif The lwip network interface structure for this slipif
547 slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len)
551 LWIP_ASSERT("netif != NULL", (netif != NULL));
552 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
555 slipif_rxbyte_enqueue(netif, *rxdata);