diff options
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/service/ndm/ndm.cpp | 197 | ||||
| -rw-r--r-- | src/core/hle/service/ndm/ndm.h | 216 | ||||
| -rw-r--r-- | src/core/hle/service/ndm/ndm_u.cpp | 34 |
3 files changed, 420 insertions, 27 deletions
diff --git a/src/core/hle/service/ndm/ndm.cpp b/src/core/hle/service/ndm/ndm.cpp index 47076a7b8..bc9c3413d 100644 --- a/src/core/hle/service/ndm/ndm.cpp +++ b/src/core/hle/service/ndm/ndm.cpp | |||
| @@ -11,28 +11,217 @@ | |||
| 11 | namespace Service { | 11 | namespace Service { |
| 12 | namespace NDM { | 12 | namespace NDM { |
| 13 | 13 | ||
| 14 | void SuspendDaemons(Service::Interface* self) { | 14 | enum : u32 { |
| 15 | DEFAULT_RETRY_INTERVAL = 10, | ||
| 16 | DEFAULT_SCAN_INTERVAL = 30 | ||
| 17 | }; | ||
| 18 | |||
| 19 | static DaemonMask daemon_bit_mask = DaemonMask::Default; | ||
| 20 | static DaemonMask default_daemon_bit_mask = DaemonMask::Default; | ||
| 21 | static std::array<DaemonStatus, 4> daemon_status = { DaemonStatus::Idle, DaemonStatus::Idle, DaemonStatus::Idle, DaemonStatus::Idle }; | ||
| 22 | static ExclusiveState exclusive_state = ExclusiveState::None; | ||
| 23 | static u32 scan_interval = DEFAULT_SCAN_INTERVAL; | ||
| 24 | static u32 retry_interval = DEFAULT_RETRY_INTERVAL; | ||
| 25 | static bool daemon_lock_enabled = false; | ||
| 26 | |||
| 27 | void EnterExclusiveState(Service::Interface* self) { | ||
| 28 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 29 | exclusive_state = static_cast<ExclusiveState>(cmd_buff[1]); | ||
| 30 | |||
| 31 | cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0); | ||
| 32 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 33 | LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state); | ||
| 34 | } | ||
| 35 | |||
| 36 | void LeaveExclusiveState(Service::Interface* self) { | ||
| 37 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 38 | exclusive_state = ExclusiveState::None; | ||
| 39 | |||
| 40 | cmd_buff[0] = IPC::MakeHeader(0x2, 1, 0); | ||
| 41 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 42 | LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state); | ||
| 43 | } | ||
| 44 | |||
| 45 | void QueryExclusiveMode(Service::Interface* self) { | ||
| 15 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 46 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 16 | 47 | ||
| 17 | LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x%08X ", cmd_buff[1]); | 48 | cmd_buff[0] = IPC::MakeHeader(0x3, 2, 0); |
| 49 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 50 | cmd_buff[2] = static_cast<u32>(exclusive_state); | ||
| 51 | LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state); | ||
| 52 | } | ||
| 53 | |||
| 54 | void LockState(Service::Interface* self) { | ||
| 55 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 56 | daemon_lock_enabled = true; | ||
| 57 | |||
| 58 | cmd_buff[0] = IPC::MakeHeader(0x4, 1, 0); | ||
| 59 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 60 | LOG_WARNING(Service_NDM, "(STUBBED) daemon_lock_enabled=0x%08X ", daemon_lock_enabled); | ||
| 61 | } | ||
| 62 | |||
| 63 | void UnlockState(Service::Interface* self) { | ||
| 64 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 65 | daemon_lock_enabled = false; | ||
| 18 | 66 | ||
| 67 | cmd_buff[0] = IPC::MakeHeader(0x5, 1, 0); | ||
| 19 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | 68 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error |
| 69 | LOG_WARNING(Service_NDM, "(STUBBED) daemon_lock_enabled=0x%08X ", daemon_lock_enabled); | ||
| 70 | } | ||
| 71 | |||
| 72 | void SuspendDaemons(Service::Interface* self) { | ||
| 73 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 74 | u32 bit_mask = cmd_buff[1] & 0xF; | ||
| 75 | daemon_bit_mask = static_cast<DaemonMask>(static_cast<u32>(default_daemon_bit_mask) & ~bit_mask); | ||
| 76 | for (size_t index = 0; index < daemon_status.size(); ++index) { | ||
| 77 | if (bit_mask & (1 << index)) { | ||
| 78 | daemon_status[index] = DaemonStatus::Suspended; | ||
| 79 | } | ||
| 80 | } | ||
| 81 | |||
| 82 | cmd_buff[0] = IPC::MakeHeader(0x6, 1, 0); | ||
| 83 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 84 | LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ", daemon_bit_mask); | ||
| 20 | } | 85 | } |
| 21 | 86 | ||
| 22 | void ResumeDaemons(Service::Interface* self) { | 87 | void ResumeDaemons(Service::Interface* self) { |
| 23 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 88 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 89 | u32 bit_mask = cmd_buff[1] & 0xF; | ||
| 90 | daemon_bit_mask = static_cast<DaemonMask>(static_cast<u32>(daemon_bit_mask) | bit_mask); | ||
| 91 | for (size_t index = 0; index < daemon_status.size(); ++index) { | ||
| 92 | if (bit_mask & (1 << index)) { | ||
| 93 | daemon_status[index] = DaemonStatus::Idle; | ||
| 94 | } | ||
| 95 | } | ||
| 96 | |||
| 97 | cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0); | ||
| 98 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 99 | LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ", daemon_bit_mask); | ||
| 100 | } | ||
| 101 | |||
| 102 | void SuspendScheduler(Service::Interface* self) { | ||
| 103 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 104 | |||
| 105 | cmd_buff[0] = IPC::MakeHeader(0x8, 1, 0); | ||
| 106 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 107 | LOG_WARNING(Service_NDM, "(STUBBED) called"); | ||
| 108 | } | ||
| 109 | |||
| 110 | void ResumeScheduler(Service::Interface* self) { | ||
| 111 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 112 | |||
| 113 | cmd_buff[0] = IPC::MakeHeader(0x9, 1, 0); | ||
| 114 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 115 | LOG_WARNING(Service_NDM, "(STUBBED) called"); | ||
| 116 | } | ||
| 117 | |||
| 118 | void QueryStatus(Service::Interface* self) { | ||
| 119 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 120 | u32 daemon = cmd_buff[1] & 0xF; | ||
| 24 | 121 | ||
| 25 | LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x%08X ", cmd_buff[1]); | 122 | cmd_buff[0] = IPC::MakeHeader(0xD, 2, 0); |
| 123 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 124 | cmd_buff[2] = static_cast<u32>(daemon_status.at(daemon)); | ||
| 125 | LOG_WARNING(Service_NDM, "(STUBBED) daemon=0x%08X, daemon_status=0x%08X", daemon, cmd_buff[2]); | ||
| 126 | } | ||
| 127 | |||
| 128 | void GetDaemonDisableCount(Service::Interface* self) { | ||
| 129 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 130 | u32 daemon = cmd_buff[1] & 0xF; | ||
| 131 | |||
| 132 | cmd_buff[0] = IPC::MakeHeader(0xE, 3, 0); | ||
| 133 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 134 | cmd_buff[2] = 0; | ||
| 135 | cmd_buff[3] = 0; | ||
| 136 | LOG_WARNING(Service_NDM, "(STUBBED) daemon=0x%08X", daemon); | ||
| 137 | } | ||
| 138 | |||
| 139 | void GetSchedulerDisableCount(Service::Interface* self) { | ||
| 140 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 141 | |||
| 142 | cmd_buff[0] = IPC::MakeHeader(0xF, 3, 0); | ||
| 143 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 144 | cmd_buff[2] = 0; | ||
| 145 | cmd_buff[3] = 0; | ||
| 146 | LOG_WARNING(Service_NDM, "(STUBBED) called"); | ||
| 147 | } | ||
| 148 | |||
| 149 | void SetScanInterval(Service::Interface* self) { | ||
| 150 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 151 | scan_interval = cmd_buff[1]; | ||
| 26 | 152 | ||
| 153 | cmd_buff[0] = IPC::MakeHeader(0x10, 1, 0); | ||
| 27 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | 154 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error |
| 155 | LOG_WARNING(Service_NDM, "(STUBBED) scan_interval=0x%08X ", scan_interval); | ||
| 156 | } | ||
| 157 | |||
| 158 | void GetScanInterval(Service::Interface* self) { | ||
| 159 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 160 | |||
| 161 | cmd_buff[0] = IPC::MakeHeader(0x11, 2, 0); | ||
| 162 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 163 | cmd_buff[2] = scan_interval; | ||
| 164 | LOG_WARNING(Service_NDM, "(STUBBED) scan_interval=0x%08X ", scan_interval); | ||
| 165 | } | ||
| 166 | |||
| 167 | void SetRetryInterval(Service::Interface* self) { | ||
| 168 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 169 | retry_interval = cmd_buff[1]; | ||
| 170 | |||
| 171 | cmd_buff[0] = IPC::MakeHeader(0x12, 1, 0); | ||
| 172 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 173 | LOG_WARNING(Service_NDM, "(STUBBED) retry_interval=0x%08X ", retry_interval); | ||
| 174 | } | ||
| 175 | |||
| 176 | void GetRetryInterval(Service::Interface* self) { | ||
| 177 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 178 | |||
| 179 | cmd_buff[0] = IPC::MakeHeader(0x13, 2, 0); | ||
| 180 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 181 | cmd_buff[2] = retry_interval; | ||
| 182 | LOG_WARNING(Service_NDM, "(STUBBED) retry_interval=0x%08X ", retry_interval); | ||
| 28 | } | 183 | } |
| 29 | 184 | ||
| 30 | void OverrideDefaultDaemons(Service::Interface* self) { | 185 | void OverrideDefaultDaemons(Service::Interface* self) { |
| 31 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 186 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 187 | u32 bit_mask = cmd_buff[1] & 0xF; | ||
| 188 | default_daemon_bit_mask = static_cast<DaemonMask>(bit_mask); | ||
| 189 | daemon_bit_mask = default_daemon_bit_mask; | ||
| 190 | for (size_t index = 0; index < daemon_status.size(); ++index) { | ||
| 191 | if (bit_mask & (1 << index)) { | ||
| 192 | daemon_status[index] = DaemonStatus::Idle; | ||
| 193 | } | ||
| 194 | } | ||
| 32 | 195 | ||
| 33 | LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x%08X ", cmd_buff[1]); | 196 | cmd_buff[0] = IPC::MakeHeader(0x14, 1, 0); |
| 197 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 198 | LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask); | ||
| 199 | } | ||
| 200 | |||
| 201 | void ResetDefaultDaemons(Service::Interface* self) { | ||
| 202 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 203 | default_daemon_bit_mask = DaemonMask::Default; | ||
| 204 | |||
| 205 | cmd_buff[0] = IPC::MakeHeader(0x15, 1, 0); | ||
| 206 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 207 | LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask); | ||
| 208 | } | ||
| 209 | |||
| 210 | void GetDefaultDaemons(Service::Interface* self) { | ||
| 211 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 212 | |||
| 213 | cmd_buff[0] = IPC::MakeHeader(0x16, 2, 0); | ||
| 214 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | ||
| 215 | cmd_buff[2] = static_cast<u32>(default_daemon_bit_mask); | ||
| 216 | LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask); | ||
| 217 | } | ||
| 218 | |||
| 219 | void ClearHalfAwakeMacFilter(Service::Interface* self) { | ||
| 220 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 34 | 221 | ||
| 222 | cmd_buff[0] = IPC::MakeHeader(0x17, 1, 0); | ||
| 35 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | 223 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error |
| 224 | LOG_WARNING(Service_NDM, "(STUBBED) called"); | ||
| 36 | } | 225 | } |
| 37 | 226 | ||
| 38 | void Init() { | 227 | void Init() { |
diff --git a/src/core/hle/service/ndm/ndm.h b/src/core/hle/service/ndm/ndm.h index 734730f8c..5c2b968dc 100644 --- a/src/core/hle/service/ndm/ndm.h +++ b/src/core/hle/service/ndm/ndm.h | |||
| @@ -12,10 +12,91 @@ class Interface; | |||
| 12 | 12 | ||
| 13 | namespace NDM { | 13 | namespace NDM { |
| 14 | 14 | ||
| 15 | enum class Daemon : u32 { | ||
| 16 | Cec = 0, | ||
| 17 | Boss = 1, | ||
| 18 | Nim = 2, | ||
| 19 | Friend = 3 | ||
| 20 | }; | ||
| 21 | |||
| 22 | enum class DaemonMask : u32 { | ||
| 23 | None = 0, | ||
| 24 | Cec = (1 << static_cast<u32>(Daemon::Cec)), | ||
| 25 | Boss = (1 << static_cast<u32>(Daemon::Boss)), | ||
| 26 | Nim = (1 << static_cast<u32>(Daemon::Nim)), | ||
| 27 | Friend = (1 << static_cast<u32>(Daemon::Friend)), | ||
| 28 | Default = Cec | Friend, | ||
| 29 | All = Cec | Boss | Nim | Friend | ||
| 30 | }; | ||
| 31 | |||
| 32 | enum class DaemonStatus : u32 { | ||
| 33 | Busy = 0, | ||
| 34 | Idle = 1, | ||
| 35 | Suspending = 2, | ||
| 36 | Suspended = 3 | ||
| 37 | }; | ||
| 38 | |||
| 39 | enum class ExclusiveState : u32 { | ||
| 40 | None = 0, | ||
| 41 | Infrastructure = 1, | ||
| 42 | LocalCommunications = 2, | ||
| 43 | Streetpass = 3, | ||
| 44 | StreetpassData = 4, | ||
| 45 | }; | ||
| 46 | |||
| 47 | /** | ||
| 48 | * NDM::EnterExclusiveState service function | ||
| 49 | * Inputs: | ||
| 50 | * 0 : Header code [0x00010042] | ||
| 51 | * 1 : Exclusive State | ||
| 52 | * 2 : 0x20 | ||
| 53 | * Outputs: | ||
| 54 | * 1 : Result, 0 on success, otherwise error code | ||
| 55 | */ | ||
| 56 | void EnterExclusiveState(Service::Interface* self); | ||
| 57 | |||
| 58 | /** | ||
| 59 | * NDM::LeaveExclusiveState service function | ||
| 60 | * Inputs: | ||
| 61 | * 0 : Header code [0x00020002] | ||
| 62 | * 1 : 0x20 | ||
| 63 | * Outputs: | ||
| 64 | * 1 : Result, 0 on success, otherwise error code | ||
| 65 | */ | ||
| 66 | void LeaveExclusiveState(Service::Interface* self); | ||
| 67 | |||
| 68 | /** | ||
| 69 | * NDM::QueryExclusiveMode service function | ||
| 70 | * Inputs: | ||
| 71 | * 0 : Header code [0x00030000] | ||
| 72 | * Outputs: | ||
| 73 | * 1 : Result, 0 on success, otherwise error code | ||
| 74 | * 2 : Current Exclusive State | ||
| 75 | */ | ||
| 76 | void QueryExclusiveMode(Service::Interface* self); | ||
| 77 | |||
| 78 | /** | ||
| 79 | * NDM::LockState service function | ||
| 80 | * Inputs: | ||
| 81 | * 0 : Header code [0x00040002] | ||
| 82 | * Outputs: | ||
| 83 | * 1 : Result, 0 on success, otherwise error code | ||
| 84 | */ | ||
| 85 | void LockState(Service::Interface* self); | ||
| 86 | |||
| 87 | /** | ||
| 88 | * NDM::UnlockState service function | ||
| 89 | * Inputs: | ||
| 90 | * 0 : Header code [0x00050002] | ||
| 91 | * Outputs: | ||
| 92 | * 1 : Result, 0 on success, otherwise error code | ||
| 93 | */ | ||
| 94 | void UnlockState(Service::Interface* self); | ||
| 95 | |||
| 15 | /** | 96 | /** |
| 16 | * SuspendDaemons | 97 | * NDM::SuspendDaemons service function |
| 17 | * Inputs: | 98 | * Inputs: |
| 18 | * 0 : Command header (0x00020082) | 99 | * 0 : Header code [0x00060040] |
| 19 | * 1 : Daemon bit mask | 100 | * 1 : Daemon bit mask |
| 20 | * Outputs: | 101 | * Outputs: |
| 21 | * 1 : Result, 0 on success, otherwise error code | 102 | * 1 : Result, 0 on success, otherwise error code |
| @@ -23,9 +104,9 @@ namespace NDM { | |||
| 23 | void SuspendDaemons(Service::Interface* self); | 104 | void SuspendDaemons(Service::Interface* self); |
| 24 | 105 | ||
| 25 | /** | 106 | /** |
| 26 | * ResumeDaemons | 107 | * NDM::ResumeDaemons service function |
| 27 | * Inputs: | 108 | * Inputs: |
| 28 | * 0 : Command header (0x00020082) | 109 | * 0 : Header code [0x00070040] |
| 29 | * 1 : Daemon bit mask | 110 | * 1 : Daemon bit mask |
| 30 | * Outputs: | 111 | * Outputs: |
| 31 | * 1 : Result, 0 on success, otherwise error code | 112 | * 1 : Result, 0 on success, otherwise error code |
| @@ -33,15 +114,138 @@ void SuspendDaemons(Service::Interface* self); | |||
| 33 | void ResumeDaemons(Service::Interface* self); | 114 | void ResumeDaemons(Service::Interface* self); |
| 34 | 115 | ||
| 35 | /** | 116 | /** |
| 36 | * OverrideDefaultDaemons | 117 | * NDM::SuspendScheduler service function |
| 37 | * Inputs: | 118 | * Inputs: |
| 38 | * 0 : Command header (0x00020082) | 119 | * 0 : Header code [0x00080040] |
| 120 | * Outputs: | ||
| 121 | * 1 : Result, 0 on success, otherwise error code | ||
| 122 | */ | ||
| 123 | void SuspendScheduler(Service::Interface* self); | ||
| 124 | |||
| 125 | /** | ||
| 126 | * NDM::ResumeScheduler service function | ||
| 127 | * Inputs: | ||
| 128 | * 0 : Header code [0x00090000] | ||
| 129 | * Outputs: | ||
| 130 | * 1 : Result, 0 on success, otherwise error code | ||
| 131 | */ | ||
| 132 | void ResumeScheduler(Service::Interface* self); | ||
| 133 | |||
| 134 | /** | ||
| 135 | * NDM::QueryStatus service function | ||
| 136 | * Inputs: | ||
| 137 | * 0 : Header code [0x000D0040] | ||
| 138 | * 1 : Daemon | ||
| 139 | * Outputs: | ||
| 140 | * 1 : Result, 0 on success, otherwise error code | ||
| 141 | * 2 : Daemon status | ||
| 142 | */ | ||
| 143 | void QueryStatus(Service::Interface* self); | ||
| 144 | |||
| 145 | /** | ||
| 146 | * NDM::GetDaemonDisableCount service function | ||
| 147 | * Inputs: | ||
| 148 | * 0 : Header code [0x000E0040] | ||
| 149 | * 1 : Daemon | ||
| 150 | * Outputs: | ||
| 151 | * 1 : Result, 0 on success, otherwise error code | ||
| 152 | * 2 : Current process disable count | ||
| 153 | * 3 : Total disable count | ||
| 154 | */ | ||
| 155 | void GetDaemonDisableCount(Service::Interface* self); | ||
| 156 | |||
| 157 | /** | ||
| 158 | * NDM::GetSchedulerDisableCount service function | ||
| 159 | * Inputs: | ||
| 160 | * 0 : Header code [0x000F0000] | ||
| 161 | * Outputs: | ||
| 162 | * 1 : Result, 0 on success, otherwise error code | ||
| 163 | * 2 : Current process disable count | ||
| 164 | * 3 : Total disable count | ||
| 165 | */ | ||
| 166 | void GetSchedulerDisableCount(Service::Interface* self); | ||
| 167 | |||
| 168 | /** | ||
| 169 | * NDM::SetScanInterval service function | ||
| 170 | * Inputs: | ||
| 171 | * 0 : Header code [0x00100040] | ||
| 172 | * 1 : Interval (default = 30) | ||
| 173 | * Outputs: | ||
| 174 | * 1 : Result, 0 on success, otherwise error code | ||
| 175 | */ | ||
| 176 | void SetScanInterval(Service::Interface* self); | ||
| 177 | |||
| 178 | /** | ||
| 179 | * NDM::GetScanInterval service function | ||
| 180 | * Inputs: | ||
| 181 | * 0 : Header code [0x00110000] | ||
| 182 | * Outputs: | ||
| 183 | * 1 : Result, 0 on success, otherwise error code | ||
| 184 | * 2 : Interval (default = 30) | ||
| 185 | */ | ||
| 186 | void GetScanInterval(Service::Interface* self); | ||
| 187 | |||
| 188 | /** | ||
| 189 | * NDM::SetRetryInterval service function | ||
| 190 | * Inputs: | ||
| 191 | * 0 : Header code [0x00120040] | ||
| 192 | * 1 : Interval (default = 10) | ||
| 193 | * Outputs: | ||
| 194 | * 1 : Result, 0 on success, otherwise error code | ||
| 195 | */ | ||
| 196 | void SetRetryInterval(Service::Interface* self); | ||
| 197 | |||
| 198 | /** | ||
| 199 | * NDM::GetRetryInterval service function | ||
| 200 | * Inputs: | ||
| 201 | * 0 : Header code [0x00130000] | ||
| 202 | * Outputs: | ||
| 203 | * 1 : Result, 0 on success, otherwise error code | ||
| 204 | * 2 : Interval (default = 10) | ||
| 205 | */ | ||
| 206 | void GetRetryInterval(Service::Interface* self); | ||
| 207 | |||
| 208 | |||
| 209 | /** | ||
| 210 | * NDM::OverrideDefaultDaemons service function | ||
| 211 | * Inputs: | ||
| 212 | * 0 : Header code [0x00140040] | ||
| 39 | * 1 : Daemon bit mask | 213 | * 1 : Daemon bit mask |
| 40 | * Outputs: | 214 | * Outputs: |
| 41 | * 1 : Result, 0 on success, otherwise error code | 215 | * 1 : Result, 0 on success, otherwise error code |
| 42 | */ | 216 | */ |
| 43 | void OverrideDefaultDaemons(Service::Interface* self); | 217 | void OverrideDefaultDaemons(Service::Interface* self); |
| 44 | 218 | ||
| 219 | /** | ||
| 220 | * NDM::ResetDefaultDaemons service function | ||
| 221 | * Inputs: | ||
| 222 | * 0 : Header code [0x00150000] | ||
| 223 | * Outputs: | ||
| 224 | * 1 : Result, 0 on success, otherwise error code | ||
| 225 | */ | ||
| 226 | void ResetDefaultDaemons(Service::Interface* self); | ||
| 227 | |||
| 228 | /** | ||
| 229 | * NDM::GetDefaultDaemons service function | ||
| 230 | * Inputs: | ||
| 231 | * 0 : Header code [0x00160000] | ||
| 232 | * Outputs: | ||
| 233 | * 1 : Result, 0 on success, otherwise error code | ||
| 234 | * 2 : Daemon bit mask | ||
| 235 | * Note: | ||
| 236 | * Gets the current default daemon bit mask. The default value is (DAEMONMASK_CEC | DAEMONMASK_FRIENDS) | ||
| 237 | */ | ||
| 238 | void GetDefaultDaemons(Service::Interface* self); | ||
| 239 | |||
| 240 | /** | ||
| 241 | * NDM::ClearHalfAwakeMacFilter service function | ||
| 242 | * Inputs: | ||
| 243 | * 0 : Header code [0x00170000] | ||
| 244 | * Outputs: | ||
| 245 | * 1 : Result, 0 on success, otherwise error code | ||
| 246 | */ | ||
| 247 | void ClearHalfAwakeMacFilter(Service::Interface* self); | ||
| 248 | |||
| 45 | /// Initialize NDM service | 249 | /// Initialize NDM service |
| 46 | void Init(); | 250 | void Init(); |
| 47 | 251 | ||
diff --git a/src/core/hle/service/ndm/ndm_u.cpp b/src/core/hle/service/ndm/ndm_u.cpp index bf95cc7aa..3ff0744ee 100644 --- a/src/core/hle/service/ndm/ndm_u.cpp +++ b/src/core/hle/service/ndm/ndm_u.cpp | |||
| @@ -9,29 +9,29 @@ namespace Service { | |||
| 9 | namespace NDM { | 9 | namespace NDM { |
| 10 | 10 | ||
| 11 | const Interface::FunctionInfo FunctionTable[] = { | 11 | const Interface::FunctionInfo FunctionTable[] = { |
| 12 | {0x00010042, nullptr, "EnterExclusiveState"}, | 12 | {0x00010042, EnterExclusiveState, "EnterExclusiveState"}, |
| 13 | {0x00020002, nullptr, "LeaveExclusiveState"}, | 13 | {0x00020002, LeaveExclusiveState, "LeaveExclusiveState"}, |
| 14 | {0x00030000, nullptr, "QueryExclusiveMode"}, | 14 | {0x00030000, QueryExclusiveMode, "QueryExclusiveMode"}, |
| 15 | {0x00040002, nullptr, "LockState"}, | 15 | {0x00040002, LockState, "LockState"}, |
| 16 | {0x00050002, nullptr, "UnlockState"}, | 16 | {0x00050002, UnlockState, "UnlockState"}, |
| 17 | {0x00060040, SuspendDaemons, "SuspendDaemons"}, | 17 | {0x00060040, SuspendDaemons, "SuspendDaemons"}, |
| 18 | {0x00070040, ResumeDaemons, "ResumeDaemons"}, | 18 | {0x00070040, ResumeDaemons, "ResumeDaemons"}, |
| 19 | {0x00080040, nullptr, "DisableWifiUsage"}, | 19 | {0x00080040, SuspendScheduler, "SuspendScheduler"}, |
| 20 | {0x00090000, nullptr, "EnableWifiUsage"}, | 20 | {0x00090000, ResumeScheduler, "ResumeScheduler"}, |
| 21 | {0x000A0000, nullptr, "GetCurrentState"}, | 21 | {0x000A0000, nullptr, "GetCurrentState"}, |
| 22 | {0x000B0000, nullptr, "GetTargetState"}, | 22 | {0x000B0000, nullptr, "GetTargetState"}, |
| 23 | {0x000C0000, nullptr, "<Stubbed>"}, | 23 | {0x000C0000, nullptr, "<Stubbed>"}, |
| 24 | {0x000D0040, nullptr, "QueryStatus"}, | 24 | {0x000D0040, QueryStatus, "QueryStatus"}, |
| 25 | {0x000E0040, nullptr, "GetDaemonDisableCount"}, | 25 | {0x000E0040, GetDaemonDisableCount, "GetDaemonDisableCount"}, |
| 26 | {0x000F0000, nullptr, "GetSchedulerDisableCount"}, | 26 | {0x000F0000, GetSchedulerDisableCount,"GetSchedulerDisableCount"}, |
| 27 | {0x00100040, nullptr, "SetScanInterval"}, | 27 | {0x00100040, SetScanInterval, "SetScanInterval"}, |
| 28 | {0x00110000, nullptr, "GetScanInterval"}, | 28 | {0x00110000, GetScanInterval, "GetScanInterval"}, |
| 29 | {0x00120040, nullptr, "SetRetryInterval"}, | 29 | {0x00120040, SetRetryInterval, "SetRetryInterval"}, |
| 30 | {0x00130000, nullptr, "GetRetryInterval"}, | 30 | {0x00130000, GetRetryInterval, "GetRetryInterval"}, |
| 31 | {0x00140040, OverrideDefaultDaemons, "OverrideDefaultDaemons"}, | 31 | {0x00140040, OverrideDefaultDaemons, "OverrideDefaultDaemons"}, |
| 32 | {0x00150000, nullptr, "ResetDefaultDaemons"}, | 32 | {0x00150000, ResetDefaultDaemons, "ResetDefaultDaemons"}, |
| 33 | {0x00160000, nullptr, "GetDefaultDaemons"}, | 33 | {0x00160000, GetDefaultDaemons, "GetDefaultDaemons"}, |
| 34 | {0x00170000, nullptr, "ClearHalfAwakeMacFilter"}, | 34 | {0x00170000, ClearHalfAwakeMacFilter, "ClearHalfAwakeMacFilter"}, |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | NDM_U_Interface::NDM_U_Interface() { | 37 | NDM_U_Interface::NDM_U_Interface() { |