mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
Fixed usbhs 3.0.0+ support with usbHsAcquireUsbIf.
This commit is contained in:
parent
36a2404e4b
commit
e9cc565e92
@ -89,7 +89,7 @@ typedef struct {
|
|||||||
Event eventCtrlXfer; ///< [2.0.0+] Signaled when CtrlXferAsync finishes.
|
Event eventCtrlXfer; ///< [2.0.0+] Signaled when CtrlXferAsync finishes.
|
||||||
s32 ID;
|
s32 ID;
|
||||||
|
|
||||||
UsbHsInterface inf; ///< Initialized with the input interface from \ref usbHsAcquireUsbIf, then the first 0x1B8-bytes are overwritten with the cmd output (data before pathstr).
|
UsbHsInterface inf; ///< Initialized with the input interface from \ref usbHsAcquireUsbIf, then overwritten with the cmd output. Pre-3.0.0 this only overwrites the first 0x1B8-bytes (data before pathstr).
|
||||||
} UsbHsClientIfSession;
|
} UsbHsClientIfSession;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -337,7 +337,14 @@ Result usbHsAcquireUsbIf(UsbHsClientIfSession* s, UsbHsInterface *interface) {
|
|||||||
s32 ID;
|
s32 ID;
|
||||||
} *raw;
|
} *raw;
|
||||||
|
|
||||||
|
if (!kernelAbove300()) {
|
||||||
ipcAddRecvBuffer(&c, &s->inf.inf, sizeof(UsbHsInterfaceInfo), BufferType_Normal);
|
ipcAddRecvBuffer(&c, &s->inf.inf, sizeof(UsbHsInterfaceInfo), BufferType_Normal);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
size_t tmpoff = offsetof(UsbHsInterfaceInfo, output_endpoint_descs[12]);
|
||||||
|
ipcAddRecvBuffer(&c, &s->inf.inf, tmpoff, BufferType_Normal);
|
||||||
|
ipcAddRecvBuffer(&c, &s->inf.inf.output_endpoint_descs[12], sizeof(UsbHsInterface) - tmpoff, BufferType_Normal);
|
||||||
|
}
|
||||||
|
|
||||||
raw = serviceIpcPrepareHeader(&g_usbHsSrv, &c, sizeof(*raw));
|
raw = serviceIpcPrepareHeader(&g_usbHsSrv, &c, sizeof(*raw));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user