mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] net: netconsole: add is_ready support
Date: Wed, 20 Nov 2013 13:39:12 +0100	[thread overview]
Message-ID: <1384951152-2902-2-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1384951152-2902-1-git-send-email-plagnioj@jcrosoft.com>

So we can be sure the console is only available when IP & Port are set.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 net/netconsole.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/netconsole.c b/net/netconsole.c
index 2ab19de..f6e9701 100644
--- a/net/netconsole.c
+++ b/net/netconsole.c
@@ -129,6 +129,14 @@ static int nc_port_set(struct param_d *p, void *_priv)
 	return 0;
 }
 
+static int nc_is_ready(struct console_device *cdev)
+{
+	struct nc_priv *priv = container_of(cdev,
+					struct nc_priv, cdev);
+
+	return priv->ip && priv->port;
+}
+
 static int netconsole_init(void)
 {
 	struct nc_priv *priv;
@@ -140,6 +148,7 @@ static int netconsole_init(void)
 	cdev->tstc = nc_tstc;
 	cdev->putc = nc_putc;
 	cdev->getc = nc_getc;
+	cdev->is_ready = nc_is_ready;
 
 	g_priv = priv;
 
-- 
1.8.4.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-11-20 12:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20 12:26 [PATCH 0/2] fix net console support Jean-Christophe PLAGNIOL-VILLARD
2013-11-20 12:39 ` [PATCH 1/2] console: add is_ready callbback support Jean-Christophe PLAGNIOL-VILLARD
2013-11-20 12:39   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-11-22  7:03   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384951152-2902-2-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox