SJA1105 driver

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SJA1105 driver

1,376 次查看
yanglei666888
Contributor II

I downloaded the sja1105 driver from the link https://github.com/nxp-auto-linux/sja1105x/tree/release/bsp31.0_5.4_cd, but the compilation reported some errors. I downloaded the version of the Linux kernel from here: https://github.com/nxp-auto-linux/linux/tree/release/bsp30.0-5.10.41-rt, can someone help me? Here is the compiled log:

/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c: In function ‘set_port_linkstatus’:
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:353:2: error: too few arguments to function ‘dev_change_flags’
353 | dev_change_flags(netdev, flags);
| ^~~~~~~~~~~~~~~~
In file included from ./include/linux/etherdevice.h:21,
from /home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:18:
./include/linux/netdevice.h:3894:5: note: declared here
3894 | int dev_change_flags(struct net_device *dev, unsigned int flags,
| ^~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c: In function ‘nxp_port_attr_get’:
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:681:7: error: ‘SWITCHDEV_ATTR_ID_PORT_PARENT_ID’ undeclared (first use in this function); did you mean ‘SWITCHDEV_ATTR_ID_PORT_MROUTER’?
681 | case SWITCHDEV_ATTR_ID_PORT_PARENT_ID:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| SWITCHDEV_ATTR_ID_PORT_MROUTER
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:681:7: note: each undeclared identifier is reported only once for each function it appears in
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:682:55: error: ‘union <anonymous>’ has no member named ‘ppid’
682 | return nxp_port_swdev_parent_id_get(netdev, &attr->u.ppid);
| ^
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c: At top level:
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:808:19: error: initialization of ‘int (*)(struct ndmsg *, struct nlattr **, struct net_device *, const unsigned char *, u16, u16, struct netlink_ext_ack *)’ {aka ‘int (*)(struct ndmsg *, struct nlattr **, struct net_device *, const unsigned char *, short unsigned int, short unsigned int, struct netlink_ext_ack *)’} from incompatible pointer type ‘int (*)(struct ndmsg *, struct nlattr **, struct net_device *, const unsigned char *, u16, u16)’ {aka ‘int (*)(struct ndmsg *, struct nlattr **, struct net_device *, const unsigned char *, short unsigned int, short unsigned int)’} [-Werror=incompatible-pointer-types]
808 | .ndo_fdb_add = nxp_port_fdb_add,
| ^~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:808:19: note: (near initialization for ‘nxp_port_netdev_ops.ndo_fdb_add’)
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:818:21: error: variable ‘nxp_port_swdev_ops’ has initializer but incomplete type
818 | static const struct switchdev_ops nxp_port_swdev_ops = {
| ^~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:819:3: error: ‘const struct switchdev_ops’ has no member named ‘switchdev_port_attr_get’
819 | .switchdev_port_attr_get = nxp_port_attr_get,
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:819:29: warning: excess elements in struct initializer
819 | .switchdev_port_attr_get = nxp_port_attr_get,
| ^~~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:819:29: note: (near initialization for ‘nxp_port_swdev_ops’)
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:820:3: error: ‘const struct switchdev_ops’ has no member named ‘switchdev_port_attr_set’
820 | .switchdev_port_attr_set = nxp_port_attr_set,
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:820:29: warning: excess elements in struct initializer
820 | .switchdev_port_attr_set = nxp_port_attr_set,
| ^~~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:820:29: note: (near initialization for ‘nxp_port_swdev_ops’)
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:821:3: error: ‘const struct switchdev_ops’ has no member named ‘switchdev_port_obj_add’
821 | .switchdev_port_obj_add = nxp_port_obj_add,
| ^~~~~~~~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:821:29: warning: excess elements in struct initializer
821 | .switchdev_port_obj_add = nxp_port_obj_add,
| ^~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:821:29: note: (near initialization for ‘nxp_port_swdev_ops’)
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:822:3: error: ‘const struct switchdev_ops’ has no member named ‘switchdev_port_obj_del’
822 | .switchdev_port_obj_del = nxp_port_obj_del,
| ^~~~~~~~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:822:29: warning: excess elements in struct initializer
822 | .switchdev_port_obj_del = nxp_port_obj_del,
| ^~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:822:29: note: (near initialization for ‘nxp_port_swdev_ops’)
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c: In function ‘attach_phydev’:
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:930:18: error: ‘PHY_CHANGELINK’ undeclared (first use in this function); did you mean ‘PHY_NOLINK’?
930 | phydev->state = PHY_CHANGELINK;
| ^~~~~~~~~~~~~~
| PHY_NOLINK
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c: In function ‘register_ports’:
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:1026:3: error: implicit declaration of function ‘SWITCHDEV_SET_OPS’ [-Werror=implicit-function-declaration]
1026 | SWITCHDEV_SET_OPS(netdev, &nxp_port_swdev_ops);
| ^~~~~~~~~~~~~~~~~
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c: At top level:
/home/yl/sja1105x/switchdev/src/sja1105p_switchdev.c:818:35: error: storage size of ‘nxp_port_swdev_ops’ isn’t known
818 | static const struct switchdev_ops nxp_port_swdev_ops = {
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:279: /home/yl/sja1105x/switchdev/src/sja1105p_switchdev.o] Error 1
make[1]: *** [Makefile:1821: /home/yl/sja1105x] Error 2
make[1]: Leaving directory '/home/yl/linux'
make: *** [Makefile:90: modules] Error 2

0 项奖励
回复
0 回复数