mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Use the proper IPC buffer type for _usbHsEpGetXferReport with [3.0.0+].
This commit is contained in:
parent
5452a4bd5f
commit
f6f6adf1cb
@ -96,6 +96,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
Service s;
|
||||
Event eventXfer; ///< [2.0.0+] Signaled when PostBufferAsync finishes.
|
||||
size_t ptrbufsize; ///< [3.0.0+] IPC pointer buffer size.
|
||||
|
||||
struct usb_endpoint_descriptor desc;
|
||||
} UsbHsClientEpSession;
|
||||
|
@ -721,6 +721,8 @@ Result usbHsIfOpenUsbEp(UsbHsClientIfSession* s, UsbHsClientEpSession* ep, u16 m
|
||||
if (R_SUCCEEDED(rc)) rc = _usbHsGetEvent(&ep->s, &ep->eventXfer, 2);
|
||||
}
|
||||
|
||||
if (hosversionAtLeast(3,0,0) && R_SUCCEEDED(rc)) rc = ipcQueryPointerBufferSize(ep->s.handle, &ep->ptrbufsize);
|
||||
|
||||
if (R_FAILED(rc)) {
|
||||
serviceClose(&ep->s);
|
||||
eventClose(&ep->eventXfer);
|
||||
@ -844,7 +846,12 @@ static Result _usbHsEpGetXferReport(UsbHsClientEpSession* s, UsbHsXferReport* re
|
||||
u32 max_reports;
|
||||
} *raw;
|
||||
|
||||
ipcAddRecvBuffer(&c, reports, sizeof(UsbHsXferReport) * max_reports, BufferType_Normal);
|
||||
if (hosversionBefore(3,0,0)) {
|
||||
ipcAddRecvBuffer(&c, reports, sizeof(UsbHsXferReport) * max_reports, BufferType_Normal);
|
||||
}
|
||||
else {
|
||||
ipcAddRecvSmart(&c, s->ptrbufsize, reports, sizeof(UsbHsXferReport) * max_reports, 0);
|
||||
}
|
||||
|
||||
raw = serviceIpcPrepareHeader(&s->s, &c, sizeof(*raw));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user