]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/include/constants.h
Fixes for SMP kernels and build for 2.2.xx and 2.6.xx kernels
[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  * Rewritten for new CAN queues by Pavel Pisa - OCERA team member
5  * email:pisa@cmp.felk.cvut.cz
6  * This software is released under the GPL-License.
7  * Version lincan-0.2  9 Jul 2003
8  */
9
10 #ifdef __CONSTANTS_H__
11 #else
12 #define __CONSTANTS_H__
13
14 /* Device name as it will appear in /proc/devices */
15 #define DEVICE_NAME "can"
16
17 /* Default driver major number, see /usr/src/linux/Documentation/devices.txt */
18 #define CAN_MAJOR 91
19
20 /* Timeout in jiffies before the system calls return with an error */
21 #define CANTIMEOUT (4*HZ)
22
23 /* Definition of the maximum number of concurrent supported hardware boards,
24  * chips per board, total number of chips, interrupts and message objects.
25  * Obviously there are no 32 different interrupts, but each chip can have its
26  * own interrupt so we have to check for it MAX_IRQ == MAX_TOT_CHIPS times.
27  */
28 #define MAX_HW_CARDS 8
29 #define MAX_HW_CHIPS 4
30 #define MAX_TOT_CHIPS (MAX_HW_CHIPS*MAX_HW_CARDS)
31 #define MAX_TOT_CHIPS_STR 32    /* must be explicit for MODULE_PARM */
32 #define MAX_IRQ 32
33 #define MAX_MSGOBJS 15
34 #define MAX_TOT_MSGOBJS (MAX_TOT_CHIPS*MAX_MSGOBJS)
35 #define MAX_BUF_LENGTH 64
36
37 #define IE (1<<1)
38 #define SIE (1<<2)
39 #define EIE (1<<3)
40
41 /* These flags can be used for the msgobj_t structure flags data entry */
42 #define OBJ_OPENED (1<<0)
43 #define OBJ_BUFFERS_ALLOCATED (1<<1)
44 #define OBJ_TX_REQUEST (1<<2)
45 #define OBJ_TX_LOCK (1<<3)
46
47 /* These flags can be used for the chip_t structure flags data entry */
48 #define CHIP_CONFIGURED (1<<0)
49 #define CHIP_SEGMENTED (1<<1)
50
51 /* These flags can be used for the candevices_t structure flags data entry */
52 #define PROGRAMMABLE_IRQ (1<<0)
53
54 enum timing_BTR1 {
55         MAX_TSEG1 = 15,
56         MAX_TSEG2 = 7
57 };
58
59 /* Flags for baud_rate function */
60 #define BTR1_SAM (1<<1)
61
62 #endif