summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2012-11-28 01:03:11 +0100
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-12-02 01:05:12 +0100
commitc971f08cba56ed17fe22040ca5ff97fe5c3f0bd7 (patch)
tree1b445a3e1fc333b816d7dc0b9ad5e34ad9645945 /net
parentsolos-pci: wait for pending TX to complete when releasing vcc (diff)
downloadlinux-c971f08cba56ed17fe22040ca5ff97fe5c3f0bd7.tar.xz
linux-c971f08cba56ed17fe22040ca5ff97fe5c3f0bd7.zip
atm: add release_cb() callback to vcc
The immediate use case for this is that it will allow us to ensure that a pppoatm queue is woken after it has to drop a packet due to the sock being locked. Note that 'release_cb' is called when the socket is *unlocked*. This is not to be confused with vcc_release() — which probably ought to be called vcc_close(). Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Acked-by: Krzysztof Mazur <krzysiek@podlesie.net>
Diffstat (limited to 'net')
-rw-r--r--net/atm/common.c10
1 files changed, 10 insertions, 0 deletions
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)
rcu_read_unlock();
}
+static void vcc_release_cb(struct sock *sk)
+{
+ struct atm_vcc *vcc = atm_sk(sk);
+
+ if (vcc->release_cb)
+ vcc->release_cb(vcc);
+}
+
static struct proto vcc_proto = {
.name = "VCC",
.owner = THIS_MODULE,
.obj_size = sizeof(struct atm_vcc),
+ .release_cb = vcc_release_cb,
};
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)
vcc->pop = NULL;
vcc->owner = NULL;
vcc->push_oam = NULL;
+ vcc->release_cb = NULL;
vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */
vcc->atm_options = vcc->aal_options = 0;
sk->sk_destruct = vcc_sock_destruct;