~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/can/af_can.h

Version: ~ [ linux-4.20-rc5 ] ~ [ linux-4.19.6 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.85 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.142 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.166 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.128 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.61 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.31.14 ] ~ [ linux-2.6.30.10 ] ~ [ linux-2.6.29.6 ] ~ [ linux-2.6.28.10 ] ~ [ linux-2.6.27.62 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
  3  * All rights reserved.
  4  *
  5  * Redistribution and use in source and binary forms, with or without
  6  * modification, are permitted provided that the following conditions
  7  * are met:
  8  * 1. Redistributions of source code must retain the above copyright
  9  *    notice, this list of conditions and the following disclaimer.
 10  * 2. Redistributions in binary form must reproduce the above copyright
 11  *    notice, this list of conditions and the following disclaimer in the
 12  *    documentation and/or other materials provided with the distribution.
 13  * 3. Neither the name of Volkswagen nor the names of its contributors
 14  *    may be used to endorse or promote products derived from this software
 15  *    without specific prior written permission.
 16  *
 17  * Alternatively, provided that this notice is retained in full, this
 18  * software may be distributed under the terms of the GNU General
 19  * Public License ("GPL") version 2, in which case the provisions of the
 20  * GPL apply INSTEAD OF those given above.
 21  *
 22  * The provided data structures and external interfaces from this code
 23  * are not restricted to be used by modules with a GPL compatible license.
 24  *
 25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 36  * DAMAGE.
 37  *
 38  */
 39 
 40 #ifndef AF_CAN_H
 41 #define AF_CAN_H
 42 
 43 #include <linux/skbuff.h>
 44 #include <linux/netdevice.h>
 45 #include <linux/list.h>
 46 #include <linux/rcupdate.h>
 47 #include <linux/can.h>
 48 
 49 /* af_can rx dispatcher structures */
 50 
 51 struct receiver {
 52         struct hlist_node list;
 53         canid_t can_id;
 54         canid_t mask;
 55         unsigned long matches;
 56         void (*func)(struct sk_buff *, void *);
 57         void *data;
 58         char *ident;
 59         struct sock *sk;
 60         struct rcu_head rcu;
 61 };
 62 
 63 #define CAN_SFF_RCV_ARRAY_SZ (1 << CAN_SFF_ID_BITS)
 64 #define CAN_EFF_RCV_HASH_BITS 10
 65 #define CAN_EFF_RCV_ARRAY_SZ (1 << CAN_EFF_RCV_HASH_BITS)
 66 
 67 enum { RX_ERR, RX_ALL, RX_FIL, RX_INV, RX_MAX };
 68 
 69 /* per device receive filters linked at dev->ml_priv */
 70 struct can_dev_rcv_lists {
 71         struct hlist_head rx[RX_MAX];
 72         struct hlist_head rx_sff[CAN_SFF_RCV_ARRAY_SZ];
 73         struct hlist_head rx_eff[CAN_EFF_RCV_ARRAY_SZ];
 74         int remove_on_zero_entries;
 75         int entries;
 76 };
 77 
 78 /* statistic structures */
 79 
 80 /* can be reset e.g. by can_init_stats() */
 81 struct s_stats {
 82         unsigned long jiffies_init;
 83 
 84         unsigned long rx_frames;
 85         unsigned long tx_frames;
 86         unsigned long matches;
 87 
 88         unsigned long total_rx_rate;
 89         unsigned long total_tx_rate;
 90         unsigned long total_rx_match_ratio;
 91 
 92         unsigned long current_rx_rate;
 93         unsigned long current_tx_rate;
 94         unsigned long current_rx_match_ratio;
 95 
 96         unsigned long max_rx_rate;
 97         unsigned long max_tx_rate;
 98         unsigned long max_rx_match_ratio;
 99 
100         unsigned long rx_frames_delta;
101         unsigned long tx_frames_delta;
102         unsigned long matches_delta;
103 };
104 
105 /* persistent statistics */
106 struct s_pstats {
107         unsigned long stats_reset;
108         unsigned long user_reset;
109         unsigned long rcv_entries;
110         unsigned long rcv_entries_max;
111 };
112 
113 /* function prototypes for the CAN networklayer procfs (proc.c) */
114 void can_init_proc(struct net *net);
115 void can_remove_proc(struct net *net);
116 void can_stat_update(struct timer_list *t);
117 
118 #endif /* AF_CAN_H */
119 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp