2010/4/7 Oliver Hartkopp <[email protected]>

> Lei Luo wrote:
>
> >>> I am a newbie of socketcan, I compiled and installed it in the
> > direction of http://dave.limoilux.org/trac/wiki/UseSocketCAN   There are
> > two mcp2510 can  controllers in my arm at91rm9200 board.
> >>> It failed when run "can_setup start", saying that "cannot creat
> > /sys/class/net/can0".
> >>
> >> If you look in SocketCAN's makefile, did you uncomment export
> > CONFIG_CAN_MCP251X=m?
> >> You will also need to uncomment export CONFIG_CAN_DEV_SYSFS=y which is
> > legacy.
>
> Yep!
>
> >
> > Yes, I have done it. I used the newest source code from the svn server
> > and patched it manually. Configration is as follows:
> > CONFIG_CAN=y;
> > CONFIG_CAN_RAW=y;
> > CONFIG_CAN_BCM=y;
> > CONFIG_CAN_GW=y;
> > CONFIG_CAN_ISOTP=y;
> >
> > CONFIG_CAN_VCAN=y;
> > CONFIG_CAN_DEV=y;
> > CONFIG_CAN_CALC_BITTIMING=y;
> > CONFIG_CAN_MCP251X=y;
> >
> >>
> >>>
> >>> Then I use "ip link add type vcan" to create the a vcan interface.
> > But cmd "add" is not recognised, ip tool is the newest one which is
> > compiled with iproute2-2.6.33.tar.bz2. Linux kernel I used is  2.6.28.
>
> Is vcan.ko loaded? Please try
>
>   modprobe vcan
>
> before invoking
>
>   ip link add type vcan
>
> There should be this startup message in the kernel log:
> "vcan: Virtual CAN interface driver"
>
> You can see all network interfaces with
>
>   cat /proc/net/dev
>
> or
>
>   ip link show
>
>
> >
> > The problem of "ip link add" is OK after recompiling kernel,
> > /sys/class/net/can0 is created if I type in "ip link add dev can0 type
> > vcan". But it says "cannot create /sys/class/net/can0" whenever I did it
> > or not.
>
> As said above the sysfs configuration interface is depricated.
>
> For that reason the "can_setup" script is also not usable here.
>
> See
>
> http://lxr.linux.no/#linux+v2.6.33/Documentation/networking/can.txt#L595
>
> for the use of virtual CAN interfaces (that are usually named vcanX).
>
> See
>
> http://lxr.linux.no/#linux+v2.6.33/Documentation/networking/can.txt#L623
>
> for the use of real CAN interfaces (that are usually named canX).
>
> When a 'real' CAN interface driver initializes (like the mcp251x.c) the CAN
> drivers allocate device names like can0, can1, can2 ... automatically.
>
> Don't mix that with virtual CAN interfaces that are software instances and
> 'generated' by "ip link add type vcan"
>
The real device file as can0, can1 havenot created after OS been loaded. So
I am trying to add mpc2510 info into the platform definition file.

Another problem is: if I build socketcan as modules and loaded them
manually, an err will happen in sometime; if build it direct into kernel,
then load application modules such as vcan, things will be OK.  An err info
is as follows(not every time the same):

kernel BUG at mm/slab.c:602!
Unable to handle kernel NULL pointer dereference at virtual address 00000000
fcse pid: 0, 0x00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 817 [#1]
Modules linked in: [last unloaded: can_dev]
CPU: 0    Not tainted  (2.6.28 #11)
PC is at __bug+0x20/0x2c
LR is at vprintk+0x288/0x2cc
pc : [<c002b7b4>]    lr : [<c0041080>]    psr: 20000013
sp : c1c21ee4  ip : c1c21e2c  fp : c1c21ef0
r10: 00000018  r9 : 00000000  r8 : 0000000f
r7 : c1c000c0  r6 : 00000000  r5 : 0000003e  r4 : 0000003e
r3 : 00000000  r2 : c02b2e5c  r1 : 20000013  r0 : 00000020
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: c000317f  Table: 21e20000  DAC: 00000017
Process events/0 (pid: 5, stack limit = 0xc1c20260)
Stack: (0xc1c21ee4 to 0xc1c22000)
1ee0:          c1c21f24 c1c21ef4 c00bae88 c002b7a4 c1d7d01c c1c05410
c1c05410
1f00: 00000018 c1c05400 c1c000c0 c02e6758 00000000 00000000 c1c21f44
c1c21f28
1f20: c00bb04c c00bae24 c1c025e0 c1c000c0 00000000 c02e674c c1c21f74
c1c21f48
1f40: c00bc58c c00baf9c 00000000 c1c21f58 c02e675c c1c01940 c02e6758
c00bc530
1f60: c0222824 00000000 c1c21f98 c1c21f78 c0050abc c00bc540 c1c01948
c1c21fb0
1f80: c1c01940 00000000 00000000 c1c21fdc c1c21f9c c0050c18 c0050a00
00000000
1fa0: c1c12040 c0054a58 c1c21fbc c1c21fbc 00000000 c1c12040 c0054a58
c1c21fbc
1fc0: c1c21fbc fffffffc c0050b60 00000000 c1c21ff4 c1c21fe0 c0054428
c0050b70
1fe0: 00000000 00000000 00000000 c1c21ff8 c0042490 c00543e4 00000000
10002040
Backtrace:
[<c002b794>] (__bug+0x0/0x2c) from [<c00bae88>] (free_block+0x74/0x178)
[<c00bae14>] (free_block+0x0/0x178) from [<c00bb04c>]
(drain_array+0xc0/0xec)
[<c00baf8c>] (drain_array+0x0/0xec) from [<c00bc58c>]
(cache_reap+0x5c/0x10c)
 r7:c02e674c r6:00000000 r5:c1c000c0 r4:c1c025e0
[<c00bc530>] (cache_reap+0x0/0x10c) from [<c0050abc>]
(run_workqueue+0xcc/0x170)
[<c00509f0>] (run_workqueue+0x0/0x170) from [<c0050c18>]
(worker_thread+0xb8/0xc
c)
 r8:00000000 r7:00000000 r6:c1c01940 r5:c1c21fb0 r4:c1c01948
[<c0050b60>] (worker_thread+0x0/0xcc) from [<c0054428>] (kthread+0x54/0x7c)
 r6:00000000 r5:c0050b60 r4:fffffffc
[<c00543d4>] (kthread+0x0/0x7c) from [<c0042490>] (do_exit+0x0/0x758)
 r5:00000000 r4:00000000
Code: e1a01000 e59f000c eb005644 e3a03000 (e5833000)
---[ end trace 12468964a579a4db ]---
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to