diff options
-rw-r--r-- | include/linux/atmdev.h | 1 | ||||
-rw-r--r-- | net/atm/common.c | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 72db2af902a8..c1da539f5e28 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -99,6 +99,7 @@ struct atm_vcc { | |||
99 | struct atm_dev *dev; /* device back pointer */ | 99 | struct atm_dev *dev; /* device back pointer */ |
100 | struct atm_qos qos; /* QOS */ | 100 | struct atm_qos qos; /* QOS */ |
101 | struct atm_sap sap; /* SAP */ | 101 | struct atm_sap sap; /* SAP */ |
102 | void (*release_cb)(struct atm_vcc *vcc); /* release_sock callback */ | ||
102 | void (*push)(struct atm_vcc *vcc,struct sk_buff *skb); | 103 | void (*push)(struct atm_vcc *vcc,struct sk_buff *skb); |
103 | void (*pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* optional */ | 104 | void (*pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* optional */ |
104 | int (*push_oam)(struct atm_vcc *vcc,void *cell); | 105 | int (*push_oam)(struct atm_vcc *vcc,void *cell); |
diff --git a/net/atm/common.c b/net/atm/common.c index 24216642d696..806fc0a40051 100644 --- a/net/atm/common.c +++ b/net/atm/common.c | |||
@@ -126,10 +126,19 @@ static void vcc_write_space(struct sock *sk) | |||
126 | rcu_read_unlock(); | 126 | rcu_read_unlock(); |
127 | } | 127 | } |
128 | 128 | ||
129 | static void vcc_release_cb(struct sock *sk) | ||
130 | { | ||
131 | struct atm_vcc *vcc = atm_sk(sk); | ||
132 | |||
133 | if (vcc->release_cb) | ||
134 | vcc->release_cb(vcc); | ||
135 | } | ||
136 | |||
129 | static struct proto vcc_proto = { | 137 | static struct proto vcc_proto = { |
130 | .name = "VCC", | 138 | .name = "VCC", |
131 | .owner = THIS_MODULE, | 139 | .owner = THIS_MODULE, |
132 | .obj_size = sizeof(struct atm_vcc), | 140 | .obj_size = sizeof(struct atm_vcc), |
141 | .release_cb = vcc_release_cb, | ||
133 | }; | 142 | }; |
134 | 143 | ||
135 | int vcc_create(struct net *net, struct socket *sock, int protocol, int family) | 144 | int vcc_create(struct net *net, struct socket *sock, int protocol, int family) |
@@ -158,6 +167,7 @@ int vcc_create(struct net *net, struct socket *sock, int protocol, int family) | |||
158 | vcc->pop = NULL; | 167 | vcc->pop = NULL; |
159 | vcc->owner = NULL; | 168 | vcc->owner = NULL; |
160 | vcc->push_oam = NULL; | 169 | vcc->push_oam = NULL; |
170 | vcc->release_cb = NULL; | ||
161 | vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */ | 171 | vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */ |
162 | vcc->atm_options = vcc->aal_options = 0; | 172 | vcc->atm_options = vcc->aal_options = 0; |
163 | sk->sk_destruct = vcc_sock_destruct; | 173 | sk->sk_destruct = vcc_sock_destruct; |