From 2b825d56dc58083092cf7de81e08d4899b87c74d Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sun, 7 Feb 2021 17:14:48 -0800 Subject: [PATCH] usb: fix wrong command id for AppendConfigurationData --- .../include/stratosphere/usb/usb_types.hpp | 9 +++++++++ .../source/usb/usb_remote_ds_interface.cpp | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libraries/libstratosphere/include/stratosphere/usb/usb_types.hpp b/libraries/libstratosphere/include/stratosphere/usb/usb_types.hpp index 26ccecad6..f9abca21d 100644 --- a/libraries/libstratosphere/include/stratosphere/usb/usb_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/usb/usb_types.hpp @@ -165,6 +165,15 @@ namespace ams::usb { UsbEndpointAddressMask_DirDevicetoHost = (0x1 << 7), }; + enum UsbEndpointAttributeMask { + UsbEndpointAttributeMask_XferType = (0x3 << 0), + + UsbEndpointAttributeMask_XferTypeControl = (0x0 << 0), + UsbEndpointAttributeMask_XferTypeIsoc = (0x1 << 0), + UsbEndpointAttributeMask_XferTypeBulk = (0x2 << 0), + UsbEndpointAttributeMask_XferTypeInt = (0x3 << 0), + }; + enum UsbEndpointDirection { UsbEndpointDirection_Invalid = 0, UsbEndpointDirection_ToDevice = 1, diff --git a/libraries/libstratosphere/source/usb/usb_remote_ds_interface.cpp b/libraries/libstratosphere/source/usb/usb_remote_ds_interface.cpp index bbe8b1c8c..5b7e32ab4 100644 --- a/libraries/libstratosphere/source/usb/usb_remote_ds_interface.cpp +++ b/libraries/libstratosphere/source/usb/usb_remote_ds_interface.cpp @@ -103,7 +103,7 @@ namespace ams::usb { Result RemoteDsInterface::AppendConfigurationData(u8 bInterfaceNumber, usb::UsbDeviceSpeed device_speed, const sf::InBuffer &data) { if (hos::GetVersion() >= hos::Version_11_0_0) { serviceAssumeDomain(std::addressof(m_srv)); - return serviceDispatchIn(std::addressof(m_srv), 12, device_speed, + return serviceDispatchIn(std::addressof(m_srv), 10, device_speed, .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_In }, .buffers = { { data.GetPointer(), data.GetSize() } }, ); @@ -114,7 +114,7 @@ namespace ams::usb { } in = { bInterfaceNumber, device_speed }; serviceAssumeDomain(std::addressof(m_srv)); - return serviceDispatchIn(std::addressof(m_srv), 10, in, + return serviceDispatchIn(std::addressof(m_srv), 12, in, .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_In }, .buffers = { { data.GetPointer(), data.GetSize() } }, );