Deleted Added
full compact
libusb20_ugen20.c (235004) libusb20_ugen20.c (247475)
1/* $FreeBSD: stable/9/lib/libusb/libusb20_ugen20.c 235004 2012-05-04 15:27:18Z hselasky $ */
1/* $FreeBSD: stable/9/lib/libusb/libusb20_ugen20.c 247475 2013-02-28 16:56:08Z hselasky $ */
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.

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

64static libusb20_get_config_desc_full_t ugen20_get_config_desc_full;
65static libusb20_get_config_index_t ugen20_get_config_index;
66static libusb20_set_config_index_t ugen20_set_config_index;
67static libusb20_set_alt_index_t ugen20_set_alt_index;
68static libusb20_reset_device_t ugen20_reset_device;
69static libusb20_check_connected_t ugen20_check_connected;
70static libusb20_set_power_mode_t ugen20_set_power_mode;
71static libusb20_get_power_mode_t ugen20_get_power_mode;
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.

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

64static libusb20_get_config_desc_full_t ugen20_get_config_desc_full;
65static libusb20_get_config_index_t ugen20_get_config_index;
66static libusb20_set_config_index_t ugen20_set_config_index;
67static libusb20_set_alt_index_t ugen20_set_alt_index;
68static libusb20_reset_device_t ugen20_reset_device;
69static libusb20_check_connected_t ugen20_check_connected;
70static libusb20_set_power_mode_t ugen20_set_power_mode;
71static libusb20_get_power_mode_t ugen20_get_power_mode;
72static libusb20_get_power_usage_t ugen20_get_power_usage;
72static libusb20_kernel_driver_active_t ugen20_kernel_driver_active;
73static libusb20_detach_kernel_driver_t ugen20_detach_kernel_driver;
74static libusb20_do_request_sync_t ugen20_do_request_sync;
75static libusb20_process_t ugen20_process;
76
77/* USB transfer specific */
78static libusb20_tr_open_t ugen20_tr_open;
79static libusb20_tr_close_t ugen20_tr_close;

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

634 temp = LIBUSB20_POWER_ON;
635 break;
636 }
637 *power_mode = temp;
638 return (0); /* success */
639}
640
641static int
73static libusb20_kernel_driver_active_t ugen20_kernel_driver_active;
74static libusb20_detach_kernel_driver_t ugen20_detach_kernel_driver;
75static libusb20_do_request_sync_t ugen20_do_request_sync;
76static libusb20_process_t ugen20_process;
77
78/* USB transfer specific */
79static libusb20_tr_open_t ugen20_tr_open;
80static libusb20_tr_close_t ugen20_tr_close;

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

635 temp = LIBUSB20_POWER_ON;
636 break;
637 }
638 *power_mode = temp;
639 return (0); /* success */
640}
641
642static int
643ugen20_get_power_usage(struct libusb20_device *pdev, uint16_t *power_usage)
644{
645 int temp;
646
647 if (ioctl(pdev->file_ctrl, USB_GET_POWER_USAGE, &temp)) {
648 return (LIBUSB20_ERROR_OTHER);
649 }
650 *power_usage = temp;
651 return (0); /* success */
652}
653
654static int
642ugen20_kernel_driver_active(struct libusb20_device *pdev,
643 uint8_t iface_index)
644{
645 int temp = iface_index;
646
647 if (ioctl(pdev->file_ctrl, USB_IFACE_DRIVER_ACTIVE, &temp)) {
648 return (LIBUSB20_ERROR_OTHER);
649 }

--- 373 unchanged lines hidden ---
655ugen20_kernel_driver_active(struct libusb20_device *pdev,
656 uint8_t iface_index)
657{
658 int temp = iface_index;
659
660 if (ioctl(pdev->file_ctrl, USB_IFACE_DRIVER_ACTIVE, &temp)) {
661 return (LIBUSB20_ERROR_OTHER);
662 }

--- 373 unchanged lines hidden ---