diff options
| author | Takashi Iwai <tiwai@suse.de> | 2009-12-17 12:27:22 +0100 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2009-12-17 12:27:22 +0100 |
| commit | 67cbf8a216259dceefe570f6dc14746f43b2e627 (patch) | |
| tree | 1eca0b9922dee01b4d00dc0713b7ff434dddd44c /include/linux/can | |
| parent | 6c941c8556dd9269be621cd8159fc60e955a91b3 (diff) | |
| parent | 2fbe74b90bafebce615466b4c20f96b0465df1ae (diff) | |
Merge branch 'fix/misc' into topic/misc
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 { struct sk_buff **echo_skb; }; +/* + * get_can_dlc(value) - helper macro to cast a given data length code (dlc) + * to __u8 and ensure the dlc value to be max. 8 bytes. + * + * To be used in the CAN netdriver receive path to ensure conformance with + * ISO 11898-1 Chapter 8.4.2.3 (DLC field) + */ +#define get_can_dlc(i) (min_t(__u8, (i), 8)) + struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); void free_candev(struct net_device *dev); |
