From: Simon Horman <simon.horman@corigine.com>
To: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
linux-can@vger.kernel.org, Thomas.Kopp@microchip.com,
Oliver Hartkopp <socketcan@hartkopp.net>,
netdev@vger.kernel.org, marex@denx.de
Subject: Re: [PATCH v2 3/3] can: length: refactor frame lengths definition to add size in bits
Date: Tue, 23 May 2023 13:14:18 +0200 [thread overview]
Message-ID: <ZGygCiGflvcvi787@corigine.com> (raw)
In-Reply-To: <20230523065218.51227-4-mailhol.vincent@wanadoo.fr>
On Tue, May 23, 2023 at 03:52:18PM +0900, Vincent Mailhol wrote:
> Introduce a method to calculate the exact size in bits of a CAN(-FD)
> frame with or without dynamic bitsuffing.
...
> +/**
> + * can_frame_bits() - Calculate the number of bits in on the wire in a
> + * CAN frame
nit: @is_fd should be documented here.
> + * @is_eff: true: Extended Frame; false: Standard Frame.
> + * @bitstuffing: if true, calculate the bitsuffing worst case, if
> + * false, calculated the bitsuffing best case (no dynamic
> + * bitsuffing). Fixed stuff bits always get included.
> + * @intermission: if and only if true, include the inter frame space
> + * assuming no bus idle (i.e. only the intermission gets added).
> + * @data_len: length of the data field in bytes. Correspond to
> + * can(fd)_frame->len. Should be zero for remote frames. No
> + * sanitization is done on @data_len.
> + *
> + * Return: the numbers of bits on the wire of a CAN frame.
> + */
> +static inline
> +unsigned int can_frame_bits(bool is_fd, bool is_eff,
> + bool bitstuffing, bool intermission,
> + unsigned int data_len)
> +{
...
next prev parent reply other threads:[~2023-05-23 11:14 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-07 15:55 [PATCH] can: length: add definitions for frame lengths in bits Vincent Mailhol
2023-05-08 8:54 ` Thomas.Kopp
2023-05-08 12:14 ` Marc Kleine-Budde
2023-05-09 4:16 ` Vincent MAILHOL
2023-05-09 6:43 ` Marc Kleine-Budde
2023-05-09 8:14 ` Vincent MAILHOL
2023-05-09 6:19 ` Thomas.Kopp
2023-05-08 12:20 ` Marc Kleine-Budde
2023-05-09 4:58 ` Vincent MAILHOL
2023-05-09 7:12 ` Thomas.Kopp
2023-05-09 8:06 ` Vincent MAILHOL
2023-05-23 6:52 ` [PATCH v2 0/3] can: length: fix definitions and add bit length calculation Vincent Mailhol
2023-05-23 6:52 ` [PATCH v2 1/3] can: length: fix bitstuffing count Vincent Mailhol
2023-05-23 6:52 ` [PATCH v2 2/3] can: length: fix description of the RRS field Vincent Mailhol
2023-05-23 6:52 ` [PATCH v2 3/3] can: length: refactor frame lengths definition to add size in bits Vincent Mailhol
2023-05-23 7:13 ` Vincent MAILHOL
2023-05-23 11:14 ` Simon Horman [this message]
2023-05-30 14:46 ` [PATCH v3 0/3] can: length: fix definitions and add bit length calculation Vincent Mailhol
2023-05-30 14:46 ` [PATCH v3 1/3] can: length: fix bitstuffing count Vincent Mailhol
2023-05-30 14:46 ` [PATCH v3 2/3] can: length: fix description of the RRS field Vincent Mailhol
2023-05-30 14:46 ` [PATCH v3 3/3] can: length: refactor frame lengths definition to add size in bits Vincent Mailhol
2023-05-30 15:51 ` Simon Horman
2023-05-30 17:29 ` Vincent MAILHOL
2023-05-30 19:49 ` Simon Horman
2023-05-31 9:45 ` Vincent MAILHOL
2023-06-01 10:31 ` Thomas.Kopp
2023-06-01 11:00 ` Vincent MAILHOL
2023-06-01 11:26 ` Thomas.Kopp
2023-06-01 16:56 ` [PATCH v4 0/3] can: length: fix definitions and add bit length calculation Vincent Mailhol
2023-06-01 16:56 ` [PATCH v4 1/3] can: length: fix bitstuffing count Vincent Mailhol
2023-06-01 16:56 ` [PATCH v4 2/3] can: length: fix description of the RRS field Vincent Mailhol
2023-06-01 16:56 ` [PATCH v4 3/3] can: length: refactor frame lengths definition to add size in bits Vincent Mailhol
2023-06-11 2:57 ` [PATCH v5 0/3] can: length: fix definitions and add bit length calculation Vincent Mailhol
2023-06-11 2:57 ` [PATCH v5 1/3] can: length: fix bitstuffing count Vincent Mailhol
2023-06-11 2:57 ` [PATCH v5 2/3] can: length: fix description of the RRS field Vincent Mailhol
2023-06-11 2:57 ` [PATCH v5 3/3] can: length: refactor frame lengths definition to add size in bits Vincent Mailhol
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=ZGygCiGflvcvi787@corigine.com \
--to=simon.horman@corigine.com \
--cc=Thomas.Kopp@microchip.com \
--cc=linux-can@vger.kernel.org \
--cc=mailhol.vincent@wanadoo.fr \
--cc=marex@denx.de \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).