[X]关闭

关于zynq的lwip初始化的疑问

文档创建者:樊yj
浏览次数:5424
最后更新:2019-10-09
F:\TIM图片20191009124135.png
我现在的打开的是sdk自带的lwip echo例程,如图,添加网络接口这个函数里面的宏定义都是灰的,那这个函数岂不是什么都没做?另外,我还找不到对硬件初始化的地方,哪个好心朋友能给我解答下

发表评论已发布 4

樊yj

发表于 2019-10-9 12:47:15 | 显示全部楼层

图片怎么上传啊

樊yj

发表于 2019-10-9 12:49:27 | 显示全部楼层

这个函数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[i] = mac_ethernet_address[i];

        /* 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-9 12:56:39 | 显示全部楼层

xemac_add

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

uisrc

发表于 2019-10-9 16:12:54 | 显示全部楼层

因为没有用到,灰色的部分,是其他功能的,通过宏定义可以切换功能。比如EMIO模式扩展以太网,AXI-ETH方式扩展以太网
越努力越幸运!加油!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则