[PATCH 09/10] ratp: new reset command

2018-02-02 Thread Aleksander Morgado
Signed-off-by: Aleksander Morgado --- commands/reset.c | 48 +--- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/commands/reset.c b/commands/reset.c index 6eac53262..7971b9f2f 100644 --- a/commands/reset.c +++

[PATCH 10/10] ratp: new md and mw commands

2018-02-02 Thread Aleksander Morgado
This commit introduces support for running the md and mw commands using the binary interface provided by RAPT. This allows clients to read and write memory files without needing to do custom string parsing on the data returned by the console 'md' and 'mw' operations. The request and response

[PATCH 04/10] ratp: port getenv operation to req/rsp format

2018-02-02 Thread Aleksander Morgado
The getenv operation executed via RATP is processed in the following way: * The client sends a 'getenv' packet to barebox specifying the name of the variable to read. * Barebox replies with a 'getenv_result' packet including the value of the variable read. We now consolidate this process

[PATCH 05/10] ratp: port filesystem operation to req/rsp format

2018-02-02 Thread Aleksander Morgado
The filesystem operation executed via RATP is processed in the following way: * The barebox RATP endpoint sends 'fs' packets to the client, with the specific filesystem operations to execute. * The client replies with 'fs_result' packets to barebox, containing the result of the filesystem

[PATCH 07/10] ratp: implement ping as a standard ratp command

2018-02-02 Thread Aleksander Morgado
Signed-off-by: Aleksander Morgado --- commands/Makefile| 1 + commands/ratp-ping.c | 38 ++ common/ratp.c| 27 --- 3 files changed, 39 insertions(+), 27 deletions(-) create mode 100644

[PATCH 02/10] ratp: port command operation to req/rsp/ind format

2018-02-02 Thread Aleksander Morgado
The commands executed by the client via RATP are processed in the following way: * The client sends a 'command' packet to the barebox console. * The result (errno) of the command is returned to the client via a 'command_return' message. * The standard output of the command executed is sent

[PATCH 03/10] ratp: port ping operation to req/rsp format

2018-02-02 Thread Aleksander Morgado
The ping operation executed via RATP is processed in the following way: * The client sends a 'ping' packet to barebox. * Barebox replies with a 'pong' packet. We now consolidate this process using the request and response packet flags, and making them part of the same 'ping' packet type.

[PATCH 01/10] ratp: define message type flags

2018-02-02 Thread Aleksander Morgado
Split message types in 3 different groups: * Requests: messages generated by one RATP endpoint and sent to the the other endpoint to be processed. * Responses: messages generated by the RATP endpoint as a result of having received and processed a specific request message. *

[PATCH 08/10] ratp: implement getenv as a standard ratp command

2018-02-02 Thread Aleksander Morgado
Also, use xstrndup() instead of the custom xmemdup_add_zero() as we're working with strings anyway. Signed-off-by: Aleksander Morgado --- commands/Makefile | 1 + commands/ratp-getenv.c | 50 ++ common/ratp.c

[PATCH 06/10] ratp: implement generic command support

2018-02-02 Thread Aleksander Morgado
The RATP implementation now allows executing generic commands with a binary interface: binary requests are received and binary responses are returned. Each command can define its own RATP request contents (e.g. to specify command-specific options) as well as its own RATP response contents (if any

[RFC PATCH 00/10] ratp: new generic RATP command support

2018-02-02 Thread Aleksander Morgado
Until now, the barebox-specific RATP commands were all defined and implemented in common/ratp.c. This series of patches allow ratp commands to be defined in a similar way to console commands. The first patches (1-5) break the current RATP API, by introducing the concept of requests, responses and