Re: [PARPORT] Parport numbering


Tim Waugh (tim@cyberelk.demon.co.uk)
Sun, 22 Feb 1998 16:23:36 +0000 (GMT)


On Sun, 22 Feb 1998, Philip Blundell wrote:

> >When parport_unregister_port is called for the very last allocated parport
> >number, that parport number should be available for re-use.
>
> That sounds like a good plan. But you can't guarantee the order that ports
> will get unregistered in (they might belong to different drivers).

I know: in the case of the ports being register by two architecture
modules (say, pc and ax), modules don't work so well anyhow because of the
single parport_lowlevel alias.

What's really missing is the ability to say "load parport_pc, and attach
0x378 to parport0, and 0x278 to parport1" - at the moment you can only
guarantee probe ORDER, not the actual numbers that get assigned. The
problem with that of course is that it may fail because the parport
numbers aren't free.

I can't think of an easy way of doing that, given that the lowlevel
drivers only get to use parport_register_port at that stage.

> Incidentally, if there's anywhere else that this sort of gruesome thing
> happens:
>
> char lastname[16];
> sprintf (lastname, "parport%d", portcount - 1);
> if (!strcmp (port->name, lastname)) portcount--;
>
> then we ought to keep the port number as an integer in struct parport as well
> as (or even instead of) the string version.

Quite. The strcmp stuff was just to show you the kind of thing I meant.

Tim.
*/

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:17:29 EST