4

everybody, I using busybox 1.2.1 as my shell in embedded linux runing on Xilinx Zynq ARM Cortex x2.Any command that busybox support is ok but "ip".In busybox, I tried "ip",it shows that:

BusyBox v1.21.1 (2013-08-15 15:21:48 CST) multi-call binary.

Usage: ip [OPTIONS] {address | route | link | tunnel | rule} {COMMAND}

ip [OPTIONS] OBJECT {COMMAND}
where OBJECT := {address | route | link | tunnel | rule}
OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }

Then I try to use "ip" to configure "can0"(Controller Area Network device),the fully command shows below:

ip link set can0 type can bitrate 125000

This command is ok in my desktop Linux,but busybox says that:

ip: either "dev" is duplicate, or "type" is garbage

So I'm confused.I need this command to configure my "can0",could anybody help me solve this promblem? Thanks very much!

auselen
  • 27,577
  • 7
  • 73
  • 114
Ezio
  • 1,116
  • 4
  • 13
  • 25
  • First of all, you use very old version of busybox, but even in recent versions "ip' command is not fully supported. For example, there is no "ip neigh". If you need advanced networking capabilities, then it is better to cross-compile iproute2. – sknaumov Sep 27 '13 at 10:43

2 Answers2

3

http://www.armadeus.com/wiki/index.php?title=CAN_bus_Linux_driver In this site they have mentioned to rebuild busybox for the ip command for the error you are receiving.

Thanks & Regards,
Alok Thaker

linux_fanatic
  • 4,767
  • 3
  • 19
  • 20
  • 1
    This is because of your "ip" is too old and does not support CAN devices setup. http://git.kernel.org/?p=network/iproute2/iproute2.git;a=summary Get & build the latest "ip" from git://git.kernel.org/pub/scm/network/iproute2/iproute2.git > ifconfig can0 up: > ifconfig: SIOCGIFFLAGS: No such device Please check for CAN driver stuff in the kernel log (e.g. with dmesg) search for "CAN device driver interface" – linux_fanatic Sep 17 '13 at 06:00
1

Alternatively you can control can interface via netlink protocol. See http://www.pengutronix.de/software/libsocketcan/download/ or libnl (http://lists.infradead.org/pipermail/libnl/2012-November/000817.html)

yegorich
  • 4,653
  • 3
  • 31
  • 37