[PATCH 2/2] net: netconsole: add is_ready support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed Nov 20 07:39:12 EST 2013


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

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at 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




More information about the barebox mailing list