嵌入式爱好者

查看: 10864|回复: 2

[Linux] 内核添加“802.1Q VLAN Support”后,内核编译错误

[复制链接]

3

主题

14

帖子

42

积分

XX18通行证

扫一扫,手机访问本帖
发表于 2021-7-17 17:48:32 | 显示全部楼层 |阅读模式
我买的是S5P6818-C2,因为需要用到VLAN,所以我在内核中增加了“802.1Q  VLAN Support”
但编译的时候,出现一下错误,麻烦大侠帮忙分析一下  CC      drivers/net/ethernet/nexell/nxpmac/nxpmac_main.o
drivers/net/ethernet/nexell/nxpmac/nxpmac_main.c: In function ‘stmmac_dvr_probe’:
drivers/net/ethernet/nexell/nxpmac/nxpmac_main.c:3315:20: error: ‘NETIF_F_HW_VLAN_CTAG_RX’ undeclared (first use in this function)
drivers/net/ethernet/nexell/nxpmac/nxpmac_main.c:3315:20: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/ethernet/nexell/nxpmac/nxpmac_main.c: At top level:
drivers/net/ethernet/nexell/nxpmac/nxpmac_main.c:1019:13: warning: ‘stmmac_display_descriptors’ defined but not used [-Wunused-function]
make[5]: *** [drivers/net/ethernet/nexell/nxpmac/nxpmac_main.o] Error 1
make[4]: *** [drivers/net/ethernet/nexell/nxpmac] Error 2
make[3]: *** [drivers/net/ethernet/nexell] Error 2
make[2]: *** [drivers/net/ethernet] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

无标题.png
回复

使用道具 举报

3

主题

14

帖子

42

积分

XX18通行证

 楼主| 发表于 2021-7-17 19:29:41 | 显示全部楼层
修改方法如下:
找到目录/forlinx/kernel-3.4.39/include/linux下的netdev_features.h
然后加上两行
#define NETIF_F_HW_VLAN_CTAG_RX        NETIF_F_HW_VLAN_RX
#define NETIF_F_HW_VLAN_CTAG_TX        NETIF_F_HW_VLAN_TX
原因是:
内核版本小于3.10则用
NETIF_F_HW_VLAN_CTAG_RX       
NETIF_F_HW_VLAN_CTAG_TX       
高于这个版本,则用
NETIF_F_HW_VLAN_RX
NETIF_F_HW_VLAN_TX
点评回复 支持 反对

使用道具 举报

0

主题

123

帖子

214

积分

发表于 2021-7-19 15:34:53 | 显示全部楼层
看报错是这个文件nxpmac_main.c。文件里有修改东西吗
点评回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-4-23 23:20

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表