Support double lwip eport, use mongoose.a

This commit is contained in:
TXuian
2023-12-06 15:59:27 +08:00
parent e0e314e301
commit 616dc4584f
41 changed files with 417 additions and 10941 deletions
@@ -15,4 +15,8 @@ ifeq ($(CONFIG_RESOURCES_LWIP), y)
export LINK_LWIP := $(KERNEL_ROOT)/resources/ethernet/LwIP/liblwip.a
endif
ifeq ($(CONFIG_USE_MONGOOSE), y)
export LINK_MONGOOSE := $(KERNEL_ROOT)/../../APP_Framework/Applications/mongoose/mongoose.a
endif
export ARCH = arm
@@ -277,10 +277,7 @@ struct pbuf* low_level_input(struct netif* netif)
return p;
}
extern void LwipSetIPTest(int argc, char* argv[]);
int HwEthInit(void)
{
// lwip_config_tcp(0, lwip_ipaddr, lwip_netmask, lwip_gwaddr);
LwipSetIPTest(1, NULL);
return EOK;
}
@@ -76,6 +76,7 @@ static int lwip_netdev_set_addr_info(struct netdev* netdev, ip_addr_t* ip_addr,
netif_set_gw((struct netif*)netdev->user_data, ip_2_ip4(gw));
}
}
return 0;
}
#ifdef LWIP_DNS
@@ -92,7 +93,7 @@ static int lwip_netdev_set_dns_server(struct netdev* netdev, uint8_t dns_num, ip
}
#endif
#ifdef LWIP_DHCP
#if LWIP_DHCP
static int lwip_netdev_set_dhcp(struct netdev* netdev, bool is_enabled)
{
netdev_low_level_set_dhcp_status(netdev, is_enabled);
@@ -120,7 +121,7 @@ static const struct netdev_ops lwip_netdev_ops = {
#ifdef LWIP_DNS
.set_dns_server = lwip_netdev_set_dns_server,
#endif
#ifdef LWIP_DHCP
#if LWIP_DHCP
.set_dhcp = lwip_netdev_set_dhcp,
#endif
.set_default = lwip_netdev_set_default,
@@ -183,9 +184,9 @@ int lwip_netdev_add(struct netif* lwip_netif)
netdev->ops = &lwip_netdev_ops;
netdev->hwaddr_len = lwip_netif->hwaddr_len;
memcpy(netdev->hwaddr, lwip_netif->hwaddr, lwip_netif->hwaddr_len);
netdev->ip_addr = lwip_netif->ip_addr;
netdev->gw = lwip_netif->gw;
netdev->netmask = lwip_netif->netmask;
netdev->ip_addr = &lwip_netif->ip_addr;
netdev->gw = &lwip_netif->gw;
netdev->netmask = &lwip_netif->netmask;
return result;
}
@@ -204,7 +204,6 @@ void ethernetif_input(void* netif_arg)
/* Move received packet into a new pbuf */
while (1) {
sys_arch_sem_wait(get_eth_recv_sem(), WAITING_FOREVER);
KPrintf("%s -->\n", netif->name);
while (1) {
p = low_level_input(netif);
#ifndef ETHERNET_LOOPBACK_TEST
@@ -113,7 +113,6 @@ void ethernetif_input2(void* netif_arg)
struct pbuf* p = NULL;
for (;;) {
sys_arch_sem_wait(get_eth_recv_sem2(), WAITING_FOREVER);
KPrintf("%s -->\n", netif->name);
sys_mutex_lock(&wiz_trans_mtx);
while (1) {