0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _CAN_CORE_H
0015 #define _CAN_CORE_H
0016
0017 #include <linux/can.h>
0018 #include <linux/skbuff.h>
0019 #include <linux/netdevice.h>
0020
0021 #define DNAME(dev) ((dev) ? (dev)->name : "any")
0022
0023
0024
0025
0026
0027
0028
0029
0030 struct can_proto {
0031 int type;
0032 int protocol;
0033 const struct proto_ops *ops;
0034 struct proto *prot;
0035 };
0036
0037
0038
0039
0040
0041 #define CAN_REQUIRED_SIZE(struct_type, member) \
0042 (offsetof(typeof(struct_type), member) + \
0043 sizeof(((typeof(struct_type) *)(NULL))->member))
0044
0045
0046
0047 extern int can_proto_register(const struct can_proto *cp);
0048 extern void can_proto_unregister(const struct can_proto *cp);
0049
0050 int can_rx_register(struct net *net, struct net_device *dev,
0051 canid_t can_id, canid_t mask,
0052 void (*func)(struct sk_buff *, void *),
0053 void *data, char *ident, struct sock *sk);
0054
0055 extern void can_rx_unregister(struct net *net, struct net_device *dev,
0056 canid_t can_id, canid_t mask,
0057 void (*func)(struct sk_buff *, void *),
0058 void *data);
0059
0060 extern int can_send(struct sk_buff *skb, int loop);
0061 void can_sock_destruct(struct sock *sk);
0062
0063 #endif