RE: Passing user-space addr. to PCI driver?

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

 



On Thu, 2006-01-12 at 11:25 -0500, Medeiros Edward M NPRI wrote:
[...]
> Thank you for your reply.  I am not implementing either a 
> "block" or "char" driver but rather a PCI device driver 

I fear/think you must since you probably want to deliver that data in
user-space (and since you want ot use copy_to_user(), the destination
*is* the user-space).

> based on "pci_skel.c" from the "Linux Device Drivers, 
> 3rd edition" book.  "pci_skel.c" has "probe()", 
> "remove()", "init()", and "exit()" functions only 
> and no "ioctl" functionality.  It is unclear to me 
> how I can use a function like "copy_to_user()" 
> that requires a user-space destination address 
> with this type of driver.....Any suggestions?

Ah, at that level (that means: at the lower part of your driver -
user-space is on top of the upper part).
I never really programmed PCI stuff but from the struct pci_driver
decalartion as in
http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/pci.h#L663
you kave just some "basic" infrastructure to start and stop the
PCI card which is controlled by your driver.
The interface at this low-level is just used by a char/block driver
to manage the PCI card with probing etc.
If, how and how much data a given PCI card delivers or accepts
and what must be done to access that data depends completely on
the given PCI card (usually you have I/O ports or memory areas to
read from and/or write to - either via DMA or directly or God knows what
hardware developer are creating).
So at that level you have at most kernel space pointers. The user-space
pointers probably come from a char or block driver.
Perhaps you want to reread the first chapters about his "skull"
driver to find the stuff I'm talking about.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


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