From: Ivan Passos <ivan@cyclades.com>
To: Andrew Morton <akpm@zip.com.au>
Cc: linux-kernel@vger.kernel.org, Richard Gooch <rgooch@ras.ucalgary.ca>
Subject: Re: Serial Driver Name Question (kernels 2.4.x)
Date: Thu, 03 Jan 2002 08:32:51 -0800 [thread overview]
Message-ID: <3C3487B3.38AACAF6@cyclades.com> (raw)
In-Reply-To: <3C33BCF3.20BE9E92@cyclades.com> <3C33E0D3.B6E932D6@zip.com.au>
Andrew Morton wrote:
>
> > By looking at tty_io.c:_tty_make_name(), it seems that the TTY
> > subsystem in the Linux 2.4.x kernel series expects driver.name to be
> > in the form "ttyX%d", even if you're not using devfs. I say that
> > because as of now the definition in serial.c for this variable is:
> >
> > #if defined(CONFIG_DEVFS_FS)
> > serial_driver.name = "tts/%d";
> > #else
> > serial_driver.name = "ttyS";
> > #endif
> >
> > , when it seems it should be:
> >
> > #if defined(CONFIG_DEVFS_FS)
> > serial_driver.name = "tts/%d";
> > #else
> > serial_driver.name = "ttyS%d";
> > #endif
>
> I don't think so. Some quick grepping indicates that _all_
> tty drivers currently use the "ttyS" equivalent if !CONFIG_DEVFS.
>
> Instead, it appears that someone broke tty_name(). Here's the
> 2.2 kernel's version:
>
> char *tty_name(struct tty_struct *tty, char *buf)
> {
> if (tty)
> sprintf(buf, "%s%d", tty->driver.name, TTY_NUMBER(tty));
> else
> strcpy(buf, "NULL tty");
> return buf;
> }
>
> And that's much more sensible. The tty has a name associated with
> what it is (eg "ttyS") - correlates with major number, probably.
> And it has an instance number.
>
> Which is cleaner, IMO, than embedding printf control strings
> in the driver name.
>
> --- linux-2.4.18-pre1/drivers/char/tty_io.c Wed Dec 26 11:47:40 2001
> +++ linux-akpm/drivers/char/tty_io.c Wed Jan 2 20:39:53 2002
> @@ -194,7 +194,7 @@ _tty_make_name(struct tty_struct *tty, c
> if (!tty) /* Hmm. NULL pointer. That's fun. */
> strcpy(buf, "NULL tty");
> else
> - sprintf(buf, name,
> + sprintf(buf, "%s%d", name,
> idx + tty->driver.name_base);
>
> return buf;
>
> Does this look (and work) OK to you?
No, because with this implementation you'll break the devfs printk.
We have two options, I guess:
1) Change the drivers to have "ttx/%d" (devfs) and "ttyX%d"
(non-devfs), and leave _tty_make_name() untouched (my original
suggestion).
2) Change the drivers to have "ttx/" (devfs) and "ttyX" (non-devfs)
and change _tty_make_name() as suggested above by Andrew. I don't
know how this would affect devfs though ...
I really don't care which solution is used (although I do prefer
option 2, if possible), but I'm sure that it can't stay as it is
now, because right now it's broken.
So ... Which one is more appropriate?? Any other suggestions??
Later,
--
Ivan Passos -o)
Integration Manager, Cyclades - http://www.cyclades.com /\\
Project Leader, NetLinOS - http://www.netlinos.org _\_V
--------------------------------------------------------------------
prev parent reply other threads:[~2002-01-03 16:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-03 2:07 Serial Driver Name Question (kernels 2.4.x) Ivan Passos
2002-01-03 4:40 ` Andrew Morton
2002-01-03 6:37 ` Richard Gooch
2002-01-03 7:03 ` Andrew Morton
2002-01-06 20:12 ` Richard Gooch
2002-01-06 20:36 ` Alan Cox
2002-01-06 20:27 ` Richard Gooch
2002-01-06 21:05 ` Andrew Morton
2002-01-07 6:36 ` Richard Gooch
2002-01-07 7:20 ` Andrew Morton
2002-01-08 5:03 ` Andrew Morton
2002-01-08 6:15 ` David Weinehall
2002-01-08 6:23 ` Andrew Morton
2002-01-08 18:54 ` Ivan Passos
2002-01-08 21:58 ` Michael H. Warfield
2002-01-08 22:11 ` Andrew Morton
2002-01-08 23:33 ` Ivan Passos
2002-01-09 16:36 ` Richard Gooch
2002-01-10 9:14 ` Nick Craig-Wood
2002-01-08 18:47 ` Ivan Passos
2002-01-03 16:32 ` Ivan Passos [this message]
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=3C3487B3.38AACAF6@cyclades.com \
--to=ivan@cyclades.com \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=rgooch@ras.ucalgary.ca \
/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