This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to write driver for CAN

Other Parts Discussed in Thread: AM3352

Hi,

I am currently working on TI AM3352. Currently we already have Linux Application and Kernel for ARM9 (Atmel) and now we would like to Port it on AM3352.

So I need to develop some driver and one of that is for CAN. Now constraint for me is that I would not like to change the Application part and current Application has some Open, Close and IOCTL call for currently implemeted CAN dirver. If I go for SocketCAN then it direclty provide interface on User Space. So I need to develop the driver to give the Current same Interface to Application but HOW?? I mean to say I need to go for writing from scracth (Which should not be the case) or can I use something which is already available or any other option??

I have gone through ../kernel/Documentation/networking/can.txt but it only talks about Socket CAN. If I understood correctly then CANUtils gives direct interface to User Space. and CANUtils also reside in User Space (I might be wrong but I assume it as CANUtils make some socket call which should be used in User Space, I might be wrong so Pleae correct me ). So how can I start??

  • More info About AM335x DCAN driver can be found here.  http://processors.wiki.ti.com/index.php/AM335X_DCAN_Driver_Guide

  • Hello Gururaja,

    I have gone through the User guide but what I found is that I tals about the SocketCAN and CANUtils only. And the D_CAN driver (d_can.c and d_can_platform.c) are used as network driver and does not meet the complete requirement what I am looking for.

    But surely this provide me some guide to implement my own Dirver. But is it the only way?? Do I need to start from the scrach (not actually as reference is available) and no other way??

    And My all other understanding are correct about CANUtils and Socket CAN??