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