<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.gmail-im
{mso-style-name:gmail-im;}
span.E-MailFormatvorlage19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'>Hello Prashanth S,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'>the design for the rx data path including the RxFIFO looks promising. If nobody is working on it yet, I would try to implement it. You said it still needs to be approved - who do I have to contact for this?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'>I think you misunderstood me about the ioctl api. My main question was why command and buffer are not passed to the dev_ioctl here:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'> bus->can_dev_ops->dev_ioctl(bus->priv, NULL, 0);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'>Regards<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'>Carlo Brokering<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b>Von:</b> Prashanth S <fishesprashanth@gmail.com> <br><b>Gesendet:</b> Mittwoch, 1. März 2023 11:53<br><b>An:</b> Brokering, Carlo <Carlo.Brokering@dlr.de><br><b>Cc:</b> devel@rtems.org<br><b>Betreff:</b> Re: CAN driver implementation for Xilinx Zynq<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Hello @Carlo Brokering<span style='font-size:12.0pt;color:black'>,</span><span class=gmail-im><span style='color:#500050'><o:p></o:p></span></span></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal><span style='font-size:12.0pt;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</span><span style='font-size:12.0pt;color:#500050'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;color:#9900FF'>> Zynq SoC. </span><span lang=EN style='font-size:12.0pt;color:#9900FF'>For this I used the existing CAN framework /dev/can/can.h. A merge request will follow soon.</span><span style='font-size:12.0pt;color:#500050'><o:p></o:p></span></p></div></div><blockquote style='margin-left:30.0pt;margin-right:0cm'><div><div><p class=MsoNormal><span lang=EN style='font-size:12.0pt;color:black'>All the best for your Internship.</span><span style='font-size:12.0pt'><o:p></o:p></span></p></div></div></blockquote><div><div><p class=MsoNormal><span style='font-size:12.0pt;color:#9900FF'>></span><span style='font-size:12.0pt;color:#500050'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;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.</span><span style='font-size:12.0pt;color:#500050'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;color:#9900FF'>> There is a FIXME note on this in can.c, line 188, but I couldn't find an implementation of it.</span><span style='font-size:12.0pt;color:#500050'><o:p></o:p></span></p></div></div><blockquote style='margin-left:30.0pt;margin-right:0cm'><div><div><p class=MsoNormal><span style='font-size:12.0pt;color:black'>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).</span><span style='font-size:12.0pt'><o:p></o:p></span></p></div></div><div><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p></div></blockquote><blockquote style='margin-left:30.0pt;margin-right:0cm'><div><p class=MsoNormal><span style='font-size:12.0pt;color:black'>Note: The tx data path has been implemented, it supports multiple open among different tasks, configurable buffers.</span><span style='font-size:12.0pt'><o:p></o:p></span></p></div></blockquote><div><div><p class=MsoNormal><span style='font-size:12.0pt;color:#9900FF'>><br>> * ioctl functionality. can_bus_ioctl does not forward the commands and arguments to can_dev_ops->dev_ioctl.</span><span style='font-size:12.0pt;color:#500050'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;color:#9900FF'>> Is there a reason for that? I propose a command enum that would provide consistency.</span><span style='font-size:12.0pt;color:#500050'><o:p></o:p></span></p></div></div><blockquote style='margin-left:30.0pt;margin-right:0cm'><div><p class=MsoNormal><span style='font-size:12.0pt'>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.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p></div></blockquote><blockquote style='margin-left:30.0pt;margin-right:0cm'><div><div><p class=MsoNormal><span style='font-size:12.0pt'>struct can_dev_ops dev_ops (.dev_ioctl member should be registered).<o:p></o:p></span></p></div></div></blockquote><div><div><p class=MsoNormal><span style='font-size:12.0pt;color:#9900FF'>></span><span style='font-size:12.0pt;color:#500050'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;color:#9900FF'>><br>> @Prashanth S (<a href="mailto:fishesprashanth@gmail.com" target="_blank">fishesprashanth@gmail.com</a>) have you already worked on these points?</span><span style='font-size:12.0pt;color:#500050'><o:p></o:p></span></p></div></div><div><p class=MsoNormal><span style='font-size:12.0pt;color:#500050'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt'>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>).<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt'>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.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt'>Regards<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;color:#888888'>Prashanth S<o:p></o:p></span></p></div></div></div></div></body></html>