Linux CAN drivers development
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "Max S." <max@schneidersoft.net>
Cc: linux-can@vger.kernel.org, Oliver Hartkopp <socketcan@hartkopp.net>
Subject: Re: usb-can device
Date: Sun, 26 Aug 2012 18:28:11 +0200	[thread overview]
Message-ID: <503A4E9B.9060308@pengutronix.de> (raw)
In-Reply-To: <1345996339.6610.10.camel@slaptop>

[-- Attachment #1: Type: text/plain, Size: 2163 bytes --]

Hello Max,

On 08/26/2012 05:52 PM, Max S. wrote:
> I am developing a usb to can adapter.
> 
> Does there exist a standard usb-can interface on the linux side? Or will
> I have to create my own device driver?

There is no standard driver, however I was thinking last week that
someone should write a CDC CAN driver. CDC Ethernet is a standard to
send ethernet frames over USB.

> In the linux kernel source I see drivers/net/can/ems_usb.c which seems
> to provide a way to add support for multiple devices through the
> ems_usb_table. What would it take to get my vendor id and product id
> into this list (assuming that the device is working with this driver).
> 
> I haven't studied the driver in great detail, so i don't know if it is
> appropriate for what I am trying to do...

I don't know what the legal department of ems will do, if you "clone"
their hardware, or build something that is compatible to their hardware
on the driver level.

> What are my options for getting a usb device, that exposes two can
> nodes, supported under linux? I have complete access to the usb device,
> so it would not be a problem for me to build a firmware that behaves a
> certain standard way.

The kvaser driver basically just sends and receives binary messages.
They have a common header (len+type of message+CAN interface) and the
message itself. There are messages to send and receive a CAN frame,
TX-complete, for error handling, and for configuration. If you want to
make your device's firmware update able, implement dfu (device firmware
update). Optional stuff is abort tx of CAN frames, timestamps for rx and tx.

Oliver, do you remember the talk about the CAN in FPGA we heart at the
CAN CIA conference, do you have a link to the presentation. It was FPGA
based, but all concept mentioned there also apply to USB based devices.

cheers, Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2012-08-26 16:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-26 15:52 usb-can device Max S.
2012-08-26 16:28 ` Marc Kleine-Budde [this message]
2012-08-27  6:20   ` Oliver Hartkopp
     [not found]     ` <20120827081028.GA417@vandijck-laurijssen.be>
2012-08-27  9:05       ` Marc Kleine-Budde
     [not found]     ` <1346071259.3928.33.camel@slaptop>
2012-08-28 11:58       ` Oliver Hartkopp
2012-08-28 12:13         ` Marc Kleine-Budde
2012-08-28 12:18           ` Oliver Hartkopp
2012-08-28 12:20             ` Marc Kleine-Budde
2012-08-28 14:30     ` Max S.
2012-08-29 10:55       ` Oliver Hartkopp
2012-08-28 23:34     ` Fabio Baltieri
2012-08-29 11:02       ` Oliver Hartkopp
2012-09-09 13:41         ` Pavel Pisa

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=503A4E9B.9060308@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=max@schneidersoft.net \
    --cc=socketcan@hartkopp.net \
    /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