首页 / AMD-FPGA / 帖子

关于zynq的lwip初始化的疑问

作者 樊yj 2019-10-09 13033 次浏览 4 条回复 论坛存档
樊
樊yj
2019-10-09
楼主
F:\TIM图片20191009124135.png
$ ]' Y' i2 f2 L' h, L. E我现在的打开的是sdk自带的lwip echo例程,如图,添加网络接口这个函数里面的宏定义都是灰的,那这个函数岂不是什么都没做?另外,我还找不到对硬件初始化的地方,哪个好心朋友能给我解答下
樊
樊yj
2019-10-09
#1

图片怎么上传啊

樊
樊yj
2019-10-09
#2

这个函数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;

}

}

樊
樊yj
2019-10-09
#3

xemac_add

uisrc
uisrc
2019-10-09
#4

因为没有用到,灰色的部分,是其他功能的,通过宏定义可以切换功能。比如EMIO模式扩展以太网,AXI-ETH方式扩展以太网

这是论坛时期的原帖存档,只读。新的讨论请到 提问, 沉淀下来的内容会进 知识库 和 方案库。