PCI Devices

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

 



I have a PCI device installed and its driver loaded in the system. Is it legal for me to (from
another driver) access this device configuration and IO space ? If this is OK, than do I need some
setup before I can do this.

For example, in the original driver, steps are

- pci_read_config_byte(pdev, PCI_CLASS_PROG, &tmp8);
- pci_enable_device(pdev);
- pci_request_regions(pdev, DRV_NAME);
- pci_set_dma_mask(pdev, ATA_DMA_MASK);
- pci_set_master(pdev);

And, I have following steps in my driver

- my_dev = (struct pci_dev *) pci_find_device(VENDOR, DEVICE, NULL)
- pci_read_config_byte(sata_dev, PCI_CLASS_PROG, &tmp8);
- theOffset = pci_resource_start(my_dev, 0);
- STATUS = pci_resource_start(my_dev, 1) | 2;
- outb_p(0, theOffset + FEATURE1);
- outb_p(0, theOffset + FEATURE2);

Do I need to enable PCI device in my driver ? am I doing this correctly ?

Where can I read more about PCI bus and programming pci drivers, what is the good source ?

Usman Ansari
---
http://pacifica.org/

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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