lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZGygCiGflvcvi787@corigine.com>
Date: Tue, 23 May 2023 13:14:18 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Vincent Mailhol <mailhol.vincent@...adoo.fr>
Cc: Marc Kleine-Budde <mkl@...gutronix.de>, linux-can@...r.kernel.org,
	Thomas.Kopp@...rochip.com, Oliver Hartkopp <socketcan@...tkopp.net>,
	netdev@...r.kernel.org, marex@...x.de
Subject: Re: [PATCH v2 3/3] can: length: refactor frame lengths definition to
 add size in bits

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)
> +{

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