Lines Matching +full:can +full:- +full:fd
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2020 Marc Kleine-Budde <[email protected]>
11 #include <linux/can.h>
12 #include <linux/can/netlink.h>
16 * Size of a Classical CAN Standard Frame header in bits
19 * ---------------------------------------------------------
26 * FD Format indicator (FDF) 1
34 * Size of a Classical CAN Extended Frame header in bits
37 * ---------------------------------------------------------
46 * FD Format indicator (FDF) 1
55 * Size of a CAN-FD Standard Frame in bits
58 * ---------------------------------------------------------
65 * FD Format indicator (FDF) 1
76 * Size of a CAN-FD Extended Frame in bits
79 * ---------------------------------------------------------
88 * FD Format indicator (FDF) 1
99 * Size of a CAN CRC Field in bits
102 * ---------------------------------------------------------
111 * Size of a CAN-FD CRC17 Field in bits (length: 0..16)
114 * ---------------------------------------------------------
123 * Size of a CAN-FD CRC21 Field in bits (length: 20..64)
126 * ---------------------------------------------------------
135 * Size of a CAN(-FD) Frame footer in bits
138 * ---------------------------------------------------------
149 * (a.k.a. IMF - intermission field)
154 * can_bitstuffing_len() - Calculate the maximum length with bitstuffing
165 * - "0": dominant bit
166 * - "o": dominant stuff bit
167 * - "1": recessive bit
168 * - "i": recessive stuff bit
175 (destuffed_len + (destuffed_len - 1) / 4)
208 * can_frame_bits() - Calculate the number of bits on the wire in a
209 * CAN frame
210 * @is_fd: true: CAN-FD frame; false: Classical CAN frame.
214 * bitstuffing). CAN-FD's fixed stuff bits are always included.
221 * can(fd)_frame->len. Should be zero for remote frames. No
225 * Return: the numbers of bits on the wire of a CAN frame.
237 * Number of bytes in a CAN frame
246 * Maximum size of a Classical CAN frame
252 * Maximum size of a CAN-FD frame
258 * can_cc_dlc2len(value) - convert a given data length code (dlc) of a
259 * Classical CAN frame into a valid data length of max. 8 bytes.
261 * To be used in the CAN netdriver receive path to ensure conformance with
262 * ISO 11898-1 Chapter 8.4.2.3 (DLC field)
266 /* helper to get the data length code (DLC) for Classical CAN raw DLC access */
271 (cf->len == CAN_MAX_DLEN) && in can_get_cc_dlc()
272 (cf->len8_dlc > CAN_MAX_DLEN && cf->len8_dlc <= CAN_MAX_RAW_DLC)) in can_get_cc_dlc()
273 return cf->len8_dlc; in can_get_cc_dlc()
276 return cf->len; in can_get_cc_dlc()
279 /* helper to set len and len8_dlc value for Classical CAN raw DLC access */
285 cf->len8_dlc = dlc; in can_frame_set_cc_len()
288 cf->len = can_cc_dlc2len(dlc); in can_frame_set_cc_len()
297 /* calculate the CAN Frame length in bytes of a given skb */