]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/include/constants.h
The first enhanced version of Linux CAN-bus driver for OCERA project
[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_TOT_CHIPS_STR 32    /* must be explicit for MODULE_PARM */
30 #define MAX_IRQ 32
31 #define MAX_MSGOBJS 15
32 #define MAX_TOT_MSGOBJS (MAX_TOT_CHIPS*MAX_MSGOBJS)
33 #define MAX_BUF_LENGTH 64
34
35 #define IE (1<<1)
36 #define SIE (1<<2)
37 #define EIE (1<<3)
38
39 #define SPACING 0x3c0
40
41 /* These flags can be used for the msgobj_t structure flags data entry */
42 #define OPENED (1<<0)
43 #define BUFFERS_ALLOCATED (1<<1)
44
45 /* These flags can be used for the chip_t structure flags data entry */
46 #define CONFIGURED (1<<0)
47 #define SEGMENTED (1<<1)
48
49 /* These flags can be used for the candevices_t structure flags data entry */
50 #define PROGRAMMABLE_IRQ (1<<0)
51
52 enum timing_BTR1 {
53         MAX_TSEG1 = 15,
54         MAX_TSEG2 = 7
55 };
56
57 /* Flags for baud_rate function */
58 #define BTR1_SAM (1<<1)
59
60 #endif