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
10 #ifndef __CONSTANTS_H__
11 #define __CONSTANTS_H__
13 /* Device name as it will appear in /proc/devices */
14 #define DEVICE_NAME "can"
16 /* Version of the driver reported by */
19 /* Default driver major number, see /usr/src/linux/Documentation/devices.txt */
22 /* Definition of the maximum number of concurrent supported hardware boards,
23 * chips per board, total number of chips, interrupts and message objects.
24 * Obviously there are no 32 different interrupts, but each chip can have its
25 * own interrupt so we have to check for it MAX_IRQ == MAX_TOT_CHIPS times.
27 #define MAX_HW_CARDS 8
28 #define MAX_HW_CHIPS 4
29 #define MAX_TOT_CHIPS (MAX_HW_CHIPS*MAX_HW_CARDS)
30 #define MAX_TOT_CHIPS_STR 32 /* must be explicit for MODULE_PARM */
32 #define MAX_MSGOBJS 15
33 #define MAX_TOT_MSGOBJS (MAX_TOT_CHIPS*MAX_MSGOBJS)
34 #define MAX_BUF_LENGTH 64
35 //#define MAX_BUF_LENGTH 4
38 /* These flags can be used for the msgobj_t structure flags data entry */
39 #define MSGOBJ_OPENED_b 0
40 #define MSGOBJ_TX_REQUEST_b 1
41 #define MSGOBJ_TX_LOCK_b 2
42 #define MSGOBJ_IRQ_REQUEST_b 3
43 #define MSGOBJ_WORKER_WAKE_b 4
45 #define MSGOBJ_OPENED (1<<MSGOBJ_OPENED_b)
46 #define MSGOBJ_TX_REQUEST (1<<MSGOBJ_TX_REQUEST_b)
47 #define MSGOBJ_TX_LOCK (1<<MSGOBJ_TX_LOCK_b)
48 #define MSGOBJ_IRQ_REQUEST (1<<MSGOBJ_IRQ_REQUEST_b)
49 #define MSGOBJ_WORKER_WAKE (1<<MSGOBJ_WORKER_WAKE_b)
51 #define can_msgobj_test_fl(obj,obj_fl) \
52 test_bit(MSGOBJ_##obj_fl##_b,&(obj)->obj_flags)
53 #define can_msgobj_set_fl(obj,obj_fl) \
54 set_bit(MSGOBJ_##obj_fl##_b,&(obj)->obj_flags)
55 #define can_msgobj_clear_fl(obj,obj_fl) \
56 clear_bit(MSGOBJ_##obj_fl##_b,&(obj)->obj_flags)
57 #define can_msgobj_test_and_set_fl(obj,obj_fl) \
58 test_and_set_bit(MSGOBJ_##obj_fl##_b,&(obj)->obj_flags)
59 #define can_msgobj_test_and_clear_fl(obj,obj_fl) \
60 test_and_clear_bit(MSGOBJ_##obj_fl##_b,&(obj)->obj_flags)
63 /* These flags can be used for the chip_t structure flags data entry */
64 #define CHIP_CONFIGURED (1<<0)
65 #define CHIP_SEGMENTED (1<<1)
66 #define CHIP_IRQ_SETUP (1<<2)
67 #define CHIP_IRQ_PCI (1<<3)
69 /* These flags can be used for the candevices_t structure flags data entry */
70 #define CANDEV_PROGRAMMABLE_IRQ (1<<0)
71 #define CANDEV_IO_RESERVED (1<<1)
73 /* Next flags are specific for struct canuser_t applications connection */
74 #define CANUSER_RTL_CLIENT (1<<0)
75 #define CANUSER_RTL_MEM (1<<1)
76 #define CANUSER_DIRECT (1<<2)
84 /* Flags for baud_rate function */
85 #define BTR1_SAM (1<<1)