diff options
author | Sjur Braendeland <sjur.brandeland@stericsson.com> | 2010-04-28 08:54:36 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-28 12:55:12 -0700 |
commit | 5b2086567503f9b55136642031ec0067319f58e0 (patch) | |
tree | 00c4264ed7a8a989b398166c2c5f98175f5c28a5 /net/caif/cfsrvl.c | |
parent | e539d83cc8a4fa581cbf8ed288fdadb19a692cb0 (diff) |
caif: Add reference counting to service layer
Changes:
o Added functions cfsrvl_get and cfsrvl_put.
o Added support release_client to use by socket and net device.
o Increase reference counting for in-flight packets from cfmuxl
Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif/cfsrvl.c')
-rw-r--r-- | net/caif/cfsrvl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/caif/cfsrvl.c b/net/caif/cfsrvl.c index d470c51c643..aff31f34528 100644 --- a/net/caif/cfsrvl.c +++ b/net/caif/cfsrvl.c @@ -158,6 +158,13 @@ void cfsrvl_init(struct cfsrvl *service, service->layer.ctrlcmd = cfservl_ctrlcmd; service->layer.modemcmd = cfservl_modemcmd; service->dev_info = *dev_info; + kref_init(&service->ref); +} + +void cfsrvl_release(struct kref *kref) +{ + struct cfsrvl *service = container_of(kref, struct cfsrvl, ref); + kfree(service); } bool cfsrvl_ready(struct cfsrvl *service, int *err) |