Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Oct 2009 15:53:53 +0100
From:      Dimitry Andric <dimitry@andric.com>
To:        freebsd-stable@freebsd.org, Andrew Thompson <thompsa@FreeBSD.org>,  Hans Petter Selasky <hselasky@c2i.net>
Subject:   Re: Console has no name?
Message-ID:  <4AEC4F81.7010404@andric.com>
In-Reply-To: <4AEC3823.9000204@andric.com>
References:  <4AEC3823.9000204@andric.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2009-10-31 14:14, Dimitry Andric wrote:
> Somewhere between r198312 and r198702 I started getting this message
> during boot, on a machine using serial console:
> 
> WARNING: console at 0xc093cea0 has no name

Okay, this seems to be caused by r198655, which is an MFC of r197570,
where experimental support for USB serial console was added.

However, the consdev::cn_name field is never initialized in
usb_serial.c, whereas this does happen in other console drivers.

There doesn't seem to be a consensus whether this field needs to be
initialized in the _cnprobe() or _cninit() functions: I count 9 instances
of initialization in the former, and 3 in the latter.  Is there a
preferred way?

Since _cnprobe seems more popular, I propose the following fix:

Index: sys/dev/usb/serial/usb_serial.c
===================================================================
--- sys/dev/usb/serial/usb_serial.c	(revision 198702)
+++ sys/dev/usb/serial/usb_serial.c	(working copy)
@@ -1301,6 +1301,7 @@ static void
 ucom_cnprobe(struct consdev  *cp)
 {
 	cp->cn_pri = CN_NORMAL;
+	strlcpy(cp->cn_name, "ucom", sizeof cp->cn_name);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AEC4F81.7010404>