]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/include/constants.h
6e716439cca227ce4b35d0db1fac233b11c18390
[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 //#define MAX_BUF_LENGTH 4
37
38 #define IE (1<<1)
39 #define SIE (1<<2)
40 #define EIE (1<<3)
41
42 /* These flags can be used for the msgobj_t structure flags data entry */
43 #define OBJ_OPENED (1<<0)
44 #define OBJ_BUFFERS_ALLOCATED (1<<1)
45 #define OBJ_TX_REQUEST (1<<2)
46 #define OBJ_TX_LOCK (1<<3)
47
48 /* These flags can be used for the chip_t structure flags data entry */
49 #define CHIP_CONFIGURED  (1<<0)
50 #define CHIP_SEGMENTED   (1<<1)
51 #define CHIP_IRQ_SETUP   (1<<2)
52
53 /* These flags can be used for the candevices_t structure flags data entry */
54 #define CANDEV_PROGRAMMABLE_IRQ (1<<0)
55 #define CANDEV_IO_RESERVED      (1<<1)
56
57 enum timing_BTR1 {
58         MAX_TSEG1 = 15,
59         MAX_TSEG2 = 7
60 };
61
62 /* Flags for baud_rate function */
63 #define BTR1_SAM (1<<1)
64
65 #endif