IMHO, the main waste is "in the drivers".
A serial driver restructuring should have a simple driver just be
"pass a character to the hardware" and "get a character from the
hardware" as well as "read/write modem control" register. (And the
driver would be requested to call a "modem status changed, please
ask me what the new status is").
That way you can build a working serial driver in under 100 lines of
Now most advanced serial drivers would want to also provide "pass a
bunch of characters to the hardware" routine. By default that would
just be a routine that calls the output one char function
repeatedly. But hardware with a larger buffer can really benefit from
All "tty-layer" things should then move out of the driver. For
instance: no calling of "hangup" if the flags allow that: The driver
should report that DCD went down, and then something generic should in
one place decide wether or not to call "hangup" (i.e. send the hangup
If someone wires "DCD" to "TXD", and then uses the port in CLOCAL, we
will call the "DCD changed" function WAY too often. But that is just
stupid. Let's not create a stupid architecture because it will be
inefficient in a stupid case.
-- ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 ** *-- BitWizard writes Linux device drivers for any device you may have! --* * There are old pilots, and there are bold pilots. * There are also old, bald pilots. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to firstname.lastname@example.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/