Re: libpci and pci utilities related newbie question

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

 




On Tue, 28 Dec 2010, Guraaf wrote:
> I am looking for a solution where I don't have to reboot the PC so
> often (tens of times during a day).  Can't I connect the device and
> then run some code to make the Linux kernel detect and enable the BAR
> of our device?  I was hoping to find some documentation on using the

have you tried using the hotplug functions?  You basically want to trigger 
a bus rescan.  The hotplug functionality really describes what you need.

echo 1 > /sys/bus/pci/rescan

060 What:           /sys/bus/pci/rescan
061 Date:           January 2009
062 Contact:        Linux PCI developers <linux-pci@xxxxxxxxxxxxxxx>
063 Description:
064                 Writing a non-zero value to this attribute will
065                 force a rescan of all PCI buses in the system, and
066                 re-discover previously removed devices.
067                 Depends on CONFIG_HOTPLUG.

> PCI Support Library and examples but haven't been able to.  Any
> pointers appreciated.  Perhaps there are calls like
> pci_enable_device() or pci_find_device() etc. that I can execute in my
> code?  I can't figure out though.  I can write kernel modules as well
> as user code to get this working, i.e., I don't have any restrictions
> on whether I have root access or not.

if you build libpci with the bus mapping mode enabled, you might be able 
to force lspci with -W option to rescan.

if the rescan doesn't work you may want to fuss around with fakephp or 
faking a hotplug event.

Jesse
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux