From: Greg KH <gregkh@suse.de>
To: Timur Tabi <timur@freescale.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Scott Wood <scottwood@freescale.com>,
Stuart Yoder <stuart.yoder@freescale.com>
Subject: Re: How do I choose an arbitrary minor number for my tty device?
Date: Thu, 18 Nov 2010 12:02:30 -0800 [thread overview]
Message-ID: <20101118200230.GA25715@suse.de> (raw)
In-Reply-To: <4CE58005.7040308@freescale.com>
On Thu, Nov 18, 2010 at 01:35:33PM -0600, Timur Tabi wrote:
> Greg KH wrote:
> >> I just booted a Linux kernel with the driver I just emailed you, and there's no
> >> > /dev/serial/ directory. The only directories under /dev/ are 'shm' and 'pts',
> >> > both of which are empty.
>
> > Then plug in a serial port device and see what happens. You didn't hook
> > everything up in your driver correctly it seems, do your devices show up
> > under /sys/class/tty?
>
> If I delete the call to device_create() in ehv_bc_init() (so that it creates the
> TTY devices only, and not the character devices), I get this:
>
> # ls -l /sys/class/tty/ttyEHV*
> lrwxrwxrwx 1 root root 0 Jan 1 00:04 /sys/class/tty/ttyEHV0
> -> ../../devices/virtual/tty/ttyEHV0
> lrwxrwxrwx 1 root root 0 Jan 1 00:04 /sys/class/tty/ttyEHV1
> -> ../../devices/virtual/tty/ttyEHV1
> lrwxrwxrwx 1 root root 0 Jan 1 00:04 /sys/class/tty/ttyEHV2
> -> ../../devices/virtual/tty/ttyEHV2
>
> >> > I'm also running a Fedora 13 x86 system, just to see if I need a full modern OS
> >> > to see these files. Again, there is no /dev/serial/, even though I have serial
> >> > ports.
> > Dynamic ones like a usb to serial device?
>
> No, not dynamic ones.
>
> >> > Also not that since I'm not registering the byte channels as serial devices, I
> >> > wouldn't expect anything in /dev/serial/ to reference them.
> >> >
> >> > What does my driver need to do in order for these /dev/xxxx/ entries to contain
> >> > that information?
>
> > See the udev rules for details.
>
> udev rules still need some way for the driver to tell user-space that
> /dev/ttyEHV0 is associated with byte channel handle 73. I still don't know what
> mechanism my driver is supposed to use to make that information available to
> user space.
>
> I could fake it by doing this:
>
> for (i = 0; i < num_byte_channels; i++) {
> bc->handle = get_the_byte_channel_handle(i);
> ehv_bc_driver->name_base = bc->handle - i;
> tty_register_device(ehv_bc_driver, i, NULL);
Why are you not setting up a parent device of your tty device? That
should be essencial.
> }
>
> This actually works and does what I want, but I seriously doubt it's acceptable.
> When I do this, I get:
>
> # ls -l /dev/ttyEH*
> crw-rw---- 1 root uucp 253, 0 Jan 1 00:00 /dev/ttyEHV73
> crw-rw---- 1 root uucp 253, 1 Jan 1 00:00 /dev/ttyEHV76
> crw-rw---- 1 root uucp 253, 2 Jan 1 00:00 /dev/ttyEHV79
Does that work for you? Looks fine to me :)
But again, you really should get the driver model portion right...
thanks,
greg k-h
next prev parent reply other threads:[~2010-11-18 20:02 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-17 21:37 How do I choose an arbitrary minor number for my tty device? Timur Tabi
2010-11-17 21:51 ` Greg KH
2010-11-17 22:10 ` Timur Tabi
2010-11-17 22:19 ` Greg KH
2010-11-17 22:42 ` Timur Tabi
2010-11-18 2:24 ` Greg KH
2010-11-18 15:31 ` Timur Tabi
2010-11-18 15:39 ` Greg KH
2010-11-18 16:03 ` Timur Tabi
2010-11-18 16:33 ` Greg KH
2010-11-18 16:36 ` Timur Tabi
2010-11-18 16:51 ` Greg KH
2010-11-18 16:56 ` Timur Tabi
2010-11-18 17:18 ` Greg KH
2010-11-18 17:38 ` Timur Tabi
2010-11-18 17:58 ` Greg KH
2010-11-18 19:35 ` Timur Tabi
2010-11-18 20:02 ` Greg KH [this message]
2010-11-18 20:06 ` Timur Tabi
2010-11-18 20:10 ` Greg KH
2010-11-18 20:43 ` Timur Tabi
2010-11-18 20:56 ` Alan Cox
2010-11-22 16:32 ` Timur Tabi
2010-11-22 20:12 ` Timur Tabi
2010-11-23 13:56 ` Alan Cox
2010-11-23 17:14 ` Timur Tabi
2010-11-23 23:03 ` Alan Cox
2010-11-18 20:58 ` Alan Cox
2010-11-18 17:21 ` Scott Wood
2010-11-18 17:42 ` Timur Tabi
2010-11-18 17:58 ` Greg KH
2010-11-18 18:13 ` Scott Wood
2010-11-24 10:23 ` Michael Ellerman
2010-11-24 18:08 ` Scott Wood
2010-11-24 18:23 ` Greg KH
2010-11-24 22:44 ` Michael Ellerman
2010-11-29 21:44 ` Greg KH
2010-11-29 21:51 ` Timur Tabi
2010-11-29 22:30 ` Greg KH
2010-11-29 22:36 ` Timur Tabi
2010-11-30 3:29 ` Greg KH
2010-11-30 4:15 ` Tabi Timur-B04825
2010-11-30 19:33 ` Timur Tabi
2010-12-01 1:00 ` Greg KH
2010-12-01 9:54 ` Kay Sievers
2010-12-02 16:12 ` Timur Tabi
2010-11-24 22:46 ` Michael Ellerman
2010-11-25 4:10 ` Grant Likely
2010-11-24 18:13 ` Scott Wood
2010-11-24 18:13 ` Scott Wood
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=20101118200230.GA25715@suse.de \
--to=gregkh@suse.de \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=scottwood@freescale.com \
--cc=stuart.yoder@freescale.com \
--cc=timur@freescale.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.