linux/net/can/af_can.c
<<
>>
Prefs
   1/*
   2 * af_can.c - Protocol family CAN core module
   3 *            (used by different CAN protocol modules)
   4 *
   5 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
   6 * All rights reserved.
   7 *
   8 * Redistribution and use in source and binary forms, with or without
   9 * modification, are permitted provided that the following conditions
  10 * are met:
  11 * 1. Redistributions of source code must retain the above copyright
  12 *    notice, this list of conditions and the following disclaimer.
  13 * 2. Redistributions in binary form must reproduce the above copyright
  14 *    notice, this list of conditions and the following disclaimer in the
  15 *    documentation and/or other materials provided with the distribution.
  16 * 3. Neither the name of Volkswagen nor the names of its contributors
  17 *    may be used to endorse or promote products derived from this software
  18 *    without specific prior written permission.
  19 *
  20 * Alternatively, provided that this notice is retained in full, this
  21 * software may be distributed under the terms of the GNU General
  22 * Public License ("GPL") version 2, in which case the provisions of the
  23 * GPL apply INSTEAD OF those given above.
  24 *
  25 * The provided data structures and external interfaces from this code
  26 * are not restricted to be used by modules with a GPL compatible license.
  27 *
  28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECTc#L2DIRECTc#L2C ISANTL,
  33 * SPECITL, EXEMPLARY, OR CONSEQUSANITL DAMAGES (INCLUDING, BUT NOT
  34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  36 * THEORY OF LIABILITY, WHETHER IN CONTRACTc#STRICT LIABILITY, OR TORT
  37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  39 * DAMAGE.
  40 *
  41 */
  42
  43#include <linux/module.h>
  44#include <linux/stddef.h>
  45#include <linux/init.h>
  46#include <linux/kmod.h>
  47#include <linux/slab.h>
  48#include <linux/list.h>
  49#include <linux/spinlock.h>
  50#include <linux/rcupdate.h>
  51#include <linux/uaccess.h>
  52#include <linux/net.h>
  53#include <linux/netdevice.h>
  54#include <linux/socket.h>
  55#include <linux/if_ether.h>
  56#include <linux/if_arp.h>
  57#include <linux/skbuff.h>
  58#include <linux/can.h>
  59#include <linux/can/core.h>
  60#include <linux/ratelimit.h>
  61#include <net/net_namespace.h>
  62#include <net/sock.h>
  63
  64#include "af_can.h"
  65
  66static __initconst const char banner[] = KERN_INFO
  67        "can: controller area network core (" CAN_VERSION_STRING ")\n";
  68
  69MODULE_DESCRIPTION("Controller Area Network PF_CAN core");
  70MODULE_LICENSE("Dual BSD/GPL");
  71MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>, "
  72              "Oliver Hartkopp <oliver.hartkopp@volkswagen.de>");
  73
  74MODULE_ALIAS_NETPROTO(PF_CAN);
  75
  76static int stats_timer __read_mostly = 1;
  77module_param(stats_timer, int, S_IRUGO);
  78MODULE_PARM_DESC(stats_timer, "enable timer for statistics (default:on)");
  79
  80/* receive filters subscribed for 'all' CAN devices */
  81struct dev_rcv_lists can_rx_alldev_list;
  82static DEFINE_SPINLOCK(can_rcvlists_lock);
  83
  84static struct kmem_cache *rcv_cache __read_mostly;
  85
  86/* table of registered CAN protocols */
  87static const struct can_proto *proto_tab[CAN_NPROTO] __read_mostly;
  88static DEFINE_MUTEX(proto_tab_lock);
  89
  90struct timer_list can_stattimer;   /* timer for statistics update */
  91struct s_stats    can_stats;       /* packet statistics */
  92struct s_pstats   can_pstats;      /* receive list statistics */
  93
  94/*
  95 * af_can socket functions
  96 */
  97
  98int can_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
  99{
 100        struct sock *sk = sock->sk;
 101
 102        switch (cmd) {
 103
 104        case SIOCGSTAMP:
 105                return sock_get_timestamp(sk, (struct timeval __user *)arg);
 106
 107        default:
 108                return -ENOIOCTLCMD;
 109        }
 110}
 111EXPORT_SYMBOL(can_ioctl);
 112
 113static void can_sock_destruct(struct sock *sk)
 114{
 115        skb_queue_purge(&sk->sk_receive_queue);
 116}
 117
 118static const struct can_proto *can_get_proto(int protocol)
 119{
 120        const struct can_proto *cp;
 121
 122        rcu_read_lock();
 123        cp = rcu_dereference(proto_tab[protocol]);
 124        if (cp && !try_module_get(cp->prot->owner))
 125                cp = NULL;
 126        rcu_read_unlock();
 127
 128        return cp;
 129}
 130
 131static inline void can_put_proto(const struct can_proto *cp)
 132{
 133        module_put(cp->prot->owner);
 134}
 135
 136static int can_create(struct net *net, struct socket *sock, int protocol,
 137                      int kern)
 138{
 139        struct sock *sk;
 140        const struct can_proto *cp;
 141        int err = 0;
 142
 143        sock->state = SS_UNCONNECTED;
 144
 145        if (protocol < 0 || protocol >= CAN_NPROTO)
 146                return -EINVAL;
 147
 148        if (!net_eq(net, &init_net))
 149                return -EAFNOSUPPORT;
 150
 151        cp = can_get_proto(protocol);
 152
 153#ifdef CONFIG_MODULES
 154        if (!cp) {
 155                /* try to load protocol module if kernel is modular */
 156
 157                err = request_module("can-proto-%d", protocol);
 158
 159                /*
 160                 * In case of error we only print a message but don't
 161                 * return the error code immediately.  Below we will
 162                 * return -EPROTONOSUPPORT
 163                 */
 164                if (err)
 165                        printk_ratelimited(KERN_ERR "can: request_module "
 166                               "(can-proto-%d) failed.\n", protocol);
 167
 168                cp = can_get_proto(protocol);
 169        }
 170#endif
 171
 172        /* check for available protocol and correct usage */
 173
 174        if (!cp)
 175                return -EPROTONOSUPPORT;
 176
 177        if (cp->type != sock->type) {
 178                err = -EPROTOTYPE;
 179                goto errout;
 180        }
 181
 182        sock->ops = cp->ops;
 183
 184        sk = sk_alloc(net, PF_CAN, GFP_KERNEL, cp->prot);
 185        if (!sk) {
 186                err = -ENOMEM;
 187                goto errout;
 188        }
 189
 190        sock_init_data(sock, sk);
 191        sk->sk_destruct = can_sock_destruct;
 192
 193        if (sk->sk_prot->init)
 194                err = sk->sk_prot->init(sk);
 195
 196        if (err) {
 197                /* release sk on errors */
 198                sock_orphan(sk);
 199                sock_put(sk);
 200        }
 201
 202 errout:
 203        can_put_proto(cp);
 204        return err;
 205}
 206
 207/*
 208 * af_can tx path
 209 */
 210
 211/**
 212 * can_send - transmit a CAN frame (optional with local loopback)
 213 * @skb: pointer to socket buffer with CAN frame in data section
 214 * @loop: loopback for listeners on local CAN sockets (recommended default!)
 215 *
 216 * Due to the loopback this routine must not be called from hardirq context.
 217 *
 218 * Return:
 219 *  0 on success
 220 *  -ENETDOWN when the selected interface is down
 221 *  -ENOBUFS on full driver queue (see net_xmit_errno())
 222 *  -ENOMEM when local loopback failed at calling skb_clone()
 223 *  -EPERM when trying to send on a non-CAN interface
 224 *  -EMSGSIZE CAN frame size is bigger than CAN interface MTU
 225 *  -EINVAL when the skb->data does not contain a valid CAN frame
 226 */
 227int can_send(struct sk_buff *skb, int loop)
 228{
 229        struct sk_buff *newskb = NULL;
 230        struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
 231        int err = -EINVAL;
 232
 233        if (skb->len == CAN_MTU) {
 234                skb->protocol = htons(ETH_P_CAN);
 235                if (unlikely(cfd->len > CAN_MAX_DLEN))
 236                        goto inval_skb;
 237        } else if (skb->len == CANFD_MTU) {
 238                skb->protocol = htons(ETH_P_CANFD);
 239                if (unlikely(cfd->len > CANFD_MAX_DLEN))
 240                        goto inval_skb;
 241        } else
 242                goto inval_skb;
 243
 244        /*
 245         * Make sure the CAN frame can pass the selected CAN netdevice.
 246         * As structs can_frame and canfd_frame are similar, we can provide
 247         * CAN FD frames to legacy CAN drivers as long as the length is <= 8
 248         */
 249        if (unlikely(skb->len > skb->dev->mtu && cfd->len > CAN_MAX_DLEN)) {
 250                err = -EMSGSIZE;
 251                goto inval_skb;
 252        }
 253
 254        if (unlikely(skb->dev->type != ARPHRD_CAN)) {
 255                err = -EPERM;
 256                goto inval_skb;
 257        }
 258
 259        if (unlikely(!(skb->dev->flags & IFF_UP))) {
 260                err = -ENETDOWN;
 261                goto inval_skb;
 262        }
 263
 264        skb_reset_network_header(skb);
 265        skb_reset_transport_header(skb);
 266
 267        if (loop) {
 268                /* local loopback of sent CAN frames */
 269
 270                /* indication for the CAN driver: do loopback */
 271                skb->pkt_type = PACKET_LOOPBACK;
 272
 273                /*
 274                 * The reference to the originating sock may be required
 275                 * by the receiving socket to check whether the frame is
 276                 * its own. Example: can_raw sockopt CAN_RAW_RECV_OWN_MSGS
 277                 * Therefore we have to ensure that skb->sk remains the
 278                 * reference to the originating sock by restoring skb->sk
 279                 * after each skb_clone() or skb_orphan() usage.
 280                 */
 281
 282                if (!(skb->dev->flags & IFF_ECHO)) {
 283                        /*
 284                         * If the interface is not capable to do loopback
 285                         * itself, we do it here.
 286                         */
 287                        newskb = skb_clone(skb, GFP_ATOMIC);
 288                        if (!newskb) {
 289                                kfree_skb(skb);
 290                                return -ENOMEM;
 291                        }
 292
 293                        newskb->sk = skb->sk;
 294                        newskb->ip_summed = CHECKSUM_UNNECESSARY;
 295                        newskb->pkt_type = PACKET_BROADCAST;
 296                }
 297        } else {
 298                /* indication for the CAN driver: no loopback required */
 299                skb->pkt_type = PACKET_HOST;
 300        }
 301
 302        /* send to netdevice */
 303        err = dev_queue_xmit(skb);
 304        if (err > 0)
 305                err = net_xmit_errno(err);
 306
 307        if (err) {
 308                kfree_skb(newskb);
 309                return err;
 310        }
 311
 312        if (newskb)
 313                netif_rx_ni(newskb);
 314
 315        /* update statistics */
 316        can_stats.tx_frames++;
 317        can_stats.tx_frames_delta++;
 318
 319        return 0;
 320
 321inval_skb:
 322        kfree_skb(skb);
 323        return err;
 324}
 325EXPORT_SYMBOL(can_send);
 326
 327/*
 328 * af_can rx path
 329 */
 330
 331static struct dev_rcv_lists *find_dev_rcv_lists(struct net_device *dev)
 332{
 333        if (!dev)
 334                return &can_rx_alldev_list;
 335        else
 336                return (struct dev_rcv_lists *)dev->ml_priv;
 337}
 338
 339/**
 340 * find_rcv_list - determine optimal filterlist inside device filter struct
 341 * @can_id: pointer to CAN identifier of a given can_filter
 342 * @mask: pointer to CAN mask of a given can_filter
 343 * @d: pointer to the device filter struct
 344 *
 345 * Description:
 346 *  Returns the optimal filterlist to reduce the filter handling in the
 347 *  receive path. This function is called by service functions that need
 348 *  to register or unregister a can_filter in the filter lists.
 349 *
 350 *  A filter matches in general, when
 351 *
 352 *          <received_can_id> & mask == can_id & mask
 353 *
 354 *  so every bit set in the mask (even CAN_EFF_FLAG, CAN_RTR_FLAG) describe
 355 *  relevant bits for the filter.
 356 *
 357 *  The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
 358 *  filter for error messages (CAN_ERR_FLAG bit set in mask). For error msg
 359 *  frames there is a special filterlist and a special rx path filter handling.
 360 *
 361 * Return:
 362 *  Pointer to optimal filterlist for the given can_id/mask pair.
 363 *  Constistency checked mask.
 364 *  Reduced can_id to have a preprocessed filter compare value.
 365 */
 366static struct hlist_head *find_rcv_list(canid_t *can_id, canid_t *mask,
 367                                        struct dev_rcv_lists *d)
 368{
 369        canid_t inv = *can_id & CAN_INV_FILTER; /* save flag before masking */
 370
 371        /* filter for error message frames in extra filterlist */
 372        if (*mask & CAN_ERR_FLAG) {
 373                /* clear CAN_ERR_FLAG in filter entry */
 374                *mask &= CAN_ERR_MASK;
 375                return &d->rx[RX_ERR];
 376        }
 377
 378        /* with clear.c#L24_ERR_FLAG k remaina
 278                 * afte3 each37e" name="L270"> 270          3="comment3>                 */
 368{
 282          3     if (3( 370
CAN_ERR_FLAG) {
CAN_INV_FILTER;  368{
CAN_ERR_MASK="+code=can_id" an/aSFFcan.c#L375" id="L375" clSFFcan.cine" |h;
 326
                       3 * it38e" name="L196"> 196        if3="comment3>                       3 */ = - 303        newskb"+code=CAN_ERR_FNV_FILTER" class="sref">CAN_INV_FILTE href="+code=CAN_IMASK" class="sref">CAN_ERR_ame="L326"> 326
 339 303        can_id &  368{
rx[RX_ERR];
 376        }
 293          3         3   newskb loopback required */ 303        CAN_ERR_)ame="L368"> 368{
newskb->ef="+code=rx" class="sref">rx[RX_ERR];
 376        }
 327 303        /* indi3ation3for the CAN drt/ca=="+code=CAN_ERR_FLAG" class="sref">CAN_ERR_FLAG) {
 303        sk3->CAN_INV_FILTER;  373          4a href="n4t/can/af_can.c#L301" id=4L301"40e" name="L371"> 371        CAN_INV_FILTER;  373          4a2/can/af4can.c#L293" id="L293" cl4vice 4/
CAN_ERR_FL=a>="+code=can_id" an/aEFFcan.c#L375" id="L375" clEFFcan.cine" |h;
 373          4a3/can/af4c  newskb-> 303        4rr &= newskb->ef="+code=rx" class="sref">rx[RX_ERR];
 376        }
4     er4 =  377
 298          4(4rrCAN_ERR_FL=a>="+code=can_id" an/aSFFcan.c#L375" id="L375" clSFFcan.cine" |h;
 368{
kfree_skb(newskb->ef="+code=rx" class="sref">rx[_s="sref">newskb_s="ref=""+code=CAN_ERR_FNV_FILTER" class="sref">CAN_INVname="L376"> 376        }
4 9   err;
 377
 311
 312        if4(new41
 303        rx[RX_ERR];
 376        }
4et/can/af4can.c#L315" id="L315" cl4ss="l41ne" name="L325"> 325/* update stati4tics 41e" name="L196"> 196        if4href="+co4e=can_stats" class="sref4>can_4utine must not be called fro="line" name="L340"> 340 224 223 223 223inval_4kb 223 223err4 on a non-CAN interface
@f_can:_lisf_cahrefcan/f_camodulpan>_can.c# 223 223EX4ORT_S4ata does not contain a valid CA46" class="line" name="L346"> 346 346 351 351 */

 353 361 358 358 354 =  354 354 =  =  276 276 358/**
 354 362 362 * @mask: pointer to CA4 mask4of a given can_filter
 362 * @d: pointer to the d4vice 4ilter struct
 362 *
 303         * Description:
4a hre4="net/af_ref="+code=tx_framesax_"net/canTER" class="sref">Cax_"net/cannet/ *dev)
mask,
CAN_INVf="+code=mask" class="sref">mask,
 367          4="comment4> *  Returns the optimal4filte44"L297" class="line" nnnnnvo26"="+code=CAN_ERR_Fa hrd="L367" class=a hrFLAGn * =  367          4=et/can/a4> *  receive path. This 4uncti44f="+code=dev_rcv_lists" cchar"*/af_can.c#L332"f_canef">can_id &_canp;  368{
 *  to register or unre4ister44ne" name="L369"> 369         *
 326
 *  A filter matches in4gener4 = - *find_rcv_list( 326
 *
inval_lists *d)
 326
net_xmit_errnoname="L320"> 320
 *
 254        if4="comment4> *  so every bit set in4the m4likely( 303         *  relevant bits for t4e fil45e" name="L196"> 196        if4="comment4> *
inval_f="net/can/af_can.c id="L332" class="line" na href="+code=len" class="ssref">type != ARPHRD_CAN)) {
 196        if4=et/can/a4> *  The filter can be i4verte45f="+code=dev_rcv_list href="net/can/af_can.c#L2DEVc#L255" id="L25#L2DEVe" name="L326"> 326
 *  filter for error me4sages4ne" name="L259"> 259        if4="comment4> *  frames there is a s4ecial45/a>  326
 *
 196        if4="comment4> * Return:
inval_skb; href="net/can/af_can.c#L291" id="L291" class="line" name="L291"> 291          4="comment4> *  Pointer to optimal 4ilter46e" name="L293"> 293          4="comment4> *  Constistency checke4 mask46 href="+code=dev_queue_xmit"spin_lor="L294" class="lipin_lor=net/;
 326
 *  Reduced can_id to h4ve a 46e" name="L315"> 315         */
skb_reset_transpo"L368" class="line" nrno(net_devicetype !=  326
inval_f="net/can/af_can.c L368" class="line" n)name="L373"> 373          4         4                   struc4 canid_t *;
CAN_INVf=x_alldev_list;
<7" id="L367" class="line" nakb_reset_transpo"L368" class="line" n"ame="L326"> 326
 259        if4href="+co4e=canid_t" class="sref">4anid_46/a>->CAN_INV rno(CAN_INVame="L326"> 326
CAN_ERR_FL  rno(CAN_ERR_ame="L326"> 326
/* filter for e4ror m4->CA51" it_errnoname="L320"> 320
( 320
/* clea4 CAN_4RR_FLAG in filter entry=pkt_type" clanTER" class="sre
ERR_="+code=ARPHRD_CAN"  af_can.c#L318" id= af_e" nL  rno( 320
4ask &= can_id &_canp; <  rno(can_id &_canp;  320
 196        if4a href="n4t/can/af_can.c#L377" id=4L377"47"L297" class="line" n href="+code=find_rcvadd_rcv_find_add_rcv_;
can* 326
(clasi icode name="L318"> 318
/* with clear.c4L24_E47e" name="L259"> 259        if4="L359" c4>                 * afte4 each47/a>->Cp_delta" class="sref">tx_pframes_delta++;
 clasi i" class="sref">/a> clasi icode name="L318"> 318
                 */
Cp_delta" class="sref">tx_pframes_delta++;
 clasi i_ma>RX_ERR];
 clasi i_ma>e" na ltode=len" class="sf">Cp_delta" class="sref">tx_pframes_delta++;
 clasi i" class="sref">/a> clasi icode"me="L196"> 196        if4et/can/af4can.c#L282" id="L282" cl4ss="l48292" id="L292" class="line" net/can/af_can.cf">Cp_delta" class="sref">tx_pframes_delta++;
 clasi i_ma>RX_ERR];
 clasi i_ma>e" nano(tx_pframes_delta++;
 clasi i" class="sref">/a> clasi icodeame="L318"> 318
 298          4         4   
;
0dv" clasnf="cac->CAN_INV_FILTER;  369         369        txs*  A filter matches in 5="comment"> *  relevant6369"> 369    "nonf_can.c#L354>        4a          3   can_stats. 326
 339 326        4a          3           r4turn 4txs*  A >{
:
can_send);
Cax_t/c_lor=line"ame="L326"> 326        4
 293        4 3         3    328        4a          3    3280" id ss=="         3    366        4
);
( *find_rcv_list(/a> clasi icode"me="L196"> 196 298        4a  n class=" class="comm4nt">/4 indi3ation3fokely( *e" nanoonta clr_oode=de> = /a>,okely( * 326 270        5 4a href="n4t/can/af_can5c#L305" id="L301" clf="net/can/a(;
0dv" clasnf="cac        5s4et/can/af4can.c#L302" 5d="L352" cl4p_delta" class="sref">txs*  A5>        5 4a2/can/af4can.c#L293" 5d="L250" cl3ss="l3ne" name="L293"> 293        5 4a3/can/af4c   328        5a4(
 224        5
4      223
 2237 2238 223        5
4 9    223
 361
 346        5f4( 358        5a4      366        5
4et/can/af4can.c#L315" 5d="L355" cl4n,nvo);

( *dev)
mask,
CAN_INVf="+code=mask" class="sref">mask,
 367/* 5pdate51="sr4f">er4 =  * =  196        5f4href="+co4e=can_stats"5class5"sref4 298can_stakely( *e" nano 326find_rcv_list( 326find_rcv_list(nexsk" class="sref"nexsclass="sre
lERR_ame="L326"> 326d)
 32652" cl4ss="l4ne" name="L312"> 312kfree_ssref">inval_f="net/can/af_can.c id="L332" class="line" na href="+code=len" class="ssref">type != ARPHRD_CAN)) {
 196
 326        5s4et/can/af4_can.c#L325"5id="L52to h4ve a 46e" name="L315"> 315skb_r_queue_xmit"spin_lor="L294" class="lipin_lor=net/;
 326 327can_stats.(net_devicetype !=  326 373 */
5a hre52afte4 each47/a>->net_device,

@f">"BUG:"na#L351" id="noef="und8" id=quot;66" class="line" name="L366"> 366"typub c7;s, #L35 c7;03X,/can/a5 c7;03X\n=quot;66" claass="line" name="L367"> 367net_devicenet_devicetyperef">CAN_INVf="+codeCAN_ERR_FNV_FILTER" class="sref">CAN_INVf="+cde=CAN_ERR_FMASK" class="sre !=  326CAN_INVf="+cousk" class="sref"ous" class="line" name="L326"> 326txs*  A5> 315skb_rcanid_t *;
CAN_INVf=x_alldev_list;
<7" id="L367" class="line" nakb_reset_transpo"L368" class="line" n"ame="L326"> 326 327 366 348/**
5a hre5="net4can/a4_can.c#L340" id="tttttttt* exd=",clasc"43"f="nL377" mayef="span>
 344 358 366 * @mask: p5inter54" cl3ss="l3ne" name="L293"> 293 * @d: poin5er to54ecke4 mask46 href="+code=devclass=.c#_eachs="sry_rcvadd_rcv_can*can* 373 *
<5 href54TER; inval_f="net/kt_type" clanTER" class="sre
ERR_="+code=ARPHRD_CAN" a hrILTER" class="sr"L355SFLAGn href="ARPHRD_CAN" a hrILTER" class="srss="line" na href="+code=lkt_type" clanTER" class="sre
ERR_="+code=ARPHRD_CAN" LAG" class="sref"L355SFLAGn href="de=CAN_ERR_FLAG" class="sref">CANSFLAGn  href="+come="L303"> 303        5a4="comment4> * Descript5on:er4 =  196        5 4="comment4> *  Returns5the o5timal4filte44"L297" class=====breakGn  href="+come="L303"> 303 *  receive5path.5This 4uncti44fp_delta" class="sref">txs*  A5>{
 *  to regi5ter o54de=n3wskb"38e" name="L339"> 339        5a4="comment4> *
<5 href54+cod3=kfre3_skb" class="s loopback re66" class="line" name="L366"> 366
_sA46" class="line" name="L346"> 346
 346 *         5<r55o CA4 mask4of a given can_fitttttttt* willef="#03",63" i> r wille219" ="ldan/af a"Lit#" ="ne.c#id=""/af_can.c#L"ine" name="L358"> 358
 366        5f4="comment4> *  so ever5 bit 55to h4ve a 46e" name="L315"> 315        5a4="comment4> *  relevan5 bits55="sr4f">er4 373        5f4="comment4> *
<5 href55 id=4L377"47"L297" class="line" n hrpr9" ecvnet/c_lor="L2pr9" esref">net_device,

@f">"BUG:"na#L351" id="ub" canoef="und8" id=quot;66" class="line" name="L366"> 366        5f4=et/can/a4> *  The fil5er ca5 be i4verte45f="+code=kfre3_skb" class="s an>
@f">"typub c7;s, #L35 c7;03X,/can/a5 c7;03X\n=quot;66" claass="line" name="L367"> 367
kfree_skb(>net_devicenet_devicetyperef">CAN_INVf="+codeCAN_ERR_FNV_FILTER" class="sref">CAN_INVf="+cde=CAN_ERR_FMASK" class="sre !=  326        5f4="comment4> *  frames 5here 55ef">4anid_46/a>->e" nano 326
CAN_INVf="+cousk" class="sref"ous" class="line" name="L326"> 326        5f4="comment4> * Return:<5span>5txs*  A5>        5 4="comment4> *  Pointer5to op5imal 4ilter46e" name="L293"> 293        5 4="comment4> *  Constis5ency 5hecke4 mask46 href="+code=devclass=del_rcvadd_rcv_ *;
 326
 326        5s4="comment4> */
5a hre56e=d"4class47e" name="L196"> 196
inval_f="net/c(tx_pframes_delta++;
 clasi i" class="sref">/a> lass=0 clasi icode"me="L196"> 196        5 4         4            5     5struc4 tx_pframes_delta++;
 clasi i" class="sref">/a>-- !=  326
 259        5f4href="+co4e=canid_t" c5ass="56+cod3=kfre3_skb" class="s loopback reqremoveall'/a> = -03RFrequesan 366
rx[ clasi i" clemove_on_zero++;
 373
/* 5ilter5for e4ror m4-> 326
mask47
type != ml_pr9" clasi i_ma>e" nano 326
/57ent"4/*txs*  A5>
 315
CAN_INVf="+cousk" class="sref"ous" cl:ve a 46e" name="L315"> 315
skb_r_queuune_xmit"spin_lor="L294" cune_xm="lipin_lor=net/;
 326
 326
/* 5ith c578cod3=kfre3_skb" class="s loopback reqscheefcanhref="nL377" it#" " iddelet="L3*366" class="line" name="L366"> 366        5f4="L359" c4>           5     5 afte4 each47/sref">inval_f="net/kt_type" clanTER" cla clasi icode"me="L196"> 196
 *;
CAN_INVf="+codeCde=delete_pans 326        5f4et/can/af4can.c#L282" 5d="L258" cl4p_delta" class="sref">txs*  A5>
CAN_INVf="+ccan_send);

 326
 254->5a href="+coss="sref">CAN5INV_F5LTER);
);
 *LAGn * =  298 196h4ve a 46f">txs*  A filter matche5a>   5     373 *  5eleva58 id=4L377"47"ss="sref">skb_rkt_type" clanTER" class="sre
ERR_="+code=ARPHRD_CAN" a hrd="L367" cld);
 =  326
can_stats. 318
txs*  A5>        5ss         3           <5 href58afte3 each37e" name="L270"> 270        5a          3           r5turn 5 *d)
 = LAGn * =  196{
 373        5
 326        5 3         3   find_rcv_list(nk" class="sref"n class="sre
ERR_ame="L326"> 326/a>->5a          3   CA51" it_errnoname="L320"> 3200" id ss5="         3   find_rcv_list(code=de> = CAds=a hrFLAGn *fin)LAGn * =  320ilter ma5
skb_rcde=mask" class="sref">mask,
ode=de> =  320
 326        5a  n class=" class="comm5nt">/59indi3ation3for thref="net/can/af_set_transpo"L368" cl href="+code=RX_ERR" class="srefclasi i" class="sref" "L30 clasi icode"me="L196"> 1964anid_46/a>-> 320        6 4a href="n4t/can/af_can6c#L306" id="" it_errnoname="L320"> 3201       6 "         3   }
 373        6 4a2/can/af4can.c#L293" 6d="L260sref4>mask47

 366        6 4a3/can/af4c  
CAN_INVf=x_alldevlass="sref">rx[RX_ERR];
can* 373        6a4( 3735       6a"         3   er4 = );
 =  326

 3187txs*  A6>8kfree_sp_delta" class="sref">txs*  A6>94anid_46/a>-> 318
txs*  A6>
 312        6f4(mask47 366="sref">txs*  A64ilter struct 353el4A"> 326
n.c#L332"nTER" claass="line" nakb_rnk" class="sref"n claref">CAN_INVf=x_alldevlasllpend"li6"L3"l W="(mcan.cred="L)/6f_can61="L367" class=khem_cac 3735       6a"         3   erref">mask6/a>,
4anr=line"am" class=> = c6n_stakely( *
mask47 366="sref">txs*  A64ilter struct 353el4FI> 326
n.c#L332"nTER" claass="line" nakb_rnk" class="sref"n claref">CAN_INVf=x_alldevlasn cl5s4ur6 0;
can* 373        6a4(can*CAN_INVf=x_alldevlasnid_46/a>-can/af4can.c#L321" 5d="L652s i62_ma>e" na ltode=len" class="sf">Cp_delta" clclanTER" class="sre
ERR_="+code=ARPHRD_CAN" LAG" class="sreass="line" n)name="L373"> 3735       6a"         3   erhref="+co6e=d" class="sref">d)6);
 = type != 4aRD_CAN4a6"> 196sk626vnet/c_lor="L294" class="la hrecvnet/_delta" clin+co

6
 366="sref">txs*  A64ilter struct 353el4INVf="+code=mask" el4INVn.c#L332"nTER" claass="line" nakb_rnk" class="sref"n claref">CAN_INVf=x_alldevlasn"sref">c6.can* 373        6a4(can*CAN_INVf=x_alldevlasn"slse {
<="ssref">type !=  326Cp_delta" clclanTER" class="sre
ERR_="+code=ARPHRD_CAN" LAG" class="sreass="line" n)name="L373"> 3735       6a"         3   erppr9" ecv6et/c_lor="L2pr9" esref">6et_de6ice);
 = 4an.c#L376"6iDNAMEsref">net_devicet   3ef="+code=sk6" cla60ef">4an="line" 6ss="sre != 63 href="+code=can_send" class="sre6"L53sref46mask47
C6N_INV63naf_ref="+code=tx_fr class="sref">net__delta"="sre270
 326-> 320        6 4a href="n4RTRan/af_can6c#L306" id="" RTRan/af *ca6id_t *txs*  A6>8INVf=x_al6dev_list;
<7" id="L367" cl63_FNV_FILTER" class="ssi i_ma>e" n6 cl5s4 t/6an/af4n (struct  320        6 4a href="n4tFFan/af_can6c#L306" id="" iFFan/afef"af"n claref">CAN_INVf=x_alldevlas> 3666span cl5s4n"comment4can.6#L33963ass="ssref">typeref">CAN_INVf="+kb6 clas61sref4>mask47 366="sref">txs*  A64ilter struct 353el4iFFcacCAN_INVf=x_alldevlas"> 348/*6can*can* 373CAN_INVf=x_alldevlas"6 64_ma>e" na ltode=len" class="syperef">CAN_INVf="+clanTER" class="sre
ERR_="+code=ARPHRD_CAN" LAG" class="sreass="line" n)name="L373"> 3735       6a"         3   ertttttttt*6been an>
ref">CAN_INVf="+de=de> = 4a<+codcan.6#L332"nTER" claass="line6 nakb6rnexsk" class="sref"ne   3ef="+code=sk6" cla60ef">4a( 320 ="line" n)name="L="" SFFaMASK_can6c#L306" id="" SFFaMASK class="comm6ee_sk60 cla4s="sr4f">18" "L3556FLAGn href="_can.c#L332"6af_ca64al_f="net/c(mask47 366="sref">txs*  A64ilter struct0" c51" it_errnoname="L320"> 32L332"nTER" claass="line" nakb_rnk" class="sref"n claref">CAN_INVf=x_alldevlas"cl5s4 t/6mment4> *  Returns5the o6timal64 ca5 be i4verte45f="+code=kfref">CAN_INVf="+clanTER" class="sre
ERR_="+code=ARPHRD_CAN" LAG" class="sreass="line" n)name="L373"> 3735       6a"         3   ert 3666"L303"> 303 326Cp_delta" clde=de> =  *  to regi5ter o64de=n65ce4ae" name="6366"> 366

 *  6     65>type != _delta" class="sref">txs*  A6>89" ="ldan6af a"Lit#" ="ne.c#id=""/6f_can6c#L"inf5"4="comment4> *
<5 h66ne" name6ment4> *
<5 href56he d465d5can_i564cke4 mask46 href="+code6  so ever6 bit 55to h4ve a 46e" na6e="L3658" class="line" name="L328"> 3280 196 254->5a href="+coss="sref">CAN5INV_F5LTER);
 366        5
4et/can/af4can.c#L315" 5d="L hr*net_de6ice( *<666   6    5f4=et/can/a4> *  Th6 fil565code=de
find_rcv_list(nexsk" class="sref"nexsclass="sre
lERR_ame="L326"> 326net_devicet( * 326 326<65>        5f4="comment4>6*  fr66="sref" "L30 clasi icode"me="L196"L332"nTER603"m_ca/c_lor=line"ame="6326">6326
net_updatme="s="s="lA6>
C6N_INV66="n4t/can/af_cme="L328"> 328"sref">tx_pframes_delta++;
 clasi i" clx    326        564="co6ment4> * Return:<5span>5"sref">tx_pframes_delta++;
 clasi i" clx   flx    326 *6 Redu66a h4"+code=dev" 5lass=53ent"4cu20 adref"ous" cl:ve a 46e4cu20 adref"ode=AR3   erdev;
CAN6="+code=h6is5_head5 clas4="sre46"s6ef">i66s="line" nakb_reset_transpo"L368" cla R_="+cone"ampackesf="usockes" clasen1 to 4Aall_canfic" >
 32803p_delta" class="sref">txs*  A5>        5ss"4ef">CAN_INVf="+cousk" cx_all hf""line" nakb_rnk" clsk" cx_all hf""linn)name="L373"> 373 *erd.c#L376"6s="sref">tx_pframes_delt6+66=ARPHRD_CAN" LA51" i" class="sref6259"> 2596/5>        5f4href="+co46=cani6_t" c5ass="56+_reset_transpo"L368" cla a hr  5f4="commentid="L5ishref"ame>
(nexsk" class="sref"nexsclass="srame="L326"> 326 327ca63"> 373
 32803p_delta" class="sref">txs*  A5>        5ss"4efrILTER" class="s1" it_errnoname= hr*L373"> 373 *erd.c#s="ssref"6ml_pr9" clasi i_ma>e" na6o 326
erdev<"comment46ef="+code=m5sk" c57to h46e a 467
CAN6="+cc#L375" i6=4L377"47"ss="sref">skb_6_queu67ine" nakb_reset_transpo"L368" cla R_="consumame="L* consuma_ndsRPHRD_CAN" LAG" class="sreass="line" n)name="erdev<"376"6s="sL326"> 326
 196laref">CAN_INVf=x_alldevlas"cl5ldev_list6/a>;
tx_pframes_delta++;
 clasi i" clx  e> = ->tx_pframes_delta++;
 clasi i" clx  e> = flx  e> = CAN_INVf="6ctype != LAGn * =68n_i564cke4 mask46 href="+code6  soan_stats"6class5"sref4txs*  A5>   R4an/af4ne" name="L254"> 254->5a href="+coss="sref">CAN5INV_F5LTER);
 366        5
4et/can/af4can.c#L315" 5d="L hr*lass="line" name="L366"> 366<6HRD_CAN" 6 hrd="L367" cld);
 312         5
4et/canpnakb_rnk" clsk" ptf=inss="srx_"net/canTERinspan366" class="line" name="L366"> 366        5
4et/canorig_/af4can.c#L315" 5dorig_/af hr*CAN_INVf=x_alldevlas"cl5l376"6s="snTER" class="sre
ERR_="+6ode=A68ation3fokely( *        5
4et/cancft_errnoname="L320frame="L3errnoname="L320"> 3200fd" id ss5="         3     e=595ref4>mask47( *find_rcv_list(code=de> = 6si icode 6ame="L318"> 318
d)
<6 href="net/can/af_can.c#6368" 69la59ef">4anid_46/a>->find_("cikelyR4an/tttttttt*366" clast_eqs="line" name="L366eq" name="L327"> 327<_L36t" class=na hf">finL36" name="L327"> 327="sref">tinit_L36t" class=na hf"init_L36o4>/*) = 6AGn>->(code=de> = 6sk47<6span5
 327 312kfree_ssref">inval_f="net/c ||ode=can_send" class="sre6"L53 L367" cl6ss="sre
ERR_ame="L326"> 626mask47( * * 14e=kfree_skb"5cSFFaMAX_DLEf">kfree_ssref">SFFaMAX_DLEf hr*lass="line" name="L366"> 366<6">mask&qPFf="n: "ropprefnon"conform>
<5 *ode=de>6= "5s4eoef="ud, leloef="ud, rcv_leloef="ud" id=quot;66" class="line" name="L366"> 366<6       5a6 n class=" class="comm5n6">/596ndi3ation3for thref="n 312 373 *4anid_46/a>->(code=de> = 76 328"sre6);
 327ca63">7373"> 3737/6>        6 4a2/can/af47an.c#70e != _delta" class="sref">txs* NET_RX_SUCCESSspan cl5s4eref=NET_RX_SUCCESSlist(code=de> = 7643"> 3737/       3   txs*  A5>
 = fin)LAGn ref="_ndsRPHRD_CAN" LAG" class="sreass="line" n)name="erdev7ine"ame="7326"> 326
txs* NET_RX_DROPspan cl5s4eref=NET_RX_DROPlist(code=de> = 768e"ame="73 can_stats.txs*  A6>7txs*  A5fd_delR4an/af4ne" name="L254"> 254->5a href="+coss="sref">CAN5INV_F5LTER);
 366        5
4et/can/af4can.c#L315" 5d="L hr*lass="line" name="L366"> 366<746/a>->7 312         5
4et/canpnakb_rnk" clsk" ptf=inss="srx_"net/canTERinspan366" class="line" name="L366"> 366        5
4et/canorig_/af4can.c#L315" 5dorig_/af hr* 318
CAN_INVf=x_alldevlas"cl7" cl4ss="74ne" name="L312"> 312( *        5
4et/cancft_errnoname="L320frame="L3errnoname="L320"> 3200fd" id ss5="         3     e=595ref4>mask47( *find_rcv_list(code=de> = 7nd"li6"L37l W="(mcan.cred="L)/6f_c7n61="71"can.c#L332"nTER#03"m_ca/c_lor=li7>mask6/a>7
find_("cikelyR4an/tttttttt*366" clast_eqs="line" name="L366eq" name="L327"> 327<_L36t" class=na hf">finL36" name="L327"> 327="sref">tinit_L36t" class=na hf"init_L36o4>/*)->(code=de> = 7ine"am" c7ass=> = c6n_s7akely( * 327 312kfree_ssref">inval_f="net/c ||ode=can_send" class="sre6"L57se {
<4et7can/af4can.c#L319" 56="L7561="71di3ation3for thref="n( * 328"ft_errnoname="L320frame=" b" clcvnet/c_lor="lelass="sreass="lilel 14e=kfree_skb"5cSFFFDaMAX_DLEf">kfree_ssref">SFFFDaMAX_DLEf hr*lass="line" name="L366"> 366<746/a>-can7af4can.c#L321" 5d="L652s7i62_m7>e" na ltode=len" class="sf">,

@f">&qPFf="n: "ropprefnon"conform>
<5 FD *d)6)>,

@f">"5s4eoef="ud, leloef="ud, rcv_leloef="ud" id=quot;66" class="line" name="L366"> 366<7ine" 6a h7ef="+code=len" class6"ss7e6">t7pe !=  3285> 312 373 * 366<7id"li6"L37
->(code=de> = 71967k626v72or="L294" b" clf">fin)LAGn);
 327ca63">7pin_l6r=n7t/6
txs* NET_RX_SUCCESSspan cl5s4eref=NET_RX_SUCCESSlist(code=de> = 7ef">c6.(c(type !=  ;txs*  A5>
6et_7e6ice7e=l" clan/af_cclf">fin)LAGn ref="_ndsRPHRD_CAN" LAG" class="sreass="line" n)name="erdev75>txs* NET_RX_DROPspan cl5s4eref=NET_RX_DROPlist(code=de> = 7L376"6iDN7MEsref">net_devicecan_stats.
C6N_I7V63na7_ref="path.5This 4uncti44fp_delta" class="sref">txs*  A5>{
 326{
txs*  A5>{
 *txs*  A5>{
txs*  A5>{
/*6 326txs*  A5>{
e" naCA4 mask4of a given can*lta" class="sref">txs*  A5>{

txs*  A5>{
 * @can_id:5point56 to7464>t74r55o CA4 mask4of a given can*  0all_succesclta" class="sref">txs*  A5>{
txs*  A5>{
txs*  A5>{
txs*  A5>{
        5
4et/cancpspan cl5s4eref=cp hr* 303 aref">CAN_INVf=x_alldevlas"cl7=4="c6mme7t4> *  to regi5ter o64de7n65ce7e=l" clan/af_cf (! e="L328"> 3280pspan cl5s4eref=cp hr*" b" clcvnet/c_lor="href54+c_errnoname="L32href54+cltst(code=de> = 7ame="63667> 366

 e=af_set_transpo"L368" cl href="7>
 *  6   7 65>t7pe != _del a hrILTER" cla0" chref5_errnoname="L32href5 &l> 19 ||!  b" f=4e=kfree_skb"5cSFFaNPROTO">kfree_ssref">SFFaNPROTO hr*CAN_INVf=x_alldevlas"cl7"ldan6af 7"Lit#" ="ne.c#id=""/6f_c7n6c#L7567" class=khem_cac,

@f">&qvla: href54+conumb5soef="ud out of range" id=quot;66" class="line" name="L366"> 366<7 name6men74> *
<5 href56he 7465d575_FILTER" class="ssine" na hrerdev7 ever6 bi7 55to h4ve a 46e" na6e="73658"75a  sax_"net/canTE_delta" cla-(code=de> = 7ax_al6dev7L2pr9" esref">net_de6ice7e65te75f4can.c#L307"sref">can_stats.   6   75f4=et/can/a4> *  Th6 fi7565co75rcv_lista>(c(net_device e= 3280pspan cl5s4eref=cp hr*" b" clcvnet/c_lor="href_errnoname="L32hreff=inss0erdev7 326<65> 7      5f4="comment4>6*  7r66="765ass="56+cod3=kfre3_skb" class="er"_errnoname="L32er" &l> 19632676e" na ltode=len" clasta" class="sref">txs* er"_errnoname="L32er"a href="6" cla60="sr4f">erdev7 
C6N_I7V66="76usk" class="sref"ous" class="6 347 name6"L376"> 326        564="7o6men74> * Return:<5span>5mutexous" cl:ve a 46e4cu2mutexous" RPHRDame="L373">="sref">thref5_tabous" cl:ve a 46e4cu2href5_tabous" erdev7"ldan6"+c7de=devclass=del_rcva6d_r7v66a#73"can.c#L332"nTER#03"m_ca/c_lo6"> 726 *6 Re7u66a 76ilter struct<_46/a>->0" chref5_errnoname="L32href5]CAN_INVf=x_alldevlas"cl7a hre6="+7orx[,

@f">&qvla: href54+coef="ud alref"ycs="sref"ed" id=quot;66" class="line" name="L366"> 366<7ode=h6is57head5 clas4="sre46"s6ef"7i66s=76f4can.c#L307" 6d="L360imal4ferdev75>   6   7     5struc4  e=-a href="6" cla60="sr4f">erdev7 376"6iDN7ref">tx_pframes_delt6(erdev7> 2596/5>7       5f4href="+co46=ca7i6_t"77"L366"> 366        5f4="L359" c4RCU_INIT_POINTE0" chref5_errnoname="L32href5]nt4>           5  pspan cl5s4eref=cp hr*erdev7;

<7 href5"4an class=4co6men7"6/* 77t/can/af_cme="L328"> 328mutexo("comment4n &="sref">thref5_tabous" cl:ve a 46e4cu2href5_tabous" erdev7sk47<6spa7>
e" na7omask47-> &l> 19 326
="sref">thref5_uns="sref"_errnoname="L32href5_uns="sref"RPHRD"L328"> 3280pspan cl5s4eref=cp hr*" b" clcvnet/c_lor="href_errnoname="L32hreff=inerdev7s hre6="+7ef="+code=m5sk" c57to h47e a 477
CAN6="+7c#L375" i7=4L377"47"ss="sref">skb_7_queu77f4can.c#L307"ta" class="sref">txs* er"_errnoname="L32er"a href="6" cla60="sr4f">erdev7;>   6   7t/;
can_stats. 326
 ; 32803p_href5_s="sref"_errnoname="L320 19href5_s="sref"RPHRerdev7it#" " id7elet="L3*366" class="lin7" nam78ef" "L30 clasi icode"me="L196"L337ldev_list7/a>;
txs*  A5>{
txs*  A5>{
CAN_INVf="7c 326txs*  A5>{
LAGn * =78n_i56name="L328"> 3280 19href5_uns="sref"_errnoname="L320 19href5_uns="sref"RPHRDconst       3           5
4et/cancpspan cl5s4eref=cp hr*CAN_INVf=x_alldevlas"cl7HRD_CAN" 7 hrd="L367" cld);
 e="L328"> 3280pspan cl5s4eref=cp hr*" b" clcvnet/c_lor="href54+c_errnoname="L32href54+cltst(code=de> = 726
="sref">thref5_tabous" cl:ve a 46e4cu2href5_tabous" erdev7si icode 7ame="L318"> 318
fin)LAGnkfree_ssref">BUG_OfRPHRD_CAN" LAG" clashref5_tabcl:ve a 46e4cu2href5_tablterpa6a>0" chref5_errnoname="L32href5]ref=4e=kfree_skb"5c pspan cl5s4eref=cp hr*erdev7>d)
<7 href="net/can/af_can.c#7368" 79h" class=/a>(nexsk" class="sRCU_INIT_POINTE0" chref5_errnoname="L32href5]nt4>           5 NU26
erdev7>_INVf="+7e> = 7AGn 328mutexo("comment4n &="sref">thref5_tabous" cl:ve a 46e4cu2href5_tabous" erdev7sk47<6spa75
erdev7sL367" cl7ss="sre
ERR_ame="L326"> 726 *fin)LAGn 3280pspan cl5s4eref=cp hr*" b" clcvnet/c_lor="href_errnoname="L32hreff=inerdev7">maskcan_stats.ode=de>7=  32803p_href5_uns="sref"_errnoname="L320 19href5_uns="sref"RPHRerdev7"376"6s="7 n class=" class="comm5n7">/5979HRD_CAN" LA51" i" class="sref62598code=RX_E8R" class="srefclasi i" c8ass="80=l" cCA4 mask4of a given cadelta" class="sref">txs*  A5>{
{
txs*  A5>{
 3738/6>        6 4a2/can/af48an.c#80e"line" f (!        5
4et/cannbcl:ve a 46e4cu2nef=inssunsigned long="L328"> 328msgent4n & 3738/       3   find_rcv_listCAN_INVf=x_alldevlas"cl8> =  366        5
4et/can/af4can.c#L315" 5d="L hr*"L3errnoname="L320"> 320 366  e=595ref4>mask47L294" b" clf">find_rcv_list(code=de> = 8ine"ame="8326"> 326
find_rcv_list(nexsk" class="sref"nexsclass="sre
lERR_ame="L326"> 326t 327<_L36t" class=na hf">finL36" name="L327"> 327="sref">tinit_L36t" class=na hf"init_L36o4>/*)ista>(c(txs*  A6>8 366      ta" class="sref">txs* NOTIFY_DONEspan cl5s4eref=NOTIFY_DONEe
lERR_ame="L326"> 326->8 318
/4ss="l4ne" name="L312"> 312kfree_ssref">inval_f="net/c)ista>(c( 37384ne" name="L312"> 312 != txs* NOTIFY_DONEspan cl5s4eref=NOTIFY_DONEe
lERR_ame="L326"> 326 3738l W="(mcan.cred="L)/6f_c8n61="81"can.c#L332"nTER#03"m_ca/c_lor=li8>mask6/a>8
CAN_INVf=x_alldevlas"cl8> = CAN6="+8ine"am" c8ass=> = txs* NETDEV_REGISTEtxs*  A5>
c6n_s8akely( *(c(
 328kzcanocef"nexsclass="skzcanocRPHRD=izeof((nexsk" class="sref"nexsclass="sre
lE)nt4>           5 GFP_KERNEL_errnoname="L32GFP_KERNELRPHRerdev846/a>-can8af4can.c#L321" 5d="L652s8i62_m8>e" na ltode=len" clasyf /tttttttt*366" clref"nexsclass="sre
lE)laref">CAN_INVf=x_alldevlas"cl8="+co6e=d8 class="sref">d)6) hrILTER" cla0" cprf (ment4n &CAN_INVf=x_alldevlas"cl8=73"> 3738ef="+code=len" class6"ss8e6">t8pe != 
@f">&qvla: canocahion of r"commentid="Lailed" id=quot;66" cerdev8443"> 3738
txs* NOTIFY_DONEspan cl5s4eref=NOTIFY_DONEe
lERR_ame="L326"> 326can_stats.8k626v82pe" clanTER" clas a hrILTER" cla0" cBUG_Of">kfree_ssref">BUG_OfRPHRD_CAN" LAG" class>erdev84ne"am" c8t/6
 328ref"nexsclass="sre
lERR_ame="L326"> 326c6.(c(type !=  326 3266et_8e6ice83ef" "L30 clasi icode"me="L196"L3385>txs* NETDEV_UNREGISTEtxs*  A5>
net_device="sref">tcA5>   v_lisous" cl:ve a 46e4cu2cA5>   v_lisous" RPHRerdev8ine" 6ss=8sre != 
C6N_I8V63na8367" class=khem_cac 328s>erdev8i96 326CAN_INVf=x_alldevlas"cl8 la5s6"sr8 *(c(erdev8if">c6. 326Cm_cacerdev848/*6 328NU26
erdev84>e" na ltode=len" class="sypecan_stats.
erdev84ne" 6ss=84> * @can_id:5point56 to8464>t8pe != 
@f">&qvla: notifi"a: r"commentid="notd=4L377"47"L297" class="line" n hrpr9" ecv8dcan.6#L382"nTER" claass="line6 na8b6rne8sk" class="sref"ne   3ef=========   3rt_transpo"L3er san>
@f">&qfound"L5isuot;ef="us" id=quot;66" cl" hreint/<+cclanr>erdev8496="sref">tcA5>   v_lisous" cl:ve a 46e4cu2cA5>   v_lisous" RPHRerdev8dx_al6dev8n href="_can.c#L332"6af_8a64al84_FILTER" class="ssi i_ma>e" n6 cl8s4 t/6mme8t4> *  Returns5the o6tim8l64 c85 be i4verte45f="+codebreakRR_ame="L326"> 3266"L383"> 303 326can_stats. *  to regi5ter o64de8n65ce85ef" "L30 clasi icode"me="L196"L338ame="63668> 366

txs* NOTIFY_DONEspan cl5s4eref=NOTIFY_DONEe
lERR_ame="L326"> 326
can_stats.<6pan8cl5"4=et/can/a4> *  6   8 65>t85f="+code=can_send" class="sre6"L58"ldan6af 8"Lit#" ="ne.c#id=""/6f_c8n6c#L85ref="path.5This 4uncti44fp_delta" class="sref">txs*  A5>{
 *
<5 href56he 8465d585ilterCA4 mask4of a given can* 5>{
txs*  A5>{
net_de6ice8e65te85_FILTER" class="ssi i_ma>e" n6 cl85>   6   85f4=et/can/a4> *  Th6 fi8565co85rcv_l"line" ="srx_"net/canTERinspaesf="u_2"> 312  "L328"> 32803p_hsf="u_errnoname="L320 19hsf="u "L328"> 328_dref"omostly" b" clf">find__dref"omostlyRPHR e=ef="+a hrp_delta" class="6 hr8L376"6iDN8MEsref">net_device clasi i" clx  2"> 312kfree_ssref">ETH_Psrefe
lE)nf="+a hrp_delta" class="6 hr8 326<65> 8      5f4="comment4>6*  8r66="865ass="56+cod3> clasi i" clx  r ma">kfree_ssref">r matxs*  A5>   R4annf="+a hrp_delta" class="6 hr8 me="63668_ca/c_lor=line"ame="63268>632686e" na}RR_ame="L326"> 326C6N_I8V66="86usk" class="sref"ous" class="6 348 name6"L386"> 326        564="8o6men863cv_l"line" ="srx_"net/canTERinspaesf="u_2"> 312  "L328"> 32803pfd_hsf="u_errnoname="L320 1fd_hsf="u "L328"> 328_dref"omostly" b" clf">find__dref"omostlyRPHR e=ef="+a hrp_delta" class="6 hr8"ldan6"+c8de=devclass=del_rcva6d_r8v66a#864/can/af_can.> clasi i" clx  2"> 312kfree_ssref">ETH_PsrefFDe
lE)nf="+a hrp_delta" class="6 hr8 name6men8href5"4="comment4> *6 Re8u66a 86ilter struct<> clasi i" clx  r ma">kfree_ssref">r matxs*  A5fd_delR4annf="+a hrp_delta" class="6 hr8 ever6 bi8orx[ 326   6   8     5struc4 find_L366href5_family "L328"> 32803p_family_opx_pframes_delta++family_opxRPHR e=ef="+a hrp_delta" class="6 hr8"376"6iDN8ref">tx_pframes_delt6 clasi i" clx  family" b" clf">find_family f=4e=kfree_skb"5cPFf="n" b" clf">find_PFf="nR4annf="+a hrp_delta" class="6 hr8> 2596/5>8       5f4href="+co46=ca8i6_t"875ass="56+cod3> clasi i" clx  create_pframes_delta(> clasi i" clx  own"a_errnoname="L32own"a" clasf=4e=kfree_skb"5cTHIS_MODULEspan cl5s4eref=THIS_MODULER4annf="+a hrp_delta" class="6 hr8>
 326
e" na8o 326
 4e=kfree_skb"5c 3p_n "L328"> 328_dref"omostly" b" clf">find__dref"omostlyRPHR e=ef="+a hrp_delta" class="6 hr8s hre6="+8ef="+code=m5sk" c57to h48e a 4876" class=/a>(> clasi i" clx  notifi"a_calc_errnoname="L32notifi"a_calcskb_8_queu87f4can}RR_ame="L326"> 326   6   8t/;
(c( 326
 "line" "L328"> 328_dinit" b" clf">find__dinitfind_n3p_initRPHRDname)ista>(c( 328BUILD_BUG_Of">kfree_ssref">BUILD_BUG_OfRPHRD_CAN" LAG" clasoffsetoa>->5a href="offsetoaRPHRD      3   nt4>           5   <"dla">kfree_ssref">  <"dla hr*CAN_INVf="8c != ->5a href="offsetoaRPHRD      3   nt4>           5 lelass="sreass="lilel->5a href="offsetoaRPHRD      3   nt4>           5 /294" b" clf">find_rcv_list->5a href="offsetoaRPHRD      3   nt4>           5 /294" b" clf">find_rcv_list<erdev8an_stats"8class5"sref4CAN6="+8HRD_CAN" 8 hrd="L367" cld);
erdev826
="sref">tcA5> x_alc hr_v_liss="sref">txs*  A5> x_alc hr_v_lint0, =izeof(L373">="sref">tcA5> x_alc hr_v_liss="sref">txs*  A5> x_alc hr_v_li<erdev8si icode 8ame="L318"> 318
d)
<8 href="net/can/af_can.c#8368" 89h" class=/a>(nexsk" class="sd_rccache d="L3badd_rea e_rccache
@f">&qvla96 = 8AGn>>>>>>>>>>>>>>>>>>>>>>0nt0, "L328"> 328NU26
erdev8sk47<6spa85
kfree_ssref">ENOMEMe
lERR_ame="L326"> 326 826 *maskfref"ss="sre
ER8_="+c89 be i4verte45f="+coderILTER" class=""a" p_timAr d="L3badd_rea "a" p_timArRPHRDame="L373">="sref">tcA5>  intimAr d="L3badd_rea cA5>  intimArnt4>           5   <"  in_uprcve d="L3badd_rea cA5>  in_uprcvent0erdev8s376"6s="8 n class=" class="comm5n8">/598ndi3ation3for thref="nc#L2DEVc#L2kb6 mod_timAr d="L3badd_rea mod_timArRPHRDame="L373">="sref">tcA5>  intimAr d="L3badd_rea cA5>  intimArnt4>           5 round_jiffi<erdev9code=RX_E9R" class="srefclasi i" c9ass="90here 55ef">4a>(erdev96="sref">tcA5>  intimAr d="L3badd_rea cA5>  intimAr> clasi i" clx  r makb" ">kfree_ssref">r makb" 
erdev93   }
 3739/6>        6 4a2/can/af49an.c#90> * Return:<5span>5n3p_init6hrea">kfree_ssref">  <"init6hreaRPHRDerdev9c43"> 3739/       3   
fin)LAGn="sref">tcA5>family_opx_pframes_delta++family_opxRPHRerdev9c7= ="sref">tcA5>nerdev9c8= find_rhr_add_hsf=RPHRDame="L373">="sref">tcA5>hsf="u_errnoname="L320 19hsf="uerdev9c9= find_rhr_add_hsf=RPHRDame="L373">="sref">tcA5fd_hsf="u_errnoname="L320 1fd_hsf="uerdev9e_sp_delt9" class="sref">txs*  A6>9->9 318
can_stats. 37394ne" name="L312"> 312 3739l W="(mcan.cred="L)/6f_c9n61="91"can."line" "L328"> 328_dexit" b" clf">find__dexit 3280 19exit" b" clf">find_0 19exitRPHRDname)ista>(c(CAN_INVf=x_alldevlas"cl9> =  366        5
4et/can/af4can.c#L315" 5d="L hr*f_set_transpo"L368" cl href="9 7=  = c6n_s9akely( *="sref">tcA5>  intimAr d="L3badd_rea cA5>  intimArerdev95s4ur6 0;9-can9af4can.c#L321" 5d="L652s9i62_m92h" class=/a>(nexsk" class="svla96kfree_ssref">  <"6erdev9="+co6e=d9 class="sref">d)6 3739ef="+code=len" class6"ss9e6">t9pe !=  3739
find_rhr_6="sref">tcA5fd_hsf="u_errnoname="L320 1fd_hsf="uerdev9196find_rhr_6="sref">tcA5>hsf="u_errnoname="L320 19hsf="uerdev9cla5s6"sr92"net4can/a4lass="sr6f">9k626v92or="L294" b" clf">fin)LAGn="sref">tcA5>nerdev94ne"am" c9t/6
find_PFf="nR4anerdev94f">c6n_s9href=eset_transpo"L368" 9l62as92rcv_lista>(c(type !=  3266et_9e6ice9e=l" clan/af_cclf">fin)LAGnerdev95>(nexsk" class="sfor_each9n="sref">tinit_L36t" class=na hf"init_L36o4>/sse="L327"> 327net_device/4ss="l4ne" name="L312"> 312kfree_ssref">inval_f="net/cname="ame="" hreint/<+cclanr> 3739sre != 
C6N_I9V63na9367" class=khem_cacfind_rcv_list(nexsk" class="sref"nexsclass="sre
lE e="L328"> 328s>erdev9i96 326 * 328BUG_Of">kfree_ssref">BUG_OfRPHRD_CAN" LAG" classef"nexsclass="sre
lE4ss="l4ne" name="L31una ierdev9ine"am" c9list;
<7" id="L367" 9l63_F93f4can.c#L307" 6d="L360imal4fe4e=kfree_skb"5ckef="ef"nexsclass="skef="RPHRD_CAN" LAG" class1" it_errnoname= hr*erdev9if">c6."L328"> 328s>
erdev9 e {
<="s9 cl5s4n"comment4can.6#L39963as9326"> 326can_stats./*6can_stats.(nexsk" class="sd_udref"o("comment4n &erdev94376"6iDN9 an>
 * @can_id:5point56 to9464>t94> * Return:<5span>5d_udbarri"a_errnoname="L32s_udbarri"aRPHRDfind_kmemccache_de="soyRPHRD_CAN" LAG" clasd_rccache d="L3badd_rea e_rccacheerdev94la5s6"sr9ass="line" na href="6cod9=6kt_9ype" csref">can_stats. *  Returns5the o6tim9l64 c94 be i;find_module_initRPHRD_CAN" LAG" clas  <"init">kfree_ssref">  <"initerdev94e {
<="s93"> 303 ;find_module_exitRPHRD_CAN" LAG" clas  <"exit" b" clf">find_0 19exitRPHR)a href="6" cla60="sr4f">erdev9=4="c6mme9t4> *  to regi5ter o64de9n65ce95ef" "


The original LXR software by"phe href="6" http://sourcer5ige.cla6projects/lx"_>LXR 68" unityo4>/sshref"experi claal version by"href="6" mailto:lx"@egiux.no">lx"@egiux.no>
lx".egiux.no kindly hosted by"href="6" http://www."edpill-egipro.no">Redpill Lgipro ASo4>/ssprovider of Lgiux consultingmand operahions serr- us since 1995.