From: Rostislav Lisovy Date: Fri, 7 Oct 2011 09:09:55 +0000 (+0200) Subject: Configuration scripts improvements. X-Git-Url: https://rtime.felk.cvut.cz/gitweb/lisovros/iproute2_canprio.git/commitdiff_plain/0f6c636c4ae4d749fe4e9f996b02fbec86cadd13 Configuration scripts improvements. --- diff --git a/tc/caninit.sh b/tc/caninit.sh index 2b34e5b..2d5be8d 100755 --- a/tc/caninit.sh +++ b/tc/caninit.sh @@ -21,5 +21,8 @@ ip link set can3 type can bitrate 1000000 ip link set can3 txqueuelen $1 ip link set can3 up -ip link show +ip link show dev can0 +ip link show dev can1 +ip link show dev can2 +ip link show dev can3 diff --git a/tc/setcanfltr.sh b/tc/setcanfltr.sh index 6e9bd0d..6fe99dc 100755 --- a/tc/setcanfltr.sh +++ b/tc/setcanfltr.sh @@ -1,5 +1,12 @@ #!/bin/bash -DEV=can0 + +if [ -z "$2" ]; then # device not set + DEV="can0" +else + DEV="$2" +fi + +echo "[ Running on ${DEV} device. ]" if [ "$1" == "del" ]; then # delete all qdiscs & filters tc qdisc del dev ${DEV} root diff --git a/tc/vcaninit.sh b/tc/vcaninit.sh new file mode 100755 index 0000000..1a77750 --- /dev/null +++ b/tc/vcaninit.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +(lsmod | grep vcan > /dev/null) && rmmod vcan +modprobe vcan echo=1 + +ip link add vcan0 type vcan +ip link set vcan0 txqueuelen $1 +ip link set vcan0 up +ip link show dev vcan0 +