include/linux/can/bittiming.h

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

File Facts

System
Linux kernel
Corpus path
include/linux/can/bittiming.h
Extension
.h
Size
9560 bytes
Lines
281
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

struct can_tdc {
	u32 tdcv;
	u32 tdco;
	u32 tdcf;
};

/* The transceiver decoding margin corresponds to t_Decode in ISO 11898-2 */
#define CAN_PWM_DECODE_NS 5
/* Maximum PWM symbol duration. Corresponds to t_SymbolNom_MAX - t_Decode */
#define CAN_PWM_NS_MAX (205 - CAN_PWM_DECODE_NS)

/*
 * struct can_tdc_const - CAN hardware-dependent constant for
 *	Transmission Delay Compensation
 *
 * @tdcv_min: Transmitter Delay Compensation Value minimum value. If
 *	the controller does not support manual mode for tdcv
 *	(c.f. flag CAN_CTRLMODE_TDC_MANUAL) then this value is
 *	ignored.
 * @tdcv_max: Transmitter Delay Compensation Value maximum value. If
 *	the controller does not support manual mode for tdcv
 *	(c.f. flag CAN_CTRLMODE_TDC_MANUAL) then this value is
 *	ignored.
 *
 * @tdco_min: Transmitter Delay Compensation Offset minimum value.
 * @tdco_max: Transmitter Delay Compensation Offset maximum value.
 *	Should not be zero. If the controller does not support TDC,
 *	then the pointer to this structure should be NULL.
 *
 * @tdcf_min: Transmitter Delay Compensation Filter window minimum
 *	value. If @tdcf_max is zero, this value is ignored.
 * @tdcf_max: Transmitter Delay Compensation Filter window maximum
 *	value. Should be set to zero if the controller does not
 *	support this feature.
 */
struct can_tdc_const {
	u32 tdcv_min;
	u32 tdcv_max;
	u32 tdco_min;
	u32 tdco_max;
	u32 tdcf_min;
	u32 tdcf_max;
};

/*
 * struct can_pwm - CAN Pulse-Width Modulation (PWM) parameters
 *
 * @pwms: pulse width modulation short phase
 * @pwml: pulse width modulation long phase
 * @pwmo: pulse width modulation offset
 */
struct can_pwm {
	u32 pwms;
	u32 pwml;
	u32 pwmo;
};

/*
 * struct can_pwm - CAN hardware-dependent constants for Pulse-Width
 *	Modulation (PWM)
 *
 * @pwms_min: PWM short phase minimum value. Must be at least 1.
 * @pwms_max: PWM short phase maximum value
 * @pwml_min: PWM long phase minimum value. Must be at least 1.
 * @pwml_max: PWM long phase maximum value
 * @pwmo_min: PWM offset phase minimum value
 * @pwmo_max: PWM offset phase maximum value
 */
struct can_pwm_const {
	u32 pwms_min;
	u32 pwms_max;
	u32 pwml_min;
	u32 pwml_max;
	u32 pwmo_min;
	u32 pwmo_max;
};

struct data_bittiming_params {
	const struct can_bittiming_const *data_bittiming_const;
	struct can_bittiming data_bittiming;
	const struct can_tdc_const *tdc_const;
	const struct can_pwm_const *pwm_const;
	union {
		struct can_tdc tdc;
		struct can_pwm pwm;
	};
	const u32 *data_bitrate_const;
	unsigned int data_bitrate_const_cnt;
	int (*do_set_data_bittiming)(struct net_device *dev);
	int (*do_get_auto_tdcv)(const struct net_device *dev, u32 *tdcv);

Annotation

Implementation Notes