mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-27 03:49:57 -04:00
can: dev: move bittiming related code into seperate file
This patch moves the bittiming related code of the CAN device infrastructure into a separate file. Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/r/20210111141930.693847-4-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#define _CAN_DEV_H
|
||||
|
||||
#include <linux/can.h>
|
||||
#include <linux/can/bittiming.h>
|
||||
#include <linux/can/error.h>
|
||||
#include <linux/can/led.h>
|
||||
#include <linux/can/netlink.h>
|
||||
@@ -82,21 +83,6 @@ struct can_priv {
|
||||
#endif
|
||||
};
|
||||
|
||||
#define CAN_SYNC_SEG 1
|
||||
|
||||
/*
|
||||
* can_bit_time() - Duration of one bit
|
||||
*
|
||||
* Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for
|
||||
* additional information.
|
||||
*
|
||||
* Return: the number of time quanta in one bit.
|
||||
*/
|
||||
static inline unsigned int can_bit_time(const struct can_bittiming *bt)
|
||||
{
|
||||
return CAN_SYNC_SEG + bt->prop_seg + bt->phase_seg1 + bt->phase_seg2;
|
||||
}
|
||||
|
||||
/*
|
||||
* can_cc_dlc2len(value) - convert a given data length code (dlc) of a
|
||||
* Classical CAN frame into a valid data length of max. 8 bytes.
|
||||
|
||||
Reference in New Issue
Block a user