tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] pcictl: simplify its usage



On Thursday 04 June 2009 12:51:17 Manuel Bouyer wrote:
> On Thu, Jun 04, 2009 at 12:37:30PM +0200, Christoph Egger wrote:
> > > I meant, a command to pcictl (like list and dump, something like
> > > listbus)
> >
> > It wouldn't work that way.
> > The functionality provided by pcictl is limited by the device file.
> > For example, /dev/pci3 only lets it operate with devices attached on
> > pci3. I need pcictl to operate on *all* devices therefore I had to fold
> > the pci device files into one. This is the main functional change from
> > the kernel side.
>
> You could have a /dev/pci node which lets you operate on all busses,

This is what the patch does. Since pcictl (list|dump) allow to specify the bus
via -b  , it makes the other /dev/pci* superflous.

> and/or get the list of busses,

Something like this ?

     PCIDEVS=""
     for i in `pcictl pci0 listbus`
     do
                 PCIDEVS="${PCIDEVS} `pcictl pci0 list -b i`"
     done

With my patch I get this with a simple

    PCIDEVS=`pcictl list`

> and the /dev/pci[0-9] nodes for backward compatibility.

The number of available pci device files differ across the ports.
Some ports only have pci0 , other have pci0-3 , etc.

> I didn't notice there were kernel changes.

That's why I'm cross-posting to tech-userlevel *and* tech-kern.

> You need to keep the /dev/pci[0-9] nodes for backward compatibility anyway.

For how long? Everytime you are speaking about backward compatibility,
it sounds like "keep it forever".

> And you also need to patch Xorg and Xfree which also use the /dev/pci[0-9]
> interface.

Shouldn't be hard once I found the right source file.

> There is probably other programs in pkgsrc which do the same.

Any examples? sysutils/libpciaccess uses /dev/mem

> > > > Compile it with COMPAT50 #defined and it understands the old syntax
> > > > as well.
> > >
> > > Do you intend to have COMPAT50 defined by default ?
> >
> > This is a good point to turn into a survey.
> > I will do what people agree with.
> > If the answer is yes, should I define COMPAT50 in the pcictl.c source or
> > in the Makefile ?
>
> I don't think a compile-time option is a good way to handle this.

Noted.

Christoph


Home | Main Index | Thread Index | Old Index