Commit Graph

6 Commits

Author SHA1 Message Date
Bjorn Andersson
365aa41212 dm: Introduce Diagnostic Monitor abstraction
Move common helpers related to "diag clients" into a "Diagnostics
Monitor" implementation. This becomes necessary in order to support
non-HDLC encoding between the DM and device transparently to the
rest of the implementation.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-24 22:10:17 -08:00
Bjorn Andersson
31dd6573b9 hdlc: Decode HDLC data from a circular buffer
In order to support any sort of fragmentation in a stream based
transport, such as TCP/IP, the data is read into a circular buffer and
the HDLC decoder is turned into a reentrant consumer of said circular
buffer.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-24 21:38:46 -08:00
Eyal Ilsar
11b7deecf7 diag: router: Increase receive buffer sizes
Increased buffer size to accommodate for masks in command packets.

Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Extracted from another patch]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-23 16:36:09 -08:00
Bjorn Andersson
a4f9c736a7 transport: Move client initialization to socket
Let the socket register itself as a client upon successfully connecting
to the remote, in order to isolate the interfacing with the socket from
the common code and group socket related handling in one place.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-23 16:35:24 -08:00
Eyal Ilsar
c8a0488edf diag: transport: Separate the socket read callback
Continued to consolidate the transport layer by moving the incoming
packet read to the separate file and delegating the command handling
back to the main code for now.

Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: omit new debug mask flags]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-23 16:35:24 -08:00
Eyal Ilsar
adcfe45ded diag: transport: Separate the socket connect call
First move in separating the transport layer from the main code so to
enable support for other connections besides socket based.

Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Retained original implementation,
	dropped now unnecessary includes from diag.c,
	moved implementation to socket.c]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-23 16:35:24 -08:00