Messages in this thread | | | Date | Thu, 10 Aug 2000 10:26:50 -0400 | From | "Theodore Ts'o" <> | Subject | Re: design-question serial-driver + predefined ldisc - Nuber |
| |
Date: Tue, 8 Aug 2000 14:29:20 +0200 From: Michael Westermann <mw@microdata-pos.de>
I hav a projekt for POS-Systeme with a few driver's that all use a protokoll over the serial device. I think it is a goo idea when i use the ldisc mechanism from the tty driver.
My problem is that the ldiscs array in tty_io.c is static predefined. I have 3 to 10 protokoll's over this mechnism.
I think it is a good idea, to create a dynamic part on the ldiscs structure.
So your idea is to have a range of line discplines from N_LDDYN and NR_LDISCS would be dynamically allocated? It seems like a good concept, but (a) not for Linux 2.4, (b) don't overload the return value of tty_register_ldisc (it's ugly, ugly, ugly), and (c) the dynamic line discplines (and arguably all of the other line discplines, in the long run) should probably use an ASCII string instead of a number to address them.
Linus hates magic numbers, and while in some cases they are necessary, line discplines are a perfect example of where a new ioctl where you pass in a 32 byte character array containing a null-terminated string naming the line discpline you want is almost certainly the Right Thing. Unfortunately, it's not for 2.4, but that's probably the right approach to use, and hopefully we can merge a patch like that in once the 2.5 development opens.
- Ted
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |