summaryrefslogtreecommitdiffstats
path: root/package/lqtapi/src/mps/vmmc-stream.c
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-11-03 19:12:34 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-11-03 19:12:34 +0000
commit6ea7ec75d2fe0dd52bc3e86135412bfc92c3158c (patch)
tree1b900bd32ce90c62703905c460db950c7c2ba9ec /package/lqtapi/src/mps/vmmc-stream.c
parent74f6f2f5a244b9ba7aec5d7114fe763f8c20e96c (diff)
[ifxmips]
* adds a rewrite of the tapi drivers + sip app. this is the result of lars' gsoc 2010 project, Thanks ! git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23840 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/lqtapi/src/mps/vmmc-stream.c')
-rw-r--r--package/lqtapi/src/mps/vmmc-stream.c73
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 000000000..36f5eef80
--- /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);
+}*/