/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */1/* Copyright (c) 2002-2007 Volkswagen Group Electronic Research2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12* 3. Neither the name of Volkswagen nor the names of its contributors13* may be used to endorse or promote products derived from this software14* without specific prior written permission.15*16* Alternatively, provided that this notice is retained in full, this17* software may be distributed under the terms of the GNU General18* Public License ("GPL") version 2, in which case the provisions of the19* GPL apply INSTEAD OF those given above.20*21* The provided data structures and external interfaces from this code22* are not restricted to be used by modules with a GPL compatible license.23*24* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS25* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT26* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR27* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT28* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,29* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT30* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,31* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY32* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT33* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE34* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH35* DAMAGE.36*37*/3839#ifndef AF_CAN_H40#define AF_CAN_H4142#include <linux/skbuff.h>43#include <linux/netdevice.h>44#include <linux/list.h>45#include <linux/rcupdate.h>46#include <linux/can.h>4748/* af_can rx dispatcher structures */4950struct receiver {51struct hlist_node list;52canid_t can_id;53canid_t mask;54unsigned long matches;55void (*func)(struct sk_buff *skb, void *data);56void *data;57char *ident;58struct sock *sk;59struct rcu_head rcu;60};6162/* statistic structures */6364/* can be reset e.g. by can_init_stats() */65struct can_pkg_stats {66unsigned long jiffies_init;6768atomic_long_t rx_frames;69atomic_long_t tx_frames;70atomic_long_t matches;7172unsigned long total_rx_rate;73unsigned long total_tx_rate;74unsigned long total_rx_match_ratio;7576unsigned long current_rx_rate;77unsigned long current_tx_rate;78unsigned long current_rx_match_ratio;7980unsigned long max_rx_rate;81unsigned long max_tx_rate;82unsigned long max_rx_match_ratio;8384atomic_long_t rx_frames_delta;85atomic_long_t tx_frames_delta;86atomic_long_t matches_delta;87};8889/* persistent statistics */90struct can_rcv_lists_stats {91unsigned long stats_reset;92unsigned long user_reset;93unsigned long rcv_entries;94unsigned long rcv_entries_max;95};9697/* function prototypes for the CAN networklayer procfs (proc.c) */98void can_init_proc(struct net *net);99void can_remove_proc(struct net *net);100void can_stat_update(struct timer_list *t);101102#endif /* AF_CAN_H */103104105