diff options
Diffstat (limited to 'net/atm/raw.c')
| -rw-r--r-- | net/atm/raw.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/net/atm/raw.c b/net/atm/raw.c index cbfcc71a17b1..d0c4bd047dc4 100644 --- a/net/atm/raw.c +++ b/net/atm/raw.c | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ | 3 | /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ |
| 4 | 4 | ||
| 5 | #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ | ||
| 5 | 6 | ||
| 6 | #include <linux/module.h> | 7 | #include <linux/module.h> |
| 7 | #include <linux/atmdev.h> | 8 | #include <linux/atmdev.h> |
| @@ -17,7 +18,7 @@ | |||
| 17 | * SKB == NULL indicates that the link is being closed | 18 | * SKB == NULL indicates that the link is being closed |
| 18 | */ | 19 | */ |
| 19 | 20 | ||
| 20 | static void atm_push_raw(struct atm_vcc *vcc,struct sk_buff *skb) | 21 | static void atm_push_raw(struct atm_vcc *vcc, struct sk_buff *skb) |
| 21 | { | 22 | { |
| 22 | if (skb) { | 23 | if (skb) { |
| 23 | struct sock *sk = sk_atm(vcc); | 24 | struct sock *sk = sk_atm(vcc); |
| @@ -27,36 +28,33 @@ static void atm_push_raw(struct atm_vcc *vcc,struct sk_buff *skb) | |||
| 27 | } | 28 | } |
| 28 | } | 29 | } |
| 29 | 30 | ||
| 30 | 31 | static void atm_pop_raw(struct atm_vcc *vcc, struct sk_buff *skb) | |
| 31 | static void atm_pop_raw(struct atm_vcc *vcc,struct sk_buff *skb) | ||
| 32 | { | 32 | { |
| 33 | struct sock *sk = sk_atm(vcc); | 33 | struct sock *sk = sk_atm(vcc); |
| 34 | 34 | ||
| 35 | pr_debug("APopR (%d) %d -= %d\n", vcc->vci, | 35 | pr_debug("(%d) %d -= %d\n", |
| 36 | sk_wmem_alloc_get(sk), skb->truesize); | 36 | vcc->vci, sk_wmem_alloc_get(sk), skb->truesize); |
| 37 | atomic_sub(skb->truesize, &sk->sk_wmem_alloc); | 37 | atomic_sub(skb->truesize, &sk->sk_wmem_alloc); |
| 38 | dev_kfree_skb_any(skb); | 38 | dev_kfree_skb_any(skb); |
| 39 | sk->sk_write_space(sk); | 39 | sk->sk_write_space(sk); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | 42 | static int atm_send_aal0(struct atm_vcc *vcc, struct sk_buff *skb) | |
| 43 | static int atm_send_aal0(struct atm_vcc *vcc,struct sk_buff *skb) | ||
| 44 | { | 43 | { |
| 45 | /* | 44 | /* |
| 46 | * Note that if vpi/vci are _ANY or _UNSPEC the below will | 45 | * Note that if vpi/vci are _ANY or _UNSPEC the below will |
| 47 | * still work | 46 | * still work |
| 48 | */ | 47 | */ |
| 49 | if (!capable(CAP_NET_ADMIN) && | 48 | if (!capable(CAP_NET_ADMIN) && |
| 50 | (((u32 *) skb->data)[0] & (ATM_HDR_VPI_MASK | ATM_HDR_VCI_MASK)) != | 49 | (((u32 *)skb->data)[0] & (ATM_HDR_VPI_MASK | ATM_HDR_VCI_MASK)) != |
| 51 | ((vcc->vpi << ATM_HDR_VPI_SHIFT) | (vcc->vci << ATM_HDR_VCI_SHIFT))) | 50 | ((vcc->vpi << ATM_HDR_VPI_SHIFT) | |
| 52 | { | 51 | (vcc->vci << ATM_HDR_VCI_SHIFT))) { |
| 53 | kfree_skb(skb); | 52 | kfree_skb(skb); |
| 54 | return -EADDRNOTAVAIL; | 53 | return -EADDRNOTAVAIL; |
| 55 | } | 54 | } |
| 56 | return vcc->dev->ops->send(vcc,skb); | 55 | return vcc->dev->ops->send(vcc, skb); |
| 57 | } | 56 | } |
| 58 | 57 | ||
| 59 | |||
| 60 | int atm_init_aal0(struct atm_vcc *vcc) | 58 | int atm_init_aal0(struct atm_vcc *vcc) |
| 61 | { | 59 | { |
| 62 | vcc->push = atm_push_raw; | 60 | vcc->push = atm_push_raw; |
| @@ -66,7 +64,6 @@ int atm_init_aal0(struct atm_vcc *vcc) | |||
| 66 | return 0; | 64 | return 0; |
| 67 | } | 65 | } |
| 68 | 66 | ||
| 69 | |||
| 70 | int atm_init_aal34(struct atm_vcc *vcc) | 67 | int atm_init_aal34(struct atm_vcc *vcc) |
| 71 | { | 68 | { |
| 72 | vcc->push = atm_push_raw; | 69 | vcc->push = atm_push_raw; |
| @@ -76,7 +73,6 @@ int atm_init_aal34(struct atm_vcc *vcc) | |||
| 76 | return 0; | 73 | return 0; |
| 77 | } | 74 | } |
| 78 | 75 | ||
| 79 | |||
| 80 | int atm_init_aal5(struct atm_vcc *vcc) | 76 | int atm_init_aal5(struct atm_vcc *vcc) |
| 81 | { | 77 | { |
| 82 | vcc->push = atm_push_raw; | 78 | vcc->push = atm_push_raw; |
| @@ -85,6 +81,4 @@ int atm_init_aal5(struct atm_vcc *vcc) | |||
| 85 | vcc->send = vcc->dev->ops->send; | 81 | vcc->send = vcc->dev->ops->send; |
| 86 | return 0; | 82 | return 0; |
| 87 | } | 83 | } |
| 88 | |||
| 89 | |||
| 90 | EXPORT_SYMBOL(atm_init_aal5); | 84 | EXPORT_SYMBOL(atm_init_aal5); |
