ferrymax wrote:
> First of all, thanks for the quick reply.
> 
> Now I'm sure that I'm missing something fundamental here :-)
> 
> The hardware-thing is, unfortunately, a little bit more complex.
> I have an EXTERNAL microprocessor with 5 CAN-interfaces. The idea is to
> provide these to the main CPU by means of sockets, so the usage is simple,
> transparent, and standardized for the user. The two CPUs communicate via
> SPI.
> So I need to write a module that handles transmit-requests (to a specific
> CAN-device using the respective socket, or ifindex as you mentioned), and
> sends some SPI message to the external CPU, which in turn controls the real
> CAN-hardware. The same applies for receiving messages, clearly the other way
> around.

The point is, that you need to establish some communication protocol between
your host CPU and the external processor to control the five CAN controllers
from the (Linux powered) host CPU.

Your (new) CAN netdevice driver needs to create as much canX instances as you
have on your communication CPU (in your case five instances).

If you look into the PCI CAN drivers you can see how a multiple channel CAN
driver creates multiple instances of CAN netdevices to have a 1:1 canX <-> CAN
controller connection.

In the end you'll have five CAN netdevice interfaces (e.g. can0 .. can4) on
your Linux box that represent the five CAN controllers on your external
communication processor.

Once you created a "standard CAN netdevice" you can use it with PF_CAN sockets
(aka SocketCAN). In your case you need to create five of them :-)

Regards,
Oliver

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to