Lines Matching defs:netif

63 /* kernel changed lwip 'netif->client_data' size, so this should be prior */
67 #include "lwip/netif.h"
145 struct netif *netif = dev;
146 struct VirtNetif *nic = netif->state;
155 netif->mtu = conf->mtu;
158 netif->mtu = ETH_DATA_LEN;
163 netif->hwaddr[i] = conf->mac[i];
165 netif->hwaddr_len = ETHARP_HWADDR_LEN;
345 static err_t LowLevelOutput(struct netif *netif, struct pbuf *p)
349 struct VirtNetif *nic = netif->state;
393 static struct pbuf *LowLevelInput(const struct netif *netif, const struct VirtqUsedElem *e)
395 struct VirtNetif *nic = netif->state;
419 static void VirtnetRxHandle(struct netif *netif)
421 struct VirtNetif *nic = netif->state;
440 buf = LowLevelInput(netif, e);
441 if (netif->input(buf, netif) != ERR_OK) {
468 struct netif *netif = (struct netif *)param;
469 struct VirtNetif *nic = netif->state;
475 VirtnetRxHandle(netif);
482 static err_t LowLevelInit(struct netif *netif)
484 struct VirtNetif *nic = netif->state;
493 if (!VirtmmioNegotiate(&nic->dev, Feature0, Feature1, netif)) {
502 if (!VirtmmioRegisterIRQ(&nic->dev, (HWI_PROC_FUNC)VirtnetIRQhandle, netif, VIRTMMIO_NETIF_NAME)) {
519 static err_t EthernetIfInit(struct netif *netif)
523 LWIP_ASSERT("netif != NULL", (netif != NULL));
530 netif->state = nic;
533 netif->hostname = VIRTMMIO_NETIF_NAME;
536 strncpy_s(netif->name, sizeof(netif->name), VIRTMMIO_NETIF_NICK, sizeof(netif->name));
537 strncpy_s(netif->full_name, sizeof(netif->full_name), VIRTMMIO_NETIF_NICK, sizeof(netif->full_name));
539 netif->output = etharp_output;
540 netif->linkoutput = LowLevelOutput;
542 netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP;
544 return LowLevelInit(netif);
547 static void VirtnetDeInit(struct netif *netif)
549 struct VirtNetif *nic = netif->state;
566 mem_free(netif);
569 struct netif *VirtnetInit(void)
572 struct netif *netif = NULL;
574 netif = mem_calloc(1, sizeof(struct netif));
575 if (netif == NULL) {
576 PRINT_ERR("alloc netif memory failed\n");
583 if (netif_add(netif, &ip, &mask, &gw, netif->state,
586 VirtnetDeInit(netif);
590 return netif;