Hi Ed,
If the code is essentially the same anyway, it might be a good idea just to add a switch in server/serial.c and to the create_serial request to tell the server whether the device is a serial port or a parallel port, then change serial/parallel behaviour depending on that switch. You can also use serial_get_info to return a flag saying that you're dealing with a parallel port if necessary.
It's probably better to avoid duplication of the code unless necessary.
Mike
Ed Lea wrote:
This patch provides initial support for accessing LPT0 via /dev/lp0. It provides this support in very much the same way serial port support is provided - most of the functions are subtly altered duplicates of that code. Currently only syncronous accesses are supported, although the infra-structure for asyncronous methods is in place it has not been tested. It would be a good starting point for anyone to get this working at a later date though.
The patch enables programs that communicate with parallel port devices directly through LPT0 to work.
Ed Lea ed@orangebits.cx