enable/disable devices behavior

Tiago Vignatti vignatti at freedesktop.org
Tue May 5 21:37:01 PDT 2009


Hi,

AFAIK, the existing interface in libpciaccess to enable a device 
(pci_device_enable) deals always with I/O _and_ memory resources. But 
I'm confused with the behavior of such interface because it's not 
working as I expected. For me it has to be equivalent to do the 
following, in the regs configuration space:

     ctrl = (PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
     pci_device_cfg_write_u32(dev, ctrl, PCI_COMMAND);


Isn't it? But it's not happening that. When I call pci_device_enable (or 
just `echo 1 > enable` in device) the kernel sometimes sets only the 
PCI_COMMAND_MEMORY bit or simply does nothing. What am I missing here?

Attached, I'm sending a code that I'm using to play with this.


Cheers,

                     Tiago
-------------- next part --------------
A non-text attachment was scrubbed...
Name: enabletest.c
Type: text/x-csrc
Size: 1987 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20090506/33ec953c/attachment.c 


More information about the xorg-devel mailing list