From db6e981728f65ab1df047a87a1c16f7fcdb82f94 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Tue, 3 Apr 2012 19:26:12 +1200 Subject: [PATCH] Added hidapi start. x64 doesn't work... not sure why. --- Externals/libusb/win32/hidapi.h | 384 ---------------- Externals/libusb/win32/lusb0_usb.h | 427 ------------------ Externals/libusb/x64/hidapi.dll | Bin 37888 -> 0 bytes Externals/libusb/x64/hidapi.h | 384 ---------------- Externals/libusb/x64/lusb0_usb.h | 427 ------------------ .../Src/IPC_HLE/WII_IPC_HLE_Device_hid.cpp | 143 ++++-- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_hid.h | 5 +- 7 files changed, 121 insertions(+), 1649 deletions(-) delete mode 100644 Externals/libusb/win32/hidapi.h delete mode 100644 Externals/libusb/win32/lusb0_usb.h delete mode 100644 Externals/libusb/x64/hidapi.dll delete mode 100644 Externals/libusb/x64/hidapi.h delete mode 100644 Externals/libusb/x64/lusb0_usb.h diff --git a/Externals/libusb/win32/hidapi.h b/Externals/libusb/win32/hidapi.h deleted file mode 100644 index bd912acd7f..0000000000 --- a/Externals/libusb/win32/hidapi.h +++ /dev/null @@ -1,384 +0,0 @@ -/******************************************************* - HIDAPI - Multi-Platform library for - communication with HID devices. - - Alan Ott - Signal 11 Software - - 8/22/2009 - - Copyright 2009, All Rights Reserved. - - At the discretion of the user of this library, - this software may be licensed under the terms of the - GNU Public License v3, a BSD-Style license, or the - original HIDAPI license as outlined in the LICENSE.txt, - LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt - files located at the root of the source distribution. - These files may also be found in the public source - code repository located at: - http://github.com/signal11/hidapi . -********************************************************/ - -/** @file - * @defgroup API hidapi API - */ - -#ifndef HIDAPI_H__ -#define HIDAPI_H__ - -#include - -#ifdef _WIN32 - #define HID_API_EXPORT __declspec(dllexport) - #define HID_API_CALL -#else - #define HID_API_EXPORT /**< API export macro */ - #define HID_API_CALL /**< API call macro */ -#endif - -#define HID_API_EXPORT_CALL HID_API_EXPORT HID_API_CALL /**< API export and call macro*/ - -#ifdef __cplusplus -extern "C" { -#endif - struct hid_device_; - typedef struct hid_device_ hid_device; /**< opaque hidapi structure */ - - /** hidapi info structure */ - struct hid_device_info { - /** Platform-specific device path */ - char *path; - /** Device Vendor ID */ - unsigned short vendor_id; - /** Device Product ID */ - unsigned short product_id; - /** Serial Number */ - wchar_t *serial_number; - /** Device Release Number in binary-coded decimal, - also known as Device Version Number */ - unsigned short release_number; - /** Manufacturer String */ - wchar_t *manufacturer_string; - /** Product string */ - wchar_t *product_string; - /** Usage Page for this Device/Interface - (Windows/Mac only). */ - unsigned short usage_page; - /** Usage for this Device/Interface - (Windows/Mac only).*/ - unsigned short usage; - /** The USB interface which this logical device - represents. Valid on both Linux implementations - in all cases, and valid on the Windows implementation - only if the device contains more than one interface. */ - int interface_number; - - /** Pointer to the next device */ - struct hid_device_info *next; - }; - - - /** @brief Initialize the HIDAPI library. - - This function initializes the HIDAPI library. Calling it is not - strictly necessary, as it will be called automatically by - hid_enumerate() and any of the hid_open_*() functions if it is - needed. This function should be called at the beginning of - execution however, if there is a chance of HIDAPI handles - being opened by different threads simultaneously. - - @ingroup API - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_init(void); - - /** @brief Finalize the HIDAPI library. - - This function frees all of the static data associated with - HIDAPI. It should be called at the end of execution to avoid - memory leaks. - - @ingroup API - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_exit(void); - - /** @brief Enumerate the HID Devices. - - This function returns a linked list of all the HID devices - attached to the system which match vendor_id and product_id. - If @p vendor_id and @p product_id are both set to 0, then - all HID devices will be returned. - - @ingroup API - @param vendor_id The Vendor ID (VID) of the types of device - to open. - @param product_id The Product ID (PID) of the types of - device to open. - - @returns - This function returns a pointer to a linked list of type - struct #hid_device, containing information about the HID devices - attached to the system, or NULL in the case of failure. Free - this linked list by calling hid_free_enumeration(). - */ - struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id); - - /** @brief Free an enumeration Linked List - - This function frees a linked list created by hid_enumerate(). - - @ingroup API - @param devs Pointer to a list of struct_device returned from - hid_enumerate(). - */ - void HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hid_device_info *devs); - - /** @brief Open a HID device using a Vendor ID (VID), Product ID - (PID) and optionally a serial number. - - If @p serial_number is NULL, the first device with the - specified VID and PID is opened. - - @ingroup API - @param vendor_id The Vendor ID (VID) of the device to open. - @param product_id The Product ID (PID) of the device to open. - @param serial_number The Serial Number of the device to open - (Optionally NULL). - - @returns - This function returns a pointer to a #hid_device object on - success or NULL on failure. - */ - HID_API_EXPORT hid_device * HID_API_CALL hid_open(unsigned short vendor_id, unsigned short product_id, wchar_t *serial_number); - - /** @brief Open a HID device by its path name. - - The path name be determined by calling hid_enumerate(), or a - platform-specific path name can be used (eg: /dev/hidraw0 on - Linux). - - @ingroup API - @param path The path name of the device to open - - @returns - This function returns a pointer to a #hid_device object on - success or NULL on failure. - */ - HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path); - - /** @brief Write an Output report to a HID device. - - The first byte of @p data[] must contain the Report ID. For - devices which only support a single report, this must be set - to 0x0. The remaining bytes contain the report data. Since - the Report ID is mandatory, calls to hid_write() will always - contain one more byte than the report contains. For example, - if a hid report is 16 bytes long, 17 bytes must be passed to - hid_write(), the Report ID (or 0x0, for devices with a - single report), followed by the report data (16 bytes). In - this example, the length passed in would be 17. - - hid_write() will send the data on the first OUT endpoint, if - one exists. If it does not, it will send the data through - the Control Endpoint (Endpoint 0). - - @ingroup API - @param device A device handle returned from hid_open(). - @param data The data to send, including the report number as - the first byte. - @param length The length in bytes of the data to send. - - @returns - This function returns the actual number of bytes written and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_write(hid_device *device, const unsigned char *data, size_t length); - - int HID_API_EXPORT HID_API_CALL hid_set_output_report(hid_device *dev, const unsigned char *data, size_t length); - /** @brief Read an Input report from a HID device with timeout. - - Input reports are returned - to the host through the INTERRUPT IN endpoint. The first byte will - contain the Report number if the device uses numbered reports. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data A buffer to put the read data into. - @param length The number of bytes to read. For devices with - multiple reports, make sure to read an extra byte for - the report number. - @param milliseconds timeout in milliseconds or -1 for blocking wait. - - @returns - This function returns the actual number of bytes read and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds); - - /** @brief Read an Input report from a HID device. - - Input reports are returned - to the host through the INTERRUPT IN endpoint. The first byte will - contain the Report number if the device uses numbered reports. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data A buffer to put the read data into. - @param length The number of bytes to read. For devices with - multiple reports, make sure to read an extra byte for - the report number. - - @returns - This function returns the actual number of bytes read and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_read(hid_device *device, unsigned char *data, size_t length); - - /** @brief Set the device handle to be non-blocking. - - In non-blocking mode calls to hid_read() will return - immediately with a value of 0 if there is no data to be - read. In blocking mode, hid_read() will wait (block) until - there is data to read before returning. - - Nonblocking can be turned on and off at any time. - - @ingroup API - @param device A device handle returned from hid_open(). - @param nonblock enable or not the nonblocking reads - - 1 to enable nonblocking - - 0 to disable nonblocking. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hid_device *device, int nonblock); - - /** @brief Send a Feature report to the device. - - Feature reports are sent over the Control endpoint as a - Set_Report transfer. The first byte of @p data[] must - contain the Report ID. For devices which only support a - single report, this must be set to 0x0. The remaining bytes - contain the report data. Since the Report ID is mandatory, - calls to hid_send_feature_report() will always contain one - more byte than the report contains. For example, if a hid - report is 16 bytes long, 17 bytes must be passed to - hid_send_feature_report(): the Report ID (or 0x0, for - devices which do not use numbered reports), followed by the - report data (16 bytes). In this example, the length passed - in would be 17. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data The data to send, including the report number as - the first byte. - @param length The length in bytes of the data to send, including - the report number. - - @returns - This function returns the actual number of bytes written and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hid_device *device, const unsigned char *data, size_t length); - - /** @brief Get a feature report from a HID device. - - Make sure to set the first byte of @p data[] to the Report - ID of the report to be read. Make sure to allow space for - this extra byte in @p data[]. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data A buffer to put the read data into, including - the Report ID. Set the first byte of @p data[] to the - Report ID of the report to be read. - @param length The number of bytes to read, including an - extra byte for the report ID. The buffer can be longer - than the actual report. - - @returns - This function returns the number of bytes read and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *device, unsigned char *data, size_t length); - - /** @brief Close a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - */ - void HID_API_EXPORT HID_API_CALL hid_close(hid_device *device); - - /** @brief Get The Manufacturer String from a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_manufacturer_string(hid_device *device, wchar_t *string, size_t maxlen); - - /** @brief Get The Product String from a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_product_string(hid_device *device, wchar_t *string, size_t maxlen); - - /** @brief Get The Serial Number String from a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_serial_number_string(hid_device *device, wchar_t *string, size_t maxlen); - - /** @brief Get a string from a HID device, based on its string index. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string_index The index of the string to get. - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *device, int string_index, wchar_t *string, size_t maxlen); - - /** @brief Get a string describing the last error which occurred. - - @ingroup API - @param device A device handle returned from hid_open(). - - @returns - This function returns a string containing the last error - which occurred or NULL if none has occurred. - */ - HID_API_EXPORT const wchar_t* HID_API_CALL hid_error(hid_device *device); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Externals/libusb/win32/lusb0_usb.h b/Externals/libusb/win32/lusb0_usb.h deleted file mode 100644 index b95fbf0a6d..0000000000 --- a/Externals/libusb/win32/lusb0_usb.h +++ /dev/null @@ -1,427 +0,0 @@ -#ifndef __USB_H__ -#define __USB_H__ - -#include -#include - -/* - * 'interface' is defined somewhere in the Windows header files. This macro - * is deleted here to avoid conflicts and compile errors. - */ - -#ifdef interface -#undef interface -#endif - -/* - * PATH_MAX from limits.h can't be used on Windows if the dll and - * import libraries are build/used by different compilers - */ - -#define LIBUSB_PATH_MAX 512 - - -/* - * USB spec information - * - * This is all stuff grabbed from various USB specs and is pretty much - * not subject to change - */ - -/* - * Device and/or Interface Class codes - */ -#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ -#define USB_CLASS_AUDIO 1 -#define USB_CLASS_COMM 2 -#define USB_CLASS_HID 3 -#define USB_CLASS_PRINTER 7 -#define USB_CLASS_MASS_STORAGE 8 -#define USB_CLASS_HUB 9 -#define USB_CLASS_DATA 10 -#define USB_CLASS_VENDOR_SPEC 0xff - -/* - * Descriptor types - */ -#define USB_DT_DEVICE 0x01 -#define USB_DT_CONFIG 0x02 -#define USB_DT_STRING 0x03 -#define USB_DT_INTERFACE 0x04 -#define USB_DT_ENDPOINT 0x05 - -#define USB_DT_HID 0x21 -#define USB_DT_REPORT 0x22 -#define USB_DT_PHYSICAL 0x23 -#define USB_DT_HUB 0x29 - -/* - * Descriptor sizes per descriptor type - */ -#define USB_DT_DEVICE_SIZE 18 -#define USB_DT_CONFIG_SIZE 9 -#define USB_DT_INTERFACE_SIZE 9 -#define USB_DT_ENDPOINT_SIZE 7 -#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ -#define USB_DT_HUB_NONVAR_SIZE 7 - - -/* ensure byte-packed structures */ -#include - - -/* All standard descriptors have these 2 fields in common */ -struct usb_descriptor_header -{ - unsigned char bLength; - unsigned char bDescriptorType; -}; - -/* String descriptor */ -struct usb_string_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned short wData[1]; -}; - -/* HID descriptor */ -struct usb_hid_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned short bcdHID; - unsigned char bCountryCode; - unsigned char bNumDescriptors; -}; - -/* Endpoint descriptor */ -#define USB_MAXENDPOINTS 32 -struct usb_endpoint_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned char bEndpointAddress; - unsigned char bmAttributes; - unsigned short wMaxPacketSize; - unsigned char bInterval; - unsigned char bRefresh; - unsigned char bSynchAddress; - - unsigned char *extra; /* Extra descriptors */ - int extralen; -}; - -#define USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ -#define USB_ENDPOINT_DIR_MASK 0x80 - -#define USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ -#define USB_ENDPOINT_TYPE_CONTROL 0 -#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 -#define USB_ENDPOINT_TYPE_BULK 2 -#define USB_ENDPOINT_TYPE_INTERRUPT 3 - -/* Interface descriptor */ -#define USB_MAXINTERFACES 32 -struct usb_interface_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned char bInterfaceNumber; - unsigned char bAlternateSetting; - unsigned char bNumEndpoints; - unsigned char bInterfaceClass; - unsigned char bInterfaceSubClass; - unsigned char bInterfaceProtocol; - unsigned char iInterface; - - struct usb_endpoint_descriptor *endpoint; - - unsigned char *extra; /* Extra descriptors */ - int extralen; -}; - -#define USB_MAXALTSETTING 128 /* Hard limit */ - -struct usb_interface -{ - struct usb_interface_descriptor *altsetting; - - int num_altsetting; -}; - -/* Configuration descriptor information.. */ -#define USB_MAXCONFIG 8 -struct usb_config_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned short wTotalLength; - unsigned char bNumInterfaces; - unsigned char bConfigurationValue; - unsigned char iConfiguration; - unsigned char bmAttributes; - unsigned char MaxPower; - - struct usb_interface *interface; - - unsigned char *extra; /* Extra descriptors */ - int extralen; -}; - -/* Device descriptor */ -struct usb_device_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned short bcdUSB; - unsigned char bDeviceClass; - unsigned char bDeviceSubClass; - unsigned char bDeviceProtocol; - unsigned char bMaxPacketSize0; - unsigned short idVendor; - unsigned short idProduct; - unsigned short bcdDevice; - unsigned char iManufacturer; - unsigned char iProduct; - unsigned char iSerialNumber; - unsigned char bNumConfigurations; -}; - -struct usb_ctrl_setup -{ - unsigned char bRequestType; - unsigned char bRequest; - unsigned short wValue; - unsigned short wIndex; - unsigned short wLength; -}; - -/* - * Standard requests - */ -#define USB_REQ_GET_STATUS 0x00 -#define USB_REQ_CLEAR_FEATURE 0x01 -/* 0x02 is reserved */ -#define USB_REQ_SET_FEATURE 0x03 -/* 0x04 is reserved */ -#define USB_REQ_SET_ADDRESS 0x05 -#define USB_REQ_GET_DESCRIPTOR 0x06 -#define USB_REQ_SET_DESCRIPTOR 0x07 -#define USB_REQ_GET_CONFIGURATION 0x08 -#define USB_REQ_SET_CONFIGURATION 0x09 -#define USB_REQ_GET_INTERFACE 0x0A -#define USB_REQ_SET_INTERFACE 0x0B -#define USB_REQ_SYNCH_FRAME 0x0C - -#define USB_TYPE_STANDARD (0x00 << 5) -#define USB_TYPE_CLASS (0x01 << 5) -#define USB_TYPE_VENDOR (0x02 << 5) -#define USB_TYPE_RESERVED (0x03 << 5) - -#define USB_RECIP_DEVICE 0x00 -#define USB_RECIP_INTERFACE 0x01 -#define USB_RECIP_ENDPOINT 0x02 -#define USB_RECIP_OTHER 0x03 - -/* - * Various libusb API related stuff - */ - -#define USB_ENDPOINT_IN 0x80 -#define USB_ENDPOINT_OUT 0x00 - -/* Error codes */ -#define USB_ERROR_BEGIN 500000 - -/* - * This is supposed to look weird. This file is generated from autoconf - * and I didn't want to make this too complicated. - */ -#define USB_LE16_TO_CPU(x) - -/* - * Device reset types for usb_reset_ex. - * http://msdn.microsoft.com/en-us/library/ff537269%28VS.85%29.aspx - * http://msdn.microsoft.com/en-us/library/ff537243%28v=vs.85%29.aspx - */ -#define USB_RESET_TYPE_RESET_PORT (1 << 0) -#define USB_RESET_TYPE_CYCLE_PORT (1 << 1) -#define USB_RESET_TYPE_FULL_RESET (USB_RESET_TYPE_CYCLE_PORT | USB_RESET_TYPE_RESET_PORT) - - -/* Data types */ -/* struct usb_device; */ -/* struct usb_bus; */ - -struct usb_device -{ - struct usb_device *next, *prev; - - char filename[LIBUSB_PATH_MAX]; - - struct usb_bus *bus; - - struct usb_device_descriptor descriptor; - struct usb_config_descriptor *config; - - void *dev; /* Darwin support */ - - unsigned char devnum; - - unsigned char num_children; - struct usb_device **children; -}; - -struct usb_bus -{ - struct usb_bus *next, *prev; - - char dirname[LIBUSB_PATH_MAX]; - - struct usb_device *devices; - unsigned long location; - - struct usb_device *root_dev; -}; - -/* Version information, Windows specific */ -struct usb_version -{ - struct - { - int major; - int minor; - int micro; - int nano; - } dll; - struct - { - int major; - int minor; - int micro; - int nano; - } driver; -}; - - -struct usb_dev_handle; -typedef struct usb_dev_handle usb_dev_handle; - -/* Variables */ -#ifndef __USB_C__ -#define usb_busses usb_get_busses() -#endif - - - -#include - - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Function prototypes */ - - /* usb.c */ - usb_dev_handle *usb_open(struct usb_device *dev); - int usb_close(usb_dev_handle *dev); - int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, - size_t buflen); - int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, - size_t buflen); - - /* descriptors.c */ - int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, - unsigned char type, unsigned char index, - void *buf, int size); - int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, - unsigned char index, void *buf, int size); - - /* .c */ - int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, - int timeout); - int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, - int timeout); - int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, - int timeout); - int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, - int timeout); - int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, - int value, int index, char *bytes, int size, - int timeout); - int usb_set_configuration(usb_dev_handle *dev, int configuration); - int usb_claim_interface(usb_dev_handle *dev, int interface); - int usb_release_interface(usb_dev_handle *dev, int interface); - int usb_set_altinterface(usb_dev_handle *dev, int alternate); - int usb_resetep(usb_dev_handle *dev, unsigned int ep); - int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); - int usb_reset(usb_dev_handle *dev); - int usb_reset_ex(usb_dev_handle *dev, unsigned int reset_type); - - char *usb_strerror(void); - - void usb_init(void); - void usb_set_debug(int level); - int usb_find_busses(void); - int usb_find_devices(void); - struct usb_device *usb_device(usb_dev_handle *dev); - struct usb_bus *usb_get_busses(void); - - - /* Windows specific functions */ - -#define LIBUSB_HAS_INSTALL_SERVICE_NP 1 - int usb_install_service_np(void); - void CALLBACK usb_install_service_np_rundll(HWND wnd, HINSTANCE instance, - LPSTR cmd_line, int cmd_show); - -#define LIBUSB_HAS_UNINSTALL_SERVICE_NP 1 - int usb_uninstall_service_np(void); - void CALLBACK usb_uninstall_service_np_rundll(HWND wnd, HINSTANCE instance, - LPSTR cmd_line, int cmd_show); - -#define LIBUSB_HAS_INSTALL_DRIVER_NP 1 - int usb_install_driver_np(const char *inf_file); - void CALLBACK usb_install_driver_np_rundll(HWND wnd, HINSTANCE instance, - LPSTR cmd_line, int cmd_show); - -#define LIBUSB_HAS_TOUCH_INF_FILE_NP 1 - int usb_touch_inf_file_np(const char *inf_file); - void CALLBACK usb_touch_inf_file_np_rundll(HWND wnd, HINSTANCE instance, - LPSTR cmd_line, int cmd_show); - -#define LIBUSB_HAS_INSTALL_NEEDS_RESTART_NP 1 - int usb_install_needs_restart_np(void); - -#define LIBUSB_HAS_INSTALL_NP 1 - int usb_install_npW(HWND hwnd, HINSTANCE instance, LPCWSTR cmd_line, int starg_arg); - int usb_install_npA(HWND hwnd, HINSTANCE instance, LPCSTR cmd_line, int starg_arg); - #define usb_install_np usb_install_npA - void CALLBACK usb_install_np_rundll(HWND wnd, HINSTANCE instance, - LPSTR cmd_line, int cmd_show); - - const struct usb_version *usb_get_version(void); - - int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, - unsigned char ep, int pktsize); - int usb_bulk_setup_async(usb_dev_handle *dev, void **context, - unsigned char ep); - int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, - unsigned char ep); - - int usb_submit_async(void *context, char *bytes, int size); - int usb_reap_async(void *context, int timeout); - int usb_reap_async_nocancel(void *context, int timeout); - int usb_cancel_async(void *context); - int usb_free_async(void **context); - - -#ifdef __cplusplus -} -#endif - -#endif /* __USB_H__ */ - diff --git a/Externals/libusb/x64/hidapi.dll b/Externals/libusb/x64/hidapi.dll deleted file mode 100644 index 1461560e500765127d643e677dee6cd415a2c708..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37888 zcmeHw4PcYix&KLv6G^`d;h=Zyl>i+FF$wp z_rIn+=RF_KdCqg5^PK0L^PH2sWy?0Rc*d9-PLdeggC~88xPN{xg6s>fdiDbLeW>)w@=&R^{n*To3wTI=4Owet#xX>{${PaSzEHWQrqNlIAeUq^?-|~S3EF_KkFXQ@@K8`bn<6~yUs

