2020-03-08 08:06:23 +00:00
|
|
|
/*
|
2021-10-04 19:59:10 +00:00
|
|
|
* Copyright (c) Atmosphère-NX
|
2020-03-08 08:06:23 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#pragma once
|
2021-10-01 02:21:08 +00:00
|
|
|
#include <stratosphere/fs/fs_common.hpp>
|
2020-03-08 08:06:23 +00:00
|
|
|
|
|
|
|
namespace ams::fs {
|
|
|
|
|
2022-03-24 15:43:40 +00:00
|
|
|
/* ACCURATE_TO_VERSION: Unknown */
|
2021-02-24 17:57:41 +00:00
|
|
|
class IEventNotifier;
|
|
|
|
|
2023-10-25 19:41:18 +00:00
|
|
|
constexpr inline size_t SdCardCidSize = 0x10;
|
|
|
|
|
|
|
|
enum SdCardSpeedMode {
|
|
|
|
SdCardSpeedMode_Identification = 0,
|
|
|
|
SdCardSpeedMode_DefaultSpeed = 1,
|
|
|
|
SdCardSpeedMode_HighSpeed = 2,
|
|
|
|
SdCardSpeedMode_Sdr12 = 3,
|
|
|
|
SdCardSpeedMode_Sdr25 = 4,
|
|
|
|
SdCardSpeedMode_Sdr50 = 5,
|
|
|
|
SdCardSpeedMode_Sdr104 = 6,
|
|
|
|
SdCardSpeedMode_Ddr50 = 7,
|
|
|
|
SdCardSpeedMode_Unknown = 8,
|
|
|
|
};
|
|
|
|
|
2022-03-06 20:08:20 +00:00
|
|
|
struct EncryptionSeed {
|
|
|
|
char value[0x10];
|
|
|
|
};
|
|
|
|
static_assert(util::is_pod<EncryptionSeed>::value);
|
|
|
|
static_assert(sizeof(EncryptionSeed) == 0x10);
|
|
|
|
|
2023-10-25 19:41:18 +00:00
|
|
|
Result GetSdCardCid(void *dst, size_t size);
|
|
|
|
|
|
|
|
inline void ClearSdCardCidSerialNumber(u8 *cid) {
|
|
|
|
/* Clear the serial number from the cid. */
|
|
|
|
std::memset(cid + 2, 0, 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
Result GetSdCardUserAreaSize(s64 *out);
|
|
|
|
Result GetSdCardProtectedAreaSize(s64 *out);
|
|
|
|
|
|
|
|
Result GetSdCardSpeedMode(SdCardSpeedMode *out);
|
|
|
|
|
2020-03-08 08:06:23 +00:00
|
|
|
Result MountSdCard(const char *name);
|
|
|
|
|
2020-04-14 00:07:37 +00:00
|
|
|
Result MountSdCardErrorReportDirectoryForAtmosphere(const char *name);
|
|
|
|
|
2021-02-24 17:57:41 +00:00
|
|
|
Result OpenSdCardDetectionEventNotifier(std::unique_ptr<IEventNotifier> *out);
|
|
|
|
|
|
|
|
bool IsSdCardInserted();
|
|
|
|
|
2020-03-08 08:06:23 +00:00
|
|
|
}
|