mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
remove hardcoded pcie device id in pci.cpp
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
parent
8008346804
commit
1157ce2996
1 changed files with 8 additions and 1 deletions
|
@ -393,7 +393,14 @@ bool Device::attachDriver(const std::string &driver) const
|
|||
bool Device::readHostBar(uint32_t &bar) const
|
||||
{
|
||||
unsigned long long start, end, size, flags;
|
||||
FILE *file = fopen("/sys/bus/pci/devices/0000:88:00.0/resource", "r");
|
||||
char *path = NULL;
|
||||
if (asprintf(&path, "%s/bus/pci/devices/%04x:%02x:%02x.%x/resource", SYSFS_PATH,
|
||||
slot.domain, slot.bus, slot.device, slot.function) == -1)
|
||||
{
|
||||
log->error("could not allocate memory for path");
|
||||
return false;
|
||||
}
|
||||
FILE *file = fopen(path, "r");
|
||||
if (!file)
|
||||
{
|
||||
log->error("error opening resource file");
|
||||
|
|
Loading…
Add table
Reference in a new issue