libusb10.c (274496044deb7b60c6396b0571c1b8ceb2f38d7a) libusb10.c (4d2472aa7bc90cbd437975f90cd2da0ba1b1f534)
1/* $FreeBSD$ */
2/*-
3 * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
4 * Copyright (c) 2009 Hans Petter Selasky. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 202 unchanged lines hidden (view full) ---

211 libusb_unref_device((*list)[i - 1]);
212 i--;
213 }
214 free(*list);
215 *list = NULL;
216 libusb20_be_free(usb_backend);
217 return (LIBUSB_ERROR_NO_MEM);
218 }
1/* $FreeBSD$ */
2/*-
3 * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
4 * Copyright (c) 2009 Hans Petter Selasky. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 202 unchanged lines hidden (view full) ---

211 libusb_unref_device((*list)[i - 1]);
212 i--;
213 }
214 free(*list);
215 *list = NULL;
216 libusb20_be_free(usb_backend);
217 return (LIBUSB_ERROR_NO_MEM);
218 }
219
220 /* get device into libUSB v1.0 list */
221 libusb20_be_dequeue_device(usb_backend, pdev);
222
223 memset(dev, 0, sizeof(*dev));
224
225 /* init transfer queues */
226 TAILQ_INIT(&dev->tr_head);
227

--- 485 unchanged lines hidden (view full) ---

713}
714
715int
716libusb_kernel_driver_active(struct libusb20_device *pdev, int interface)
717{
718 if (pdev == NULL)
719 return (LIBUSB_ERROR_INVALID_PARAM);
720
219 /* get device into libUSB v1.0 list */
220 libusb20_be_dequeue_device(usb_backend, pdev);
221
222 memset(dev, 0, sizeof(*dev));
223
224 /* init transfer queues */
225 TAILQ_INIT(&dev->tr_head);
226

--- 485 unchanged lines hidden (view full) ---

712}
713
714int
715libusb_kernel_driver_active(struct libusb20_device *pdev, int interface)
716{
717 if (pdev == NULL)
718 return (LIBUSB_ERROR_INVALID_PARAM);
719
721 return (libusb20_dev_kernel_driver_active(
722 pdev, interface));
720 if (libusb20_dev_kernel_driver_active(pdev, interface))
721 return (0); /* no kernel driver is active */
722 else
723 return (1); /* kernel driver is active */
723}
724
725int
726libusb_get_driver_np(struct libusb20_device *pdev, int interface,
727 char *name, int namelen)
728{
729 return (libusb_get_driver(pdev, interface, name, namelen));
730}

--- 791 unchanged lines hidden ---
724}
725
726int
727libusb_get_driver_np(struct libusb20_device *pdev, int interface,
728 char *name, int namelen)
729{
730 return (libusb_get_driver(pdev, interface, name, namelen));
731}

--- 791 unchanged lines hidden ---