From 49d7fe81b8ea800775f2375365d1b3a16de7fa30 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Thu, 3 Dec 2020 23:11:28 -0500 Subject: [PATCH] usbds: Fixed usbDsInterface_AppendConfigurationData for 11.0.0. --- nx/source/services/usbds.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/nx/source/services/usbds.c b/nx/source/services/usbds.c index e109a4c9..c786f972 100644 --- a/nx/source/services/usbds.c +++ b/nx/source/services/usbds.c @@ -657,12 +657,21 @@ Result usbDsInterface_AppendConfigurationData(UsbDsInterface* interface, UsbDevi if (hosversionBefore(5,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); - const struct { - u8 intf_num; - u32 speed; - } in = { interface->interface_index, speed }; + if (hosversionBefore(11,0,0)) { + const struct { + u8 intf_num; + u8 pad[3]; + u32 speed; + } in = { interface->interface_index, {0}, speed }; - return serviceDispatchIn(&interface->s, hosversionAtLeast(11,0,0) ? 10 : 12, in, + return serviceDispatchIn(&interface->s, 12, in, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_In }, + .buffers = { { buffer, size } }, + ); + } + + u32 in = speed; + return serviceDispatchIn(&interface->s, 10, in, .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_In }, .buffers = { { buffer, size } }, );