Basic PCI driver questions

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

 



Hello All,

 

 

I have been reading the  "Linux Device Drivers" book 3rd edition but I'm not sure how to put it all together.  I am writing a PCI device driver for a PCI board that is capable of DMA and generating interrupts.  Here are my questions:

 

  1. Is a PCI driver always the best choice for a PCI board?  Why not write a "block" driver or a "char" driver?

 

 

2.   Is there a mechanism for a user-space process to control/access  a PCI driver like the "ioctl" call for a char driver?

 

 

  1. I mentioned that my board does DMA.  I am calling "pci_alloc_consistent()"  in my "probe()" function to allow my board to DMA data into a kernel space buffer.

Then I assume that I need to call a function something like "move_to_user()" to pass the data to user-space for processing.  Is there a way to DMA directly to user-space without double buffering?

 

      4.  How can I alert a user-space process when there is new data available from the PCI board?   I was looking at the "top half" and "bottom half"  sections in the

          driver book and contemplating using a "bottom half" process to move the data to user-space but I don't know how to alert a user-space process it has

          new data in its buffer to process.    What about synchronization?   Could the function "wait_event_interruptable()"  play a role here?

 

 

     5.  Has anyone done this before?  Is there example driver source code that I might have overlooked? 

 

 

 


[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