Linux Kernel
3.7.1
|
#include <linux/module.h>
#include <linux/stddef.h>
#include <linux/init.h>
#include <linux/kmod.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/rcupdate.h>
#include <linux/uaccess.h>
#include <linux/net.h>
#include <linux/netdevice.h>
#include <linux/socket.h>
#include <linux/if_ether.h>
#include <linux/if_arp.h>
#include <linux/skbuff.h>
#include <linux/can.h>
#include <linux/can/core.h>
#include <linux/ratelimit.h>
#include <net/net_namespace.h>
#include <net/sock.h>
#include "af_can.h"
Go to the source code of this file.
Macros | |
#define | CAN_EFF_RTR_FLAGS (CAN_EFF_FLAG | CAN_RTR_FLAG) |
Variables | |
struct dev_rcv_lists | can_rx_alldev_list |
struct timer_list | can_stattimer |
struct s_stats | can_stats |
struct s_pstats | can_pstats |
#define CAN_EFF_RTR_FLAGS (CAN_EFF_FLAG | CAN_RTR_FLAG) |
int can_rx_register | ( | struct net_device * | dev, |
canid_t | can_id, | ||
canid_t | mask, | ||
void(*)(struct sk_buff *, void *) | func, | ||
void * | data, | ||
char * | ident | ||
) |
can_rx_register - subscribe CAN frames from a specific interface : pointer to netdevice (NULL => subcribe from 'all' CAN devices list) : CAN identifier (see description) : CAN mask (see description) : callback function on filter match : returned parameter for callback function : string for calling module indentification
Description: Invokes the callback function with the received sk_buff and the given parameter 'data' on a matching receive filter. A filter matches, when
<received_can_id> & mask == can_id & mask
The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can filter for error message frames (CAN_ERR_FLAG bit set in mask).
The provided pointer to the sk_buff is guaranteed to be valid as long as the callback function is running. The callback function must not free the given sk_buff while processing it's task. When the given sk_buff is needed after the end of the callback function it must be cloned inside the callback function with skb_clone().
Return: 0 on success -ENOMEM on missing cache mem to create subscription entry -ENODEV unknown device
void can_rx_unregister | ( | struct net_device * | dev, |
canid_t | can_id, | ||
canid_t | mask, | ||
void(*)(struct sk_buff *, void *) | func, | ||
void * | data | ||
) |
can_rx_unregister - unsubscribe CAN frames from a specific interface : pointer to netdevice (NULL => unsubcribe from 'all' CAN devices list) : CAN identifier : CAN mask : callback function on filter match : returned parameter for callback function
Description: Removes subscription entry depending on given (subscription) values.
can_send - transmit a CAN frame (optional with local loopback) : pointer to socket buffer with CAN frame in data section : loopback for listeners on local CAN sockets (recommended default!)
Due to the loopback this routine must not be called from hardirq context.
Return: 0 on success -ENETDOWN when the selected interface is down -ENOBUFS on full driver queue (see net_xmit_errno()) -ENOMEM when local loopback failed at calling skb_clone() -EPERM when trying to send on a non-CAN interface -EMSGSIZE CAN frame size is bigger than CAN interface MTU -EINVAL when the skb->data does not contain a valid CAN frame
EXPORT_SYMBOL | ( | can_ioctl | ) |
EXPORT_SYMBOL | ( | can_send | ) |
EXPORT_SYMBOL | ( | can_rx_register | ) |
EXPORT_SYMBOL | ( | can_rx_unregister | ) |
EXPORT_SYMBOL | ( | can_proto_register | ) |
EXPORT_SYMBOL | ( | can_proto_unregister | ) |
MODULE_ALIAS_NETPROTO | ( | PF_CAN | ) |
MODULE_AUTHOR | ( | "Urs Thuermann <[email protected]> | , |
""Oliver Hartkopp< oliver.hartkopp @volkswagen.de >" | |||
) |
module_exit | ( | can_exit | ) |
module_init | ( | can_init | ) |
MODULE_LICENSE | ( | "Dual BSD/GPL" | ) |
struct dev_rcv_lists can_rx_alldev_list |
struct timer_list can_stattimer |