From: Philippe Gerum <rpm@xenomai.org>
To: Frederik Bayart <frederik_bayart@yahoo.co.uk>,
"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] xeno 3-rc7 : rtcanconfig fails to set baudrate
Date: Wed, 19 Aug 2015 18:38:08 +0200 [thread overview]
Message-ID: <55D4B0F0.3020003@xenomai.org> (raw)
In-Reply-To: <466299436.7725534.1440001753062.JavaMail.yahoo@mail.yahoo.com>
On 08/19/2015 06:29 PM, Frederik Bayart wrote:
>> On Tuesday, 18 August 2015, 19:25, Philippe Gerum <rpm@xenomai.org> wrote:
>>> On 08/18/2015 06:26 PM, Frederik Bayart wrote:
>>
>>> I have build xeno-3.0.rc7 with kernel 3.18.12.
>>> I have a PEAK-PCIe CAN card in my system.
>>> Drivers are loaded and rtcan0 en rtcan1 are created in /proc/rtcan.
>>>
>>> However, I'm not able to set the baudrate when I'm execute 'rtcanconfig rtcan0 -v -b 1000000 start'
>>> By adding debug statements in rtcanconfig, I found that ioctl(can_fd, SIOCSCANBAUDRATE, &u.ifr); fails,
>>> errno gives : SIOCSCANBAUDRATE(errno=19): No such device
>>> Below the output of rtcan0/info and xeno-config --info
>>> Any suggestions ?
>>
>> This error is documented, I would check ->ifr_name in the request block:
>>
>> http://www.xenomai.org/documentation/xenomai-3/html/xeno3prm/group__rtdm__can.html#ga7c070037c218b40de849ebf4d299f977
>>
>> --
>> Philippe.
>
>
> The problem was that the interface name was overwritten by the baudrate. The problem is caused by use of
>
> union {
> struct ifreq ifr;
> struct can_bittime bittime;
> can_baudrate_t baudrate;
> can_ctrlmode_t ctrlmode;
> can_mode_t mode;
> } u;
>
> I think the intention was to put struct ifreq.ifr_ifru in the union. But I think the union above doesn't work because struct ifreq has first member ifr_ifrn
I broke this code:
commit 78e77431163e35a3dafb30c86cc71fa167c7faa2
Author: Philippe Gerum <rpm@xenomai.org>
Date: Thu Dec 1 19:02:42 2011 +0100
utils/rtcanconfig: fix aliasing
But we can't just revert it, the data aliasing is wrong. I'll have a
look, thanks for the debug work.
--
Philippe.
prev parent reply other threads:[~2015-08-19 16:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-18 16:26 [Xenomai] xeno 3-rc7 : rtcanconfig fails to set baudrate Frederik Bayart
2015-08-18 17:25 ` Philippe Gerum
2015-08-19 16:29 ` Frederik Bayart
2015-08-19 16:38 ` Philippe Gerum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55D4B0F0.3020003@xenomai.org \
--to=rpm@xenomai.org \
--cc=frederik_bayart@yahoo.co.uk \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.