source: mainline/uspace/lib/usbhost/src/ddf_helpers.c@ cce3228

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since cce3228 was cce3228, checked in by Jan Vesely <jano.vesely@…>, 12 years ago

libusbhost: Use goto instead of macros for error handling.

supposedly lesser evil…

  • Property mode set to 100644
File size: 17.9 KB
Line 
1/*
2 * Copyright (c) 2013 Jan Vesely
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup libusbhost
30 * @{
31 */
32/** @file
33 *
34 */
35
36#include <usb_iface.h>
37#include <usb/classes/classes.h>
38#include <usb/debug.h>
39#include <usb/descriptor.h>
40#include <usb/request.h>
41#include <errno.h>
42#include <str_error.h>
43
44#include "ddf_helpers.h"
45
46#define CTRL_PIPE_MIN_PACKET_SIZE 8
47
48extern usbhc_iface_t hcd_iface;
49
50typedef struct hc_dev {
51 ddf_fun_t *hc_fun;
52 list_t devices;
53 fibril_mutex_t guard;
54} hc_dev_t;
55
56static hc_dev_t *dev_to_hc_dev(ddf_dev_t *dev)
57{
58 return ddf_dev_data_get(dev);
59}
60
61hcd_t *dev_to_hcd(ddf_dev_t *dev)
62{
63 hc_dev_t *hc_dev = dev_to_hc_dev(dev);
64 if (!hc_dev || !hc_dev->hc_fun) {
65 usb_log_error("Invalid HCD device.\n");
66 return NULL;
67 }
68 return ddf_fun_data_get(hc_dev->hc_fun);
69}
70
71typedef struct usb_dev {
72 link_t link;
73 ddf_fun_t *fun;
74 usb_address_t address;
75 usb_speed_t speed;
76 devman_handle_t hc_handle;
77} usb_dev_t;
78
79/** Register endpoint interface function.
80 * @param fun DDF function.
81 * @param address USB address of the device.
82 * @param endpoint USB endpoint number to be registered.
83 * @param transfer_type Endpoint's transfer type.
84 * @param direction USB communication direction the endpoint is capable of.
85 * @param max_packet_size Maximu size of packets the endpoint accepts.
86 * @param interval Preferred timeout between communication.
87 * @return Error code.
88 */
89static int register_endpoint(
90 ddf_fun_t *fun, usb_endpoint_t endpoint,
91 usb_transfer_type_t transfer_type, usb_direction_t direction,
92 size_t max_packet_size, unsigned interval)
93{
94 assert(fun);
95 hcd_t *hcd = dev_to_hcd(ddf_fun_get_dev(fun));
96 usb_dev_t *dev = ddf_fun_data_get(fun);
97 assert(hcd);
98 assert(dev);
99 const size_t size = max_packet_size;
100 const usb_target_t target =
101 {{.address = dev->address, .endpoint = endpoint}};
102
103 usb_log_debug("Register endpoint %d:%d %s-%s %zuB %ums.\n",
104 dev->address, endpoint, usb_str_transfer_type(transfer_type),
105 usb_str_direction(direction), max_packet_size, interval);
106
107 return hcd_add_ep(hcd, target, direction, transfer_type,
108 max_packet_size, size);
109}
110
111/** Unregister endpoint interface function.
112 * @param fun DDF function.
113 * @param address USB address of the endpoint.
114 * @param endpoint USB endpoint number.
115 * @param direction Communication direction of the enpdoint to unregister.
116 * @return Error code.
117 */
118static int unregister_endpoint(
119 ddf_fun_t *fun, usb_endpoint_t endpoint, usb_direction_t direction)
120{
121 assert(fun);
122 hcd_t *hcd = dev_to_hcd(ddf_fun_get_dev(fun));
123 usb_dev_t *dev = ddf_fun_data_get(fun);
124 assert(hcd);
125 assert(dev);
126 const usb_target_t target =
127 {{.address = dev->address, .endpoint = endpoint}};
128 usb_log_debug("Unregister endpoint %d:%d %s.\n",
129 dev->address, endpoint, usb_str_direction(direction));
130 return hcd_remove_ep(hcd, target, direction);
131}
132
133static int reserve_default_address(ddf_fun_t *fun, usb_speed_t speed)
134{
135 assert(fun);
136 hcd_t *hcd = dev_to_hcd(ddf_fun_get_dev(fun));
137 usb_dev_t *dev = ddf_fun_data_get(fun);
138 assert(hcd);
139 assert(dev);
140
141 usb_log_debug("Device %d requested default address at %s speed\n",
142 dev->address, usb_str_speed(speed));
143 return hcd_reserve_default_address(hcd, speed);
144}
145
146static int release_default_address(ddf_fun_t *fun)
147{
148 assert(fun);
149 hcd_t *hcd = dev_to_hcd(ddf_fun_get_dev(fun));
150 usb_dev_t *dev = ddf_fun_data_get(fun);
151 assert(hcd);
152 assert(dev);
153
154 usb_log_debug("Device %d released default address\n", dev->address);
155 return hcd_release_default_address(hcd);
156}
157
158static int device_enumerate(ddf_fun_t *fun, usb_device_handle_t *handle)
159{
160 assert(fun);
161 ddf_dev_t *ddf_dev = ddf_fun_get_dev(fun);
162 usb_dev_t *dev = ddf_fun_data_get(fun);
163 assert(ddf_dev);
164 assert(dev);
165 usb_address_t address = 0;
166 usb_log_debug("Device %d reported a new USB device\n", dev->address);
167 const int ret = hcd_ddf_new_device(ddf_dev, &address);
168 if (ret == EOK && handle)
169 *handle = address;
170 return ret;
171}
172
173static int device_remove(ddf_fun_t *fun, usb_device_handle_t handle)
174{
175 assert(fun);
176 ddf_dev_t *ddf_dev = ddf_fun_get_dev(fun);
177 usb_dev_t *dev = ddf_fun_data_get(fun);
178 assert(ddf_dev);
179 assert(dev);
180 usb_log_debug("Device %d reported removal of device %d\n",
181 dev->address, (int)handle);
182 return hcd_ddf_remove_device(ddf_dev, (usb_address_t)handle);
183}
184
185/** Get USB address assigned to root hub.
186 *
187 * @param[in] fun Root hub function.
188 * @param[out] address Store the address here.
189 * @return Error code.
190 */
191static int get_my_address(ddf_fun_t *fun, usb_address_t *address)
192{
193 assert(fun);
194 if (address != NULL) {
195 usb_dev_t *usb_dev = ddf_fun_data_get(fun);
196 *address = usb_dev->address;
197 }
198 return EOK;
199}
200
201/** Gets handle of the respective hc (this device, hc function).
202 *
203 * @param[in] root_hub_fun Root hub function seeking hc handle.
204 * @param[out] handle Place to write the handle.
205 * @return Error code.
206 */
207static int get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle)
208{
209 assert(fun);
210
211 if (handle != NULL) {
212 usb_dev_t *usb_dev = ddf_fun_data_get(fun);
213 *handle = usb_dev->hc_handle;
214 }
215 return EOK;
216}
217
218/** Gets handle of the respective hc (this device, hc function).
219 *
220 * @param[in] root_hub_fun Root hub function seeking hc handle.
221 * @param[out] handle Place to write the handle.
222 * @return Error code.
223 */
224static int get_device_handle(ddf_fun_t *fun, devman_handle_t *handle)
225{
226 assert(fun);
227 if (handle)
228 *handle = ddf_fun_get_handle(fun);
229 return EOK;
230}
231
232/** Inbound communication interface function.
233 * @param fun DDF function.
234 * @param target Communication target.
235 * @param setup_data Data to use in setup stage (control transfers).
236 * @param data Pointer to data buffer.
237 * @param size Size of the data buffer.
238 * @param callback Function to call on communication end.
239 * @param arg Argument passed to the callback function.
240 * @return Error code.
241 */
242static int dev_read(ddf_fun_t *fun, usb_endpoint_t endpoint,
243 uint64_t setup_data, uint8_t *data, size_t size,
244 usbhc_iface_transfer_in_callback_t callback, void *arg)
245{
246 assert(fun);
247 usb_dev_t *usb_dev = ddf_fun_data_get(fun);
248 assert(usb_dev);
249 const usb_target_t target = {{
250 .address = usb_dev->address,
251 .endpoint = endpoint,
252 }};
253 return hcd_send_batch(dev_to_hcd(ddf_fun_get_dev(fun)), target,
254 USB_DIRECTION_IN, data, size, setup_data, callback, NULL, arg,
255 "READ");
256}
257
258/** Outbound communication interface function.
259 * @param fun DDF function.
260 * @param target Communication target.
261 * @param setup_data Data to use in setup stage (control transfers).
262 * @param data Pointer to data buffer.
263 * @param size Size of the data buffer.
264 * @param callback Function to call on communication end.
265 * @param arg Argument passed to the callback function.
266 * @return Error code.
267 */
268static int dev_write(ddf_fun_t *fun, usb_endpoint_t endpoint,
269 uint64_t setup_data, const uint8_t *data, size_t size,
270 usbhc_iface_transfer_out_callback_t callback, void *arg)
271{
272 assert(fun);
273 usb_dev_t *usb_dev = ddf_fun_data_get(fun);
274 assert(usb_dev);
275 const usb_target_t target = {{
276 .address = usb_dev->address,
277 .endpoint = endpoint,
278 }};
279 return hcd_send_batch(dev_to_hcd(ddf_fun_get_dev(fun)),
280 target, USB_DIRECTION_OUT, (uint8_t*)data, size, setup_data, NULL,
281 callback, arg, "WRITE");
282}
283
284/** Root hub USB interface */
285static usb_iface_t usb_iface = {
286 .get_hc_handle = get_hc_handle,
287 .get_my_address = get_my_address,
288
289 .get_device_handle = get_device_handle,
290
291 .reserve_default_address = reserve_default_address,
292 .release_default_address = release_default_address,
293 .device_enumerate = device_enumerate,
294 .device_remove = device_remove,
295 .register_endpoint = register_endpoint,
296 .unregister_endpoint = unregister_endpoint,
297 .read = dev_read,
298 .write = dev_write,
299};
300
301/** Standard USB RH options (device interface) */
302static ddf_dev_ops_t usb_ops = {
303 .interfaces[USB_DEV_IFACE] = &usb_iface,
304};
305
306#define GET_DEVICE_DESC(size) \
307{ \
308 .request_type = SETUP_REQUEST_TYPE_DEVICE_TO_HOST \
309 | (USB_REQUEST_TYPE_STANDARD << 5) \
310 | USB_REQUEST_RECIPIENT_DEVICE, \
311 .request = USB_DEVREQ_GET_DESCRIPTOR, \
312 .value = uint16_host2usb(USB_DESCTYPE_DEVICE << 8), \
313 .index = uint16_host2usb(0), \
314 .length = uint16_host2usb(size), \
315};
316
317#define SET_ADDRESS(address) \
318{ \
319 .request_type = SETUP_REQUEST_TYPE_HOST_TO_DEVICE \
320 | (USB_REQUEST_TYPE_STANDARD << 5) \
321 | USB_REQUEST_RECIPIENT_DEVICE, \
322 .request = USB_DEVREQ_SET_ADDRESS, \
323 .value = uint16_host2usb(address), \
324 .index = uint16_host2usb(0), \
325 .length = uint16_host2usb(0), \
326};
327
328int hcd_ddf_add_usb_device(ddf_dev_t *parent,
329 usb_address_t address, usb_speed_t speed, const char *name,
330 const match_id_list_t *mids)
331{
332 assert(parent);
333 hc_dev_t *hc_dev = dev_to_hc_dev(parent);
334 devman_handle_t hc_handle = ddf_fun_get_handle(hc_dev->hc_fun);
335
336 char default_name[10] = { 0 }; /* usbxyz-ss */
337 if (!name) {
338 snprintf(default_name, sizeof(default_name) - 1,
339 "usb%u-%cs", address, usb_str_speed(speed)[0]);
340 name = default_name;
341 }
342
343 //TODO more checks
344 ddf_fun_t *fun = ddf_fun_create(parent, fun_inner, name);
345 if (!fun)
346 return ENOMEM;
347 usb_dev_t *info = ddf_fun_data_alloc(fun, sizeof(usb_dev_t));
348 if (!info) {
349 ddf_fun_destroy(fun);
350 return ENOMEM;
351 }
352 info->address = address;
353 info->speed = speed;
354 info->hc_handle = hc_handle;
355 info->fun = fun;
356 link_initialize(&info->link);
357
358 ddf_fun_set_ops(fun, &usb_ops);
359 list_foreach(mids->ids, iter) {
360 match_id_t *mid = list_get_instance(iter, match_id_t, link);
361 ddf_fun_add_match_id(fun, mid->id, mid->score);
362 }
363
364 int ret = ddf_fun_bind(fun);
365 if (ret != EOK) {
366 ddf_fun_destroy(fun);
367 return ret;
368 }
369
370 list_append(&info->link, &hc_dev->devices);
371 return EOK;
372}
373
374#define ADD_MATCHID_OR_RETURN(list, sc, str, ...) \
375do { \
376 match_id_t *mid = malloc(sizeof(match_id_t)); \
377 if (!mid) { \
378 clean_match_ids(list); \
379 return ENOMEM; \
380 } \
381 char *id = NULL; \
382 int ret = asprintf(&id, str, ##__VA_ARGS__); \
383 if (ret < 0) { \
384 clean_match_ids(list); \
385 free(mid); \
386 return ENOMEM; \
387 } \
388 mid->score = sc; \
389 mid->id = id; \
390 add_match_id(list, mid); \
391} while (0)
392
393
394/* This is a copy of lib/usbdev/src/recognise.c */
395static int create_match_ids(match_id_list_t *l,
396 usb_standard_device_descriptor_t *d)
397{
398 assert(l);
399 assert(d);
400
401 if (d->vendor_id != 0) {
402 /* First, with release number. */
403 ADD_MATCHID_OR_RETURN(l, 100,
404 "usb&vendor=%#04x&product=%#04x&release=%x.%x",
405 d->vendor_id, d->product_id, (d->device_version >> 8),
406 (d->device_version & 0xff));
407
408 /* Next, without release number. */
409 ADD_MATCHID_OR_RETURN(l, 90, "usb&vendor=%#04x&product=%#04x",
410 d->vendor_id, d->product_id);
411 }
412
413 /* Class match id */
414 ADD_MATCHID_OR_RETURN(l, 50, "usb&class=%s",
415 usb_str_class(d->device_class));
416
417 /* As a last resort, try fallback driver. */
418 ADD_MATCHID_OR_RETURN(l, 10, "usb&fallback");
419
420 return EOK;
421
422}
423
424int hcd_ddf_remove_device(ddf_dev_t *device, usb_address_t id)
425{
426 assert(device);
427
428 hcd_t *hcd = dev_to_hcd(device);
429 assert(hcd);
430
431 hc_dev_t *hc_dev = dev_to_hc_dev(device);
432 assert(hc_dev);
433
434 fibril_mutex_lock(&hc_dev->guard);
435
436 usb_dev_t *victim = NULL;
437
438 list_foreach(hc_dev->devices, it) {
439 victim = list_get_instance(it, usb_dev_t, link);
440 if (victim->address == id)
441 break;
442 }
443 if (victim && victim->address == id) {
444 list_remove(&victim->link);
445 fibril_mutex_unlock(&hc_dev->guard);
446 const int ret = ddf_fun_unbind(victim->fun);
447 if (ret == EOK) {
448 ddf_fun_destroy(victim->fun);
449 hcd_release_address(hcd, id);
450 } else {
451 usb_log_warning("Failed to unbind device %d: %s\n",
452 id, str_error(ret));
453 }
454 return EOK;
455 }
456 return ENOENT;
457}
458
459int hcd_ddf_new_device(ddf_dev_t *device, usb_address_t *id)
460{
461 assert(device);
462
463 hcd_t *hcd = dev_to_hcd(device);
464 assert(hcd);
465
466 usb_speed_t speed = USB_SPEED_MAX;
467
468 /* This checks whether the default address is reserved and gets speed */
469 int ret = usb_endpoint_manager_get_info_by_address(&hcd->ep_manager,
470 USB_ADDRESS_DEFAULT, &speed);
471 if (ret != EOK) {
472 return ret;
473 }
474
475 static const usb_target_t default_target = {{
476 .address = USB_ADDRESS_DEFAULT,
477 .endpoint = 0,
478 }};
479
480 const usb_address_t address = hcd_request_address(hcd, speed);
481 if (address < 0)
482 return address;
483
484 const usb_target_t target = {{
485 .address = address,
486 .endpoint = 0,
487 }};
488
489 /* Add default pipe on default address */
490 ret = hcd_add_ep(hcd,
491 default_target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL,
492 CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE);
493
494 if (ret != EOK) {
495 hcd_release_address(hcd, address);
496 return ret;
497 }
498
499 /* Get max packet size for default pipe */
500 usb_standard_device_descriptor_t desc = { 0 };
501 static const usb_device_request_setup_packet_t get_device_desc_8 =
502 GET_DEVICE_DESC(CTRL_PIPE_MIN_PACKET_SIZE);
503
504 // TODO CALLBACKS
505 ssize_t got = hcd_send_batch_sync(hcd, default_target, USB_DIRECTION_IN,
506 &desc, CTRL_PIPE_MIN_PACKET_SIZE, *(uint64_t *)&get_device_desc_8,
507 "read first 8 bytes of dev descriptor");
508
509 if (got != CTRL_PIPE_MIN_PACKET_SIZE) {
510 hcd_remove_ep(hcd, default_target, USB_DIRECTION_BOTH);
511 hcd_release_address(hcd, address);
512 return got < 0 ? got : EOVERFLOW;
513 }
514
515 /* Register EP on the new address */
516 ret = hcd_add_ep(hcd, target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL,
517 desc.max_packet_size, desc.max_packet_size);
518 if (ret != EOK) {
519 hcd_remove_ep(hcd, default_target, USB_DIRECTION_BOTH);
520 hcd_remove_ep(hcd, target, USB_DIRECTION_BOTH);
521 hcd_release_address(hcd, address);
522 return ret;
523 }
524
525 /* Set new address */
526 const usb_device_request_setup_packet_t set_address =
527 SET_ADDRESS(target.address);
528
529 got = hcd_send_batch_sync(hcd, default_target, USB_DIRECTION_OUT,
530 NULL, 0, *(uint64_t *)&set_address, "set address");
531
532 hcd_remove_ep(hcd, default_target, USB_DIRECTION_BOTH);
533
534 if (got != 0) {
535 hcd_remove_ep(hcd, target, USB_DIRECTION_BOTH);
536 hcd_release_address(hcd, address);
537 return got;
538 }
539
540 /* Get std device descriptor */
541 static const usb_device_request_setup_packet_t get_device_desc =
542 GET_DEVICE_DESC(sizeof(desc));
543
544 got = hcd_send_batch_sync(hcd, target, USB_DIRECTION_IN,
545 &desc, sizeof(desc), *(uint64_t *)&get_device_desc,
546 "read device descriptor");
547 if (ret != EOK) {
548 hcd_remove_ep(hcd, target, USB_DIRECTION_BOTH);
549 hcd_release_address(hcd, target.address);
550 return got < 0 ? got : EOVERFLOW;
551 }
552
553 /* Create match ids from the device descriptor */
554 match_id_list_t mids;
555 init_match_ids(&mids);
556
557 ret = create_match_ids(&mids, &desc);
558 if (ret != EOK) {
559 hcd_remove_ep(hcd, target, USB_DIRECTION_BOTH);
560 hcd_release_address(hcd, target.address);
561 return ret;
562 }
563
564 /* Register device */
565 ret = hcd_ddf_add_usb_device(device, address, speed, NULL, &mids);
566 clean_match_ids(&mids);
567 if (ret != EOK) {
568 hcd_remove_ep(hcd, target, USB_DIRECTION_BOTH);
569 hcd_release_address(hcd, target.address);
570 return ret;
571 }
572 if (ret == EOK && id)
573 *id = target.address;
574
575 return ret;
576}
577
578/** Announce root hub to the DDF
579 *
580 * @param[in] device Host controller ddf device
581 * @param[in] speed roothub communication speed
582 * @return Error code
583 */
584int hcd_ddf_setup_root_hub(ddf_dev_t *device, usb_speed_t speed)
585{
586 assert(device);
587 hcd_t *hcd = dev_to_hcd(device);
588 assert(hcd);
589
590 hcd_reserve_default_address(hcd, speed);
591 const int ret = hcd_ddf_new_device(device, NULL);
592 hcd_release_default_address(hcd);
593 return ret;
594}
595
596/** Initialize hc structures.
597 *
598 * @param[in] device DDF instance of the device to use.
599 *
600 * This function does all the ddf work for hc driver.
601 */
602int hcd_ddf_setup_device(ddf_dev_t *device, ddf_fun_t **hc_fun,
603 usb_speed_t max_speed, size_t bw, bw_count_func_t bw_count)
604{
605 if (!device)
606 return EBADMEM;
607
608 int ret = ENOMEM;
609 hc_dev_t *instance = ddf_dev_data_alloc(device, sizeof(hc_dev_t));
610 if (instance == NULL) {
611 usb_log_error("Failed to allocate HCD ddf structure.\n");
612 return ENOMEM;
613 }
614 list_initialize(&instance->devices);
615 fibril_mutex_initialize(&instance->guard);
616
617 instance->hc_fun = ddf_fun_create(device, fun_exposed, "hc");
618 if (!instance->hc_fun) {
619 usb_log_error("Failed to create HCD ddf fun.\n");
620 goto err_destroy_fun;
621 }
622
623 hcd_t *hcd = ddf_fun_data_alloc(instance->hc_fun, sizeof(hcd_t));
624 if (!instance->hc_fun) {
625 usb_log_error("Failed to allocate HCD ddf fun data.\n");
626 goto err_destroy_fun;
627 }
628
629 hcd_init(hcd, max_speed, bw, bw_count);
630
631 ret = ddf_fun_bind(instance->hc_fun);
632 if (ret != EOK) {
633 usb_log_error("Failed to bind hc_fun: %s.\n", str_error(ret));
634 goto err_destroy_fun;
635 }
636
637 ret = ddf_fun_add_to_category(instance->hc_fun, USB_HC_CATEGORY);
638 if (ret != EOK) {
639 usb_log_error("Failed to add fun to category: %s.\n",
640 str_error(ret));
641 ddf_fun_unbind(instance->hc_fun);
642 goto err_destroy_fun;
643 }
644
645 /* HC should be ok at this point (except it can't do anything) */
646 if (hc_fun)
647 *hc_fun = instance->hc_fun;
648 return EOK;
649
650err_destroy_fun:
651 ddf_fun_destroy(instance->hc_fun);
652 instance->hc_fun = NULL;
653 return ret;
654}
655
656/**
657 * @}
658 */
Note: See TracBrowser for help on using the repository browser.