1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Protoypes and definitions for CAN protocol modules using the PF_CAN core
9 * Copyright (c) 2002-2017 Volkswagen Group Electronic Research
10 * All rights reserved.
17 #include <linux/can.h>
18 #include <linux/skbuff.h>
19 #include <linux/netdevice.h>
21 #define CAN_VERSION "20170425"
23 /* increment this number each time you change some user-space interface */
24 #define CAN_ABI_VERSION "9"
26 #define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION
28 #define DNAME(dev) ((dev) ? (dev)->name : "any")
31 * struct can_proto - CAN protocol structure
32 * @type: type argument in socket() syscall, e.g. SOCK_DGRAM.
33 * @protocol: protocol number in socket() syscall.
34 * @ops: pointer to struct proto_ops for sock->ops.
35 * @prot: pointer to struct proto structure.
40 const struct proto_ops *ops;
44 /* function prototypes for the CAN networklayer core (af_can.c) */
46 extern int can_proto_register(const struct can_proto *cp);
47 extern void can_proto_unregister(const struct can_proto *cp);
49 int 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);
54 extern 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 *),
59 extern int can_send(struct sk_buff *skb, int loop);
60 extern int can_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
62 #endif /* !_CAN_CORE_H */