Deleted Added
full compact
libusb01.c (194069) libusb01.c (195957)
1/* $FreeBSD: head/lib/libusb/libusb20_compat01.c 194069 2009-06-12 16:07:06Z thompsa $ */
1/* $FreeBSD: head/lib/libusb/libusb20_compat01.c 195957 2009-07-30 00:11:41Z alfred $ */
2/*-
3 * Copyright (c) 2008 Hans Petter Selasky. 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 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.

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

830 struct usb_device *udev;
831 struct LIBUSB20_DEVICE_DESC_DECODED *ddesc;
832 int err;
833
834 /* cleanup after last device search */
835 /* close all opened devices, if any */
836
837 while ((pdev = libusb20_be_device_foreach(usb_backend, NULL))) {
2/*-
3 * Copyright (c) 2008 Hans Petter Selasky. 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 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.

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

830 struct usb_device *udev;
831 struct LIBUSB20_DEVICE_DESC_DECODED *ddesc;
832 int err;
833
834 /* cleanup after last device search */
835 /* close all opened devices, if any */
836
837 while ((pdev = libusb20_be_device_foreach(usb_backend, NULL))) {
838 udev = pdev->priv01Data;
838 udev = pdev->privLuData;
839 libusb20_be_dequeue_device(usb_backend, pdev);
840 libusb20_dev_free(pdev);
841 if (udev != NULL) {
842 LIST_DEL(usb_global_bus.devices, udev);
843 free(udev);
844 }
845 }
846

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

888 udev->descriptor.bNumConfigurations =
889 ddesc->bNumConfigurations;
890 if (udev->descriptor.bNumConfigurations > USB_MAXCONFIG) {
891 /* truncate number of configurations */
892 udev->descriptor.bNumConfigurations = USB_MAXCONFIG;
893 }
894 /* link together the two structures */
895 udev->dev = pdev;
839 libusb20_be_dequeue_device(usb_backend, pdev);
840 libusb20_dev_free(pdev);
841 if (udev != NULL) {
842 LIST_DEL(usb_global_bus.devices, udev);
843 free(udev);
844 }
845 }
846

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

888 udev->descriptor.bNumConfigurations =
889 ddesc->bNumConfigurations;
890 if (udev->descriptor.bNumConfigurations > USB_MAXCONFIG) {
891 /* truncate number of configurations */
892 udev->descriptor.bNumConfigurations = USB_MAXCONFIG;
893 }
894 /* link together the two structures */
895 udev->dev = pdev;
896 pdev->priv01Data = udev;
896 pdev->privLuData = udev;
897
898 err = libusb20_dev_open(pdev, 0);
899 if (err == 0) {
900 /* XXX get all config descriptors by default */
901 usb_fetch_and_parse_descriptors((void *)pdev);
902 libusb20_dev_close(pdev);
903 }
904 LIST_ADD(usb_global_bus.devices, udev);

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

909
910struct usb_device *
911usb_device(usb_dev_handle * dev)
912{
913 struct libusb20_device *pdev;
914
915 pdev = (void *)dev;
916
897
898 err = libusb20_dev_open(pdev, 0);
899 if (err == 0) {
900 /* XXX get all config descriptors by default */
901 usb_fetch_and_parse_descriptors((void *)pdev);
902 libusb20_dev_close(pdev);
903 }
904 LIST_ADD(usb_global_bus.devices, udev);

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

909
910struct usb_device *
911usb_device(usb_dev_handle * dev)
912{
913 struct libusb20_device *pdev;
914
915 pdev = (void *)dev;
916
917 return (pdev->priv01Data);
917 return (pdev->privLuData);
918}
919
920struct usb_bus *
921usb_get_busses(void)
922{
923 return (usb_busses);
924}
918}
919
920struct usb_bus *
921usb_get_busses(void)
922{
923 return (usb_busses);
924}