[virtio-dev] Re: [virtio-comment] [RFC PATCH v3] virtio-can: Device specification.
Marc Kleine-Budde <[email protected]> Wed, 21 Feb 2024 13:49:31 +0100
| Newsgroups | dev.linux.lists.virtio-dev,org.kernel.vger.linux-can |
|---|---|
| Message-ID | <[email protected]> |
On 21.02.2024 11:37:58, Matias Ezequiel Vara Larsen wrote:
> > > +The length of the \field{sdu} is determined by the \field{length}.
> > > +
> > > +The type of a CAN message identifier is determined by \field{flags}. The
> > > +3 most significant bits of \field{can_id} do not bear the information
> > > +about the type of the CAN message identifier and are 0.
> > > +
> > > +The device MUST reject any CAN frame type for which support has not been
> > > +negotiated with VIRTIO_CAN_RESULT_NOT_OK in \field{result} and MUST NOT
> > > +schedule the message for transmission. A CAN frame with an undefined bit
> > > +set in \field{flags} is treated like a CAN frame for which support has
> > > +not been negotiated.
> > > +
> > > +The device MUST reject any CAN frame for which \field{can_id} or
> > > +\field{sdu} length are out of range or the CAN controller is in an
> > > +invalid state with VIRTIO_CAN_RESULT_NOT_OK in \field{result} and MUST
> > > +NOT schedule the message for transmission.
> > > +
> I am not very familiar with CAN but how does the device figure out that
> the can_id is out of range?
In classical CAN we have the standard CAN frames, which have an 11 bit
ID, and there are extended CAN frames, which have 29 bits ID. Extended
frames are signaled with VIRTIO_CAN_FLAGS_EXTENDED set.
So if a standard frame uses more than 11 Bits of CAN-ID, it's considered
out of range.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEUEC6huC2BN0pvD5fKDiiPnotvG8FAmXV8VgACgkQKDiiPnot vG9Dfwf/fB9BsfKlNrhf0m0/Ym50ssSYlC9p4UdBqBli+D4CQQbFhKXuJIc5pbsF cxMDyo3aayKdXskeVJWiBys8wBI52EY/gRFuwM/OuBLsaN3WS+nLVrINT+EniPHn mu1yPVoYWPfFjQKi3sPZkQUluJ8O1KUbL3m77jUVPJ93SAoQM6nQrIwsQvPIg7Ct gsmpD1UruWsbNGWzvPK6BoQ+tNfYkCcuMwn5y6BUyOX2GFAQhaDaqRjATyjlfJDC DbytEO1tE0lWW+Z1UxaTamF0r7hLIcNKmEP5gD5J+qSCE60NOotPcgbimBJ973Aq 8E8oGG6CFa5E5oyEam1M4qulavwknQ== =SERR -----END PGP SIGNATURE-----