[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: Probing PCI device..
> I have a analog data acquisition Card based on PCI. I want to write
> a driver for the same on Linux. I have some knowledge of it's working and
> also it's register details are with me. But while trying to probe it I am
> unable to sort out that, to which class I should put it in. This is
> required as one of the argument to pci_find_class asks the class of the
> card. I know the vendorid and deviceid by the help of which I may try to
> probe it(this too I haven't tried yet), but if I want to probe it by it's
> class argument then to which class does it belong. I tried to find out
> from pci.h header file but could not settle down for a class. If somebody
> has done some similar work then I would like to seek his/her help for the
> Also is there any other way to probe the PCI devices. I found a lot of
> functions in pci.h but it asks some input argument of type 'struct pci_dev
> *' to start somewhere and following this link the code will find out other
> pci devices i.e. if I want to probe all the PCI devives then what argument
> should I pass to the function pci_find_class or other probing functions so
> that I can find out all the PCI devices starting from the very first
> device in the linked list.
> Also I am unable to do the probing work in user mode as there are no
> supporting libraries for the same. All the libraries for probing PCI
> devices are part of the linux kernel. So, is it possible to do so in user
> mode, if yes how? Related links will be of great help where I can found
> some detailed stuff.
The commands 'lspci' and 'setpci' can be used to view/configure PCI device
man lspci says:
lspci - list all PCI devices
lspci is a utility for displaying information about all
PCI buses in the system and all devices connected to them.
To make use of all the features of this program, you need
to have Linux kernel 2.1.82 or newer which supports the
/proc/bus/pci interface. With older kernels, the PCI util-
ities have to use direct hardware access which is avail-
able only to root and it suffers from numerous race condi-
tions and other problems.
man setpci says:
setpci - configure PCI devices
setpci [options] devices operations...
setpci is a utility for querying and configuring PCI