]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/can/core.h
can: complete initial namespace support
[mirror_ubuntu-bionic-kernel.git] / include / linux / can / core.h
CommitLineData
0d66548a
OH
1/*
2 * linux/can/core.h
3 *
4 * Protoypes and definitions for CAN protocol modules using the PF_CAN core
5 *
6 * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
7 * Urs Thuermann <urs.thuermann@volkswagen.de>
cb5635a3 8 * Copyright (c) 2002-2017 Volkswagen Group Electronic Research
0d66548a
OH
9 * All rights reserved.
10 *
0d66548a
OH
11 */
12
42193e3e
OH
13#ifndef _CAN_CORE_H
14#define _CAN_CORE_H
0d66548a
OH
15
16#include <linux/can.h>
17#include <linux/skbuff.h>
18#include <linux/netdevice.h>
19
cb5635a3 20#define CAN_VERSION "20170425"
0d66548a
OH
21
22/* increment this number each time you change some user-space interface */
8b01939f 23#define CAN_ABI_VERSION "9"
0d66548a
OH
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 * struct can_proto - CAN protocol structure
31 * @type: type argument in socket() syscall, e.g. SOCK_DGRAM.
32 * @protocol: protocol number in socket() syscall.
0d66548a
OH
33 * @ops: pointer to struct proto_ops for sock->ops.
34 * @prot: pointer to struct proto structure.
35 */
36struct can_proto {
53914b67
OH
37 int type;
38 int protocol;
39 const struct proto_ops *ops;
40 struct proto *prot;
0d66548a
OH
41};
42
43/* function prototypes for the CAN networklayer core (af_can.c) */
44
1650629d
KVD
45extern int can_proto_register(const struct can_proto *cp);
46extern void can_proto_unregister(const struct can_proto *cp);
0d66548a 47
8e8cda6d
MK
48int can_rx_register(struct net *net, struct net_device *dev,
49 canid_t can_id, canid_t mask,
f1712c73
ED
50 void (*func)(struct sk_buff *, void *),
51 void *data, char *ident, struct sock *sk);
0d66548a 52
8e8cda6d
MK
53extern void can_rx_unregister(struct net *net, struct net_device *dev,
54 canid_t can_id, canid_t mask,
0d66548a
OH
55 void (*func)(struct sk_buff *, void *),
56 void *data);
57
58extern int can_send(struct sk_buff *skb, int loop);
53914b67 59extern int can_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
0d66548a 60
42193e3e 61#endif /* !_CAN_CORE_H */