include/linux/can/length.h

Source file repositories/reference/linux-study-clean/include/linux/can/length.h

File Facts

System
Linux kernel
Corpus path
include/linux/can/length.h
Extension
.h
Size
9106 bytes
Lines
307
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef _CAN_LENGTH_H
#define _CAN_LENGTH_H

#include <linux/bits.h>
#include <linux/can.h>
#include <linux/can/netlink.h>
#include <linux/math.h>

/*
 * Size of a Classical CAN Standard Frame header in bits
 *
 * Name of Field				Bits
 * ---------------------------------------------------------
 * Start Of Frame (SOF)				1
 * Arbitration field:
 *	base ID					11
 *	Remote Transmission Request (RTR)	1
 * Control field:
 *	IDentifier Extension bit (IDE)		1
 *	FD Format indicator (FDF)		1
 *	Data Length Code (DLC)			4
 *
 * including all fields preceding the data field, ignoring bitstuffing
 */
#define CAN_FRAME_HEADER_SFF_BITS 19

/*
 * Size of a Classical CAN Extended Frame header in bits
 *
 * Name of Field				Bits
 * ---------------------------------------------------------
 * Start Of Frame (SOF)				1
 * Arbitration field:
 *	base ID					11
 *	Substitute Remote Request (SRR)		1
 *	IDentifier Extension bit (IDE)		1
 *	ID extension				18
 *	Remote Transmission Request (RTR)	1
 * Control field:
 *	FD Format indicator (FDF)		1
 *	Reserved bit (r0)			1
 *	Data length code (DLC)			4
 *
 * including all fields preceding the data field, ignoring bitstuffing
 */
#define CAN_FRAME_HEADER_EFF_BITS 39

/*
 * Size of a CAN-FD Standard Frame in bits
 *
 * Name of Field				Bits
 * ---------------------------------------------------------
 * Start Of Frame (SOF)				1
 * Arbitration field:
 *	base ID					11
 *	Remote Request Substitution (RRS)	1
 * Control field:
 *	IDentifier Extension bit (IDE)		1
 *	FD Format indicator (FDF)		1
 *	Reserved bit (res)			1
 *	Bit Rate Switch (BRS)			1
 *	Error Status Indicator (ESI)		1
 *	Data length code (DLC)			4
 *
 * including all fields preceding the data field, ignoring bitstuffing
 */
#define CANFD_FRAME_HEADER_SFF_BITS 22

/*
 * Size of a CAN-FD Extended Frame in bits
 *
 * Name of Field				Bits
 * ---------------------------------------------------------
 * Start Of Frame (SOF)				1
 * Arbitration field:
 *	base ID					11
 *	Substitute Remote Request (SRR)		1
 *	IDentifier Extension bit (IDE)		1
 *	ID extension				18
 *	Remote Request Substitution (RRS)	1
 * Control field:
 *	FD Format indicator (FDF)		1
 *	Reserved bit (res)			1
 *	Bit Rate Switch (BRS)			1
 *	Error Status Indicator (ESI)		1
 *	Data length code (DLC)			4
 *
 * including all fields preceding the data field, ignoring bitstuffing
 */
#define CANFD_FRAME_HEADER_EFF_BITS 41

Annotation

Implementation Notes