uio_pci_generic driver
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 34 lines · On Tue, Mar 20, 2012 at 09:56:03PM +0400, [email protected] wrote:
Quoted 33 lines
Hello!
I have a question aboutuio_pci_genericdriver. I'm trying to use it in my
project, but have no luck.
There are very little information on the subject. If you have a few minutes, I would like to ask a few questions.
I need tommap()memory of my board to work with it. I did# modprobe uio_pci_generic # echo "xxxx xxxx" > /sys/bus/pci/drivers/uio_pci_generic/new_idFiles in
/sys/class/uio/uio0appears, but there no directory named/sys/class/uio/uio0/maps/.
Anyway I tryed to mmap with code:#include <
sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>#include <
sys/mman.h>
#include <stdio.h>int
main(){ int fd = open("/dev/uio0", O_RDWR | O_SYNC); printf("fd = %d\n", fd); void *addr = mmap(NULL, 1024, PROT_READ, MAP_SHARED, fd, 0); printf("addr = %p\n", addr); }Ofcourse,
mmap()failes with error "Invalid argument". Nothing criminal in
dmesg and any other hints of error.
Quoted 8 lines
Quoted 2 lines
--
DmitriyMap memory through
/sys/bus/pci/devices/......Also copy questions to mailing lists please.
Thanks, it works now.
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <stdio.h>
int main() {
int fd =
open("/sys/class/pci_bus/0000:03/device/0000:03:00.0/resource5",
O_RDWR | O_SYNC);
printf("fd = %d\n", fd);
void *addr = mmap(NULL, 512, PROT_READ, MAP_SHARED, fd, 0);
if(addr == MAP_FAILED) {
perror("mmap");
}
else {
printf("addr = %p\n", addr);
}
}May be its time to add some hints in documentation? :-)
Quoted 65 lines · On Tue, Mar 20, 2012 at 10:48:25PM +0400, [email protected] wrote:
Quoted 34 lines · On Tue, Mar 20, 2012 at 09:56:03PM +0400, [email protected] wrote:
Quoted 33 lines
Hello!
I have a question aboutuio_pci_genericdriver. I'm trying to use it in my
project, but have no luck.
There are very little information on the subject. If you have a few minutes, I would like to ask a few questions.
I need tommap()memory of my board to work with it. I did# modprobe uio_pci_generic # echo "xxxx xxxx" > /sys/bus/pci/drivers/uio_pci_generic/new_idFiles in
/sys/class/uio/uio0appears, but there no directory named/sys/class/uio/uio0/maps/.
Anyway I tryed to mmap with code:#include <
sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>#include <
sys/mman.h>
#include <stdio.h>int
main(){ int fd = open("/dev/uio0", O_RDWR | O_SYNC); printf("fd = %d\n", fd); void *addr = mmap(NULL, 1024, PROT_READ, MAP_SHARED, fd, 0); printf("addr = %p\n", addr); }Ofcourse,
mmap()failes with error "Invalid argument". Nothing criminal in
dmesg and any other hints of error.Quoted 8 lines
Quoted 2 lines
--
DmitriyMap memory through
/sys/bus/pci/devices/......Also copy questions to mailing lists please.
Thanks, it works now.
#include <
sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>#include <
sys/mman.h>
#include <stdio.h>int
main(){
int fd =
open("/sys/class/pci_bus/0000:03/device/0000:03:00.0/resource5",O_RDWR | O_SYNC); printf("fd = %d\n", fd); void *addr = mmap(NULL, 512, PROT_READ, MAP_SHARED, fd, 0); if(addr == MAP_FAILED) { perror("mmap"); } else { printf("addr = %p\n", addr); } }
Quoted 1 line
May be its time to add some hints in documentation? :-)
Good idea. Michael, are you in the mood to hack something up for Documentation/DocBook/uio-howto.tmpl ?
Thanks,
Hans
Quoted 66 lines · Hans J. Koch
Quoted 65 lines · On Tue, Mar 20, 2012 at 10:48:25PM +0400, [email protected] wrote:
Quoted 34 lines · On Tue, Mar 20, 2012 at 09:56:03PM +0400, [email protected] wrote:
Quoted 33 lines
Hello!
I have a question aboutuio_pci_genericdriver. I'm trying to use it in my
project, but have no luck.
There are very little information on the subject. If you have a few minutes, I would like to ask a few questions.
I need tommap()memory of my board to work with it. I did# modprobe uio_pci_generic # echo "xxxx xxxx" > /sys/bus/pci/drivers/uio_pci_generic/new_idFiles in
/sys/class/uio/uio0appears, but there no directory named/sys/class/uio/uio0/maps/.
Anyway I tryed to mmap with code:#include <
sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>#include <
sys/mman.h>
#include <stdio.h>int
main(){ int fd = open("/dev/uio0", O_RDWR | O_SYNC); printf("fd = %d\n", fd); void *addr = mmap(NULL, 1024, PROT_READ, MAP_SHARED, fd, 0); printf("addr = %p\n", addr); }Ofcourse,
mmap()failes with error "Invalid argument". Nothing criminal in
dmesg and any other hints of error.Quoted 8 lines
Quoted 2 lines
--
DmitriyMap memory through
/sys/bus/pci/devices/......Also copy questions to mailing lists please.
Thanks, it works now.
#include <
sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>#include <
sys/mman.h>
#include <stdio.h>int
main(){
int fd =
open("/sys/class/pci_bus/0000:03/device/0000:03:00.0/resource5",O_RDWR | O_SYNC); printf("fd = %d\n", fd); void *addr = mmap(NULL, 512, PROT_READ, MAP_SHARED, fd, 0); if(addr == MAP_FAILED) { perror("mmap"); } else { printf("addr = %p\n", addr); } }
Quoted 7 lines
Quoted 1 line
May be its time to add some hints in documentation? :-)
Good idea. Michael, are you in the mood to hack something up for
Documentation/DocBook/uio-howto.tmpl?Thanks,
Hans
I'll see what can be done.