>
> On Wed, 09 Feb 2000, Byron A Jeff wrote:
>
> > The 2.2.x kernel does dynamic parallel port numbers starting at 0.
> >
> > A quick fix without recompiling is to link /dev/lp1 to /dev/lp0 then configure
> > the picprg2.2 to use lp1.
>
> yes, this is one problem. But another one is that i can't recompile the source,
> because the lp.h with some structures has changed from 2.0.x to 2.2.x
I remember that now. It was a while ago since I worked on it. The 2.2 parport
stuff has completely changed the nature of accessing the parallel ports
using the lp_struct defined in /usr/include/linux/lp.h.
I simply faked it out by adding my own structure and defining my own
LP_B macro that accomplished the same task. Also you get uint defined
you need to include the file sys/types.h.
I replaced the lp_table definition with the following code :
-------------------------------------------------------------
58,61c58,68
< 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, },
---
{Quote hidden}>
> struct my_lp_struct {
> unsigned int base;
> } ;
>
> #define LP_B(x) (lp_table[x].base)
>
> struct my_lp_struct lp_table[] = {
> { 0x3bc},
> { 0x378},
> { 0x278},
62a70
>
8a9
> #include <sys/types.h>
-----------------------------------------------------------------------
Now honestly it still isn't right due to dynamic ioport assignment that
the 2.2 kernel does. The next thing to do is to actually open each of
/proc/parport/N/hardware files and get the base I/O port from there and
fill the lp_table values from it. It's another 10 minutes work, but it's
not 10 minutes that I've taken the time to do.
Hope this helps,
BAJ
>
> Martin
>