From: Hollis Blanchard <hollisb@us.ibm.com>
To: Evgeniy Polyakov <zbr@ioremap.net>
Cc: netdev@vger.kernel.org, mpm@selenic.com
Subject: Re: [PATCH 2 of 2] netconsole: add write-only tty driver
Date: Thu, 27 Nov 2008 23:25:15 -0600 [thread overview]
Message-ID: <200811272325.15452.hollisb@us.ibm.com> (raw)
In-Reply-To: <20081127214701.GA7195@ioremap.net>
On Thursday 27 November 2008 15:47:01 Evgeniy Polyakov wrote:
> Hi.
>
> Looks good. A short note below.
>
> On Thu, Nov 27, 2008 at 03:11:02PM -0600, Hollis Blanchard
(hollisb@us.ibm.com) wrote:
> > +static int __init netconsole_tty_init(void)
> > +{
> > + netconsole_tty_driver = alloc_tty_driver(1);
> > + if (!netconsole_tty_driver)
> > + return -ENOMEM;
> > +
> > + netconsole_tty_driver->owner = THIS_MODULE;
> > + netconsole_tty_driver->driver_name = "netcon";
> > + netconsole_tty_driver->name = "netcon";
> > + netconsole_tty_driver->minor_start = 0;
> > + netconsole_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
> > + netconsole_tty_driver->init_termios = tty_std_termios;
> > + netconsole_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD |
HUPCL;
> > + netconsole_tty_driver->init_termios.c_ispeed = 9600;
> > + netconsole_tty_driver->init_termios.c_ospeed = 9600;
> > + netconsole_tty_driver->flags = TTY_DRIVER_REAL_RAW;
> > + tty_set_operations(netconsole_tty_driver, &netconsole_tty_ops);
> > +
> > + if (tty_register_driver(netconsole_tty_driver))
> > + printk(KERN_ERR "Couldn't register netconsole tty driver\n");
> > +
> > + return 0;
> > +}
> > +device_initcall(netconsole_tty_init);
>
> Would it be better called from init_netconsole()?
Hmm, I don't remember what the ordering is here. "console_initcall", used with
most other console-providing drivers, is done before alloc_tty_driver() can
work. However, since init_netconsole() is a "module_initcall", I guess that
should work. Well, it must, since init_netconsole() calls kzalloc() already...
--
Hollis Blanchard
IBM Linux Technology Center
next prev parent reply other threads:[~2008-11-28 5:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 21:11 [PATCH 0 of 2] implement tty driver for netconsole Hollis Blanchard
2008-11-27 21:11 ` [PATCH 1 of 2] netconsole: don't require struct console to send data Hollis Blanchard
2008-11-30 17:21 ` Matt Mackall
2008-11-27 21:11 ` [PATCH 2 of 2] netconsole: add write-only tty driver Hollis Blanchard
2008-11-27 21:47 ` Evgeniy Polyakov
2008-11-28 5:25 ` Hollis Blanchard [this message]
2008-11-30 17:28 ` Matt Mackall
2008-11-27 23:09 ` [PATCH 0 of 2] implement tty driver for netconsole Matt Mackall
2008-11-30 5:39 ` David Miller
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=200811272325.15452.hollisb@us.ibm.com \
--to=hollisb@us.ibm.com \
--cc=mpm@selenic.com \
--cc=netdev@vger.kernel.org \
--cc=zbr@ioremap.net \
/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;
as well as URLs for NNTP newsgroup(s).