[no subject]

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

 




Hi,
   Thanks for the early reply.
	The error message I get is "dereferencing pointer to incomplete
type"
	hello Mouw, do I really need to configure the device? I just want
to read what's there in the configuration space of the device.I think
the bios must have taken care of allocating irq etc .Infact my 
'lspci' lists that device

thanks in advance
gcr

	



On Mon, 17 Sep 2001, Erik Mouw wrote:

> On Mon, Sep 17, 2001 at 07:47:19PM -0500, Ravindra G C wrote:
> > 	I am trying to write a module to scan PCI devices based on Vendor
> > Id and Device Id. I am trying to find the device (returned by
> > pci_find_device) and  access the pci_dev fields(like
> > irq). 
> > 	Compilations is giving problems.
> > 
> > 
> > CODE goes here..
> >   	struct pci_dev *d=NULL;
> > 	int irq;
> >       do{
> >                 d=(struct pci_dev*)pci_find_device(VENDOR_ID,DEVICE_ID,d);
> 
> No need to cast this, pci_find_device() returns a struct pci_dev
> pointer.
> 
> >                 count++;
> >         } while (d!=NULL);
> 
> I think you have to configure the device first over here, otherwise it
> doesn't even have an interrupt. See Documentation/pci.txt.
> 
> > 	irq= d->irq; // Compilation error here
> 
> Oh, and *always* compile with "-O2" or the compile phase *will* fail.
> 
> 
> Erik
> 
> -- 
> J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
> of Electrical Engineering, Faculty of Information Technology and Systems,
> Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
> Phone: +31-15-2783635  Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
> WWW: http://www-ict.its.tudelft.nl/~erik/
> -
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> IRC Channel:   irc.openprojects.net / #kernelnewbies
> Web Page:      http://www.kernelnewbies.org/
> 

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux