From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "Christopher R. Baker" <cbaker@rec.ri.cmu.edu>,
linux-can@vger.kernel.org
Subject: Re: Populating netdev::dev_id for udev discrimination
Date: Sun, 09 Mar 2014 20:05:19 +0100 [thread overview]
Message-ID: <531CBB6F.7090803@pengutronix.de> (raw)
In-Reply-To: <1394294420.3356.15.camel@NREC-014563>
[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]
On 03/08/2014 05:00 PM, Christopher R. Baker wrote:
> I'm new to the list, and have poked around on gmane enough to convince
> myself that this hasn't been covered before, but if I've missed
> something in this vein, apologies in advance.
You are the first one to address this issue. \o/
> My objective is to be able to totally discriminate CAN ports on
> multi-port cards via udev so as to rename them to semantically
> interesting/unique names for my system (e.g., "ecuCAN" and "auxCAN"
> instead of "can0" and "can1").
>
> udevadm info gives me the KERNELS=... incantation to match the pci bus
> address, but there are no other differences in the udev listing for my
> various CAN ports (at least for my peak_pci device)
>
> Digging into the semantics of ATTRS{...}, "dev_id" stood out as having
> the intention of discriminating between physical ports that "share the
> same link layer" (from netdev.h) or "share the same MAC address" (from
> various other mailing lists).
>
> The following patch assigns the dev_id field to match the channel number
> on all multi-channel cards I could identify in a fresh git pull under
> drivers/net/can. I can only test my two-port Peak PCI card, but it
> works as expected: ATTRS{dev_id} now expresses the port number and my
> udev rules now unambiguously pick out and rename my individual CAN
> ports.
>
> The drivers for other cards I have touched at least compile, but should
> certainly be tested before deploying this patch.
Thanks for the patch, looks good. Can I add your Signed-off-by[1]?
Marc
[1]
http://lxr.free-electrons.com/source/Documentation/SubmittingPatches#L307
--
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: 242 bytes --]
next prev parent reply other threads:[~2014-03-09 19:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-08 16:00 Populating netdev::dev_id for udev discrimination Christopher R. Baker
2014-03-09 19:05 ` Marc Kleine-Budde [this message]
2014-03-09 23:32 ` Christopher R. Baker
2014-03-10 7:43 ` Oliver Hartkopp
2014-03-10 10:46 ` Kurt Van Dijck
2014-03-10 11:01 ` Marc Kleine-Budde
2014-03-10 12:18 ` Oliver Hartkopp
2014-03-11 19:08 ` Marc Kleine-Budde
2014-03-11 19:41 ` Oliver Hartkopp
2014-03-11 19:45 ` Marc Kleine-Budde
2014-03-10 12:18 ` Kurt Van Dijck
2014-03-10 12:15 ` Oliver Hartkopp
2014-03-10 12:52 ` Kurt Van Dijck
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=531CBB6F.7090803@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=cbaker@rec.ri.cmu.edu \
--cc=linux-can@vger.kernel.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.