]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/include/constants.h
The original version of Arnaud Westenberg Linux CAN-bus driver
[lincan.git] / lincan / include / constants.h
1 /* constants.h
2  * Header file for the Linux CAN-bus driver.
3  * Written by Arnaud Westenberg email:arnaud@wanadoo.nl
4  * This software is released under the GPL-License.
5  * Version 0.7  6 Aug 2001
6  */
7
8 #ifdef __CONSTANTS_H__
9 #else
10 #define __CONSTANTS_H__
11
12 /* Device name as it will appear in /proc/devices */
13 #define DEVICE_NAME "can"
14
15 /* Default driver major number, see /usr/src/linux/Documentation/devices.txt */
16 #define CAN_MAJOR 91
17
18 /* Timeout in jiffies before the system calls return with an error */
19 #define CANTIMEOUT (4*HZ)
20
21 /* Definition of the maximum number of concurrent supported hardware boards,
22  * chips per board, total number of chips, interrupts and message objects.
23  * Obviously there are no 32 different interrupts, but each chip can have its
24  * own interrupt so we have to check for it MAX_IRQ == MAX_TOT_CHIPS times.
25  */
26 #define MAX_HW_CARDS 8
27 #define MAX_HW_CHIPS 4
28 #define MAX_TOT_CHIPS (MAX_HW_CHIPS*MAX_HW_CARDS)
29 #define MAX_IRQ 32
30 #define MAX_MSGOBJS 15
31 #define MAX_TOT_MSGOBJS (MAX_TOT_CHIPS*MAX_MSGOBJS)
32 #define MAX_BUF_LENGTH 64
33
34 #define IE (1<<1)
35 #define SIE (1<<2)
36 #define EIE (1<<3)
37
38 #define SPACING 0x3c0
39
40 /* These flags can be used for the msgobj_t structure flags data entry */
41 #define OPENED (1<<0)
42
43 /* These flags can be used for the chip_t structure flags data entry */
44 #define CONFIGURED (1<<0)
45 #define SEGMENTED (1<<1)
46
47 /* These flags can be used for the candevices_t structure flags data entry */
48 #define PROGRAMMABLE_IRQ (1<<0)
49
50 enum timing_BTR1 {
51         MAX_TSEG1 = 15,
52         MAX_TSEG2 = 7
53 };
54
55 /* Flags for baud_rate function */
56 #define BTR1_SAM (1<<1)
57
58 #endif