Re: [PATCH v2 3/3] can: length: refactor frame lengths definition to add size in bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

...



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux