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

TOMOYO Linux Cross Reference
Linux/net/atm/raw.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /net/atm/raw.c (Version linux-6.12-rc7) and /net/atm/raw.c (Version linux-2.4.37.11)


  1 // SPDX-License-Identifier: GPL-2.0            << 
  2 /* net/atm/raw.c - Raw AAL0 and AAL5 transport      1 /* net/atm/raw.c - Raw AAL0 and AAL5 transports */
  3                                                     2 
  4 /* Written 1995-2000 by Werner Almesberger, EP      3 /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
  5                                                     4 
  6 #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt << 
  7                                                     5 
  8 #include <linux/module.h>                           6 #include <linux/module.h>
                                                   >>   7 #include <linux/sched.h>
  9 #include <linux/atmdev.h>                           8 #include <linux/atmdev.h>
 10 #include <linux/capability.h>                  << 
 11 #include <linux/kernel.h>                           9 #include <linux/kernel.h>
 12 #include <linux/skbuff.h>                          10 #include <linux/skbuff.h>
 13 #include <linux/mm.h>                              11 #include <linux/mm.h>
 14 #include <linux/slab.h>                        << 
 15                                                    12 
 16 #include "common.h"                                13 #include "common.h"
 17 #include "protocols.h"                             14 #include "protocols.h"
 18                                                    15 
                                                   >>  16 
                                                   >>  17 #if 0
                                                   >>  18 #define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
                                                   >>  19 #else
                                                   >>  20 #define DPRINTK(format,args...)
                                                   >>  21 #endif
                                                   >>  22 
                                                   >>  23 
 19 /*                                                 24 /*
 20  * SKB == NULL indicates that the link is bein     25  * SKB == NULL indicates that the link is being closed
 21  */                                                26  */
 22                                                    27 
 23 static void atm_push_raw(struct atm_vcc *vcc,  !!  28 void atm_push_raw(struct atm_vcc *vcc,struct sk_buff *skb)
 24 {                                                  29 {
 25         if (skb) {                                 30         if (skb) {
 26                 struct sock *sk = sk_atm(vcc); !!  31                 skb_queue_tail(&vcc->sk->receive_queue,skb);
 27                                                !!  32                 wake_up(&vcc->sleep);
 28                 skb_queue_tail(&sk->sk_receive << 
 29                 sk->sk_data_ready(sk);         << 
 30         }                                          33         }
 31 }                                                  34 }
 32                                                    35 
 33 static void atm_pop_raw(struct atm_vcc *vcc, s << 
 34 {                                              << 
 35         struct sock *sk = sk_atm(vcc);         << 
 36                                                    36 
 37         pr_debug("(%d) %d -= %d\n",            !!  37 static void atm_pop_raw(struct atm_vcc *vcc,struct sk_buff *skb)
 38                  vcc->vci, sk_wmem_alloc_get(s !!  38 {
 39         WARN_ON(refcount_sub_and_test(ATM_SKB( !!  39         DPRINTK("APopR (%d) %d -= %d\n",vcc->vci,vcc->sk->wmem_alloc,skb->truesize);
                                                   >>  40         atomic_sub(skb->truesize, &vcc->sk->wmem_alloc);
 40         dev_kfree_skb_any(skb);                    41         dev_kfree_skb_any(skb);
 41         sk->sk_write_space(sk);                !!  42         wake_up(&vcc->sleep);
 42 }                                                  43 }
 43                                                    44 
 44 static int atm_send_aal0(struct atm_vcc *vcc,  !!  45 
                                                   >>  46 static int atm_send_aal0(struct atm_vcc *vcc,struct sk_buff *skb)
 45 {                                                  47 {
 46         /*                                         48         /*
 47          * Note that if vpi/vci are _ANY or _U     49          * Note that if vpi/vci are _ANY or _UNSPEC the below will
 48          * still work                              50          * still work
 49          */                                        51          */
 50         if (!capable(CAP_NET_ADMIN) &&             52         if (!capable(CAP_NET_ADMIN) &&
 51             (((u32 *)skb->data)[0] & (ATM_HDR_ !!  53             (((u32 *) skb->data)[0] & (ATM_HDR_VPI_MASK | ATM_HDR_VCI_MASK)) !=
 52             ((vcc->vpi << ATM_HDR_VPI_SHIFT) | !!  54             ((vcc->vpi << ATM_HDR_VPI_SHIFT) | (vcc->vci << ATM_HDR_VCI_SHIFT)))
 53              (vcc->vci << ATM_HDR_VCI_SHIFT))) !!  55             {
 54                 kfree_skb(skb);                    56                 kfree_skb(skb);
 55                 return -EADDRNOTAVAIL;             57                 return -EADDRNOTAVAIL;
 56         }                                      !!  58         }
 57         if (vcc->dev->ops->send_bh)            !!  59         return vcc->dev->ops->send(vcc,skb);
 58                 return vcc->dev->ops->send_bh( << 
 59         return vcc->dev->ops->send(vcc, skb);  << 
 60 }                                                  60 }
 61                                                    61 
                                                   >>  62 
 62 int atm_init_aal0(struct atm_vcc *vcc)             63 int atm_init_aal0(struct atm_vcc *vcc)
 63 {                                                  64 {
 64         vcc->push = atm_push_raw;                  65         vcc->push = atm_push_raw;
 65         vcc->pop = atm_pop_raw;                    66         vcc->pop = atm_pop_raw;
 66         vcc->push_oam = NULL;                      67         vcc->push_oam = NULL;
 67         vcc->send = atm_send_aal0;                 68         vcc->send = atm_send_aal0;
 68         return 0;                                  69         return 0;
 69 }                                                  70 }
 70                                                    71 
                                                   >>  72 
 71 int atm_init_aal34(struct atm_vcc *vcc)            73 int atm_init_aal34(struct atm_vcc *vcc)
 72 {                                                  74 {
 73         vcc->push = atm_push_raw;                  75         vcc->push = atm_push_raw;
 74         vcc->pop = atm_pop_raw;                    76         vcc->pop = atm_pop_raw;
 75         vcc->push_oam = NULL;                      77         vcc->push_oam = NULL;
 76         if (vcc->dev->ops->send_bh)            !!  78         vcc->send = vcc->dev->ops->send;
 77                 vcc->send = vcc->dev->ops->sen << 
 78         else                                   << 
 79                 vcc->send = vcc->dev->ops->sen << 
 80         return 0;                                  79         return 0;
 81 }                                                  80 }
 82                                                    81 
                                                   >>  82 
 83 int atm_init_aal5(struct atm_vcc *vcc)             83 int atm_init_aal5(struct atm_vcc *vcc)
 84 {                                                  84 {
 85         vcc->push = atm_push_raw;                  85         vcc->push = atm_push_raw;
 86         vcc->pop = atm_pop_raw;                    86         vcc->pop = atm_pop_raw;
 87         vcc->push_oam = NULL;                      87         vcc->push_oam = NULL;
 88         if (vcc->dev->ops->send_bh)            !!  88         vcc->send = vcc->dev->ops->send;
 89                 vcc->send = vcc->dev->ops->sen << 
 90         else                                   << 
 91                 vcc->send = vcc->dev->ops->sen << 
 92         return 0;                                  89         return 0;
 93 }                                                  90 }
                                                   >>  91 
                                                   >>  92 
 94 EXPORT_SYMBOL(atm_init_aal5);                      93 EXPORT_SYMBOL(atm_init_aal5);
 95                                                    94 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php