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-stream.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-stream.c')
-rw-r--r-- | package/lqtapi/src/mps/vmmc-stream.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/package/lqtapi/src/mps/vmmc-stream.c b/package/lqtapi/src/mps/vmmc-stream.c new file mode 100644 index 0000000000..36f5eef80b --- /dev/null +++ b/package/lqtapi/src/mps/vmmc-stream.c @@ -0,0 +1,73 @@ +#include <linux/kernel.h> +#include <linux/tapi/tapi.h> +#include <linux/skbuff.h> + +#include "vmmc.h" +#include "vmmc-coder.h" + +struct vmmc_tapi_stream { + struct vmmc_coder *coder; + struct tapi_stream stream; +}; + +struct vmmc_tapi_stream *tapi_to_vmmc_stream(struct tapi_stream * stream) +{ + return container_of(stream, struct vmmc_tapi_stream, stream); +} + +struct tapi_stream *vmmc_stream_alloc(struct tapi_device *tdev) +{ + struct vmmc *vmmc = tdev_to_vmmc(tdev); + struct vmmc_tapi_stream *stream; + struct vmmc_coder *coder; + + coder = vmmc_coder_get(vmmc); + if (!coder) + return ERR_PTR(-ENODEV); + + stream = kzalloc(sizeof(*stream), GFP_KERNEL); + if (!stream) + return ERR_PTR(-ENOMEM); + + stream->coder = coder; + coder->stream = &stream->stream; + tapi_endpoint_set_data(&stream->stream.ep, &coder->module); + + return &stream->stream; +} + +void vmmc_stream_free(struct tapi_device *tdev, struct tapi_stream *tstream) +{ + struct vmmc *vmmc = tdev_to_vmmc(tdev); + struct vmmc_tapi_stream *stream = tapi_to_vmmc_stream(tstream); + + stream->coder->stream = NULL; + + vmmc_coder_put(vmmc, stream->coder); + kfree(stream); +} + +int vmmc_stream_start(struct tapi_device *tdev, struct tapi_stream *stream) +{ + return 0; +} + +int vmmc_stream_stop(struct tapi_device *tdev, struct tapi_stream *stream) +{ + return 0; +} + +int vmmc_stream_send(struct tapi_device *tdev, struct tapi_stream *stream, + struct sk_buff *skb) +{ + struct vmmc *vmmc = tdev_to_vmmc(tdev); + struct vmmc_coder *coder = tapi_to_vmmc_stream(stream)->coder; + + vmmc_send_paket(vmmc, coder->id, skb); + return 0; +} +/* +int vmmc_stream_recv(struct vmmc_stream *stream) +{ + tapi_stream_recv(&stream->coder->vmmc->tdev stream->stream, skb); +}*/ |