<div dir="ltr"><div dir="ltr">Hello <a class="gmail_plusreply" id="m_2665174796782671776plusReplyChip-2">@Carlo Brokering</a><span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px">,</span><span class="gmail-im" style="color:rgb(80,0,80)"><div><span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px"><br></span></div><div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#9900ff">> As part of an internship at the German Aerospace Center, I am currently working on the implementation of a CAN driver for a Xilinx</font></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#9900ff">> Zynq SoC. <span lang="en">For this I used the existing CAN framework /dev/can/can.h. A merge request will follow soon.</span><br></font></div></div></span><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><span lang="en"><font color="#000000">All the best for your Internship.</font></span></div></div></blockquote><span class="gmail-im" style="color:rgb(80,0,80)"><div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#9900ff">></font></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#9900ff">><br>> Here's what I'd like to add to the framework if it hasn't already been done:<br>><br>> * RxFIFO. Currently can_bus_read only stores the latest CAN message in can_bus->can_rx_msg.<br></font></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#9900ff">> There is a FIXME note on this in can.c, line 188, but I couldn't find an implementation of it.</font></div></div></span><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#000000">Currently, the CAN framework has minimal rx support. The design of the rx data path in the CAN Framework is ready (You could use that design if approved or you can have your own design).</font></div></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#000000"><br></font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#000000">Note: The tx data path has been implemented, it supports multiple open among different tasks, configurable buffers.</font></div></blockquote><span class="gmail-im" style="color:rgb(80,0,80)"><div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#9900ff">><br>> * ioctl functionality. can_bus_ioctl does not forward the commands and arguments to can_dev_ops->dev_ioctl.<br></font></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#9900ff">> Is there a reason for that? I propose a command enum that would provide consistency.<br></font></div></div></span><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px">The bsp CAN driver should register the ioctl api with the CAN Framework for device specific commands (To add commands for hardware independent functionality the commands can be added before "if (bus == NULL || bus->can_dev_ops->dev_ioctl == NULL)" statement.</div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><br></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px">struct can_dev_ops dev_ops (.dev_ioctl member should be registered).</div></div></blockquote><span class="gmail-im" style="color:rgb(80,0,80)"><div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#9900ff">></font></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><font color="#9900ff">><br>> @Prashanth S (<a href="mailto:fishesprashanth@gmail.com" target="_blank">fishesprashanth@gmail.com</a>) have you already worked on these points?</font><br></div></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><br></div></span><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px">For the overview of the CAN framework, tx, rx, data paths you can refer the docs files in the gitlab link (.puml version of the docs are also available if you needed (<a href="https://gitlab.com/slpp95prashanth/gsoc-2022/-/commit/f42e192afefdd94a66456181f9d169f0728d5b4f)" target="_blank">https://gitlab.com/slpp95prashanth/gsoc-2022/-/commit/f42e192afefdd94a66456181f9d169f0728d5b4f)</a>).</div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px">You can use the gitlab <a href="https://gitlab.com/slpp95prashanth/gsoc-2022/-/tree/can-bsp-docs/can-docs">https://gitlab.com/slpp95prashanth/gsoc-2022/-/tree/can-bsp-docs/can-docs</a> link for the design documents.</div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px">Regards</div><font color="#888888"><div style="font-family:Calibri,Helvetica,sans-serif;font-size:16px">Prashanth S</div></font></div></div>