lishun800525 发表于 2021-7-17 17:48:32

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

我买的是S5P6818-C2,因为需要用到VLAN,所以我在内核中增加了“802.1QVLAN 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: *** Error 1
make: *** Error 2
make: *** Error 2
make: *** Error 2
make: *** Error 2
make: *** Error 2


lishun800525 发表于 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

倔强的土坷垃 发表于 2021-7-19 15:34:53

看报错是这个文件nxpmac_main.c。文件里有修改东西吗
页: [1]
查看完整版本: 内核添加“802.1Q VLAN Support”后,内核编译错误