27 #include <linux/kernel.h>
28 #include <linux/slab.h>
29 #include <linux/list.h>
30 #include <linux/string.h>
33 #include <linux/export.h>
54 static struct class *elements_class;
65 p +=
sprintf(p,
"Name: %s\n%s%s%sDescription: %s\n\n",
67 elem->
args[i].def ?
"Default: " :
"",
68 elem->
args[i].def ? elem->
args[i].def :
"",
69 elem->
args[i].def ?
"\n" :
"",
80 mISDN_dsp_dev_release(
struct device *dev)
102 entry->
dev.class = elements_class;
103 entry->
dev.release = mISDN_dsp_dev_release;
109 __func__, elem->
name);
114 for (i = 0; i <
ARRAY_SIZE(element_attributes); ++
i) {
116 &element_attributes[i]);
124 #ifdef PIPELINE_DEBUG
147 if (entry->
elem == elem) {
149 #ifdef PIPELINE_DEBUG
151 __func__, elem->
name);
162 if (IS_ERR(elements_class))
163 return PTR_ERR(elements_class);
165 #ifdef PIPELINE_DEBUG
185 __func__, entry->
elem->name);
189 #ifdef PIPELINE_DEBUG
199 INIT_LIST_HEAD(&pipeline->
list);
201 #ifdef PIPELINE_DEBUG
208 static inline void _dsp_pipeline_destroy(
struct dsp_pipeline *pipeline)
218 entry->
elem->free(entry->
p);
229 _dsp_pipeline_destroy(pipeline);
231 #ifdef PIPELINE_DEBUG
238 int len, incomplete = 0, found = 0;
247 if (!list_empty(&pipeline->
list))
248 _dsp_pipeline_destroy(pipeline);
261 while ((tok =
strsep(&dup,
"|"))) {
273 pipeline_entry =
kmalloc(
sizeof(
struct
275 if (!pipeline_entry) {
277 "entry to pipeline: %s (out of "
278 "memory)\n", __func__, elem->
name);
288 struct dsp, pipeline), args);
292 pipeline_entry->
p = elem->
new(args);
293 if (pipeline_entry->
p) {
296 #ifdef PIPELINE_DEBUG
298 "instance of %s%s%s\n",
299 __func__, name, args ?
300 " with args " :
"", args ?
305 "to add entry to pipeline: "
306 "%s (new() returned NULL)\n",
307 __func__, elem->
name);
308 kfree(pipeline_entry);
320 "%s\n", __func__, name);
326 if (!list_empty(&pipeline->
list))
331 #ifdef PIPELINE_DEBUG
333 __func__, incomplete ?
" incomplete" :
"", cfg);
347 if (entry->
elem->process_tx)
348 entry->
elem->process_tx(entry->
p, data, len);
360 if (entry->
elem->process_rx)
361 entry->
elem->process_rx(entry->
p, data, len, txlen);