zVQislJo|H{ZgDiPo5fu{QI*J84N?l^)WwrjjHMz>j(mE?F_yrPj!*Q-x)3L( z;Si@y4J5^Q-%{iIWY4<6+0%A zc2?lof^&^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++ /dev/null @@ -1,384 +0,0 @@ -/******************************************************* - HIDAPI - Multi-Platform library for - communication with HID devices. - - Alan Ott - Signal 11 Software - - 8/22/2009 - - Copyright 2009, All Rights Reserved. - - At the discretion of the user of this library, - this software may be licensed under the terms of the - GNU Public License v3, a BSD-Style license, or the - original HIDAPI license as outlined in the LICENSE.txt, - LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt - files located at the root of the source distribution. - These files may also be found in the public source - code repository located at: - http://github.com/signal11/hidapi . -********************************************************/ - -/** @file - * @defgroup API hidapi API - */ - -#ifndef HIDAPI_H__ -#define HIDAPI_H__ - -#include - -#ifdef _WIN32 - #define HID_API_EXPORT __declspec(dllexport) - #define HID_API_CALL -#else - #define HID_API_EXPORT /**< API export macro */ - #define HID_API_CALL /**< API call macro */ -#endif - -#define HID_API_EXPORT_CALL HID_API_EXPORT HID_API_CALL /**< API export and call macro*/ - -#ifdef __cplusplus -extern "C" { -#endif - struct hid_device_; - typedef struct hid_device_ hid_device; /**< opaque hidapi structure */ - - /** hidapi info structure */ - struct hid_device_info { - /** Platform-specific device path */ - char *path; - /** Device Vendor ID */ - unsigned short vendor_id; - /** Device Product ID */ - unsigned short product_id; - /** Serial Number */ - wchar_t *serial_number; - /** Device Release Number in binary-coded decimal, - also known as Device Version Number */ - unsigned short release_number; - /** Manufacturer String */ - wchar_t *manufacturer_string; - /** Product string */ - wchar_t *product_string; - /** Usage Page for this Device/Interface - (Windows/Mac only). */ - unsigned short usage_page; - /** Usage for this Device/Interface - (Windows/Mac only).*/ - unsigned short usage; - /** The USB interface which this logical device - represents. Valid on both Linux implementations - in all cases, and valid on the Windows implementation - only if the device contains more than one interface. */ - int interface_number; - - /** Pointer to the next device */ - struct hid_device_info *next; - }; - - - /** @brief Initialize the HIDAPI library. - - This function initializes the HIDAPI library. Calling it is not - strictly necessary, as it will be called automatically by - hid_enumerate() and any of the hid_open_*() functions if it is - needed. This function should be called at the beginning of - execution however, if there is a chance of HIDAPI handles - being opened by different threads simultaneously. - - @ingroup API - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_init(void); - - /** @brief Finalize the HIDAPI library. - - This function frees all of the static data associated with - HIDAPI. It should be called at the end of execution to avoid - memory leaks. - - @ingroup API - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_exit(void); - - /** @brief Enumerate the HID Devices. - - This function returns a linked list of all the HID devices - attached to the system which match vendor_id and product_id. - If @p vendor_id and @p product_id are both set to 0, then - all HID devices will be returned. - - @ingroup API - @param vendor_id The Vendor ID (VID) of the types of device - to open. - @param product_id The Product ID (PID) of the types of - device to open. - - @returns - This function returns a pointer to a linked list of type - struct #hid_device, containing information about the HID devices - attached to the system, or NULL in the case of failure. Free - this linked list by calling hid_free_enumeration(). - */ - struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id); - - /** @brief Free an enumeration Linked List - - This function frees a linked list created by hid_enumerate(). - - @ingroup API - @param devs Pointer to a list of struct_device returned from - hid_enumerate(). - */ - void HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hid_device_info *devs); - - /** @brief Open a HID device using a Vendor ID (VID), Product ID - (PID) and optionally a serial number. - - If @p serial_number is NULL, the first device with the - specified VID and PID is opened. - - @ingroup API - @param vendor_id The Vendor ID (VID) of the device to open. - @param product_id The Product ID (PID) of the device to open. - @param serial_number The Serial Number of the device to open - (Optionally NULL). - - @returns - This function returns a pointer to a #hid_device object on - success or NULL on failure. - */ - HID_API_EXPORT hid_device * HID_API_CALL hid_open(unsigned short vendor_id, unsigned short product_id, wchar_t *serial_number); - - /** @brief Open a HID device by its path name. - - The path name be determined by calling hid_enumerate(), or a - platform-specific path name can be used (eg: /dev/hidraw0 on - Linux). - - @ingroup API - @param path The path name of the device to open - - @returns - This function returns a pointer to a #hid_device object on - success or NULL on failure. - */ - HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path); - - /** @brief Write an Output report to a HID device. - - The first byte of @p data[] must contain the Report ID. For - devices which only support a single report, this must be set - to 0x0. The remaining bytes contain the report data. Since - the Report ID is mandatory, calls to hid_write() will always - contain one more byte than the report contains. For example, - if a hid report is 16 bytes long, 17 bytes must be passed to - hid_write(), the Report ID (or 0x0, for devices with a - single report), followed by the report data (16 bytes). In - this example, the length passed in would be 17. - - hid_write() will send the data on the first OUT endpoint, if - one exists. If it does not, it will send the data through - the Control Endpoint (Endpoint 0). - - @ingroup API - @param device A device handle returned from hid_open(). - @param data The data to send, including the report number as - the first byte. - @param length The length in bytes of the data to send. - - @returns - This function returns the actual number of bytes written and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_write(hid_device *device, const unsigned char *data, size_t length); - - int HID_API_EXPORT HID_API_CALL hid_set_output_report(hid_device *dev, const unsigned char *data, size_t length); - /** @brief Read an Input report from a HID device with timeout. - - Input reports are returned - to the host through the INTERRUPT IN endpoint. The first byte will - contain the Report number if the device uses numbered reports. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data A buffer to put the read data into. - @param length The number of bytes to read. For devices with - multiple reports, make sure to read an extra byte for - the report number. - @param milliseconds timeout in milliseconds or -1 for blocking wait. - - @returns - This function returns the actual number of bytes read and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds); - - /** @brief Read an Input report from a HID device. - - Input reports are returned - to the host through the INTERRUPT IN endpoint. The first byte will - contain the Report number if the device uses numbered reports. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data A buffer to put the read data into. - @param length The number of bytes to read. For devices with - multiple reports, make sure to read an extra byte for - the report number. - - @returns - This function returns the actual number of bytes read and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_read(hid_device *device, unsigned char *data, size_t length); - - /** @brief Set the device handle to be non-blocking. - - In non-blocking mode calls to hid_read() will return - immediately with a value of 0 if there is no data to be - read. In blocking mode, hid_read() will wait (block) until - there is data to read before returning. - - Nonblocking can be turned on and off at any time. - - @ingroup API - @param device A device handle returned from hid_open(). - @param nonblock enable or not the nonblocking reads - - 1 to enable nonblocking - - 0 to disable nonblocking. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hid_device *device, int nonblock); - - /** @brief Send a Feature report to the device. - - Feature reports are sent over the Control endpoint as a - Set_Report transfer. The first byte of @p data[] must - contain the Report ID. For devices which only support a - single report, this must be set to 0x0. The remaining bytes - contain the report data. Since the Report ID is mandatory, - calls to hid_send_feature_report() will always contain one - more byte than the report contains. For example, if a hid - report is 16 bytes long, 17 bytes must be passed to - hid_send_feature_report(): the Report ID (or 0x0, for - devices which do not use numbered reports), followed by the - report data (16 bytes). In this example, the length passed - in would be 17. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data The data to send, including the report number as - the first byte. - @param length The length in bytes of the data to send, including - the report number. - - @returns - This function returns the actual number of bytes written and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hid_device *device, const unsigned char *data, size_t length); - - /** @brief Get a feature report from a HID device. - - Make sure to set the first byte of @p data[] to the Report - ID of the report to be read. Make sure to allow space for - this extra byte in @p data[]. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data A buffer to put the read data into, including - the Report ID. Set the first byte of @p data[] to the - Report ID of the report to be read. - @param length The number of bytes to read, including an - extra byte for the report ID. The buffer can be longer - than the actual report. - - @returns - This function returns the number of bytes read and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *device, unsigned char *data, size_t length); - - /** @brief Close a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - */ - void HID_API_EXPORT HID_API_CALL hid_close(hid_device *device); - - /** @brief Get The Manufacturer String from a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_manufacturer_string(hid_device *device, wchar_t *string, size_t maxlen); - - /** @brief Get The Product String from a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_product_string(hid_device *device, wchar_t *string, size_t maxlen); - - /** @brief Get The Serial Number String from a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_serial_number_string(hid_device *device, wchar_t *string, size_t maxlen); - - /** @brief Get a string from a HID device, based on its string index. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string_index The index of the string to get. - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *device, int string_index, wchar_t *string, size_t maxlen); - - /** @brief Get a string describing the last error which occurred. - - @ingroup API - @param device A device handle returned from hid_open(). - - @returns - This function returns a string containing the last error - which occurred or NULL if none has occurred. - */ - HID_API_EXPORT const wchar_t* HID_API_CALL hid_error(hid_device *device); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Externals/libusb/x64/lusb0_usb.h b/Externals/libusb/x64/lusb0_usb.h deleted file mode 100644 index b95fbf0a6d..0000000000 --- a/Externals/libusb/x64/lusb0_usb.h +++ /dev/null @@ -1,427 +0,0 @@ -#ifndef __USB_H__ -#define __USB_H__ - -#include -#include - -/* - * 'interface' is defined somewhere in the Windows header files. This macro - * is deleted here to avoid conflicts and compile errors. - */ - -#ifdef interface -#undef interface -#endif - -/* - * PATH_MAX from limits.h can't be used on Windows if the dll and - * import libraries are build/used by different compilers - */ - -#define LIBUSB_PATH_MAX 512 - - -/* - * USB spec information - * - * This is all stuff grabbed from various USB specs and is pretty much - * not subject to change - */ - -/* - * Device and/or Interface Class codes - */ -#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ -#define USB_CLASS_AUDIO 1 -#define USB_CLASS_COMM 2 -#define USB_CLASS_HID 3 -#define USB_CLASS_PRINTER 7 -#define USB_CLASS_MASS_STORAGE 8 -#define USB_CLASS_HUB 9 -#define USB_CLASS_DATA 10 -#define USB_CLASS_VENDOR_SPEC 0xff - -/* - * Descriptor types - */ -#define USB_DT_DEVICE 0x01 -#define USB_DT_CONFIG 0x02 -#define USB_DT_STRING 0x03 -#define USB_DT_INTERFACE 0x04 -#define USB_DT_ENDPOINT 0x05 - -#define USB_DT_HID 0x21 -#define USB_DT_REPORT 0x22 -#define USB_DT_PHYSICAL 0x23 -#define USB_DT_HUB 0x29 - -/* - * Descriptor sizes per descriptor type - */ -#define USB_DT_DEVICE_SIZE 18 -#define USB_DT_CONFIG_SIZE 9 -#define USB_DT_INTERFACE_SIZE 9 -#define USB_DT_ENDPOINT_SIZE 7 -#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ -#define USB_DT_HUB_NONVAR_SIZE 7 - - -/* ensure byte-packed structures */ -#include - - -/* All standard descriptors have these 2 fields in common */ -struct usb_descriptor_header -{ - unsigned char bLength; - unsigned char bDescriptorType; -}; - -/* String descriptor */ -struct usb_string_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned short wData[1]; -}; - -/* HID descriptor */ -struct usb_hid_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned short bcdHID; - unsigned char bCountryCode; - unsigned char bNumDescriptors; -}; - -/* Endpoint descriptor */ -#define USB_MAXENDPOINTS 32 -struct usb_endpoint_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned char bEndpointAddress; - unsigned char bmAttributes; - unsigned short wMaxPacketSize; - unsigned char bInterval; - unsigned char bRefresh; - unsigned char bSynchAddress; - - unsigned char *extra; /* Extra descriptors */ - int extralen; -}; - -#define USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ -#define USB_ENDPOINT_DIR_MASK 0x80 - -#define USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ -#define USB_ENDPOINT_TYPE_CONTROL 0 -#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 -#define USB_ENDPOINT_TYPE_BULK 2 -#define USB_ENDPOINT_TYPE_INTERRUPT 3 - -/* Interface descriptor */ -#define USB_MAXINTERFACES 32 -struct usb_interface_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned char bInterfaceNumber; - unsigned char bAlternateSetting; - unsigned char bNumEndpoints; - unsigned char bInterfaceClass; - unsigned char bInterfaceSubClass; - unsigned char bInterfaceProtocol; - unsigned char iInterface; - - struct usb_endpoint_descriptor *endpoint; - - unsigned char *extra; /* Extra descriptors */ - int extralen; -}; - -#define USB_MAXALTSETTING 128 /* Hard limit */ - -struct usb_interface -{ - struct usb_interface_descriptor *altsetting; - - int num_altsetting; -}; - -/* Configuration descriptor information.. */ -#define USB_MAXCONFIG 8 -struct usb_config_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned short wTotalLength; - unsigned char bNumInterfaces; - unsigned char bConfigurationValue; - unsigned char iConfiguration; - unsigned char bmAttributes; - unsigned char MaxPower; - - struct usb_interface *interface; - - unsigned char *extra; /* Extra descriptors */ - int extralen; -}; - -/* Device descriptor */ -struct usb_device_descriptor -{ - unsigned char bLength; - unsigned char bDescriptorType; - unsigned short bcdUSB; - unsigned char bDeviceClass; - unsigned char bDeviceSubClass; - unsigned char bDeviceProtocol; - unsigned char bMaxPacketSize0; - unsigned short idVendor; - unsigned short idProduct; - unsigned short bcdDevice; - unsigned char iManufacturer; - unsigned char iProduct; - unsigned char iSerialNumber; - unsigned char bNumConfigurations; -}; - -struct usb_ctrl_setup -{ - unsigned char bRequestType; - unsigned char bRequest; - unsigned short wValue; - unsigned short wIndex; - unsigned short wLength; -}; - -/* - * Standard requests - */ -#define USB_REQ_GET_STATUS 0x00 -#define USB_REQ_CLEAR_FEATURE 0x01 -/* 0x02 is reserved */ -#define USB_REQ_SET_FEATURE 0x03 -/* 0x04 is reserved */ -#define USB_REQ_SET_ADDRESS 0x05 -#define USB_REQ_GET_DESCRIPTOR 0x06 -#define USB_REQ_SET_DESCRIPTOR 0x07 -#define USB_REQ_GET_CONFIGURATION 0x08 -#define USB_REQ_SET_CONFIGURATION 0x09 -#define USB_REQ_GET_INTERFACE 0x0A -#define USB_REQ_SET_INTERFACE 0x0B -#define USB_REQ_SYNCH_FRAME 0x0C - -#define USB_TYPE_STANDARD (0x00 << 5) -#define USB_TYPE_CLASS (0x01 << 5) -#define USB_TYPE_VENDOR (0x02 << 5) -#define USB_TYPE_RESERVED (0x03 << 5) - -#define USB_RECIP_DEVICE 0x00 -#define USB_RECIP_INTERFACE 0x01 -#define USB_RECIP_ENDPOINT 0x02 -#define USB_RECIP_OTHER 0x03 - -/* - * Various libusb API related stuff - */ - -#define USB_ENDPOINT_IN 0x80 -#define USB_ENDPOINT_OUT 0x00 - -/* Error codes */ -#define USB_ERROR_BEGIN 500000 - -/* - * This is supposed to look weird. This file is generated from autoconf - * and I didn't want to make this too complicated. - */ -#define USB_LE16_TO_CPU(x) - -/* - * Device reset types for usb_reset_ex. - * http://msdn.microsoft.com/en-us/library/ff537269%28VS.85%29.aspx - * http://msdn.microsoft.com/en-us/library/ff537243%28v=vs.85%29.aspx - */ -#define USB_RESET_TYPE_RESET_PORT (1 << 0) -#define USB_RESET_TYPE_CYCLE_PORT (1 << 1) -#define USB_RESET_TYPE_FULL_RESET (USB_RESET_TYPE_CYCLE_PORT | USB_RESET_TYPE_RESET_PORT) - - -/* Data types */ -/* struct usb_device; */ -/* struct usb_bus; */ - -struct usb_device -{ - struct usb_device *next, *prev; - - char filename[LIBUSB_PATH_MAX]; - - struct usb_bus *bus; - - struct usb_device_descriptor descriptor; - struct usb_config_descriptor *config; - - void *dev; /* Darwin support */ - - unsigned char devnum; - - unsigned char num_children; - struct usb_device **children; -}; - -struct usb_bus -{ - struct usb_bus *next, *prev; - - char dirname[LIBUSB_PATH_MAX]; - - struct usb_device *devices; - unsigned long location; - - struct usb_device *root_dev; -}; - -/* Version information, Windows specific */ -struct usb_version -{ - struct - { - int major; - int minor; - int micro; - int nano; - } dll; - struct - { - int major; - int minor; - int micro; - int nano; - } driver; -}; - - -struct usb_dev_handle; -typedef struct usb_dev_handle usb_dev_handle; - -/* Variables */ -#ifndef __USB_C__ -#define usb_busses usb_get_busses() -#endif - - - -#include - - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Function prototypes */ - - /* usb.c */ - usb_dev_handle *usb_open(struct usb_device *dev); - int usb_close(usb_dev_handle *dev); - int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, - size_t buflen); - int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, - size_t buflen); - - /* descriptors.c */ - int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, - unsigned char type, unsigned char index, - void *buf, int size); - int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, - unsigned char index, void *buf, int size); - - /* .c */ - int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, - int timeout); - int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, - int timeout); - int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, - int timeout); - int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, - int timeout); - int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, - int value, int index, char *bytes, int size, - int timeout); - int usb_set_configuration(usb_dev_handle *dev, int configuration); - int usb_claim_interface(usb_dev_handle *dev, int interface); - int usb_release_interface(usb_dev_handle *dev, int interface); - int usb_set_altinterface(usb_dev_handle *dev, int alternate); - int usb_resetep(usb_dev_handle *dev, unsigned int ep); - int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); - int usb_reset(usb_dev_handle *dev); - int usb_reset_ex(usb_dev_handle *dev, unsigned int reset_type); - - char *usb_strerror(void); - - void usb_init(void); - void usb_set_debug(int level); - int usb_find_busses(void); - int usb_find_devices(void); - struct usb_device *usb_device(usb_dev_handle *dev); - struct usb_bus *usb_get_busses(void); - - - /* Windows specific functions */ - -#define LIBUSB_HAS_INSTALL_SERVICE_NP 1 - int usb_install_service_np(void); - void CALLBACK usb_install_service_np_rundll(HWND wnd, HINSTANCE instance, - LPSTR cmd_line, int cmd_show); - -#define LIBUSB_HAS_UNINSTALL_SERVICE_NP 1 - int usb_uninstall_service_np(void); - void CALLBACK usb_uninstall_service_np_rundll(HWND wnd, HINSTANCE instance, - LPSTR cmd_line, int cmd_show); - -#define LIBUSB_HAS_INSTALL_DRIVER_NP 1 - int usb_install_driver_np(const char *inf_file); - void CALLBACK usb_install_driver_np_rundll(HWND wnd, HINSTANCE instance, - LPSTR cmd_line, int cmd_show); - -#define LIBUSB_HAS_TOUCH_INF_FILE_NP 1 - int usb_touch_inf_file_np(const char *inf_file); - void CALLBACK usb_touch_inf_file_np_rundll(HWND wnd, HINSTANCE instance, - LPSTR cmd_line, int cmd_show); - -#define LIBUSB_HAS_INSTALL_NEEDS_RESTART_NP 1 - int usb_install_needs_restart_np(void); - -#define LIBUSB_HAS_INSTALL_NP 1 - int usb_install_npW(HWND hwnd, HINSTANCE instance, LPCWSTR cmd_line, int starg_arg); - int usb_install_npA(HWND hwnd, HINSTANCE instance, LPCSTR cmd_line, int starg_arg); - #define usb_install_np usb_install_npA - void CALLBACK usb_install_np_rundll(HWND wnd, HINSTANCE instance, - LPSTR cmd_line, int cmd_show); - - const struct usb_version *usb_get_version(void); - - int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, - unsigned char ep, int pktsize); - int usb_bulk_setup_async(usb_dev_handle *dev, void **context, - unsigned char ep); - int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, - unsigned char ep); - - int usb_submit_async(void *context, char *bytes, int size); - int usb_reap_async(void *context, int timeout); - int usb_reap_async_nocancel(void *context, int timeout); - int usb_cancel_async(void *context); - int usb_free_async(void **context); - - -#ifdef __cplusplus -} -#endif - -#endif /* __USB_H__ */ - diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_hid.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_hid.cpp index 0103a534c3..2e1e3c1823 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_hid.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_hid.cpp @@ -248,24 +248,16 @@ bool CWII_IPC_HLE_Device_hid::IOCtlV(u32 _CommandAddress) u32 ReturnValue = 0; SIOCtlVBuffer CommandBuffer(_CommandAddress); - switch (CommandBuffer.Parameter) - { - - default: - { - DEBUG_LOG(WII_IPC_HID, "%s - IOCtlV:", GetDeviceName().c_str()); - DEBUG_LOG(WII_IPC_HID, " Parameter: 0x%x", CommandBuffer.Parameter); - DEBUG_LOG(WII_IPC_HID, " NumberIn: 0x%08x", CommandBuffer.NumberInBuffer); - DEBUG_LOG(WII_IPC_HID, " NumberOut: 0x%08x", CommandBuffer.NumberPayloadBuffer); - DEBUG_LOG(WII_IPC_HID, " BufferVector: 0x%08x", CommandBuffer.BufferVector); - DEBUG_LOG(WII_IPC_HID, " PayloadAddr: 0x%08x", CommandBuffer.PayloadBuffer[0].m_Address); - DEBUG_LOG(WII_IPC_HID, " PayloadSize: 0x%08x", CommandBuffer.PayloadBuffer[0].m_Size); - #if defined(_DEBUG) || defined(DEBUGFAST) - DumpAsync(CommandBuffer.BufferVector, CommandBuffer.NumberInBuffer, CommandBuffer.NumberPayloadBuffer); - #endif - } - break; - } + DEBUG_LOG(WII_IPC_HID, "%s - IOCtlV:", GetDeviceName().c_str()); + DEBUG_LOG(WII_IPC_HID, " Parameter: 0x%x", CommandBuffer.Parameter); + DEBUG_LOG(WII_IPC_HID, " NumberIn: 0x%08x", CommandBuffer.NumberInBuffer); + DEBUG_LOG(WII_IPC_HID, " NumberOut: 0x%08x", CommandBuffer.NumberPayloadBuffer); + DEBUG_LOG(WII_IPC_HID, " BufferVector: 0x%08x", CommandBuffer.BufferVector); + DEBUG_LOG(WII_IPC_HID, " PayloadAddr: 0x%08x", CommandBuffer.PayloadBuffer[0].m_Address); + DEBUG_LOG(WII_IPC_HID, " PayloadSize: 0x%08x", CommandBuffer.PayloadBuffer[0].m_Size); + #if defined(_DEBUG) || defined(DEBUGFAST) + DumpAsync(CommandBuffer.BufferVector, CommandBuffer.NumberInBuffer, CommandBuffer.NumberPayloadBuffer); + #endif Memory::Write_U32(ReturnValue, _CommandAddress + 4); return true; @@ -298,31 +290,130 @@ void CWII_IPC_HLE_Device_hid::ConvertEndpointToWii(WiiHIDEndpointDescriptor *des memcpy(dest,src,sizeof(WiiHIDEndpointDescriptor)); dest->wMaxPacketSize = Common::swap16(dest->wMaxPacketSize); } -/* + +u32 CWII_IPC_HLE_Device_hid::GetAvailableID(char* path) +{ + return 0; +} + // hidapi version -void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize) +void CWII_IPC_HLE_Device_hid::FillOutDevicesHidApi(u32 BufferOut, u32 BufferOutSize) { // Enumerate and print the HID devices on the system struct hid_device_info *devs, *cur_dev; + int OffsetBuffer = BufferOut; + int OffsetStart = 0; + int c,ic,i,e; // config, interface container, interface, endpoint + devs = hid_enumerate(0x0, 0x0); cur_dev = devs; while (cur_dev) { - printf("Device Found\n type: %04hx %04hx\n path: %s\n serial_number: %ls", + + OffsetStart = OffsetBuffer; + OffsetBuffer += 4; // skip length for now, fill at end + + Memory::Write_U32(GetAvailableID(cur_dev->path), OffsetBuffer); //write device num + OffsetBuffer += 4; + + WiiHIDDeviceDescriptor wii_device; + /* + u8 bDescriptorType; + u16 bcdUSB; + u8 bDeviceClass; + u8 bDeviceSubClass; + u8 bDeviceProtocol; + u8 bMaxPacketSize0; + u16 idVendor; + u16 idProduct; + u16 bcdDevice; + u8 iManufacturer; + u8 iProduct; + u8 iSerialNumber; + u8 bNumConfigurations; + u8 pad[2]; + + */ + + wii_device.bLength = Common::swap8(0x12); + wii_device.bcdUSB = Common::swap16(0x0002); + wii_device.bDeviceClass = Common::swap8(0); + wii_device.bDeviceSubClass = Common::swap8(0); + wii_device.bDeviceProtocol = Common::swap8(0); + wii_device.bMaxPacketSize0 = Common::swap8(0x20); + wii_device.idVendor = Common::swap16(cur_dev->vendor_id); + wii_device.idProduct = Common::swap16(cur_dev->product_id); + wii_device.bcdDevice = Common::swap16(0x100); + wii_device.iManufacturer = Common::swap8(0x1); + wii_device.iProduct = Common::swap8(0x2); + wii_device.iSerialNumber = Common::swap8(0); + wii_device.bNumConfigurations = Common::swap8(0x1); + + Memory::WriteBigEData((const u8*)&wii_device, OffsetBuffer, Align(wii_device.bLength, 4)); + + OffsetBuffer += Align(wii_device.bLength, 4); + + + for (c = 0; c < Common::swap8(wii_device.bNumConfigurations); c++) + { + + WiiHIDConfigDescriptor wii_config; + wii_config.bLength = Common::swap8(0x9); + wii_config.bDescriptorType = Common::swap8(0x2); + wii_config.wTotalLength = Common::swap16(0x29); + wii_config.bNumInterfaces = Common::swap8(0x1); + wii_config.bConfigurationValue = Common::swap8(0x1); + wii_config.iConfiguration = Common::swap8(0); + wii_config.bmAttributes = Common::swap8(0x80); + wii_config.MaxPower = Common::swap8(0x96); + + Memory::WriteBigEData((const u8*)&wii_config, OffsetBuffer, Align(wii_config.bLength, 4)); + OffsetBuffer += Align(wii_config.bLength, 4); + + for (ic = 0; ic < wii_config.bNumInterfaces; ic++) + { +/* struct usb_interface *interfaceContainer = &config->interface[ic]; + for (i = 0; i < interfaceContainer->num_altsetting; i++) + { + struct usb_interface_descriptor *interface = &interfaceContainer->altsetting[i]; + + WiiHIDInterfaceDescriptor wii_interface; + ConvertInterfaceToWii(&wii_interface, interface); + Memory::WriteBigEData((const u8*)&wii_interface, OffsetBuffer, Align(wii_interface.bLength, 4)); + OffsetBuffer += Align(wii_interface.bLength, 4); + + for (e = 0; e < interface->bNumEndpoints; e++) + { + struct usb_endpoint_descriptor *endpoint = &interface->endpoint[e]; + + WiiHIDEndpointDescriptor wii_endpoint; + ConvertEndpointToWii(&wii_endpoint, endpoint); + Memory::WriteBigEData((const u8*)&wii_endpoint, OffsetBuffer, Align(wii_endpoint.bLength, 4)); + OffsetBuffer += Align(wii_endpoint.bLength, 4); + + } //endpoints + } // interfaces + */ + } // interface containters + } // configs + + + NOTICE_LOG(WII_IPC_HID, "Device Found\n type: %04hx %04hx\n path: %s\n serial_number: %ls", cur_dev->vendor_id, cur_dev->product_id, cur_dev->path, cur_dev->serial_number); - printf("\n"); - printf(" Manufacturer: %ls\n", cur_dev->manufacturer_string); - printf(" Product: %ls\n", cur_dev->product_string); - printf("\n"); + NOTICE_LOG(WII_IPC_HID, "\n"); + NOTICE_LOG(WII_IPC_HID, " Manufacturer: %ls\n", cur_dev->manufacturer_string); + NOTICE_LOG(WII_IPC_HID, " Product: %ls\n", cur_dev->product_string); + NOTICE_LOG(WII_IPC_HID, "\n"); cur_dev = cur_dev->next; } hid_free_enumeration(devs); } -*/ + // libusb version void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize) { + //FillOutDevicesHidApi(BufferOut, BufferOutSize); usb_find_busses(); // find all busses usb_find_devices(); // find all connected devices struct usb_bus *bus; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_hid.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_hid.h index 2bb7f47a59..ef3b8912f1 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_hid.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_hid.h @@ -111,7 +111,10 @@ private: } WiiHIDEndpointDescriptor; - void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize); + u32 GetAvailableID(char* path); + + void FillOutDevices(u32 BufferOut, u32 BufferOutSize); + void FillOutDevicesHidApi(u32 BufferOut, u32 BufferOutSize); void ConvertDeviceToWii(WiiHIDDeviceDescriptor *dest, struct usb_device_descriptor *src); void ConvertConfigToWii(WiiHIDConfigDescriptor *dest, struct usb_config_descriptor *src);