Re: User mode drivers: part 2: PCI device handling (patch 1/2 for 2.6.11)

From: Jesse Barnes
Date: Fri Mar 11 2005 - 11:50:02 EST

On Friday, March 11, 2005 7:21 am, Greg KH wrote:
> > The only call that would go is usr_pci_open() -- you'd still need
> > usr_pci_map()
> see mmap(2)
> > , usr_pci_unmap()
> see munmap(2)

Aren't those different cases though? E.g. you might have a buffer in userland
that you want to DMA to a card, sure you can mmap the registers to program
the DMA, but you need a way to pin the memory and get the bus address to send
down, right?

> In fact, both of the above can be done today from /proc/bus/pci/ right?
> > and usr_pci_get_consistent().
> Hm, this one might be different. How about just opening and mmap a new
> file for the pci device for this?

New syscalls seem like the cleanest solution. For basic, non-dma programming
though, I'd suggest just using sysfs, since all the PCI resources are
exported there; you can mmap them and do simple programming that way.

As for the idea of userland drivers in general, I'm not sure I like it. I'm
afraid it will just encourage more undebuggable, x86 binary blobs (or big
source code blobs with their own bridge drivers like X) that people are
forced to run to get their hardware to work...

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at