add mtp custom mount support (image sd, image nand, install, speed test).

This commit is contained in:
ITotalJustice
2025-06-12 14:47:33 +01:00
parent c535b96b12
commit 275707fe27
12 changed files with 952 additions and 62 deletions

View File

@@ -4,22 +4,6 @@
#include <ranges>
#include <cstring>
namespace sphaira::usb {
namespace {
// TODO: pr missing speed fields to libnx.
enum { UsbDeviceSpeed_None = 0x0 };
enum { UsbDeviceSpeed_Low = 0x1 };
constexpr u16 DEVICE_SPEED[] = {
[UsbDeviceSpeed_None] = 0x0,
[UsbDeviceSpeed_Low] = 0x0,
[UsbDeviceSpeed_Full] = 0x40,
[UsbDeviceSpeed_High] = 0x200,
[UsbDeviceSpeed_Super] = 0x400,
};
// TODO: pr this to libnx.
Result usbDsGetSpeed(UsbDeviceSpeed *out) {
if (hosversionBefore(8,0,0)) {
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
@@ -29,6 +13,17 @@ Result usbDsGetSpeed(UsbDeviceSpeed *out) {
return serviceDispatchOut(usbDsGetServiceSession(), hosversionAtLeast(11,0,0) ? 11 : 12, *out);
}
namespace sphaira::usb {
namespace {
constexpr u16 DEVICE_SPEED[] = {
[UsbDeviceSpeed_None] = 0x0,
[UsbDeviceSpeed_Low] = 0x0,
[UsbDeviceSpeed_Full] = 0x40,
[UsbDeviceSpeed_High] = 0x200,
[UsbDeviceSpeed_Super] = 0x400,
};
} // namespace
UsbDs::~UsbDs() {