add helper functions to determine if the pci device use MMIO or IO ports

This commit is contained in:
Stefan Lankes 2014-12-19 11:35:24 +01:00
parent 75b39829f8
commit dabd33f37c
2 changed files with 7 additions and 2 deletions

View file

@ -42,11 +42,10 @@ extern "C" {
#endif
typedef struct {
uint32_t slot, bus;
uint8_t slot, bus, irq;
uint32_t base[6];
uint32_t size[6];
uint8_t type[6];
uint8_t irq;
} pci_info_t;
/** @brief Initialize the PCI environment
@ -68,11 +67,13 @@ int pci_init(void);
*/
int pci_get_device_info(uint32_t vendor_id, uint32_t device_id, pci_info_t* info);
#ifdef WITH_PCI_NAMES
/** @brief Print information of existing pci adapters
*
* @return 0 in any case
*/
int print_pci_adapters(void);
#endif
#ifdef __cplusplus
}

View file

@ -34,7 +34,9 @@
#ifdef CONFIG_PCI
#include <asm/pci.h>
#ifdef WITH_PCI_NAMES
#include "pcihdr.h"
#endif
/*
* PCI configuration registers
@ -173,6 +175,7 @@ int pci_get_device_info(uint32_t vendor_id, uint32_t device_id, pci_info_t* info
return -EINVAL;
}
#ifdef WITH_PCI_NAMES
int print_pci_adapters(void)
{
uint32_t slot, bus;
@ -216,5 +219,6 @@ int print_pci_adapters(void)
return 0;
}
#endif
#endif