[package] 6to4: remove leftover peeraddr stuff
[openwrt.git] / package / lqtapi / src / mps / vmmc-stream.c
1 #include <linux/kernel.h>
2 #include <linux/tapi/tapi.h>
3 #include <linux/skbuff.h>
4
5 #include "vmmc.h"
6 #include "vmmc-coder.h"
7
8 struct vmmc_tapi_stream {
9 struct vmmc_coder *coder;
10 struct tapi_stream stream;
11 };
12
13 struct vmmc_tapi_stream *tapi_to_vmmc_stream(struct tapi_stream * stream)
14 {
15 return container_of(stream, struct vmmc_tapi_stream, stream);
16 }
17
18 struct tapi_stream *vmmc_stream_alloc(struct tapi_device *tdev)
19 {
20 struct vmmc *vmmc = tdev_to_vmmc(tdev);
21 struct vmmc_tapi_stream *stream;
22 struct vmmc_coder *coder;
23
24 coder = vmmc_coder_get(vmmc);
25 if (!coder)
26 return ERR_PTR(-ENODEV);
27
28 stream = kzalloc(sizeof(*stream), GFP_KERNEL);
29 if (!stream)
30 return ERR_PTR(-ENOMEM);
31
32 stream->coder = coder;
33 coder->stream = &stream->stream;
34 tapi_endpoint_set_data(&stream->stream.ep, &coder->module);
35
36 return &stream->stream;
37 }
38
39 void vmmc_stream_free(struct tapi_device *tdev, struct tapi_stream *tstream)
40 {
41 struct vmmc *vmmc = tdev_to_vmmc(tdev);
42 struct vmmc_tapi_stream *stream = tapi_to_vmmc_stream(tstream);
43
44 stream->coder->stream = NULL;
45
46 vmmc_coder_put(vmmc, stream->coder);
47 kfree(stream);
48 }
49
50 int vmmc_stream_start(struct tapi_device *tdev, struct tapi_stream *stream)
51 {
52 return 0;
53 }
54
55 int vmmc_stream_stop(struct tapi_device *tdev, struct tapi_stream *stream)
56 {
57 return 0;
58 }
59
60 int vmmc_stream_send(struct tapi_device *tdev, struct tapi_stream *stream,
61 struct sk_buff *skb)
62 {
63 struct vmmc *vmmc = tdev_to_vmmc(tdev);
64 struct vmmc_coder *coder = tapi_to_vmmc_stream(stream)->coder;
65
66 vmmc_send_paket(vmmc, coder->id, skb);
67 return 0;
68 }
69 /*
70 int vmmc_stream_recv(struct vmmc_stream *stream)
71 {
72 tapi_stream_recv(&stream->coder->vmmc->tdev stream->stream, skb);
73 }*/
This page took 0.047174 seconds and 5 git commands to generate.