]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/include/main.h
Hotplug device support functions renamed
[lincan.git] / lincan / include / main.h
1 /**************************************************************************/
2 /* File: main.h - the CAN driver basic data structures and functions      */
3 /*                                                                        */
4 /* LinCAN - (Not only) Linux CAN bus driver                               */
5 /* Copyright (C) 2002-2009 DCE FEE CTU Prague <http://dce.felk.cvut.cz>   */
6 /* Copyright (C) 2002-2009 Pavel Pisa <pisa@cmp.felk.cvut.cz>             */
7 /* Funded by OCERA and FRESCOR IST projects                               */
8 /* Based on CAN driver code by Arnaud Westenberg <arnaud@wanadoo.nl>      */
9 /*                                                                        */
10 /* LinCAN is free software; you can redistribute it and/or modify it      */
11 /* under terms of the GNU General Public License as published by the      */
12 /* Free Software Foundation; either version 2, or (at your option) any    */
13 /* later version.  LinCAN is distributed in the hope that it will be      */
14 /* useful, but WITHOUT ANY WARRANTY; without even the implied warranty    */
15 /* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU    */
16 /* General Public License for more details. You should have received a    */
17 /* copy of the GNU General Public License along with LinCAN; see file     */
18 /* COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,  */
19 /* Cambridge, MA 02139, USA.                                              */
20 /*                                                                        */
21 /* To allow use of LinCAN in the compact embedded systems firmware        */
22 /* and RT-executives (RTEMS for example), main authors agree with next    */
23 /* special exception:                                                     */
24 /*                                                                        */
25 /* Including LinCAN header files in a file, instantiating LinCAN generics */
26 /* or templates, or linking other files with LinCAN objects to produce    */
27 /* an application image/executable, does not by itself cause the          */
28 /* resulting application image/executable to be covered by                */
29 /* the GNU General Public License.                                        */
30 /* This exception does not however invalidate any other reasons           */
31 /* why the executable file might be covered by the GNU Public License.    */
32 /* Publication of enhanced or derived LinCAN files is required although.  */
33 /**************************************************************************/
34
35 #include "./can.h"
36 #include "./constants.h"
37 #include "./can_sysdep.h"
38 #include "./can_queue.h"
39
40 #ifdef CAN_DEBUG
41         #define DEBUGMSG(fmt,args...) can_printk(KERN_ERR "lincan (debug): " fmt,\
42         ##args)
43 #else
44         #define DEBUGMSG(fmt,args...)
45 #endif
46
47 #define CANMSG(fmt,args...) can_printk(KERN_ERR "lincan: " fmt,##args)
48
49
50 extern can_spinlock_t canuser_manipulation_lock;
51
52 /**
53  * struct canhardware_t - structure representing pointers to all CAN boards
54  * @nr_boards: number of present boards
55  * @rtr_queue: RTR - remote transmission request queue (expect some changes there)
56  * @rtr_lock: locking for RTR queue
57  * @candevice: array of pointers to CAN devices/boards
58  */
59 struct canhardware_t {
60         int nr_boards;
61         struct rtr_id *rtr_queue;
62         can_spinlock_t rtr_lock;
63         struct candevice_t *candevice[MAX_HW_CARDS];
64 };
65
66 /**
67  * struct candevice_t - CAN device/board structure
68  * @hwname: text string with board type
69  * @candev_idx: board index in canhardware_t.candevice[]
70  * @io_addr: IO/physical MEM address
71  * @res_addr: optional reset register port
72  * @dev_base_addr: CPU translated IO/virtual MEM address
73  * @flags: board flags: %PROGRAMMABLE_IRQ .. interrupt number
74  *      can be programmed into board
75  * @nr_all_chips: number of chips present on the board
76  * @nr_82527_chips: number of Intel 8257 chips
77  * @nr_sja1000_chips: number of Philips SJA100 chips
78  * @chip: array of pointers to the chip structures
79  * @hwspecops: pointer to board specific operations
80  * @hosthardware_p: pointer to the root hardware structure
81  * @sysdevptr: union reserved for pointer to bus specific
82  *      device structure (case @pcidev is used for PCI devices)
83  *
84  * The structure represent configuration and state of associated board.
85  * The driver infrastructure prepares this structure and calls
86  * board type specific board_register() function. The board support provided
87  * register function fills right function pointers in @hwspecops structure.
88  * Then driver setup calls functions init_hw_data(), init_chip_data(),
89  * init_chip_data(), init_obj_data() and program_irq(). Function init_hw_data()
90  * and init_chip_data() have to specify number and types of connected chips
91  * or objects respectively.
92  * The use of @nr_all_chips is preferred over use of fields @nr_82527_chips
93  * and @nr_sja1000_chips in the board non-specific functions.
94  * The @io_addr and @dev_base_addr is filled from module parameters
95  * to the same value. The request_io function can fix-up @dev_base_addr
96  * field if virtual address is different than bus address.
97  */
98 struct candevice_t {
99         char *hwname;                   /* text board type */
100         int candev_idx;                 /* board index in canhardware_t.candevice[] */
101         unsigned long io_addr;          /* IO/physical MEM address */
102         unsigned long res_addr;         /* optional reset register port */
103         can_ioptr_t dev_base_addr;      /* CPU translated IO/virtual MEM address */
104         can_ioptr_t aux_base_addr;      /* CPU translated IO/virtual MEM address */
105         unsigned int flags;
106         int nr_all_chips;
107         int nr_82527_chips;
108         int nr_sja1000_chips;
109         can_spinlock_t device_lock;
110         struct canchip_t *chip[MAX_HW_CHIPS];
111
112         struct hwspecops_t *hwspecops;
113
114         struct canhardware_t *hosthardware_p;
115
116         union {
117                 void *anydev;
118             #ifdef CAN_ENABLE_PCI_SUPPORT
119                 struct pci_dev *pcidev;
120             #endif /*CAN_ENABLE_PCI_SUPPORT*/
121         } sysdevptr;
122
123 };
124
125 /**
126  * struct canchip_t - CAN chip state and type information
127  * @chip_type: text string describing chip type
128  * @chip_idx: index of the chip in candevice_t.chip[] array
129  * @chip_irq: chip interrupt number if any
130  * @chip_base_addr: chip base address in the CPU IO or virtual memory space
131  * @flags: chip flags: %CHIP_CONFIGURED .. chip is configured,
132  *      %CHIP_SEGMENTED .. access to the chip is segmented (mainly for i82527 chips)
133  * @clock: chip base clock frequency in Hz
134  * @baudrate: selected chip baudrate in Hz
135  * @write_register: write chip register function copy
136  * @read_register: read chip register function copy
137  * @chip_data: pointer for optional chip specific data extension
138  * @sja_cdr_reg: SJA specific register -
139  *      holds hardware specific options for the Clock Divider
140  *      register. Options defined in the sja1000.h file:
141  *      %CDR_CLKOUT_MASK, %CDR_CLK_OFF, %CDR_RXINPEN, %CDR_CBP, %CDR_PELICAN
142  * @sja_ocr_reg: SJA specific register -
143  *      hold hardware specific options for the Output Control
144  *      register. Options defined in the sja1000.h file:
145  *      %OCR_MODE_BIPHASE, %OCR_MODE_TEST, %OCR_MODE_NORMAL, %OCR_MODE_CLOCK,
146  *      %OCR_TX0_LH, %OCR_TX1_ZZ.
147  * @int_cpu_reg: Intel specific register -
148  *      holds hardware specific options for the CPU Interface
149  *      register. Options defined in the i82527.h file:
150  *      %iCPU_CEN, %iCPU_MUX, %iCPU_SLP, %iCPU_PWD, %iCPU_DMC, %iCPU_DSC, %iCPU_RST.
151  * @int_clk_reg: Intel specific register -
152  *      holds hardware specific options for the Clock Out
153  *      register. Options defined in the i82527.h file:
154  *      %iCLK_CD0, %iCLK_CD1, %iCLK_CD2, %iCLK_CD3, %iCLK_SL0, %iCLK_SL1.
155  * @int_bus_reg: Intel specific register -
156  *      holds hardware specific options for the Bus Configuration
157  *      register. Options defined in the i82527.h file:
158  *      %iBUS_DR0, %iBUS_DR1, %iBUS_DT1, %iBUS_POL, %iBUS_CBY.
159  * @msgobj: array of pointers to individual communication objects
160  * @chipspecops: pointer to the set of chip specific object filled by init_chip_data() function
161  * @hostdevice: pointer to chip hosting board
162  * @max_objects: maximal number of communication objects connected to this chip
163  * @chip_lock: reserved for synchronization of the chip supporting routines
164  *      (not used in the current driver version)
165  * @worker_thread: chip worker thread ID (RT-Linux specific field)
166  * @pend_flags: holds information about pending interrupt and tx_wake() operations
167  *      (RT-Linux specific field). Masks values:
168  *      %MSGOBJ_TX_REQUEST .. some of the message objects requires tx_wake() call,
169  *      %MSGOBJ_IRQ_REQUEST .. chip interrupt processing required
170  *      %MSGOBJ_WORKER_WAKE .. marks, that worker thread should be waked
171  *              for some of above reasons
172  *
173  * The fields @write_register and @read_register are copied from
174  * corresponding fields from @hwspecops structure
175  * (chip->hostdevice->hwspecops->write_register and
176  * chip->hostdevice->hwspecops->read_register)
177  * to speedup can_write_reg() and can_read_reg() functions.
178  */
179 struct canchip_t {
180         char *chip_type;
181         int chip_idx;   /* chip index in candevice_t.chip[] */
182         int chip_irq;
183         can_ioptr_t chip_base_addr;
184         unsigned int flags;
185         long clock; /* Chip clock in Hz */
186         long baudrate;
187
188         void (*write_register)(unsigned data, can_ioptr_t address);
189         unsigned (*read_register)(can_ioptr_t address);
190
191         void *chip_data;
192
193         unsigned short sja_cdr_reg; /* sja1000 only! */
194         unsigned short sja_ocr_reg; /* sja1000 only! */
195         unsigned short int_cpu_reg; /* intel 82527 only! */
196         unsigned short int_clk_reg; /* intel 82527 only! */
197         unsigned short int_bus_reg; /* intel 82527 only! */
198
199         struct msgobj_t *msgobj[MAX_MSGOBJS];
200
201         struct chipspecops_t *chipspecops;
202
203         struct candevice_t *hostdevice;
204
205         int max_objects;        /* 1 for sja1000, 15 for i82527 */
206
207         can_spinlock_t chip_lock;
208
209     #ifdef CAN_WITH_RTL
210         pthread_t worker_thread;
211         unsigned long pend_flags;
212     #endif /*CAN_WITH_RTL*/
213 };
214
215 /**
216  * struct msgobj_t - structure holding communication object state
217  * @obj_base_addr:
218  * @minor: associated device minor number
219  * @object: object number in canchip_t structure +1
220  * @flags: message object flags
221  * @ret: field holding status of the last Tx operation
222  * @qends: pointer to message object corresponding ends structure
223  * @tx_qedge: edge corresponding to transmitted message
224  * @tx_slot: slot holding transmitted message, slot is taken from
225  *      canque_test_outslot() call and is freed by canque_free_outslot()
226  *      or rescheduled canque_again_outslot()
227  * @tx_retry_cnt: transmission attempt counter
228  * @tx_timeout: can be used by chip driver to check for the transmission timeout
229  * @rx_msg: temporary storage to hold received messages before
230  *      calling to canque_filter_msg2edges()
231  * @hostchip: pointer to the &canchip_t structure this object belongs to
232  * @obj_used: counter of users (associated file structures for Linux
233  *      userspace clients) of this object
234  * @obj_users: list of user structures of type &canuser_t.
235  * @obj_flags: message object specific flags. Masks values:
236  *      %MSGOBJ_TX_REQUEST .. the message object requests TX activation
237  *      %MSGOBJ_TX_LOCK .. some IRQ routine or callback on some CPU
238  *              is running inside TX activation processing code
239  * @rx_preconfig_id: place to store RX message identifier for some chip types
240  *               that reuse same object for TX
241  */
242 struct msgobj_t {
243         can_ioptr_t obj_base_addr;
244         unsigned int minor;     /* associated device minor number  */
245         unsigned int object;    /* object number in canchip_t +1 for debug printk */
246         unsigned long obj_flags;
247         int ret;
248
249         struct canque_ends_t *qends;
250
251         struct canque_edge_t *tx_qedge;
252         struct canque_slot_t *tx_slot;
253         int tx_retry_cnt;
254         struct timer_list tx_timeout;
255
256         struct canmsg_t rx_msg;
257
258         struct canchip_t *hostchip;
259
260         unsigned long rx_preconfig_id;
261
262         atomic_t obj_used;
263         struct list_head obj_users;
264 };
265
266 #define CAN_USER_MAGIC 0x05402033
267
268 /**
269  * struct canuser_t - structure holding CAN user/client state
270  * @flags: used to distinguish Linux/RT-Linux type
271  * @peers: for connection into list of object users
272  * @qends: pointer to the ends structure corresponding for this user
273  * @msgobj: communication object the user is connected to
274  * @rx_edge0: default receive queue for filter IOCTL
275  * @userinfo: stores user context specific information.
276  *      The field @fileinfo.file holds pointer to open device file state structure
277  *      for the Linux user-space client applications
278  * @magic: magic number to check consistency when pointer is retrieved
279  *      from file private field
280  */
281 struct canuser_t {
282         unsigned long flags;
283         struct list_head peers;
284         struct canque_ends_t *qends;
285         struct msgobj_t *msgobj;
286         struct canque_edge_t *rx_edge0; /* simplifies IOCTL */
287         union {
288                 struct {
289                         struct file *file;  /* back ptr to file */
290                 } fileinfo;
291             #ifdef CAN_WITH_RTL
292                 struct {
293                         struct rtl_file *file;
294                 } rtlinfo;
295             #endif /*CAN_WITH_RTL*/
296         } userinfo;
297         int magic;
298 };
299
300 /**
301  * struct hwspecops_t - hardware/board specific operations
302  * @request_io: reserve io or memory range for can board
303  * @release_io: free reserved io memory range
304  * @reset: hardware reset routine
305  * @init_hw_data: called to initialize &candevice_t structure, mainly
306  *      @res_add, @nr_all_chips, @nr_82527_chips, @nr_sja1000_chips
307  *      and @flags fields
308  * @init_chip_data: called initialize each &canchip_t structure, mainly
309  *      @chip_type, @chip_base_addr, @clock and chip specific registers.
310  *      It is responsible to setup &canchip_t->@chipspecops functions
311  *      for non-standard chip types (type other than "i82527", "sja1000" or "sja1000p")
312  * @init_obj_data: called initialize each &msgobj_t structure,
313  *      mainly @obj_base_addr field.
314  * @program_irq: program interrupt generation hardware of the board
315  *      if flag %PROGRAMMABLE_IRQ is present for specified device/board
316  * @write_register: low level write register routine
317  * @read_register: low level read register routine
318  */
319 struct hwspecops_t {
320         int (*request_io)(struct candevice_t *candev);
321         int (*release_io)(struct candevice_t *candev);
322         int (*reset)(struct candevice_t *candev);
323         int (*init_hw_data)(struct candevice_t *candev);
324         int (*init_chip_data)(struct candevice_t *candev, int chipnr);
325         int (*init_obj_data)(struct canchip_t *chip, int objnr);
326         int (*program_irq)(struct candevice_t *candev);
327         void (*write_register)(unsigned data, can_ioptr_t address);
328         unsigned (*read_register)(can_ioptr_t address);
329 };
330
331 /**
332  * struct chipspecops_t - can controller chip specific operations
333  * @chip_config: CAN chip configuration
334  * @baud_rate: set communication parameters
335  * @standard_mask: setup of mask for message filtering
336  * @extended_mask: setup of extended mask for message filtering
337  * @message15_mask: set mask of i82527 message object 15
338  * @clear_objects: clears state of all message object residing in chip
339  * @config_irqs: tunes chip hardware interrupt delivery
340  * @pre_read_config: prepares message object for message reception
341  * @pre_write_config: prepares message object for message transmission
342  * @send_msg: initiate message transmission
343  * @remote_request: configures message object and asks for RTR message
344  * @check_tx_stat: checks state of transmission engine
345  * @wakeup_tx: wakeup TX processing
346  * @filtch_rq: optional routine for propagation of outgoing edges filters to HW
347  * @enable_configuration: enable chip configuration mode
348  * @disable_configuration: disable chip configuration mode
349  * @set_btregs: configures bitrate registers
350  * @attach_to_chip: attaches to the chip, setups registers and possibly state informations
351  * @release_chip: called before chip structure removal if %CHIP_ATTACHED is set
352  * @start_chip: starts chip message processing
353  * @stop_chip: stops chip message processing
354  * @irq_handler: interrupt service routine
355  * @irq_accept: optional fast irq accept routine responsible for blocking further interrupts
356  */
357 struct chipspecops_t {
358         int (*chip_config)(struct canchip_t *chip);
359         int (*baud_rate)(struct canchip_t *chip, int rate, int clock, int sjw,
360                                                 int sampl_pt, int flags);
361         int (*standard_mask)(struct canchip_t *chip, unsigned short code,
362                                                         unsigned short mask);
363         int (*extended_mask)(struct canchip_t *chip, unsigned long code,
364                                                         unsigned long mask);
365         int (*message15_mask)(struct canchip_t *chip, unsigned long code,
366                                                         unsigned long mask);
367         int (*clear_objects)(struct canchip_t *chip);
368         int (*config_irqs)(struct canchip_t *chip, short irqs);
369         int (*pre_read_config)(struct canchip_t *chip, struct msgobj_t *obj);
370         int (*pre_write_config)(struct canchip_t *chip, struct msgobj_t *obj,
371                                                         struct canmsg_t *msg);
372         int (*send_msg)(struct canchip_t *chip, struct msgobj_t *obj,
373                                                         struct canmsg_t *msg);
374         int (*remote_request)(struct canchip_t *chip, struct msgobj_t *obj);
375         int (*check_tx_stat)(struct canchip_t *chip);
376         int (*wakeup_tx)(struct canchip_t *chip, struct msgobj_t *obj);
377         int (*filtch_rq)(struct canchip_t *chip, struct msgobj_t *obj);
378         int (*enable_configuration)(struct canchip_t *chip);
379         int (*disable_configuration)(struct canchip_t *chip);
380         int (*set_btregs)(struct canchip_t *chip, unsigned short btr0,
381                                                         unsigned short btr1);
382         int (*attach_to_chip)(struct canchip_t *chip);
383         int (*release_chip)(struct canchip_t *chip);
384         int (*start_chip)(struct canchip_t *chip);
385         int (*stop_chip)(struct canchip_t *chip);
386         int (*irq_handler)(int irq, struct canchip_t *chip);
387         int (*irq_accept)(int irq, struct canchip_t *chip);
388 };
389
390 struct mem_addr {
391         void *address;
392         struct mem_addr *next;
393         size_t size;
394 };
395
396 /* Structure for the RTR queue */
397 struct rtr_id {
398         unsigned long id;
399         struct canmsg_t *rtr_message;
400         wait_queue_head_t rtr_wq;
401         struct rtr_id *next;
402 };
403
404 extern int major;
405 extern int minor[MAX_TOT_CHIPS];
406 extern int extended;
407 extern int baudrate[MAX_TOT_CHIPS];
408 extern int irq[MAX_IRQ];
409 extern char *hw[MAX_HW_CARDS];
410 extern unsigned long io[MAX_HW_CARDS];
411 extern long clockfreq[MAX_HW_CARDS];
412 extern int processlocal;
413
414 extern struct canhardware_t *hardware_p;
415 extern struct canchip_t *chips_p[MAX_TOT_CHIPS];
416 extern struct msgobj_t *objects_p[MAX_TOT_MSGOBJS];
417
418 extern struct mem_addr *mem_head;
419
420
421 #if defined(CONFIG_OC_LINCAN_PORTIO_ONLY)
422 extern inline void can_write_reg(const struct canchip_t *chip, unsigned char data, unsigned reg_offs)
423 {
424         can_outb(data, chip->chip_base_addr+reg_offs);
425 }
426 extern inline unsigned can_read_reg(const struct canchip_t *chip, unsigned reg_offs)
427 {
428         return can_inb(chip->chip_base_addr+reg_offs);
429 }
430 extern inline void canobj_write_reg(const struct canchip_t *chip, const struct msgobj_t *obj,
431                                 unsigned char data, unsigned reg_offs)
432 {
433         can_outb(data, obj->obj_base_addr+reg_offs);
434 }
435 extern inline unsigned canobj_read_reg(const struct canchip_t *chip, const struct msgobj_t *obj,
436                                 unsigned reg_offs)
437 {
438         return can_inb(obj->obj_base_addr+reg_offs);
439 }
440
441 #elif defined(CONFIG_OC_LINCAN_MEMIO_ONLY)
442 extern inline void can_write_reg(const struct canchip_t *chip, unsigned char data, unsigned reg_offs)
443 {
444         can_writeb(data, chip->chip_base_addr+reg_offs);
445 }
446 extern inline unsigned can_read_reg(const struct canchip_t *chip, unsigned reg_offs)
447 {
448         return can_readb(chip->chip_base_addr+reg_offs);
449 }
450 extern inline void canobj_write_reg(const struct canchip_t *chip, const struct msgobj_t *obj,
451                                 unsigned char data, unsigned reg_offs)
452 {
453         can_writeb(data, obj->obj_base_addr+reg_offs);
454 }
455 extern inline unsigned canobj_read_reg(const struct canchip_t *chip, const struct msgobj_t *obj,
456                                 unsigned reg_offs)
457 {
458         return can_readb(obj->obj_base_addr+reg_offs);
459 }
460
461 #else /*CONFIG_OC_LINCAN_DYNAMICIO*/
462 #ifndef CONFIG_OC_LINCAN_DYNAMICIO
463 #define CONFIG_OC_LINCAN_DYNAMICIO
464 #endif
465
466 /* Inline function to write to the hardware registers. The argument reg_offs is
467  * relative to the memory map of the chip and not the absolute memory reg_offs.
468  */
469 extern inline void can_write_reg(const struct canchip_t *chip, unsigned char data, unsigned reg_offs)
470 {
471         can_ioptr_t address_to_write;
472         address_to_write = chip->chip_base_addr+reg_offs;
473         chip->write_register(data, address_to_write);
474 }
475
476 extern inline unsigned can_read_reg(const struct canchip_t *chip, unsigned reg_offs)
477 {
478         can_ioptr_t address_to_read;
479         address_to_read = chip->chip_base_addr+reg_offs;
480         return chip->read_register(address_to_read);
481 }
482
483 extern inline void canobj_write_reg(const struct canchip_t *chip, const struct msgobj_t *obj,
484                                 unsigned char data, unsigned reg_offs)
485 {
486         can_ioptr_t address_to_write;
487         address_to_write = obj->obj_base_addr+reg_offs;
488         chip->write_register(data, address_to_write);
489 }
490
491 extern inline unsigned canobj_read_reg(const struct canchip_t *chip, const struct msgobj_t *obj,
492                                 unsigned reg_offs)
493 {
494         can_ioptr_t address_to_read;
495         address_to_read = obj->obj_base_addr+reg_offs;
496         return chip->read_register(address_to_read);
497 }
498
499 #endif /*CONFIG_OC_LINCAN_DYNAMICIO*/
500
501 int can_base_addr_fixup(struct candevice_t *candev, can_ioptr_t new_base);
502 int can_request_io_region(unsigned long start, unsigned long n, const char *name);
503 void can_release_io_region(unsigned long start, unsigned long n);
504 int can_request_mem_region(unsigned long start, unsigned long n, const char *name);
505 void can_release_mem_region(unsigned long start, unsigned long n);
506
507 struct boardtype_t {
508         const char *boardtype;
509         int (*board_register)(struct hwspecops_t *hwspecops);
510         int irqnum;
511 };
512
513 const struct boardtype_t* boardtype_find(const char *str);
514
515 int can_check_dev_taken(void *anydev);
516
517 #if defined(can_gettimeofday) && defined(CAN_MSG_VERSION_2) && 1
518 static inline
519 void can_filltimestamp(canmsg_tstamp_t *ptimestamp)
520 {
521         can_gettimeofday(ptimestamp);
522 }
523 #else /* No timestamp support, set field to zero */
524 static inline
525 void can_filltimestamp(canmsg_tstamp_t *ptimestamp)
526 {
527     #ifdef CAN_MSG_VERSION_2
528         ptimestamp->tv_sec = 0;
529         ptimestamp->tv_usec = 0;
530     #else /* CAN_MSG_VERSION_2 */
531         *ptimestamp = 0;
532     #endif /* CAN_MSG_VERSION_2 */
533
534 }
535 #endif /* End of timestamp source selection */
536
537 #ifdef CAN_WITH_RTL
538 extern int can_rtl_priority;
539 #endif /*CAN_WITH_RTL*/
540
541 extern struct candevice_t* register_hotplug_dev(const char *hwname,void *devdata,void (*chipdataregfnc)(struct canchip_t *chip,void *data));
542 extern void cleanup_hotplug_dev(struct candevice_t *dev);