diff options
author | John Crispin <john@openwrt.org> | 2010-11-03 19:12:34 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2010-11-03 19:12:34 +0000 |
commit | a8b2a07f375edefec242de9f20d4aefafa927517 (patch) | |
tree | d15f5bb696bfa9dfd9555788d411e0ba59b99a65 /package/lqtapi/src/mps/vmmc-link.c | |
parent | 72ae8452cda47d6e18e664097a4adbc0eee3fc7b (diff) | |
download | upstream-a8b2a07f375edefec242de9f20d4aefafa927517.tar.gz upstream-a8b2a07f375edefec242de9f20d4aefafa927517.tar.bz2 upstream-a8b2a07f375edefec242de9f20d4aefafa927517.zip |
* adds a rewrite of the tapi drivers + sip app. this is the result of lars' gsoc 2010 project, Thanks !
SVN-Revision: 23840
Diffstat (limited to 'package/lqtapi/src/mps/vmmc-link.c')
-rw-r--r-- | package/lqtapi/src/mps/vmmc-link.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/package/lqtapi/src/mps/vmmc-link.c b/package/lqtapi/src/mps/vmmc-link.c new file mode 100644 index 0000000000..42d11dbb6e --- /dev/null +++ b/package/lqtapi/src/mps/vmmc-link.c @@ -0,0 +1,52 @@ +#include <linux/kernel.h> +#include <linux/slab.h> +#include <linux/tapi/tapi.h> + +#include "vmmc-link.h" +#include "vmmc-module.h" + +struct vmmc_tapi_link { + struct tapi_link tapi_link; + struct vmmc_link vmmc_link; +}; + +struct tapi_link *vmmc_tapi_link_alloc(struct tapi_device *tdev, + struct tapi_endpoint *ep1, struct tapi_endpoint *ep2) +{ + struct vmmc_tapi_link *link = kzalloc(sizeof(*link), GFP_KERNEL); + struct vmmc_module *module1 = tapi_endpoint_to_vmmc_module(ep1); + struct vmmc_module *module2 = tapi_endpoint_to_vmmc_module(ep2); + + vmmc_link_init(&link->vmmc_link, module1, module2); + + return &link->tapi_link; +} + +void vmmc_tapi_link_free(struct tapi_device *tdev, struct tapi_link *tapi_link) +{ + struct vmmc_tapi_link *link = container_of(tapi_link, struct vmmc_tapi_link, + tapi_link); + + vmmc_link_put(&link->vmmc_link); + kfree(link); +} + +int vmmc_tapi_link_enable(struct tapi_device *tdev, + struct tapi_link *tapi_link) +{ + struct vmmc_tapi_link *link = container_of(tapi_link, struct vmmc_tapi_link, + tapi_link); + + vmmc_link_enable(&link->vmmc_link); + return 0; +} + +int vmmc_tapi_link_disable(struct tapi_device *tdev, + struct tapi_link *tapi_link) +{ + struct vmmc_tapi_link *link = container_of(tapi_link, struct vmmc_tapi_link, + tapi_link); + + vmmc_link_disable(&link->vmmc_link); + return 0; +} |