diff options
| author | 2018-07-30 10:06:52 -0700 | |
|---|---|---|
| committer | 2018-07-30 10:06:52 -0700 | |
| commit | c5fa3560a63e82babea22b148128f1e70fd54d06 (patch) | |
| tree | bd86c30123f70ffe6d8fef6df3e8d166a585f33f | |
| parent | Merge pull request #856 from lioncash/btm (diff) | |
| parent | service: Add wlan services (diff) | |
| download | yuzu-c5fa3560a63e82babea22b148128f1e70fd54d06.tar.gz yuzu-c5fa3560a63e82babea22b148128f1e70fd54d06.tar.xz yuzu-c5fa3560a63e82babea22b148128f1e70fd54d06.zip | |
Merge pull request #857 from lioncash/wlan
service: Add wlan services
| -rw-r--r-- | src/common/logging/backend.cpp | 1 | ||||
| -rw-r--r-- | src/common/logging/log.h | 1 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/wlan/wlan.cpp | 172 | ||||
| -rw-r--r-- | src/core/hle/service/wlan/wlan.h | 15 |
6 files changed, 194 insertions, 1 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index c663b6358..55de535c0 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp | |||
| @@ -193,6 +193,7 @@ void FileBackend::Write(const Entry& entry) { | |||
| 193 | SUB(Service, SSL) \ | 193 | SUB(Service, SSL) \ |
| 194 | SUB(Service, Time) \ | 194 | SUB(Service, Time) \ |
| 195 | SUB(Service, VI) \ | 195 | SUB(Service, VI) \ |
| 196 | SUB(Service, WLAN) \ | ||
| 196 | CLS(HW) \ | 197 | CLS(HW) \ |
| 197 | SUB(HW, Memory) \ | 198 | SUB(HW, Memory) \ |
| 198 | SUB(HW, LCD) \ | 199 | SUB(HW, LCD) \ |
diff --git a/src/common/logging/log.h b/src/common/logging/log.h index e7fd986d5..e8d98de99 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h | |||
| @@ -80,6 +80,7 @@ enum class Class : ClassType { | |||
| 80 | Service_SSL, ///< The SSL service | 80 | Service_SSL, ///< The SSL service |
| 81 | Service_Time, ///< The time service | 81 | Service_Time, ///< The time service |
| 82 | Service_VI, ///< The VI (Video interface) service | 82 | Service_VI, ///< The VI (Video interface) service |
| 83 | Service_WLAN, ///< The WLAN (Wireless local area network) service | ||
| 83 | HW, ///< Low-level hardware emulation | 84 | HW, ///< Low-level hardware emulation |
| 84 | HW_Memory, ///< Memory-map and address translation | 85 | HW_Memory, ///< Memory-map and address translation |
| 85 | HW_LCD, ///< LCD register emulation | 86 | HW_LCD, ///< LCD register emulation |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 2b9e3a6ce..f05e02cfb 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -279,6 +279,8 @@ add_library(core STATIC | |||
| 279 | hle/service/vi/vi_s.h | 279 | hle/service/vi/vi_s.h |
| 280 | hle/service/vi/vi_u.cpp | 280 | hle/service/vi/vi_u.cpp |
| 281 | hle/service/vi/vi_u.h | 281 | hle/service/vi/vi_u.h |
| 282 | hle/service/wlan/wlan.cpp | ||
| 283 | hle/service/wlan/wlan.h | ||
| 282 | hw/hw.cpp | 284 | hw/hw.cpp |
| 283 | hw/hw.h | 285 | hw/hw.h |
| 284 | hw/lcd.cpp | 286 | hw/lcd.cpp |
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 61a81f564..3cad64837 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -56,6 +56,7 @@ | |||
| 56 | #include "core/hle/service/ssl/ssl.h" | 56 | #include "core/hle/service/ssl/ssl.h" |
| 57 | #include "core/hle/service/time/time.h" | 57 | #include "core/hle/service/time/time.h" |
| 58 | #include "core/hle/service/vi/vi.h" | 58 | #include "core/hle/service/vi/vi.h" |
| 59 | #include "core/hle/service/wlan/wlan.h" | ||
| 59 | 60 | ||
| 60 | using Kernel::ClientPort; | 61 | using Kernel::ClientPort; |
| 61 | using Kernel::ServerPort; | 62 | using Kernel::ServerPort; |
| @@ -227,12 +228,13 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) { | |||
| 227 | PCTL::InstallInterfaces(*sm); | 228 | PCTL::InstallInterfaces(*sm); |
| 228 | PlayReport::InstallInterfaces(*sm); | 229 | PlayReport::InstallInterfaces(*sm); |
| 229 | PM::InstallInterfaces(*sm); | 230 | PM::InstallInterfaces(*sm); |
| 231 | Set::InstallInterfaces(*sm); | ||
| 230 | Sockets::InstallInterfaces(*sm); | 232 | Sockets::InstallInterfaces(*sm); |
| 231 | SPL::InstallInterfaces(*sm); | 233 | SPL::InstallInterfaces(*sm); |
| 232 | SSL::InstallInterfaces(*sm); | 234 | SSL::InstallInterfaces(*sm); |
| 233 | Time::InstallInterfaces(*sm); | 235 | Time::InstallInterfaces(*sm); |
| 234 | VI::InstallInterfaces(*sm, nv_flinger); | 236 | VI::InstallInterfaces(*sm, nv_flinger); |
| 235 | Set::InstallInterfaces(*sm); | 237 | WLAN::InstallInterfaces(*sm); |
| 236 | 238 | ||
| 237 | LOG_DEBUG(Service, "initialized OK"); | 239 | LOG_DEBUG(Service, "initialized OK"); |
| 238 | } | 240 | } |
diff --git a/src/core/hle/service/wlan/wlan.cpp b/src/core/hle/service/wlan/wlan.cpp new file mode 100644 index 000000000..2654594c1 --- /dev/null +++ b/src/core/hle/service/wlan/wlan.cpp | |||
| @@ -0,0 +1,172 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <memory> | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | #include "core/hle/service/sm/sm.h" | ||
| 9 | #include "core/hle/service/wlan/wlan.h" | ||
| 10 | |||
| 11 | namespace Service::WLAN { | ||
| 12 | |||
| 13 | class WLANInfra final : public ServiceFramework<WLANInfra> { | ||
| 14 | public: | ||
| 15 | explicit WLANInfra() : ServiceFramework{"wlan:inf"} { | ||
| 16 | // clang-format off | ||
| 17 | static const FunctionInfo functions[] = { | ||
| 18 | {0, nullptr, "Unknown1"}, | ||
| 19 | {1, nullptr, "Unknown2"}, | ||
| 20 | {2, nullptr, "GetMacAddress"}, | ||
| 21 | {3, nullptr, "StartScan"}, | ||
| 22 | {4, nullptr, "StopScan"}, | ||
| 23 | {5, nullptr, "Connect"}, | ||
| 24 | {6, nullptr, "CancelConnect"}, | ||
| 25 | {7, nullptr, "Disconnect"}, | ||
| 26 | {8, nullptr, "Unknown3"}, | ||
| 27 | {9, nullptr, "Unknown4"}, | ||
| 28 | {10, nullptr, "GetState"}, | ||
| 29 | {11, nullptr, "GetScanResult"}, | ||
| 30 | {12, nullptr, "GetRssi"}, | ||
| 31 | {13, nullptr, "ChangeRxAntenna"}, | ||
| 32 | {14, nullptr, "Unknown5"}, | ||
| 33 | {15, nullptr, "Unknown6"}, | ||
| 34 | {16, nullptr, "RequestWakeUp"}, | ||
| 35 | {17, nullptr, "RequestIfUpDown"}, | ||
| 36 | {18, nullptr, "Unknown7"}, | ||
| 37 | {19, nullptr, "Unknown8"}, | ||
| 38 | {20, nullptr, "Unknown9"}, | ||
| 39 | {21, nullptr, "Unknown10"}, | ||
| 40 | {22, nullptr, "Unknown11"}, | ||
| 41 | {23, nullptr, "Unknown12"}, | ||
| 42 | {24, nullptr, "Unknown13"}, | ||
| 43 | {25, nullptr, "Unknown14"}, | ||
| 44 | {26, nullptr, "Unknown15"}, | ||
| 45 | {27, nullptr, "Unknown16"}, | ||
| 46 | }; | ||
| 47 | // clang-format on | ||
| 48 | |||
| 49 | RegisterHandlers(functions); | ||
| 50 | } | ||
| 51 | }; | ||
| 52 | |||
| 53 | class WLANLocal final : public ServiceFramework<WLANLocal> { | ||
| 54 | public: | ||
| 55 | explicit WLANLocal() : ServiceFramework{"wlan:lcl"} { | ||
| 56 | // clang-format off | ||
| 57 | static const FunctionInfo functions[] = { | ||
| 58 | {0, nullptr, "Unknown1"}, | ||
| 59 | {1, nullptr, "Unknown2"}, | ||
| 60 | {2, nullptr, "Unknown3"}, | ||
| 61 | {3, nullptr, "Unknown4"}, | ||
| 62 | {4, nullptr, "Unknown5"}, | ||
| 63 | {5, nullptr, "Unknown6"}, | ||
| 64 | {6, nullptr, "GetMacAddress"}, | ||
| 65 | {7, nullptr, "CreateBss"}, | ||
| 66 | {8, nullptr, "DestroyBss"}, | ||
| 67 | {9, nullptr, "StartScan"}, | ||
| 68 | {10, nullptr, "StopScan"}, | ||
| 69 | {11, nullptr, "Connect"}, | ||
| 70 | {12, nullptr, "CancelConnect"}, | ||
| 71 | {13, nullptr, "Join"}, | ||
| 72 | {14, nullptr, "CancelJoin"}, | ||
| 73 | {15, nullptr, "Disconnect"}, | ||
| 74 | {16, nullptr, "SetBeaconLostCount"}, | ||
| 75 | {17, nullptr, "Unknown7"}, | ||
| 76 | {18, nullptr, "Unknown8"}, | ||
| 77 | {19, nullptr, "Unknown9"}, | ||
| 78 | {20, nullptr, "GetBssIndicationEvent"}, | ||
| 79 | {21, nullptr, "GetBssIndicationInfo"}, | ||
| 80 | {22, nullptr, "GetState"}, | ||
| 81 | {23, nullptr, "GetAllowedChannels"}, | ||
| 82 | {24, nullptr, "AddIe"}, | ||
| 83 | {25, nullptr, "DeleteIe"}, | ||
| 84 | {26, nullptr, "Unknown10"}, | ||
| 85 | {27, nullptr, "Unknown11"}, | ||
| 86 | {28, nullptr, "CreateRxEntry"}, | ||
| 87 | {29, nullptr, "DeleteRxEntry"}, | ||
| 88 | {30, nullptr, "Unknown12"}, | ||
| 89 | {31, nullptr, "Unknown13"}, | ||
| 90 | {32, nullptr, "AddMatchingDataToRxEntry"}, | ||
| 91 | {33, nullptr, "RemoveMatchingDataFromRxEntry"}, | ||
| 92 | {34, nullptr, "GetScanResult"}, | ||
| 93 | {35, nullptr, "Unknown14"}, | ||
| 94 | {36, nullptr, "SetActionFrameWithBeacon"}, | ||
| 95 | {37, nullptr, "CancelActionFrameWithBeacon"}, | ||
| 96 | {38, nullptr, "CreateRxEntryForActionFrame"}, | ||
| 97 | {39, nullptr, "DeleteRxEntryForActionFrame"}, | ||
| 98 | {40, nullptr, "Unknown15"}, | ||
| 99 | {41, nullptr, "Unknown16"}, | ||
| 100 | {42, nullptr, "CancelGetActionFrame"}, | ||
| 101 | {43, nullptr, "GetRssi"}, | ||
| 102 | {44, nullptr, "Unknown17"}, | ||
| 103 | {45, nullptr, "Unknown18"}, | ||
| 104 | {46, nullptr, "Unknown19"}, | ||
| 105 | {47, nullptr, "Unknown20"}, | ||
| 106 | {48, nullptr, "Unknown21"}, | ||
| 107 | }; | ||
| 108 | // clang-format on | ||
| 109 | |||
| 110 | RegisterHandlers(functions); | ||
| 111 | } | ||
| 112 | }; | ||
| 113 | |||
| 114 | class WLANLocalGetFrame final : public ServiceFramework<WLANLocalGetFrame> { | ||
| 115 | public: | ||
| 116 | explicit WLANLocalGetFrame() : ServiceFramework{"wlan:lg"} { | ||
| 117 | // clang-format off | ||
| 118 | static const FunctionInfo functions[] = { | ||
| 119 | {0, nullptr, "Unknown"}, | ||
| 120 | }; | ||
| 121 | // clang-format on | ||
| 122 | |||
| 123 | RegisterHandlers(functions); | ||
| 124 | } | ||
| 125 | }; | ||
| 126 | |||
| 127 | class WLANSocketGetFrame final : public ServiceFramework<WLANSocketGetFrame> { | ||
| 128 | public: | ||
| 129 | explicit WLANSocketGetFrame() : ServiceFramework{"wlan:sg"} { | ||
| 130 | // clang-format off | ||
| 131 | static const FunctionInfo functions[] = { | ||
| 132 | {0, nullptr, "Unknown"}, | ||
| 133 | }; | ||
| 134 | // clang-format on | ||
| 135 | |||
| 136 | RegisterHandlers(functions); | ||
| 137 | } | ||
| 138 | }; | ||
| 139 | |||
| 140 | class WLANSocketManager final : public ServiceFramework<WLANSocketManager> { | ||
| 141 | public: | ||
| 142 | explicit WLANSocketManager() : ServiceFramework{"wlan:soc"} { | ||
| 143 | // clang-format off | ||
| 144 | static const FunctionInfo functions[] = { | ||
| 145 | {0, nullptr, "Unknown1"}, | ||
| 146 | {1, nullptr, "Unknown2"}, | ||
| 147 | {2, nullptr, "Unknown3"}, | ||
| 148 | {3, nullptr, "Unknown4"}, | ||
| 149 | {4, nullptr, "Unknown5"}, | ||
| 150 | {5, nullptr, "Unknown6"}, | ||
| 151 | {6, nullptr, "GetMacAddress"}, | ||
| 152 | {7, nullptr, "SwitchTsfTimerFunction"}, | ||
| 153 | {8, nullptr, "Unknown7"}, | ||
| 154 | {9, nullptr, "Unknown8"}, | ||
| 155 | {10, nullptr, "Unknown9"}, | ||
| 156 | {11, nullptr, "Unknown10"}, | ||
| 157 | }; | ||
| 158 | // clang-format on | ||
| 159 | |||
| 160 | RegisterHandlers(functions); | ||
| 161 | } | ||
| 162 | }; | ||
| 163 | |||
| 164 | void InstallInterfaces(SM::ServiceManager& sm) { | ||
| 165 | std::make_shared<WLANInfra>()->InstallAsService(sm); | ||
| 166 | std::make_shared<WLANLocal>()->InstallAsService(sm); | ||
| 167 | std::make_shared<WLANLocalGetFrame>()->InstallAsService(sm); | ||
| 168 | std::make_shared<WLANSocketGetFrame>()->InstallAsService(sm); | ||
| 169 | std::make_shared<WLANSocketManager>()->InstallAsService(sm); | ||
| 170 | } | ||
| 171 | |||
| 172 | } // namespace Service::WLAN | ||
diff --git a/src/core/hle/service/wlan/wlan.h b/src/core/hle/service/wlan/wlan.h new file mode 100644 index 000000000..054ea928a --- /dev/null +++ b/src/core/hle/service/wlan/wlan.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | namespace Service::SM { | ||
| 8 | class ServiceManager; | ||
| 9 | } | ||
| 10 | |||
| 11 | namespace Service::WLAN { | ||
| 12 | |||
| 13 | void InstallInterfaces(SM::ServiceManager& sm); | ||
| 14 | |||
| 15 | } // namespace Service::WLAN | ||