summaryrefslogtreecommitdiff
path: root/com32/lib/pci/scan.c
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-03-13 23:38:39 +0100
committerErwan Velu <erwan.velu@free.fr>2009-03-13 23:38:39 +0100
commit56bd7c3ec4446d237f82ede9928ccff075d47041 (patch)
tree4ac2fe2a269543504ae19d832e55a2f68ea28050 /com32/lib/pci/scan.c
parent662e44df5fefa9da266941b63557c55286637a29 (diff)
downloadsyslinux-56bd7c3ec4446d237f82ede9928ccff075d47041.tar.gz
hdt: Adding legacy IRQ stuff
In the cli mode, the pci context feature the following : pci> show irq Under cli, "pci> show device <x>" display the IRQ when device features one. The menu mode behave the same way.
Diffstat (limited to 'com32/lib/pci/scan.c')
-rw-r--r--com32/lib/pci/scan.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c
index cfd9e654..0c521007 100644
--- a/com32/lib/pci/scan.c
+++ b/com32/lib/pci/scan.c
@@ -83,7 +83,7 @@ int get_module_name_from_pci_ids(struct pci_domain *domain, char *modules_pcimap
char sub_vendor_id[16];
char sub_product_id[16];
FILE *f;
- struct pci_device *dev;
+ struct pci_device *dev=NULL;
/* Intializing the linux_kernel_module for each pci device to "unknown" */
/* adding a dev_info member if needed */
@@ -512,6 +512,33 @@ struct pci_domain *pci_scan(void)
return NULL;
}
+/* gathering additional configuration*/
+void gather_additional_pci_config(struct pci_domain *domain)
+{
+ struct pci_bus *bus = NULL;
+ struct pci_slot *slot = NULL;
+ unsigned int nbus, ndev, nfunc, maxfunc;
+ pciaddr_t a;
+ int cfgtype;
+ cfgtype = pci_set_config_type(PCI_CFG_AUTO);
+ (void)cfgtype;
+
+ for (nbus = 0; nbus < MAX_PCI_BUSES; nbus++) {
+ bus = NULL;
+
+ for (ndev = 0; ndev < MAX_PCI_DEVICES; ndev++) {
+ maxfunc = 1; /* Assume a single-function device */
+ slot = NULL;
+
+ for (nfunc = 0; nfunc < maxfunc; nfunc++) {
+ a = pci_mkaddr(nbus, ndev, nfunc, 0);
+ domain->bus[nbus]->slot[ndev]->func[nfunc]->irq = pci_readb(a + 0x3c);
+ }
+ }
+ }
+}
+
+
void free_pci_domain(struct pci_domain *domain)
{
struct pci_bus *bus;