From: Philip Homburg Date: Wed, 12 Apr 2006 11:18:13 +0000 (+0000) Subject: Do not record BARs for IDE controllers in compatibility mode. X-Git-Tag: v3.1.2a~26 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=2dc693cfe52546cac3c79e792ce5948cc508093d;p=minix.git Do not record BARs for IDE controllers in compatibility mode. --- diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d93ce70e8..7ef90f9c2 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -912,13 +912,62 @@ int devind; PRIVATE void record_bars(devind) int devind; { - int i, reg, prefetch, type; + int i, j, reg, prefetch, type, clear_01, clear_23, pb_nr; u32_t bar, bar2; for (i= 0, reg= PCI_BAR; reg <= PCI_BAR_6; i++, reg += 4) { record_bar(devind, i); } + + /* Special case code for IDE controllers in compatibility mode */ + if (pcidev[devind].pd_baseclass == PCI_BCR_MASS_STORAGE && + pcidev[devind].pd_subclass == PCI_MS_IDE) + { + /* IDE device */ + clear_01= 0; + clear_23= 0; + if (!(pcidev[devind].pd_infclass & PCI_IDE_PRI_NATIVE)) + { + if (debug) + { + printf( + "primary channel is not in native mode, clearing BARs 0 and 1\n"); + } + clear_01= 1; + } + if (!(pcidev[devind].pd_infclass & PCI_IDE_SEC_NATIVE)) + { + if (debug) + { + printf( + "primary channel is not in native mode, clearing BARs 2 and 3\n"); + } + clear_23= 1; + } + + j= 0; + for (i= 0; i