1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef _CAN_CORE_H
14#define _CAN_CORE_H
15
16#include <linux/can.h>
17#include <linux/skbuff.h>
18#include <linux/netdevice.h>
19
20#define CAN_VERSION "20120528"
21
22
23#define CAN_ABI_VERSION "9"
24
25#define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION
26
27#define DNAME(dev) ((dev) ? (dev)->name : "any")
28
29
30
31
32
33
34
35
36struct can_proto {
37 int type;
38 int protocol;
39 const struct proto_ops *ops;
40 struct proto *prot;
41};
42
43
44
45extern int can_proto_register(const struct can_proto *cp);
46extern void can_proto_unregister(const struct can_proto *cp);
47
48extern int can_rx_register(struct net_device *dev, canid_t can_id,
49 canid_t mask,
50 void (*func)(struct sk_buff *, void *),
51 void *data, char *ident);
52
53extern void can_rx_unregister(struct net_device *dev, canid_t can_id,
54 canid_t mask,
55 void (*func)(struct sk_buff *, void *),
56 void *data);
57
58extern int can_send(struct sk_buff *skb, int loop);
59extern int can_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
60
61#endif
62