Xenomai  3.1
rtcan_raw.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 __RTCAN_RAW_H_
21 #define __RTCAN_RAW_H_
22 
23 #ifdef __KERNEL__
24 
25 int rtcan_raw_ioctl_dev(struct rtdm_fd *fd, int request, void *arg);
26 
27 int rtcan_raw_check_filter(struct rtcan_socket *sock,
28  int ifindex, struct rtcan_filter_list *flist);
29 int rtcan_raw_add_filter(struct rtcan_socket *sock, int ifindex);
30 void rtcan_raw_remove_filter(struct rtcan_socket *sock);
31 
32 void rtcan_rcv(struct rtcan_device *rtcandev, struct rtcan_skb *skb);
33 
34 void rtcan_loopback(struct rtcan_device *rtcandev);
35 #ifdef CONFIG_XENO_DRIVERS_CAN_LOOPBACK
36 #define rtcan_loopback_enabled(sock) (sock->loopback)
37 #define rtcan_loopback_pending(dev) (dev->tx_socket)
38 #else /* !CONFIG_XENO_DRIVERS_CAN_LOOPBACK */
39 #define rtcan_loopback_enabled(sock) (0)
40 #define rtcan_loopback_pending(dev) (0)
41 #endif /* CONFIG_XENO_DRIVERS_CAN_LOOPBACK */
42 
43 #ifdef CONFIG_XENO_DRIVERS_CAN_BUS_ERR
44 void __rtcan_raw_enable_bus_err(struct rtcan_socket *sock);
45 static inline void rtcan_raw_enable_bus_err(struct rtcan_socket *sock)
46 {
47  if ((sock->err_mask & CAN_ERR_BUSERROR))
48  __rtcan_raw_enable_bus_err(sock);
49 }
50 #else
51 #define rtcan_raw_enable_bus_err(sock)
52 #endif
53 
54 int __init rtcan_raw_proto_register(void);
55 void __exit rtcan_raw_proto_unregister(void);
56 
57 #endif /* __KERNEL__ */
58 
59 #endif /* __RTCAN_RAW_H_ */
#define CAN_ERR_BUSERROR
Bus error (may flood!)
Definition: can.h:824