Implemented and registered a handler for the Event Report Control command
request.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Moved implementation to common_cmds.c,
removed uncessary error handling of unkown status values,
use return value to return bad command errors]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Implemented and registered a handler for the Event Set Mask command
request.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Moved implementation to common_cmds.c,
replaced posix_memalign with malloc,
use return value to send bad response,
provide broadcast helper]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Implemented and registered a handler for the Event Get Mask command
request.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Moved implementation to common_cmds.c,
replace posix_memalign with malloc,
use return code to signal errors]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Implemented and registered a handler for the Extended Message
Configuration command request.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Replace posix_memalign with malloc,
use return value to respond with error message,
moved implementation to common_cmds.c,
add peripheral broadcast helper for message masks,
reworked GET_MSG_MASK to not modify the incoming buffer]
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 initialisation of masks and broadcasting of MSG masks to new
peripherals.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Split out common_cmds handling to separate commit,
broadcast message masks when new peripherals arrive,
replace posix_memalign with malloc]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
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>
1) Added masks support to features mask.
2) Implemented a call to create and send LOG mask control response packet
for a specific equipment id to a peripheral.
3) Implemented a call to create and send MSG mask control response packet
for a specific ssid range to a peripheral.
4) Implemented a call to create and send EVENT mask control response packet
to a peripheral.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Dropped posix_memalign usage, fixed up peripherial interfacing]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Messages from the peripherals should be propagated to any registered
client, so extract this logic into its own function.
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>
Registered the Extended Build ID request command and implemented its
handler.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Moved implementation to app_cmds.c]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Registered the Version Number request command and implemented its
handler.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Moved handler to app_cmds, changed registration function]
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>
Added support for handling subsystem dispatch command v2 with command
code of 128 (0x80).
Change-Id: I06d30d0ea6f529f9961095832e09ee3ee508ea6d
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
Remove code that was left behind from prototyping, causing memory leaks
in some code paths.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.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>
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>
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>
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>
Added a command channel handler similar to the data channel handler.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Wire up the new handler to the fd]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>