]> rtime.felk.cvut.cz Git - socketcan-devel.git/blob - kernel/2.4/can/can.h
9497a8a7e489a49f5843f6d3566ee1136d72433d
[socketcan-devel.git] / kernel / 2.4 / can / can.h
1 /*
2  * can.h
3  *
4  * Copyright (c) 2002-2005 Volkswagen Group Electronic Research
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions, the following disclaimer and
12  *    the referenced file 'COPYING'.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of Volkswagen nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * Alternatively, provided that this notice is retained in full, this
21  * software may be distributed under the terms of the GNU General
22  * Public License ("GPL") version 2 as distributed in the 'COPYING'
23  * file from the main directory of the linux kernel source.
24  *
25  * The provided data structures and external interfaces from this code
26  * are not restricted to be used by modules with a GPL compatible license.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
39  * DAMAGE.
40  *
41  * Send feedback to <llcf@volkswagen.de>
42  *
43  */
44
45 #ifndef CAN_H
46 #define CAN_H
47
48 #ifdef __KERNEL__
49 #include "version.h"
50 RCSID("$Id$");
51 #endif
52
53 #include <linux/types.h>
54
55 #define ETH_P_CAN    0x000c
56
57 /* special address description flags for the CAN_ID */
58 #define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
59 #define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
60
61 /* valid bits in CAN ID for frame formats */
62 #define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
63 #define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
64
65 typedef __u32 canid_t;
66
67 struct can_frame {
68     canid_t can_id;      /* 32 bit CAN_ID + EFF/RTR flags */
69     __u8    can_dlc;     /* data length code: 0 .. 8 */
70     __u8    data[8] __attribute__ ((aligned(8)));
71 };
72
73 #endif /* CAN_H */