23/07/27 1.Add netdev module and for edu-arm32, fit Lwip to it; 2.Fit Webnet to edu-arm32;

This commit is contained in:
涂煜洋
2023-07-27 15:05:50 +08:00
parent 1a6ee0234b
commit 0307fb2671
29 changed files with 1884 additions and 627 deletions
@@ -1,40 +1,39 @@
/*
* Copyright (c) 2021 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
* Copyright (c) 2021 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file connect_ethernet.h
* @brief Adapted network software protocol stack and hardware operation functions
* @version 2.0
* @author AIIT XUOS Lab
* @date 2022-12-05
*/
* @file connect_ethernet.h
* @brief Adapted network software protocol stack and hardware operation functions
* @version 2.0
* @author AIIT XUOS Lab
* @date 2022-12-05
*/
#ifndef CONNECT_ETHERNET_H
#define CONNECT_ETHERNET_H
#include "hardware_ethernetif.h"
#include <sys_arch.h>
#include <hc32_ll_eth.h>
#include <hardware_irq.h>
#include <hc32_ll_eth.h>
#include <sys_arch.h>
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
struct hc32_irq_config
{
IRQn_Type irq_num;
uint32_t irq_prio;
en_int_src_t int_src;
struct hc32_irq_config {
IRQn_Type irq_num;
uint32_t irq_prio;
en_int_src_t int_src;
};
/* Global Ethernet handle*/
@@ -52,22 +51,23 @@ __ALIGN_BEGIN static uint8_t EthRxBuff[ETH_RX_BUF_NUM][ETH_RX_BUF_SIZE];
static uint8_t u8PhyLinkStatus = 0U, u8EthInitStatus = 0U;
static struct Hc32IrqConfig eth_irq_config = {
.irq_num = BSP_ETH_IRQ_NUM,
.irq_prio = BSP_ETH_IRQ_PRIO,
.int_src = INT_SRC_ETH_GLB_INT,
.irq_num = BSP_ETH_IRQ_NUM,
.irq_prio = BSP_ETH_IRQ_PRIO,
.int_src = INT_SRC_ETH_GLB_INT,
};
void Ethernet_GpioInit(void);
int32_t low_level_init(struct netif *netif);
err_t low_level_output(struct netif *netif, struct pbuf *p);
struct pbuf *low_level_input(struct netif *netif);
int32_t low_level_init(struct netif* netif);
err_t low_level_output(struct netif* netif, struct pbuf* p);
struct pbuf* low_level_input(struct netif* netif);
int lwip_netdev_add(struct netif* lwip_netif);
void lwip_netdev_del(struct netif* lwip_netif);
int HwEthInit(void);
#ifdef __cplusplus
}
#endif
#endif