If CFLAGS is set in the environment, it should be used. The Makefile
was previously clobbering it. Now it adds -Wall -g -O2 only if CFLAGS
was not specified.
Signed-off-by: Evan Green <evangreen86@gmail.com>
Default to support both QRTR based and RPMSG based communication, rather
than none. This default configuration allow us to run the binary on both
SDM845 and DB820c; but still make it possible to disable the RPMSG based
peripheral support when the host doesn't have the cross compile
environment for libudev.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Move router code into "router" and move send_data into "tools", in order
to make things cleaner as the implementation gains further components.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
In recent platforms the previous SMD based transport is replaced by QRTR
sockets, introduce the initial support for this.
This has been tested by booting the modem and sending loopback messages
and retrieving the associated responses. More work is needed to handle
dying remotes etc.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Provide a crude tool called "send_data", which can be used to send
single DIAG commands, over the newly added local UNIX socket, and wait
for the responses.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
In order to interact with the DIAG router locally this introduces a
crude UNIX socket based DM.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Move the rpmsg based peripheral discovery and communication
implementation, in order to be able to make it depend on the presence of
libudev.h. This is useful as the dependency of this is optional in the
new AF_QIPCRTR based communication model.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
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>
This introduces a circular buffer and a read operation to store stream
data, from e.g. a TCP stream.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Implemented and registered a handler for the Logging Configuration command
request.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Move handler to common_cmds.c,
abstract broadcasting the logmask to all peripherals,
replace posix_memalign with malloc]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Added support for managing masks.
Note that some masks are built from hardcoded lists but are also modified
at runtime and are kept in memory.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Omit debug prints, use malloc instead of posix_memalign]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
1) Added command key generation macros.
2) Added a utility command registration call that creates a command
instance for a given key and adds it to the given commands list.
Change-Id: Ibc4f451cd60d7bb6a6e751137f50545a31645d5b
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
Add the option to connect to a host PC connected via a USB cable.
Configure the USB via the following command line option:
-g <gadget device name[#serial number]>
The device name is typically /dev/ffs_diag.
Note that this is based on a user space erected driver using configfs and
requires a gadget and diag function file system nodes to be setup a priori.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Moved to usb.c, replaced transport wrapper]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Add the option to connect to a host PC connected via a UART cable.
Configure the UART via the following command line option:
-u <uart device name[@baudrate]>
The device name is typically /dev/ttyMSM1 and the baud rate 115200.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Moved code to uart.c, modified initialization from main,
made uart register iself as client]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
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>