Next Previous Contents

8. Patches to make PLIP and LP live together.

The best way to make PLIP and LP live together is to use kernel modules: you can load plip.o and unload it when you need to print or vice versa. If you do really need to use both PLIP and LP, try the following patches.

8.1 PLIP and LP together on the same port.

If for some reason you wish PLIP and LP supported directly by the kernel, you can try these patches.

You must modify the following pieces of code, but backup the files before:


******** modifications to linux/drivers/char/lp.c ***********************
struct lp_struct lp_table[] = {
        { 0x3bc, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL,
NULL, },
/*      { 0x378, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL,
NULL, },
        { 0x278, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL,
NULL, },
*/
};
#define LP_NO 1

******** modifications to linux/drivers/net/Space.c ********************
#if defined(PLIP) || defined(CONFIG_PLIP)
    extern int plip_init(struct device *);
    static struct device plip2_dev = {
        "plip2", 0, 0, 0, 0, 0x278, 2, 0, 0, 0, NEXT_DEV, plip_init, };
    static struct device plip1_dev = {
        "plip1", 0, 0, 0, 0, 0x378, 7, 0, 0, 0, &plip2_dev, plip_init, };
/*    static struct device plip0_dev = {
        "plip0", 0, 0, 0, 0, 0x3BC, 5, 0, 0, 0, &plip1_dev, plip_init, };
*/
#   undef NEXT_DEV
#   define NEXT_DEV     (&plip1_dev)
#endif  /* PLIP */

Of course there is the standard disclaimer: I received these patches and I put them "as I got them". This means that you try them at your own risk. Anyway, your biggest trouble should be only restore the original files and recompile.

8.2 PLIP and LP on different ports.

If you have at least 2 parallel ports you can try these patches, that should allow you to use PLIP on a port and LP on the other.

  1. Comment out one line in kernel source file, drivers/char/lp.c.
    struct lp_struct lp_table[] = {
    { 0x3bc, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, },
    { 0x378, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, },
    /* { 0x278, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, }, */
    }; 
        3 -> 2
    

  2. Kernel configuration
    PLIP (parallel port) support (CONFIG_PLIP) [n] y
    
    Parallel Printer support [y] y
    
  3. Kernel message at startup
    lp1 at 0x0378, using polling driver
    .....
    NET3 PLIP version 2.0 gniibe@mri.co.jp
    plip2: Parallel port at 0x278, using assigned IRQ 5.
    

Again the standard disclaimer, like section 8.1.


Next Previous Contents
Copyright © 2010-2024 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout