libusb.h (5e53a4f90f82c4345f277dd87cc9292f26e04a29) libusb.h (04391da364e252ca15645147e2c966dc6d1fbbda)
1/* $FreeBSD$ */
2/*-
3 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 *
5 * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

49
50/* libusb enums */
51
52enum libusb_class_code {
53 LIBUSB_CLASS_PER_INTERFACE = 0,
54 LIBUSB_CLASS_AUDIO = 1,
55 LIBUSB_CLASS_COMM = 2,
56 LIBUSB_CLASS_HID = 3,
1/* $FreeBSD$ */
2/*-
3 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 *
5 * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

49
50/* libusb enums */
51
52enum libusb_class_code {
53 LIBUSB_CLASS_PER_INTERFACE = 0,
54 LIBUSB_CLASS_AUDIO = 1,
55 LIBUSB_CLASS_COMM = 2,
56 LIBUSB_CLASS_HID = 3,
57 LIBUSB_CLASS_PHYSICAL = 5,
57 LIBUSB_CLASS_PTP = 6,
58 LIBUSB_CLASS_IMAGE = 6,
59 LIBUSB_CLASS_PRINTER = 7,
60 LIBUSB_CLASS_MASS_STORAGE = 8,
61 LIBUSB_CLASS_HUB = 9,
62 LIBUSB_CLASS_DATA = 10,
63 LIBUSB_CLASS_SMART_CARD = 11,
64 LIBUSB_CLASS_CONTENT_SECURITY = 13,

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

173
174enum libusb_bos_type {
175 LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY = 1,
176 LIBUSB_BT_USB_2_0_EXTENSION = 2,
177 LIBUSB_BT_SS_USB_DEVICE_CAPABILITY = 3,
178 LIBUSB_BT_CONTAINER_ID = 4,
179};
180
58 LIBUSB_CLASS_PTP = 6,
59 LIBUSB_CLASS_IMAGE = 6,
60 LIBUSB_CLASS_PRINTER = 7,
61 LIBUSB_CLASS_MASS_STORAGE = 8,
62 LIBUSB_CLASS_HUB = 9,
63 LIBUSB_CLASS_DATA = 10,
64 LIBUSB_CLASS_SMART_CARD = 11,
65 LIBUSB_CLASS_CONTENT_SECURITY = 13,

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

174
175enum libusb_bos_type {
176 LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY = 1,
177 LIBUSB_BT_USB_2_0_EXTENSION = 2,
178 LIBUSB_BT_SS_USB_DEVICE_CAPABILITY = 3,
179 LIBUSB_BT_CONTAINER_ID = 4,
180};
181
182enum libusb_capability {
183 /* libusb supports libusb_has_capability(). */
184 LIBUSB_CAP_HAS_CAPABILITY = 0,
185 /* Hotplug support is available. */
186 LIBUSB_CAP_HAS_HOTPLUG,
187 /* Can access HID devices without requiring user intervention. */
188 LIBUSB_CAP_HAS_HID_ACCESS,
189
190 /*
191 * Supports detaching of the default USB driver with
192 * libusb_detach_kernel_driver().
193 */
194 LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER,
195};
196
181enum libusb_error {
182 LIBUSB_SUCCESS = 0,
183 LIBUSB_ERROR_IO = -1,
184 LIBUSB_ERROR_INVALID_PARAM = -2,
185 LIBUSB_ERROR_ACCESS = -3,
186 LIBUSB_ERROR_NO_DEVICE = -4,
187 LIBUSB_ERROR_NOT_FOUND = -5,
188 LIBUSB_ERROR_BUSY = -6,

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

445/* Library initialisation */
446
447void libusb_set_debug(libusb_context * ctx, int level);
448const struct libusb_version *libusb_get_version(void);
449const char *libusb_strerror(int code);
450const char *libusb_error_name(int code);
451int libusb_init(libusb_context ** context);
452void libusb_exit(struct libusb_context *ctx);
197enum libusb_error {
198 LIBUSB_SUCCESS = 0,
199 LIBUSB_ERROR_IO = -1,
200 LIBUSB_ERROR_INVALID_PARAM = -2,
201 LIBUSB_ERROR_ACCESS = -3,
202 LIBUSB_ERROR_NO_DEVICE = -4,
203 LIBUSB_ERROR_NOT_FOUND = -5,
204 LIBUSB_ERROR_BUSY = -6,

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

461/* Library initialisation */
462
463void libusb_set_debug(libusb_context * ctx, int level);
464const struct libusb_version *libusb_get_version(void);
465const char *libusb_strerror(int code);
466const char *libusb_error_name(int code);
467int libusb_init(libusb_context ** context);
468void libusb_exit(struct libusb_context *ctx);
469int libusb_has_capability(uint32_t capability);
453
454/* Device handling and enumeration */
455
456ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list);
457void libusb_free_device_list(libusb_device ** list, int unref_devices);
458uint8_t libusb_get_bus_number(libusb_device * dev);
459uint8_t libusb_get_port_number(libusb_device * dev);
460int libusb_get_port_numbers(libusb_device *dev, uint8_t *buf, uint8_t bufsize);

--- 122 unchanged lines hidden ---
470
471/* Device handling and enumeration */
472
473ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list);
474void libusb_free_device_list(libusb_device ** list, int unref_devices);
475uint8_t libusb_get_bus_number(libusb_device * dev);
476uint8_t libusb_get_port_number(libusb_device * dev);
477int libusb_get_port_numbers(libusb_device *dev, uint8_t *buf, uint8_t bufsize);

--- 122 unchanged lines hidden ---