diff options
Diffstat (limited to 'include/linux/can')
-rw-r--r-- | include/linux/can/dev.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 1ed2a5cc03f5..3db7767d2a17 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
@@ -51,6 +51,15 @@ struct can_priv { | |||
51 | struct sk_buff **echo_skb; | 51 | struct sk_buff **echo_skb; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | /* | ||
55 | * get_can_dlc(value) - helper macro to cast a given data length code (dlc) | ||
56 | * to __u8 and ensure the dlc value to be max. 8 bytes. | ||
57 | * | ||
58 | * To be used in the CAN netdriver receive path to ensure conformance with | ||
59 | * ISO 11898-1 Chapter 8.4.2.3 (DLC field) | ||
60 | */ | ||
61 | #define get_can_dlc(i) (min_t(__u8, (i), 8)) | ||
62 | |||
54 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); | 63 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
55 | void free_candev(struct net_device *dev); | 64 | void free_candev(struct net_device *dev); |
56 | 65 | ||