summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-02-08 09:04:08 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-02-08 09:04:08 +0100
commita830047442883e130b39b620168c16e0495420db (patch)
tree4cb147620222ab486fd1f3c8d073e1b59bef6827 /common
parent0fae783beefc4ea6f201d517bcfe9dd1bd02f38b (diff)
parent8994a0aab7a204308e5c8f13612913874e49b50f (diff)
downloadbarebox-a830047442883e130b39b620168c16e0495420db.tar.gz
barebox-a830047442883e130b39b620168c16e0495420db.tar.xz
Merge branch 'for-next/ratp'
Diffstat (limited to 'common')
-rw-r--r--common/ratp.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/common/ratp.c b/common/ratp.c
index 7be86d49a1..80863f81fb 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -54,14 +54,8 @@ struct ratp_bb_command_return {
struct ratp_ctx {
struct console_device *cdev;
struct ratp ratp;
- int ratp_status;
struct console_device ratp_console;
int have_synch;
- int in_ratp_console;
-
- u8 sendbuf[256];
- u8 sendbuf_len;
-
int old_active;
struct kfifo *console_recv_fifo;
@@ -204,7 +198,7 @@ static int ratp_bb_send_getenv_return(struct ratp_ctx *ctx, const char *val)
}
static char *ratp_command;
-static struct ratp_ctx *ratp_command_ctx;
+static struct ratp_ctx *ratp_ctx;
static int ratp_bb_dispatch(struct ratp_ctx *ctx, const void *buf, int len)
{
@@ -220,7 +214,7 @@ static int ratp_bb_dispatch(struct ratp_ctx *ctx, const void *buf, int len)
return 0;
ratp_command = xmemdup_add_zero(&rbb->data, dlen);
- ratp_command_ctx = ctx;
+ ratp_ctx = ctx;
pr_debug("got command: %s\n", ratp_command);
break;
@@ -323,7 +317,7 @@ static int ratp_console_register(struct ratp_ctx *ctx)
return 0;
}
-void ratp_run_command(void)
+void barebox_ratp_command_run(void)
{
int ret;
@@ -337,7 +331,7 @@ void ratp_run_command(void)
free(ratp_command);
ratp_command = NULL;
- ratp_bb_send_command_return(ratp_command_ctx, ret);
+ ratp_bb_send_command_return(ratp_ctx, ret);
}
static const char *ratpfs_mount_path;
@@ -400,7 +394,7 @@ out:
int barebox_ratp_fs_call(struct ratp_bb_pkt *tx, struct ratp_bb_pkt **rx)
{
- struct ratp_ctx *ctx = ratp_command_ctx;
+ struct ratp_ctx *ctx = ratp_ctx;
struct ratp_bb *rbb;
int len;
u64 start;
@@ -446,11 +440,11 @@ int barebox_ratp(struct console_device *cdev)
if (!cdev->getc || !cdev->putc)
return -EINVAL;
- if (ratp_command_ctx) {
- ctx = ratp_command_ctx;
+ if (ratp_ctx) {
+ ctx = ratp_ctx;
} else {
ctx = xzalloc(sizeof(*ctx));
- ratp_command_ctx = ctx;
+ ratp_ctx = ctx;
ctx->ratp.send = console_send;
ctx->ratp.recv = console_recv;
ctx->console_recv_fifo = kfifo_alloc(512);
@@ -494,7 +488,7 @@ out:
static void barebox_ratp_close(void)
{
- if (ratp_command_ctx && ratp_command_ctx->cdev)
- ratp_console_unregister(ratp_command_ctx);
+ if (ratp_ctx && ratp_ctx->cdev)
+ ratp_console_unregister(ratp_ctx);
}
predevshutdown_exitcall(barebox_ratp_close);