All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: puneet.sharma@moschip.com,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: CAN Driver
Date: Thu, 06 Dec 2012 11:09:06 +0100	[thread overview]
Message-ID: <50C06EC2.3000609@pengutronix.de> (raw)
In-Reply-To: <1354787514.6620.3.camel@punsfloyd-desktop>

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

Hello,

please keep the mailinglist on Cc.

On 12/06/2012 10:51 AM, Puneet Sharma wrote:
> I have read the driver code (at91_can.c) but what i want is some
> simple application which will make use of this driver in u-boot to
> test the Controller.

Have you already ported the CAN driver to u-boot?

> For eg. the application can continously send CAN frames in binary,
> dec or Hex format thereby incrementing the CAN ID everytime or doing
> some similar thing. Is it possible to do such things in u-boot. I
> know in linux this can be achieved via SOCKET CAN.

I think you haev to first invent some kind of interface from your
application to the driver, e.g.:

can_init();
can_write(struct can_frame *cf);
can_read_timeout(struct can_frame *cf, unsinged long timeout);

All these functions should be blocking (with timeout in the read case).
Then you can write an application against that API. You have to write
some glue code to attach the API to the driver. For testing applications
have a look the the can-utils at gitorious [1].

Marc

[1] https://gitorious.org/linux-can/can-utils

-- 
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: 261 bytes --]

  parent reply	other threads:[~2012-12-06 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1346761707.5009.4.camel@punsfloyd-desktop>
     [not found] ` <5045F53F.7070209@pengutronix.de>
     [not found]   ` <1354779353.5010.2.camel@punsfloyd-desktop>
2012-12-06  9:02     ` CAN Driver Marc Kleine-Budde
     [not found]       ` <1354785999.5871.8.camel@punsfloyd-desktop>
2012-12-06  9:44         ` Marc Kleine-Budde
     [not found]           ` <1354787514.6620.3.camel@punsfloyd-desktop>
2012-12-06 10:09             ` Marc Kleine-Budde [this message]
     [not found]               ` <1354789804.6620.6.camel@punsfloyd-desktop>
2012-12-06 10:42                 ` Marc Kleine-Budde
2012-12-06 10:43                   ` Puneet Sharma

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=50C06EC2.3000609@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=puneet.sharma@moschip.com \
    /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.