lkml.org 
[lkml]   [2010]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: How do I choose an arbitrary minor number for my tty device?
    > Are you talking about this:
    >
    > static struct tty_driver *ehv_bc_console_device(struct console *co, int *index)
    > {
    > *index = co->index;
    >
    > return ehv_bc_driver;
    > }

    Yes.

    > I never really understood this function, but almost everyone does the same
    > thing, and it seems to work for me. Looking at console_device(), it appears
    > that all of the xxx_console_device functions are called in order until one of
    > them returns non-NULL.

    *index is the minor number to use - so you can return whichever minor
    matches your primary interface

    > > I suspect in your case you probably want to attach the primary byte
    > > channel to minor 0 in the driver (and reserve it for that), or some
    > > similar rule.
    >
    > Yes, that's a good idea. It does simplify things a lot.

    It's probably the cleanest and simplest solution and it fits the
    "natural" order of things.


    \
     
     \ /
      Last update: 2010-11-24 00:07    [W:4.165 / U:0.440 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site