tech-userlevel archive

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

Re: [PATCH] pcictl: simplify its usage



On Thu, Jun 04, 2009 at 03:27:15PM +0200, Christoph Egger wrote:
> 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.

But this break backward compatibility, and any software using this
interface (including software not in the NetBSD source tree)

> 
> > 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

yes

> 
> With my patch I get this with a simple
> 
>     PCIDEVS=`pcictl list`

But it breaks backward compat, this could easily be fixed by using a
command line flag for the new behavior.
Anyway breaking the pcictl command line interface is not as much a problem
as breaking the kernel ABI and API.

> 
> > 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.

Of course, this depends on what the hardware can do. 

> 
> > 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".

Yes, that's what backward compatibility is. 

> 
> > 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

Not off hand and I won't go though the whole pkgsrc to find them.
Xorg is obvisouly one of them. Maybe some software dealing with
video capture cards. There could also be third-party binary-only
softwares.

-- 
Manuel Bouyer, LIP6, Universite Paris VI.           
Manuel.Bouyer%lip6.fr@localhost
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index