mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
@@ -2,10 +2,10 @@ SUMMARY="A library that provides generic access to USB devices"
|
||||
DESCRIPTION="libusb is meant to facilitate the communication with USB hardware.
|
||||
|
||||
- portable: Using a single cross-platform API, it provides access to USB \
|
||||
devices on Linux, OS X, Windows and OpenBSD.
|
||||
devices on Linux, Windows, Android, macOS, BSD, Haiku, etc.
|
||||
- user-mode: No special privilege or elevation is required for the \
|
||||
application to communicate with a device.
|
||||
- version-agnostic: All versions of the USB protocol, from 1.0 to 3.0 \
|
||||
- version-agnostic: All versions of the USB protocol, from 1.0 to 3.1 \
|
||||
(latest), are supported."
|
||||
HOMEPAGE="https://libusb.info/"
|
||||
COPYRIGHT="2001 Johannes Erdfelt
|
||||
@@ -22,14 +22,13 @@ COPYRIGHT="2001 Johannes Erdfelt
|
||||
LICENSE="GNU LGPL v2.1"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/libusb/libusb/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="02620708c4eea7e736240a623b0b156650c39bfa93a14bcfa5f3e05270313eba"
|
||||
CHECKSUM_SHA256="b7724c272dfc5713dce88ff717efd60f021ca5b7c8e30f08ebb2c42d2eea08ae"
|
||||
SOURCE_FILENAME="libusb-$portVersion.tar.gz"
|
||||
PATCHES="libusb-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="x86 x86_64 x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
|
||||
ARCHITECTURES="!x86_gcc2 x86_64 "
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
libVersion="0.2.0"
|
||||
libVersion="0.3.0"
|
||||
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
|
||||
portVers="${portVersion%.*}"
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
From b8b9f6edc122afe05cb6b1095c396a8913498bf6 Mon Sep 17 00:00:00 2001
|
||||
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
||||
Date: Wed, 15 Aug 2018 10:03:17 +0200
|
||||
Subject: implement clear_halt and provide reset_device
|
||||
|
||||
Fix crashes in ec2drv.
|
||||
|
||||
diff --git a/libusb/os/haiku_usb_backend.cpp b/libusb/os/haiku_usb_backend.cpp
|
||||
index 539a996..16d7528 100644
|
||||
--- a/libusb/os/haiku_usb_backend.cpp
|
||||
+++ b/libusb/os/haiku_usb_backend.cpp
|
||||
@@ -309,7 +309,7 @@ USBDeviceHandle::SetAltSetting(int inumber, int alt)
|
||||
return LIBUSB_SUCCESS;
|
||||
}
|
||||
|
||||
-
|
||||
+/*
|
||||
int
|
||||
USBDevice::ClearHalt(int endpoint)
|
||||
{
|
||||
@@ -325,6 +325,23 @@ USBDevice::ClearHalt(int endpoint)
|
||||
return _errno_to_libusb(command.control.status);
|
||||
}
|
||||
}
|
||||
+*/
|
||||
+
|
||||
+int
|
||||
+USBDeviceHandle::ClearHalt(int endpoint)
|
||||
+{
|
||||
+ usb_raw_command command;
|
||||
+ command.control.request_type = USB_REQTYPE_ENDPOINT_OUT;
|
||||
+ command.control.request = USB_REQUEST_CLEAR_FEATURE;
|
||||
+ command.control.value = USB_FEATURE_ENDPOINT_HALT;
|
||||
+ command.control.index = endpoint;
|
||||
+ command.control.length = 0;
|
||||
+
|
||||
+ if (ioctl(fRawFD, B_USB_RAW_COMMAND_CONTROL_TRANSFER, &command, sizeof(command)) ||
|
||||
+ command.control.status != B_USB_RAW_STATUS_SUCCESS) {
|
||||
+ return _errno_to_libusb(command.config.status);
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
USBDevice::USBDevice(const char *path)
|
||||
@@ -449,6 +466,7 @@ USBDevice::EndpointToInterface(uint8 address) const
|
||||
int
|
||||
USBDevice::Initialise() //Do we need more error checking, etc? How to report?
|
||||
{
|
||||
+ usbi_dbg("Haiku init dev %s", fPath);
|
||||
int fRawFD = open(fPath, O_RDWR | O_CLOEXEC);
|
||||
if (fRawFD < 0)
|
||||
return B_ERROR;
|
||||
@@ -479,7 +497,7 @@ USBDevice::Initialise() //Do we need more error checking, etc? How to report?
|
||||
command.config_etc.descriptor = (usb_configuration_descriptor*)fConfigurationDescriptors[i];
|
||||
command.config_etc.length = tmp_config.total_length;
|
||||
command.config_etc.config_index = i;
|
||||
- if (ioctl(fRawFD, B_USB_COMMAND_GET_CONFIGURATION_DESCRIPTOR_ETC, &command, sizeof(command)) ||
|
||||
+ if (ioctl(fRawFD, B_USB_RAW_COMMAND_GET_CONFIGURATION_DESCRIPTOR_ETC, &command, sizeof(command)) ||
|
||||
command.config_etc.status != B_USB_RAW_STATUS_SUCCESS) {
|
||||
usbi_err(NULL, "failed retrieving full configuration descriptor");
|
||||
close(fRawFD);
|
||||
--
|
||||
2.26.0
|
||||
|
||||
Reference in New Issue
Block a user