summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2012-11-13 19:05:18 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2012-11-13 19:05:18 +0100
commit4d411e0dd94cea2b71e6c526399ef96cdf3cb364 (patch)
tree2a54177f794120ae9b3c8df446f560c5f7325b45
parent4a39fdf798b4f8f6dadc7109f04587dced12b5a9 (diff)
downloadipecamera-4d411e0dd94cea2b71e6c526399ef96cdf3cb364.tar.gz
ipecamera-4d411e0dd94cea2b71e6c526399ef96cdf3cb364.tar.bz2
ipecamera-4d411e0dd94cea2b71e6c526399ef96cdf3cb364.tar.xz
ipecamera-4d411e0dd94cea2b71e6c526399ef96cdf3cb364.zip
Provide information on device location (bus,device,function)
-rw-r--r--cli.c3
-rw-r--r--driver/ioctl.c1
-rw-r--r--driver/pciDriver.h1
3 files changed, 4 insertions, 1 deletions
diff --git a/cli.c b/cli.c
index 4bff445..42bea5e 100644
--- a/cli.c
+++ b/cli.c
@@ -507,7 +507,8 @@ void List(pcilib_t *handle, pcilib_model_description_t *model_info, const char *
void Info(pcilib_t *handle, pcilib_model_description_t *model_info) {
const pcilib_board_info_t *board_info = pcilib_get_board_info(handle);
- printf("Vendor: %x, Device: %x, Interrupt Pin: %i, Interrupt Line: %i\n", board_info->vendor_id, board_info->device_id, board_info->interrupt_pin, board_info->interrupt_line);
+ printf("Vendor: %x, Device: %x, Bus: %x, Slot: %x, Function: %x\n", board_info->vendor_id, board_info->device_id, board_info->bus, board_info->slot, board_info->func);
+ printf(" Interrupt - Pin: %i, Line: %i\n", board_info->interrupt_pin, board_info->interrupt_line);
List(handle, model_info, (char*)-1, 0);
}
diff --git a/driver/ioctl.c b/driver/ioctl.c
index 43a3cf7..2d4af73 100644
--- a/driver/ioctl.c
+++ b/driver/ioctl.c
@@ -150,6 +150,7 @@ static int ioctl_pci_info(pcidriver_privdata_t *privdata, unsigned long arg)
pci_info.bus = privdata->pdev->bus->number;
pci_info.slot = PCI_SLOT(privdata->pdev->devfn);
pci_info.devfn = privdata->pdev->devfn;
+ pci_info.func = PCI_FUNC(privdata->pdev->devfn);
if ((ret = pci_read_config_byte(privdata->pdev, PCI_INTERRUPT_PIN, &(pci_info.interrupt_pin))) != 0)
return ret;
diff --git a/driver/pciDriver.h b/driver/pciDriver.h
index 159f6ad..d548765 100644
--- a/driver/pciDriver.h
+++ b/driver/pciDriver.h
@@ -170,6 +170,7 @@ typedef struct {
unsigned short device_id;
unsigned short bus;
unsigned short slot;
+ unsigned short func;
unsigned short devfn;
unsigned char interrupt_pin;
unsigned char interrupt_line;