diff options
| -rw-r--r-- | src/core/hle/service/usb/usb.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/core/hle/service/usb/usb.cpp b/src/core/hle/service/usb/usb.cpp index a2855e783..f29fff1dd 100644 --- a/src/core/hle/service/usb/usb.cpp +++ b/src/core/hle/service/usb/usb.cpp | |||
| @@ -16,19 +16,19 @@ public: | |||
| 16 | explicit IDsInterface(Core::System& system_) : ServiceFramework{system_, "IDsInterface"} { | 16 | explicit IDsInterface(Core::System& system_) : ServiceFramework{system_, "IDsInterface"} { |
| 17 | // clang-format off | 17 | // clang-format off |
| 18 | static const FunctionInfo functions[] = { | 18 | static const FunctionInfo functions[] = { |
| 19 | {0, nullptr, "BindDevice"}, | 19 | {0, nullptr, "AddEndpoint"}, |
| 20 | {1, nullptr, "BindClientProcess"}, | 20 | {1, nullptr, "GetSetupEvent"}, |
| 21 | {2, nullptr, "AddInterface"}, | 21 | {2, nullptr, "GetSetupPacket"}, |
| 22 | {3, nullptr, "GetStateChangeEvent"}, | 22 | {3, nullptr, "Enable"}, |
| 23 | {4, nullptr, "GetState"}, | 23 | {4, nullptr, "Disable"}, |
| 24 | {5, nullptr, "ClearDeviceData"}, | 24 | {5, nullptr, "CtrlIn"}, |
| 25 | {6, nullptr, "AddUsbStringDescriptor"}, | 25 | {6, nullptr, "CtrlOut"}, |
| 26 | {7, nullptr, "DeleteUsbStringDescriptor"}, | 26 | {7, nullptr, "GetCtrlInCompletionEvent"}, |
| 27 | {8, nullptr, "SetUsbDeviceDescriptor"}, | 27 | {8, nullptr, "GetCtrlInUrbReport"}, |
| 28 | {9, nullptr, "SetBinaryObjectStore"}, | 28 | {9, nullptr, "GetCtrlOutCompletionEvent"}, |
| 29 | {10, nullptr, "Enable"}, | 29 | {10, nullptr, "GetCtrlOutUrbReport"}, |
| 30 | {11, nullptr, "Disable"}, | 30 | {11, nullptr, "CtrlStall"}, |
| 31 | {12, nullptr, "Unknown12"}, | 31 | {12, nullptr, "AppendConfigurationData"}, |
| 32 | }; | 32 | }; |
| 33 | // clang-format on | 33 | // clang-format on |
| 34 | 34 | ||
| @@ -36,9 +36,9 @@ public: | |||
| 36 | } | 36 | } |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | class USB_DS final : public ServiceFramework<USB_DS> { | 39 | class IDsRootSession final : public ServiceFramework<IDsRootSession> { |
| 40 | public: | 40 | public: |
| 41 | explicit USB_DS(Core::System& system_) : ServiceFramework{system_, "usb:ds"} { | 41 | explicit IDsRootSession(Core::System& system_) : ServiceFramework{system_, "usb:ds"} { |
| 42 | // clang-format off | 42 | // clang-format off |
| 43 | static const FunctionInfo functions[] = { | 43 | static const FunctionInfo functions[] = { |
| 44 | {0, nullptr, "OpenDsService"}, | 44 | {0, nullptr, "OpenDsService"}, |
| @@ -94,9 +94,9 @@ public: | |||
| 94 | } | 94 | } |
| 95 | }; | 95 | }; |
| 96 | 96 | ||
| 97 | class USB_HS final : public ServiceFramework<USB_HS> { | 97 | class IClientRootSession final : public ServiceFramework<IClientRootSession> { |
| 98 | public: | 98 | public: |
| 99 | explicit USB_HS(Core::System& system_) : ServiceFramework{system_, "usb:hs"} { | 99 | explicit IClientRootSession(Core::System& system_) : ServiceFramework{system_, "usb:hs"} { |
| 100 | // clang-format off | 100 | // clang-format off |
| 101 | static const FunctionInfo functions[] = { | 101 | static const FunctionInfo functions[] = { |
| 102 | {0, nullptr, "BindClientProcess"}, | 102 | {0, nullptr, "BindClientProcess"}, |
| @@ -107,7 +107,7 @@ public: | |||
| 107 | {5, nullptr, "DestroyInterfaceAvailableEvent"}, | 107 | {5, nullptr, "DestroyInterfaceAvailableEvent"}, |
| 108 | {6, nullptr, "GetInterfaceStateChangeEvent"}, | 108 | {6, nullptr, "GetInterfaceStateChangeEvent"}, |
| 109 | {7, nullptr, "AcquireUsbIf"}, | 109 | {7, nullptr, "AcquireUsbIf"}, |
| 110 | {8, nullptr, "ResetDevice"}, | 110 | {8, nullptr, "SetTestMode"}, |
| 111 | }; | 111 | }; |
| 112 | // clang-format on | 112 | // clang-format on |
| 113 | 113 | ||
| @@ -134,12 +134,12 @@ public: | |||
| 134 | } | 134 | } |
| 135 | }; | 135 | }; |
| 136 | 136 | ||
| 137 | class USB_PD final : public ServiceFramework<USB_PD> { | 137 | class IPdManager final : public ServiceFramework<IPdManager> { |
| 138 | public: | 138 | public: |
| 139 | explicit USB_PD(Core::System& system_) : ServiceFramework{system_, "usb:pd"} { | 139 | explicit IPdManager(Core::System& system_) : ServiceFramework{system_, "usb:pd"} { |
| 140 | // clang-format off | 140 | // clang-format off |
| 141 | static const FunctionInfo functions[] = { | 141 | static const FunctionInfo functions[] = { |
| 142 | {0, &USB_PD::GetPdSession, "GetPdSession"}, | 142 | {0, &IPdManager::OpenSession, "OpenSession"}, |
| 143 | }; | 143 | }; |
| 144 | // clang-format on | 144 | // clang-format on |
| 145 | 145 | ||
| @@ -147,7 +147,7 @@ public: | |||
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | private: | 149 | private: |
| 150 | void GetPdSession(HLERequestContext& ctx) { | 150 | void OpenSession(HLERequestContext& ctx) { |
| 151 | LOG_DEBUG(Service_USB, "called"); | 151 | LOG_DEBUG(Service_USB, "called"); |
| 152 | 152 | ||
| 153 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 153 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| @@ -178,12 +178,12 @@ public: | |||
| 178 | } | 178 | } |
| 179 | }; | 179 | }; |
| 180 | 180 | ||
| 181 | class USB_PD_C final : public ServiceFramework<USB_PD_C> { | 181 | class IPdCradleManager final : public ServiceFramework<IPdCradleManager> { |
| 182 | public: | 182 | public: |
| 183 | explicit USB_PD_C(Core::System& system_) : ServiceFramework{system_, "usb:pd:c"} { | 183 | explicit IPdCradleManager(Core::System& system_) : ServiceFramework{system_, "usb:pd:c"} { |
| 184 | // clang-format off | 184 | // clang-format off |
| 185 | static const FunctionInfo functions[] = { | 185 | static const FunctionInfo functions[] = { |
| 186 | {0, &USB_PD_C::GetPdCradleSession, "GetPdCradleSession"}, | 186 | {0, &IPdCradleManager::OpenCradleSession, "OpenCradleSession"}, |
| 187 | }; | 187 | }; |
| 188 | // clang-format on | 188 | // clang-format on |
| 189 | 189 | ||
| @@ -191,18 +191,18 @@ public: | |||
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | private: | 193 | private: |
| 194 | void GetPdCradleSession(HLERequestContext& ctx) { | 194 | void OpenCradleSession(HLERequestContext& ctx) { |
| 195 | LOG_DEBUG(Service_USB, "called"); | ||
| 196 | |||
| 195 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 197 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 196 | rb.Push(ResultSuccess); | 198 | rb.Push(ResultSuccess); |
| 197 | rb.PushIpcInterface<IPdCradleSession>(system); | 199 | rb.PushIpcInterface<IPdCradleSession>(system); |
| 198 | |||
| 199 | LOG_DEBUG(Service_USB, "called"); | ||
| 200 | } | 200 | } |
| 201 | }; | 201 | }; |
| 202 | 202 | ||
| 203 | class USB_PM final : public ServiceFramework<USB_PM> { | 203 | class IPmMainService final : public ServiceFramework<IPmMainService> { |
| 204 | public: | 204 | public: |
| 205 | explicit USB_PM(Core::System& system_) : ServiceFramework{system_, "usb:pm"} { | 205 | explicit IPmMainService(Core::System& system_) : ServiceFramework{system_, "usb:pm"} { |
| 206 | // clang-format off | 206 | // clang-format off |
| 207 | static const FunctionInfo functions[] = { | 207 | static const FunctionInfo functions[] = { |
| 208 | {0, nullptr, "GetPowerEvent"}, | 208 | {0, nullptr, "GetPowerEvent"}, |
| @@ -221,11 +221,11 @@ public: | |||
| 221 | void LoopProcess(Core::System& system) { | 221 | void LoopProcess(Core::System& system) { |
| 222 | auto server_manager = std::make_unique<ServerManager>(system); | 222 | auto server_manager = std::make_unique<ServerManager>(system); |
| 223 | 223 | ||
| 224 | server_manager->RegisterNamedService("usb:ds", std::make_shared<USB_DS>(system)); | 224 | server_manager->RegisterNamedService("usb:ds", std::make_shared<IDsRootSession>(system)); |
| 225 | server_manager->RegisterNamedService("usb:hs", std::make_shared<USB_HS>(system)); | 225 | server_manager->RegisterNamedService("usb:hs", std::make_shared<IClientRootSession>(system)); |
| 226 | server_manager->RegisterNamedService("usb:pd", std::make_shared<USB_PD>(system)); | 226 | server_manager->RegisterNamedService("usb:pd", std::make_shared<IPdManager>(system)); |
| 227 | server_manager->RegisterNamedService("usb:pd:c", std::make_shared<USB_PD_C>(system)); | 227 | server_manager->RegisterNamedService("usb:pd:c", std::make_shared<IPdCradleManager>(system)); |
| 228 | server_manager->RegisterNamedService("usb:pm", std::make_shared<USB_PM>(system)); | 228 | server_manager->RegisterNamedService("usb:pm", std::make_shared<IPmMainService>(system)); |
| 229 | ServerManager::RunServer(std::move(server_manager)); | 229 | ServerManager::RunServer(std::move(server_manager)); |
| 230 | } | 230 | } |
| 231 | 231 | ||