/* * Copyright (c) Atmosphère-NX * * 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 . */ #pragma once #include namespace ams::usb { class RemoteDsInterface { private: using Allocator = sf::ExpHeapAllocator; using ObjectFactory = sf::ObjectFactory; private: Service m_srv; Allocator *m_allocator; public: RemoteDsInterface(Service &srv, sf::ExpHeapAllocator *allocator) : m_srv(srv), m_allocator(allocator) { /* ... */ } virtual ~RemoteDsInterface() { serviceClose(std::addressof(m_srv)); } public: Result RegisterEndpoint(u8 endpoint_address, sf::Out> out); Result GetSetupEvent(sf::OutCopyHandle out); Result GetSetupPacket(const sf::OutBuffer & out); Result CtrlInAsync(sf::Out out_urb_id, u64 address, u32 size); Result CtrlOutAsync(sf::Out out_urb_id, u64 address, u32 size); Result GetCtrlInCompletionEvent(sf::OutCopyHandle out); Result GetCtrlInUrbReport(sf::Out out); Result GetCtrlOutCompletionEvent(sf::OutCopyHandle out); Result GetCtrlOutUrbReport(sf::Out out); Result CtrlStall(); Result AppendConfigurationData(u8 bInterfaceNumber, usb::UsbDeviceSpeed device_speed, const sf::InBuffer &data); Result Enable(); Result Disable(); }; static_assert(ds::IsIDsInterface); }