Lines Matching refs:netif
35 * This file is built upon the file: src/arch/rtxc/netif/sioslip.c
40 * Usage: This netif can be used in three ways:
44 * completed packets are fed into netif->input().
54 * This is an arch independent SLIP netif. The specific serial hooks must be
58 #include "netif/slipif.h"
75 /** Maximum packet size that is received by this netif */
109 * @param netif the lwip network interface structure for this slipif
115 slipif_output(struct netif *netif, struct pbuf *p, ip_addr_t *ipaddr)
122 LWIP_ASSERT("netif != NULL", (netif != NULL));
123 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
128 LWIP_DEBUGF(SLIP_DEBUG, ("slipif_output(%"U16_F"): sending %"U16_F" bytes\n", (u16_t)netif->num, p->tot_len));
129 priv = netif->state;
164 * @param netif the lwip network interface structure for this slipif
170 slipif_rxbyte(struct netif *netif, u8_t c)
175 LWIP_ASSERT("netif != NULL", (netif != NULL));
176 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
178 priv = netif->state;
261 /** Like slipif_rxbyte, but passes completed packets to netif->input
263 * @param netif The lwip network interface structure for this slipif
267 slipif_rxbyte_input(struct netif *netif, u8_t c)
270 p = slipif_rxbyte(netif, c);
272 if (netif->input(p, netif) != ERR_OK) {
290 struct netif *netif = (struct netif *)nf;
291 struct slipif_priv *priv = (struct slipif_priv *)netif->state;
295 slipif_rxbyte_input(netif, c);
302 * SLIP netif initialization
305 * the opened device in the state field of the netif.
307 * @param netif the lwip network interface structure for this slipif
312 * @note netif->num must contain the number of the serial port to open
313 * (0 by default). If netif->state is != NULL, it is interpreted as an
314 * u8_t pointer pointing to the serial port number instead of netif->num.
318 slipif_init(struct netif *netif)
323 LWIP_DEBUGF(SLIP_DEBUG, ("slipif_init: netif->num=%"U16_F"\n", (u16_t)netif->num));
331 netif->name[0] = 's';
332 netif->name[1] = 'l';
333 netif->output = slipif_output;
334 netif->mtu = SLIP_MAX_SIZE;
335 netif->flags |= NETIF_FLAG_POINTTOPOINT;
337 /* netif->state or netif->num contain the port number */
338 if (netif->state != NULL) {
339 sio_num = *(u8_t*)netif->state;
341 sio_num = netif->num;
361 netif->state = priv;
363 /* initialize the snmp variables and counters inside the struct netif */
364 NETIF_INIT_SNMP(netif, snmp_ifType_slip, SLIP_SIO_SPEED(priv->sd));
368 sys_thread_new(SLIPIF_THREAD_NAME, slipif_loop_thread, netif,
377 * @param netif The lwip network interface structure for this slipif
380 slipif_poll(struct netif *netif)
385 LWIP_ASSERT("netif != NULL", (netif != NULL));
386 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
388 priv = (struct slipif_priv *)netif->state;
391 slipif_rxbyte_input(netif, c);
399 * @param netif The lwip network interface structure for this slipif
402 slipif_process_rxqueue(struct netif *netif)
407 LWIP_ASSERT("netif != NULL", (netif != NULL));
408 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
410 priv = (struct slipif_priv *)netif->state;
427 if (netif->input(p, netif) != ERR_OK) {
436 * @param netif The lwip network interface structure for this slipif
440 slipif_rxbyte_enqueue(struct netif *netif, u8_t data)
443 struct slipif_priv *priv = (struct slipif_priv *)netif->state;
446 p = slipif_rxbyte(netif, data);
475 * @param netif The lwip network interface structure for this slipif
479 slipif_received_byte(struct netif *netif, u8_t data)
481 LWIP_ASSERT("netif != NULL", (netif != NULL));
482 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
483 slipif_rxbyte_enqueue(netif, data);
492 * @param netif The lwip network interface structure for this slipif
497 slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len)
501 LWIP_ASSERT("netif != NULL", (netif != NULL));
502 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
505 slipif_rxbyte_enqueue(netif, *rxdata);