linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: "Heinz-Jürgen Oertel" <oe@port.de>
Cc: "socketcan-users@lists.berlios.de"
	<socketcan-users@lists.berlios.de>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [Socketcan-users] Bit rate configuration of PEAK USB devices
Date: Tue, 15 Nov 2011 19:33:22 +0100	[thread overview]
Message-ID: <4EC2B072.5060704@hartkopp.net> (raw)
In-Reply-To: <4EC2AAD8.6080907@hartkopp.net>

I forgot to mention that you can also use the PCAN ioctl() interface on the
PEAK chardevices or their pcanlib ...


On 15.11.2011 19:09, Oliver Hartkopp wrote:

> Hello Heinz,
> 
> On 15.11.2011 15:13, Heinz-Jürgen Oertel wrote:
> 
>> I tried
>>  ip link set can0 type can bitrate 125000
>> and I tried socketcanlib
>> can_set_bitrate("can0", 125000);
>> but everytime got the error 
>> RTNETLINK answers: Operation not permitted.
>> Reading the "PCAN driver for Linux - User Manual" v7.1
>> I could not find instructions to set the bit rate for netdev.
> 
>>
> 
>> Who knows the best and/or correct way?
> 
> 
> Me :-)
> 
> The netdev support inside the PEAK driver is a bit like an add-on to the
> original character device driver.
> 
> Since PCAN Linux driver 6.0 you can compile the PEAK driver with netdev
> support which means that for each detected CAN device an 'additional'
> netdevice is being created.
> 
> Unfortunately these netdevices only support the sending and receiving of CAN
> frames BUT no configuration of the CAN devices. This is still to be done via
> the chardev inodes in /dev/pcanXX ..
> 
> See "PCAN driver for Linux - User Manual" v7.1, page 22
> 
> ---
> 
> The 'ndev' column shows the network device assignment. For
> assignment of bitrates to network devices you can either set the
> desired bit rate as module load parameter or you can assign the bit
> rate after loading the driver with a simple command line invocation
> like:
> 
>     echo "i 0x4914 e" > /dev/pcan0
> 
> For this reason it is important to create the chardev-device-entries,
> too. If your target does no create the device files automatically with
> UDEV you have to run with the script
> 
>     ./pcan_make_devices 2
> 
> even if only the netdev driver is used.
> 
> ---
> 
> Indeed i was already thinking about the integration of the netlink-based
> configuration interface (of the mainline kernel) into the PCAN driver.
> 
> But finally this would be another add-on ... IMHO the better approach would be
> to support the PEAK hardware in the form of mainline drivers, like we already
> have for the PCAN PCI and PCAN ISA hardware. A future PCAN USB driver could be
> created on the basis of the existing USB CAN adapter from ESD and EMS.
> 
> Best regards,
> Oliver
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



  reply	other threads:[~2011-11-15 18:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 14:13 Bit rate configuration of PEAK USB devices Heinz-Jürgen Oertel
2011-11-15 18:09 ` [Socketcan-users] " Oliver Hartkopp
2011-11-15 18:33   ` Oliver Hartkopp [this message]
     [not found]     ` <4EC2B072.5060704-fJ+pQTUTwRTk1uMJSBkQmQ@public.gmane.org>
2011-11-17  6:49       ` Heinz-Jürgen Oertel
     [not found]         ` <B3B3BE5A55ED7743A83865E234A22B1D1B91F2BE57-E+xEQJb9ENTWDPv2tuTBK42P0GrZ+RbP@public.gmane.org>
2011-11-17 11:24           ` Kurt Van Dijck
     [not found]             ` <20111117112447.GA366-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-11-17 16:14               ` Oliver Hartkopp
     [not found]                 ` <4EC532E9.5050308-fJ+pQTUTwRTk1uMJSBkQmQ@public.gmane.org>
2011-11-17 16:25                   ` Kurt Van Dijck
     [not found]                     ` <20111117162535.GF366-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-11-17 17:55                       ` Wolfgang Grandegger
     [not found]                         ` <4EC54A78.2060109-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-11-18  9:23                           ` Marc Kleine-Budde
2011-11-17 16:11           ` Oliver Hartkopp

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=4EC2B072.5060704@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=linux-can@vger.kernel.org \
    --cc=oe@port.de \
    --cc=socketcan-users@lists.berlios.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).