Xenomai  3.0.8
rtcan_sja1000.h
1 /*
2  * Copyright (C) 2006, Wolfgang Grandegger <wg@grandegger.com>
3  *
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software Foundation,
17  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19 
20 #ifndef __SJA1000_H_
21 #define __SJA1000_H_
22 
23 #include <rtcan_dev.h>
24 
25 struct rtcan_sja1000 {
26  unsigned char (*read_reg)(struct rtcan_device *dev, int off);
27  void (*write_reg)(struct rtcan_device *dev, int off, unsigned char val);
28  void (*irq_ack)(struct rtcan_device *dev);
29  unsigned short irq_num;
30  unsigned short irq_flags;
31  unsigned char ocr;
32  unsigned char cdr;
33  char bus_err_on;
34 };
35 
36 #ifdef CONFIG_FS_PROCFS
37 int rtcan_sja_create_proc(struct rtcan_device* dev);
38 void rtcan_sja_remove_proc(struct rtcan_device* dev);
39 #else
40 static inline int rtcan_sja_create_proc(struct rtcan_device* dev)
41 { return 0; }
42 static inline void rtcan_sja_remove_proc(struct rtcan_device* dev) { }
43 #endif
44 int rtcan_sja1000_register(struct rtcan_device *dev);
45 void rtcan_sja1000_unregister(struct rtcan_device *dev);
46 
47 
48 #endif /* __SJA1000_H_ */