mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 00:42:48 +00:00
info logs
This commit is contained in:
parent
09fae8700c
commit
c4b5fc5cf3
@ -27,19 +27,19 @@ libusb_context* g_libusb_context;
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdInit() {
|
s32 PS4_SYSV_ABI sceUsbdInit() {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_init_context(&g_libusb_context, nullptr, 0));
|
return libusb_to_orbis_error(libusb_init_context(&g_libusb_context, nullptr, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdExit() {
|
void PS4_SYSV_ABI sceUsbdExit() {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_exit(g_libusb_context);
|
libusb_exit(g_libusb_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
s64 PS4_SYSV_ABI sceUsbdGetDeviceList(SceUsbdDevice*** list) {
|
s64 PS4_SYSV_ABI sceUsbdGetDeviceList(SceUsbdDevice*** list) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
s64 cnt = libusb_get_device_list(g_libusb_context, list);
|
s64 cnt = libusb_get_device_list(g_libusb_context, list);
|
||||||
if (cnt >= 0)
|
if (cnt >= 0)
|
||||||
@ -49,212 +49,212 @@ s64 PS4_SYSV_ABI sceUsbdGetDeviceList(SceUsbdDevice*** list) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdFreeDeviceList(SceUsbdDevice** list, s32 unref_devices) {
|
void PS4_SYSV_ABI sceUsbdFreeDeviceList(SceUsbdDevice** list, s32 unref_devices) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_free_device_list(list, unref_devices);
|
libusb_free_device_list(list, unref_devices);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceUsbdDevice* PS4_SYSV_ABI sceUsbdRefDevice(SceUsbdDevice* device) {
|
SceUsbdDevice* PS4_SYSV_ABI sceUsbdRefDevice(SceUsbdDevice* device) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_ref_device(device);
|
return libusb_ref_device(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdUnrefDevice(SceUsbdDevice* device) {
|
void PS4_SYSV_ABI sceUsbdUnrefDevice(SceUsbdDevice* device) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_unref_device(device);
|
libusb_unref_device(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdGetConfiguration(SceUsbdDeviceHandle* dev_handle, s32* config) {
|
s32 PS4_SYSV_ABI sceUsbdGetConfiguration(SceUsbdDeviceHandle* dev_handle, s32* config) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_get_configuration(dev_handle, config));
|
return libusb_to_orbis_error(libusb_get_configuration(dev_handle, config));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdGetDeviceDescriptor(SceUsbdDevice* device, SceUsbdDeviceDescriptor* desc) {
|
s32 PS4_SYSV_ABI sceUsbdGetDeviceDescriptor(SceUsbdDevice* device, SceUsbdDeviceDescriptor* desc) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_get_device_descriptor(device, desc));
|
return libusb_to_orbis_error(libusb_get_device_descriptor(device, desc));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdGetActiveConfigDescriptor(SceUsbdDevice* device,
|
s32 PS4_SYSV_ABI sceUsbdGetActiveConfigDescriptor(SceUsbdDevice* device,
|
||||||
SceUsbdConfigDescriptor** config) {
|
SceUsbdConfigDescriptor** config) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_get_active_config_descriptor(device, config));
|
return libusb_to_orbis_error(libusb_get_active_config_descriptor(device, config));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdGetConfigDescriptor(SceUsbdDevice* device, u8 config_index,
|
s32 PS4_SYSV_ABI sceUsbdGetConfigDescriptor(SceUsbdDevice* device, u8 config_index,
|
||||||
SceUsbdConfigDescriptor** config) {
|
SceUsbdConfigDescriptor** config) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_get_config_descriptor(device, config_index, config));
|
return libusb_to_orbis_error(libusb_get_config_descriptor(device, config_index, config));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdGetConfigDescriptorByValue(SceUsbdDevice* device, u8 bConfigurationValue,
|
s32 PS4_SYSV_ABI sceUsbdGetConfigDescriptorByValue(SceUsbdDevice* device, u8 bConfigurationValue,
|
||||||
SceUsbdConfigDescriptor** config) {
|
SceUsbdConfigDescriptor** config) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(
|
return libusb_to_orbis_error(
|
||||||
libusb_get_config_descriptor_by_value(device, bConfigurationValue, config));
|
libusb_get_config_descriptor_by_value(device, bConfigurationValue, config));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdFreeConfigDescriptor(SceUsbdConfigDescriptor* config) {
|
void PS4_SYSV_ABI sceUsbdFreeConfigDescriptor(SceUsbdConfigDescriptor* config) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_free_config_descriptor(config);
|
libusb_free_config_descriptor(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 PS4_SYSV_ABI sceUsbdGetBusNumber(SceUsbdDevice* device) {
|
u8 PS4_SYSV_ABI sceUsbdGetBusNumber(SceUsbdDevice* device) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_get_bus_number(device);
|
return libusb_get_bus_number(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 PS4_SYSV_ABI sceUsbdGetDeviceAddress(SceUsbdDevice* device) {
|
u8 PS4_SYSV_ABI sceUsbdGetDeviceAddress(SceUsbdDevice* device) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_get_device_address(device);
|
return libusb_get_device_address(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceUsbdSpeed PS4_SYSV_ABI sceUsbdGetDeviceSpeed(SceUsbdDevice* device) {
|
SceUsbdSpeed PS4_SYSV_ABI sceUsbdGetDeviceSpeed(SceUsbdDevice* device) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return static_cast<SceUsbdSpeed>(libusb_get_device_speed(device));
|
return static_cast<SceUsbdSpeed>(libusb_get_device_speed(device));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdGetMaxPacketSize(SceUsbdDevice* device, u8 endpoint) {
|
s32 PS4_SYSV_ABI sceUsbdGetMaxPacketSize(SceUsbdDevice* device, u8 endpoint) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_get_max_packet_size(device, endpoint));
|
return libusb_to_orbis_error(libusb_get_max_packet_size(device, endpoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdGetMaxIsoPacketSize(SceUsbdDevice* device, u8 endpoint) {
|
s32 PS4_SYSV_ABI sceUsbdGetMaxIsoPacketSize(SceUsbdDevice* device, u8 endpoint) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_get_max_iso_packet_size(device, endpoint));
|
return libusb_to_orbis_error(libusb_get_max_iso_packet_size(device, endpoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdOpen(SceUsbdDevice* device, SceUsbdDeviceHandle** dev_handle) {
|
s32 PS4_SYSV_ABI sceUsbdOpen(SceUsbdDevice* device, SceUsbdDeviceHandle** dev_handle) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_open(device, dev_handle));
|
return libusb_to_orbis_error(libusb_open(device, dev_handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdClose(SceUsbdDeviceHandle* dev_handle) {
|
void PS4_SYSV_ABI sceUsbdClose(SceUsbdDeviceHandle* dev_handle) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_close(dev_handle);
|
libusb_close(dev_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceUsbdDevice* PS4_SYSV_ABI sceUsbdGetDevice(SceUsbdDeviceHandle* dev_handle) {
|
SceUsbdDevice* PS4_SYSV_ABI sceUsbdGetDevice(SceUsbdDeviceHandle* dev_handle) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_get_device(dev_handle);
|
return libusb_get_device(dev_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdSetConfiguration(SceUsbdDeviceHandle* dev_handle, s32 config) {
|
s32 PS4_SYSV_ABI sceUsbdSetConfiguration(SceUsbdDeviceHandle* dev_handle, s32 config) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_set_configuration(dev_handle, config));
|
return libusb_to_orbis_error(libusb_set_configuration(dev_handle, config));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdClaimInterface(SceUsbdDeviceHandle* dev_handle, s32 interface_number) {
|
s32 PS4_SYSV_ABI sceUsbdClaimInterface(SceUsbdDeviceHandle* dev_handle, s32 interface_number) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_claim_interface(dev_handle, interface_number));
|
return libusb_to_orbis_error(libusb_claim_interface(dev_handle, interface_number));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdReleaseInterface(SceUsbdDeviceHandle* dev_handle, s32 interface_number) {
|
s32 PS4_SYSV_ABI sceUsbdReleaseInterface(SceUsbdDeviceHandle* dev_handle, s32 interface_number) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_release_interface(dev_handle, interface_number));
|
return libusb_to_orbis_error(libusb_release_interface(dev_handle, interface_number));
|
||||||
}
|
}
|
||||||
|
|
||||||
SceUsbdDeviceHandle* PS4_SYSV_ABI sceUsbdOpenDeviceWithVidPid(u16 vendor_id, u16 product_id) {
|
SceUsbdDeviceHandle* PS4_SYSV_ABI sceUsbdOpenDeviceWithVidPid(u16 vendor_id, u16 product_id) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_open_device_with_vid_pid(g_libusb_context, vendor_id, product_id);
|
return libusb_open_device_with_vid_pid(g_libusb_context, vendor_id, product_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdSetInterfaceAltSetting(SceUsbdDeviceHandle* dev_handle,
|
s32 PS4_SYSV_ABI sceUsbdSetInterfaceAltSetting(SceUsbdDeviceHandle* dev_handle,
|
||||||
int interface_number, int alternate_setting) {
|
int interface_number, int alternate_setting) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(
|
return libusb_to_orbis_error(
|
||||||
libusb_set_interface_alt_setting(dev_handle, interface_number, alternate_setting));
|
libusb_set_interface_alt_setting(dev_handle, interface_number, alternate_setting));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdClearHalt(SceUsbdDeviceHandle* dev_handle, uint8_t endpoint) {
|
s32 PS4_SYSV_ABI sceUsbdClearHalt(SceUsbdDeviceHandle* dev_handle, uint8_t endpoint) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_clear_halt(dev_handle, endpoint));
|
return libusb_to_orbis_error(libusb_clear_halt(dev_handle, endpoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdResetDevice(SceUsbdDeviceHandle* dev_handle) {
|
s32 PS4_SYSV_ABI sceUsbdResetDevice(SceUsbdDeviceHandle* dev_handle) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_reset_device(dev_handle));
|
return libusb_to_orbis_error(libusb_reset_device(dev_handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdKernelDriverActive(SceUsbdDeviceHandle* dev_handle, int interface_number) {
|
s32 PS4_SYSV_ABI sceUsbdKernelDriverActive(SceUsbdDeviceHandle* dev_handle, int interface_number) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_kernel_driver_active(dev_handle, interface_number));
|
return libusb_to_orbis_error(libusb_kernel_driver_active(dev_handle, interface_number));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdDetachKernelDriver(SceUsbdDeviceHandle* dev_handle, int interface_number) {
|
s32 PS4_SYSV_ABI sceUsbdDetachKernelDriver(SceUsbdDeviceHandle* dev_handle, int interface_number) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_detach_kernel_driver(dev_handle, interface_number));
|
return libusb_to_orbis_error(libusb_detach_kernel_driver(dev_handle, interface_number));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdAttachKernelDriver(SceUsbdDeviceHandle* dev_handle, int interface_number) {
|
s32 PS4_SYSV_ABI sceUsbdAttachKernelDriver(SceUsbdDeviceHandle* dev_handle, int interface_number) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_attach_kernel_driver(dev_handle, interface_number));
|
return libusb_to_orbis_error(libusb_attach_kernel_driver(dev_handle, interface_number));
|
||||||
}
|
}
|
||||||
|
|
||||||
u8* PS4_SYSV_ABI sceUsbdControlTransferGetData(SceUsbdTransfer* transfer) {
|
u8* PS4_SYSV_ABI sceUsbdControlTransferGetData(SceUsbdTransfer* transfer) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_control_transfer_get_data(transfer);
|
return libusb_control_transfer_get_data(transfer);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceUsbdControlSetup* PS4_SYSV_ABI sceUsbdControlTransferGetSetup(SceUsbdTransfer* transfer) {
|
SceUsbdControlSetup* PS4_SYSV_ABI sceUsbdControlTransferGetSetup(SceUsbdTransfer* transfer) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_control_transfer_get_setup(transfer);
|
return libusb_control_transfer_get_setup(transfer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdFillControlSetup(u8* buf, u8 bmRequestType, u8 bRequest, u16 wValue,
|
void PS4_SYSV_ABI sceUsbdFillControlSetup(u8* buf, u8 bmRequestType, u8 bRequest, u16 wValue,
|
||||||
u16 wIndex, u16 wLength) {
|
u16 wIndex, u16 wLength) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_fill_control_setup(buf, bmRequestType, bRequest, wValue, wIndex, wLength);
|
return libusb_fill_control_setup(buf, bmRequestType, bRequest, wValue, wIndex, wLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceUsbdTransfer* PS4_SYSV_ABI sceUsbdAllocTransfer(int iso_packets) {
|
SceUsbdTransfer* PS4_SYSV_ABI sceUsbdAllocTransfer(int iso_packets) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_alloc_transfer(iso_packets);
|
return libusb_alloc_transfer(iso_packets);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdSubmitTransfer(SceUsbdTransfer* transfer) {
|
s32 PS4_SYSV_ABI sceUsbdSubmitTransfer(SceUsbdTransfer* transfer) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_submit_transfer(transfer));
|
return libusb_to_orbis_error(libusb_submit_transfer(transfer));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdCancelTransfer(SceUsbdTransfer* transfer) {
|
s32 PS4_SYSV_ABI sceUsbdCancelTransfer(SceUsbdTransfer* transfer) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_cancel_transfer(transfer));
|
return libusb_to_orbis_error(libusb_cancel_transfer(transfer));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdFreeTransfer(SceUsbdTransfer* transfer) {
|
void PS4_SYSV_ABI sceUsbdFreeTransfer(SceUsbdTransfer* transfer) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_free_transfer(transfer);
|
libusb_free_transfer(transfer);
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ void PS4_SYSV_ABI sceUsbdFillControlTransfer(SceUsbdTransfer* transfer,
|
|||||||
SceUsbdDeviceHandle* dev_handle, u8* buffer,
|
SceUsbdDeviceHandle* dev_handle, u8* buffer,
|
||||||
SceUsbdTransferCallback callback, void* user_data,
|
SceUsbdTransferCallback callback, void* user_data,
|
||||||
u32 timeout) {
|
u32 timeout) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_fill_control_transfer(transfer, dev_handle, buffer, callback, user_data, timeout);
|
libusb_fill_control_transfer(transfer, dev_handle, buffer, callback, user_data, timeout);
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ void PS4_SYSV_ABI sceUsbdFillBulkTransfer(SceUsbdTransfer* transfer,
|
|||||||
SceUsbdDeviceHandle* dev_handle, uint8_t endpoint,
|
SceUsbdDeviceHandle* dev_handle, uint8_t endpoint,
|
||||||
u8* buffer, s32 length, SceUsbdTransferCallback callback,
|
u8* buffer, s32 length, SceUsbdTransferCallback callback,
|
||||||
void* user_data, u32 timeout) {
|
void* user_data, u32 timeout) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, length, callback, user_data,
|
libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, length, callback, user_data,
|
||||||
timeout);
|
timeout);
|
||||||
@ -283,7 +283,7 @@ void PS4_SYSV_ABI sceUsbdFillInterruptTransfer(SceUsbdTransfer* transfer,
|
|||||||
u8* buffer, s32 length,
|
u8* buffer, s32 length,
|
||||||
SceUsbdTransferCallback callback, void* user_data,
|
SceUsbdTransferCallback callback, void* user_data,
|
||||||
u32 timeout) {
|
u32 timeout) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_fill_interrupt_transfer(transfer, dev_handle, endpoint, buffer, length, callback,
|
libusb_fill_interrupt_transfer(transfer, dev_handle, endpoint, buffer, length, callback,
|
||||||
user_data, timeout);
|
user_data, timeout);
|
||||||
@ -293,20 +293,20 @@ void PS4_SYSV_ABI sceUsbdFillIsoTransfer(SceUsbdTransfer* transfer, SceUsbdDevic
|
|||||||
uint8_t endpoint, u8* buffer, s32 length,
|
uint8_t endpoint, u8* buffer, s32 length,
|
||||||
s32 num_iso_packets, SceUsbdTransferCallback callback,
|
s32 num_iso_packets, SceUsbdTransferCallback callback,
|
||||||
void* user_data, u32 timeout) {
|
void* user_data, u32 timeout) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_fill_iso_transfer(transfer, dev_handle, endpoint, buffer, length, num_iso_packets,
|
libusb_fill_iso_transfer(transfer, dev_handle, endpoint, buffer, length, num_iso_packets,
|
||||||
callback, user_data, timeout);
|
callback, user_data, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdSetIsoPacketLengths(SceUsbdTransfer* transfer, u32 length) {
|
void PS4_SYSV_ABI sceUsbdSetIsoPacketLengths(SceUsbdTransfer* transfer, u32 length) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_set_iso_packet_lengths(transfer, length);
|
libusb_set_iso_packet_lengths(transfer, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8* PS4_SYSV_ABI sceUsbdGetIsoPacketBuffer(SceUsbdTransfer* transfer, u32 packet) {
|
u8* PS4_SYSV_ABI sceUsbdGetIsoPacketBuffer(SceUsbdTransfer* transfer, u32 packet) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_get_iso_packet_buffer(transfer, packet);
|
return libusb_get_iso_packet_buffer(transfer, packet);
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ u8* PS4_SYSV_ABI sceUsbdGetIsoPacketBuffer(SceUsbdTransfer* transfer, u32 packet
|
|||||||
s32 PS4_SYSV_ABI sceUsbdControlTransfer(SceUsbdDeviceHandle* dev_handle, u8 request_type,
|
s32 PS4_SYSV_ABI sceUsbdControlTransfer(SceUsbdDeviceHandle* dev_handle, u8 request_type,
|
||||||
u8 bRequest, u16 wValue, u16 wIndex, u8* data, s32 wLength,
|
u8 bRequest, u16 wValue, u16 wIndex, u8* data, s32 wLength,
|
||||||
u32 timeout) {
|
u32 timeout) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_control_transfer(dev_handle, request_type, bRequest, wValue,
|
return libusb_to_orbis_error(libusb_control_transfer(dev_handle, request_type, bRequest, wValue,
|
||||||
wIndex, data, wLength, timeout));
|
wIndex, data, wLength, timeout));
|
||||||
@ -322,7 +322,7 @@ s32 PS4_SYSV_ABI sceUsbdControlTransfer(SceUsbdDeviceHandle* dev_handle, u8 requ
|
|||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdBulkTransfer(SceUsbdDeviceHandle* dev_handle, u8 endpoint, u8* data,
|
s32 PS4_SYSV_ABI sceUsbdBulkTransfer(SceUsbdDeviceHandle* dev_handle, u8 endpoint, u8* data,
|
||||||
s32 length, s32* actual_length, u32 timeout) {
|
s32 length, s32* actual_length, u32 timeout) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(
|
return libusb_to_orbis_error(
|
||||||
libusb_bulk_transfer(dev_handle, endpoint, data, length, actual_length, timeout));
|
libusb_bulk_transfer(dev_handle, endpoint, data, length, actual_length, timeout));
|
||||||
@ -330,7 +330,7 @@ s32 PS4_SYSV_ABI sceUsbdBulkTransfer(SceUsbdDeviceHandle* dev_handle, u8 endpoin
|
|||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdInterruptTransfer(SceUsbdDeviceHandle* dev_handle, u8 endpoint, u8* data,
|
s32 PS4_SYSV_ABI sceUsbdInterruptTransfer(SceUsbdDeviceHandle* dev_handle, u8 endpoint, u8* data,
|
||||||
s32 length, s32* actual_length, u32 timeout) {
|
s32 length, s32* actual_length, u32 timeout) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(
|
return libusb_to_orbis_error(
|
||||||
libusb_interrupt_transfer(dev_handle, endpoint, data, length, actual_length, timeout));
|
libusb_interrupt_transfer(dev_handle, endpoint, data, length, actual_length, timeout));
|
||||||
@ -338,7 +338,7 @@ s32 PS4_SYSV_ABI sceUsbdInterruptTransfer(SceUsbdDeviceHandle* dev_handle, u8 en
|
|||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdGetDescriptor(SceUsbdDeviceHandle* dev_handle, u8 descType, u8 descIndex,
|
s32 PS4_SYSV_ABI sceUsbdGetDescriptor(SceUsbdDeviceHandle* dev_handle, u8 descType, u8 descIndex,
|
||||||
u8* data, s32 length) {
|
u8* data, s32 length) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(
|
return libusb_to_orbis_error(
|
||||||
libusb_get_descriptor(dev_handle, descType, descIndex, data, length));
|
libusb_get_descriptor(dev_handle, descType, descIndex, data, length));
|
||||||
@ -346,7 +346,7 @@ s32 PS4_SYSV_ABI sceUsbdGetDescriptor(SceUsbdDeviceHandle* dev_handle, u8 descTy
|
|||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdGetStringDescriptor(SceUsbdDeviceHandle* dev_handle, u8 desc_index,
|
s32 PS4_SYSV_ABI sceUsbdGetStringDescriptor(SceUsbdDeviceHandle* dev_handle, u8 desc_index,
|
||||||
u16 langid, u8* data, s32 length) {
|
u16 langid, u8* data, s32 length) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(
|
return libusb_to_orbis_error(
|
||||||
libusb_get_string_descriptor(dev_handle, desc_index, langid, data, length));
|
libusb_get_string_descriptor(dev_handle, desc_index, langid, data, length));
|
||||||
@ -354,80 +354,80 @@ s32 PS4_SYSV_ABI sceUsbdGetStringDescriptor(SceUsbdDeviceHandle* dev_handle, u8
|
|||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdGetStringDescriptorAscii(SceUsbdDeviceHandle* dev_handle, u8 desc_index,
|
s32 PS4_SYSV_ABI sceUsbdGetStringDescriptorAscii(SceUsbdDeviceHandle* dev_handle, u8 desc_index,
|
||||||
u8* data, s32 length) {
|
u8* data, s32 length) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(
|
return libusb_to_orbis_error(
|
||||||
libusb_get_string_descriptor_ascii(dev_handle, desc_index, data, length));
|
libusb_get_string_descriptor_ascii(dev_handle, desc_index, data, length));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdTryLockEvents() {
|
s32 PS4_SYSV_ABI sceUsbdTryLockEvents() {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_try_lock_events(g_libusb_context);
|
return libusb_try_lock_events(g_libusb_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdLockEvents() {
|
void PS4_SYSV_ABI sceUsbdLockEvents() {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_lock_events(g_libusb_context);
|
libusb_lock_events(g_libusb_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdUnlockEvents() {
|
void PS4_SYSV_ABI sceUsbdUnlockEvents() {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_unlock_events(g_libusb_context);
|
libusb_unlock_events(g_libusb_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdEventHandlingOk() {
|
s32 PS4_SYSV_ABI sceUsbdEventHandlingOk() {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_event_handling_ok(g_libusb_context);
|
return libusb_event_handling_ok(g_libusb_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdEventHandlerActive() {
|
s32 PS4_SYSV_ABI sceUsbdEventHandlerActive() {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_event_handler_active(g_libusb_context);
|
return libusb_event_handler_active(g_libusb_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdLockEventWaiters() {
|
void PS4_SYSV_ABI sceUsbdLockEventWaiters() {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_lock_event_waiters(g_libusb_context);
|
libusb_lock_event_waiters(g_libusb_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS4_SYSV_ABI sceUsbdUnlockEventWaiters() {
|
void PS4_SYSV_ABI sceUsbdUnlockEventWaiters() {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
libusb_unlock_event_waiters(g_libusb_context);
|
libusb_unlock_event_waiters(g_libusb_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdWaitForEvent(timeval* tv) {
|
s32 PS4_SYSV_ABI sceUsbdWaitForEvent(timeval* tv) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_wait_for_event(g_libusb_context, tv));
|
return libusb_to_orbis_error(libusb_wait_for_event(g_libusb_context, tv));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdHandleEventsTimeout(timeval* tv) {
|
s32 PS4_SYSV_ABI sceUsbdHandleEventsTimeout(timeval* tv) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_handle_events_timeout(g_libusb_context, tv));
|
return libusb_to_orbis_error(libusb_handle_events_timeout(g_libusb_context, tv));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdHandleEvents() {
|
s32 PS4_SYSV_ABI sceUsbdHandleEvents() {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_handle_events(g_libusb_context));
|
return libusb_to_orbis_error(libusb_handle_events(g_libusb_context));
|
||||||
}
|
}
|
||||||
|
|
||||||
int PS4_SYSV_ABI sceUsbdHandleEventsLocked(timeval* tv) {
|
int PS4_SYSV_ABI sceUsbdHandleEventsLocked(timeval* tv) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
return libusb_to_orbis_error(libusb_handle_events_locked(g_libusb_context, tv));
|
return libusb_to_orbis_error(libusb_handle_events_locked(g_libusb_context, tv));
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceUsbdCheckConnected(SceUsbdDeviceHandle* dev_handle) {
|
s32 PS4_SYSV_ABI sceUsbdCheckConnected(SceUsbdDeviceHandle* dev_handle) {
|
||||||
LOG_TRACE(Lib_Usbd, "called");
|
LOG_INFO(Lib_Usbd, "called");
|
||||||
|
|
||||||
// There's no libusb version of this function.
|
// There's no libusb version of this function.
|
||||||
// Simulate by querying data.
|
// Simulate by querying data.
|
||||||
|
Loading…
Reference in New Issue
Block a user