From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: puneet.sharma@moschip.com, linux-can@vger.kernel.org
Subject: Re: CAN device filterting
Date: Tue, 04 Sep 2012 15:57:31 +0200 [thread overview]
Message-ID: <504608CB.9080709@pengutronix.de> (raw)
In-Reply-To: <504604E3.1040305@hartkopp.net>
[-- Attachment #1: Type: text/plain, Size: 1942 bytes --]
On 09/04/2012 03:40 PM, Oliver Hartkopp wrote:
> On 04.09.2012 15:31, Puneet Sharma wrote:
>
>> I need some guidance on implementing the CAN filtering of identifier in
>> the driver code of CAN for atmel AT91SAM9263 board. Please guide me how
>> to proceed with it..
>
>
> Hm - i wrote that some days ago:
I talked to Puneet in private before, if I understand him correctly he
wants to implement hardware filtering, although software filtering is
available.
From my point of view it should become a per device callback, which you
(admin, i.e. the root user) can set when the device is down. You have to
extend the CAN netlink interface [1].
Each device should identify what kind and how many hardware filters it
supports:
a) mask+id
b) just id
c) ...
Analogue to ctrlmode [2][3].
The requested filers are transferred into the kernel via netlink, but
you have to figure out how to encode a variable length list (netfilter
has probably a solution for this). Then the code in can_changelink() [4]
should check if the transferred filter is supported on that hardware.
Then, during open the driver should code the filters into hardware, on
at91 it should be done in at91_setup_mailboxes [5][6].
Marc
[1] http://lxr.free-electrons.com/source/drivers/net/can/dev.c#L585
[2] http://lxr.free-electrons.com/source/include/linux/can/netlink.h#L81
[3] http://lxr.free-electrons.com/source/drivers/net/can/dev.c#L691
[4] http://lxr.free-electrons.com/source/drivers/net/can/dev.c#L600
[5] http://lxr.free-electrons.com/source/drivers/net/can/at91_can.c#L418
[6] http://lxr.free-electrons.com/source/drivers/net/can/at91_can.c#L336
--
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: 259 bytes --]
next prev parent reply other threads:[~2012-09-04 13:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-04 13:31 CAN device filterting Puneet Sharma
2012-09-04 13:40 ` Oliver Hartkopp
2012-09-04 13:57 ` Marc Kleine-Budde [this message]
2012-09-04 16:53 ` Oliver Hartkopp
2012-09-04 17:13 ` Marc Kleine-Budde
2012-09-05 9:28 ` 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=504608CB.9080709@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=puneet.sharma@moschip.com \
--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