htc: implement remainder of Mux/Tasks

This commit is contained in:
Michael Scire
2021-02-09 19:51:52 -08:00
committed by SciresM
parent 42cf3f50d7
commit b925344c3b
13 changed files with 291 additions and 24 deletions

View File

@@ -45,8 +45,8 @@ namespace ams::htclow::mux {
ChannelConfig m_config;
u64 m_offset;
u64 m_total_send_size;
u64 m_next_max_data;
u64 m_cur_max_data;
u64 m_prev_max_data;
std::optional<u64> m_share;
os::Event m_state_change_event;
ChannelState m_state;
@@ -55,6 +55,9 @@ namespace ams::htclow::mux {
void SetVersion(s16 version);
ChannelState GetChannelState() { return m_state; }
os::EventType *GetChannelStateEvent() { return m_state_change_event.GetBase(); }
Result ProcessReceivePacket(const PacketHeader &header, const void *body, size_t body_size);
bool QuerySendPacket(PacketHeader *header, PacketBody *body, int *out_body_size);
@@ -68,6 +71,15 @@ namespace ams::htclow::mux {
Result DoConnectBegin(u32 *out_task_id);
Result DoConnectEnd();
Result DoFlush(u32 *out_task_id);
Result DoReceiveBegin(u32 *out_task_id, size_t size);
Result DoReceiveEnd(size_t *out, void *dst, size_t dst_size);
Result DoSend(u32 *out_task_id, size_t *out, const void *src, size_t src_size);
Result DoShutdown();
void SetSendBuffer(void *buf, size_t buf_size, size_t max_packet_size);
void SetReceiveBuffer(void *buf, size_t buf_size);
void SetSendBufferWithData(const void *buf, size_t buf_size, size_t max_packet_size);