我现在的打开的是sdk自带的lwip echo例程,如图,添加网络接口这个函数里面的宏定义都是灰的,那这个函数岂不是什么都没做?另外,我还找不到对硬件初始化的地方,哪个好心朋友能给我解答下
我现在的打开的是sdk自带的lwip echo例程,如图,添加网络接口这个函数里面的宏定义都是灰的,那这个函数岂不是什么都没做?另外,我还找不到对硬件初始化的地方,哪个好心朋友能给我解答下
首页 / AMD-FPGA / 帖子
图片怎么上传啊
这个函数switch里面的宏定义都是灰的
struct netif *
xemac_add(struct netif *netif,
struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw,
unsigned char *mac_ethernet_address,
unsigned mac_baseaddr)
{
int i;
/* set mac address */
netif->hwaddr_len = 6;
for (i = 0; i < 6; i++)
netif->hwaddr = mac_ethernet_address;
/* initialize based on MAC type */
switch (find_mac_type(mac_baseaddr)) {
case xemac_type_xps_emaclite:
#ifdef XLWIP_CONFIG_INCLUDE_EMACLITE
return netif_add(netif, ipaddr, netmask, gw,
(void*)(UINTPTR)mac_baseaddr,
xemacliteif_init,
#if NO_SYS
ethernet_input
#else
tcpip_input
#endif
);
#else
return NULL;
#endif
case xemac_type_axi_ethernet:
#ifdef XLWIP_CONFIG_INCLUDE_AXI_ETHERNET
return netif_add(netif, ipaddr, netmask, gw,
(void*)(UINTPTR)mac_baseaddr,
xaxiemacif_init,
#if NO_SYS
ethernet_input
#else
tcpip_input
#endif
);
#else
return NULL;
#endif
#if defined (__arm__) || defined (__aarch64__)
case xemac_type_emacps:
#ifdef XLWIP_CONFIG_INCLUDE_GEM
return netif_add(netif, ipaddr, netmask, gw,
(void*)(UINTPTR)mac_baseaddr,
xemacpsif_init,
#if NO_SYS
ethernet_input
#else
tcpip_input
#endif
);
#endif
#endif
default:
xil_printf("unable to determine type of EMAC with baseaddress 0x%08x\r\n",
mac_baseaddr);
return NULL;
}
}
xemac_add
因为没有用到,灰色的部分,是其他功能的,通过宏定义可以切换功能。比如EMIO模式扩展以太网,AXI-ETH方式扩展以太网