From: Philip Homburg Date: Tue, 7 Mar 2006 14:16:13 +0000 (+0000) Subject: Fixed masks on I/O ports. X-Git-Tag: v3.1.2a~295 X-Git-Url: http://zhaoyanbai.com/repos/icons/valid-xhtml10.png?a=commitdiff_plain;h=e25dc302a905b05691e4bc049caddf529bf46075;p=minix.git Fixed masks on I/O ports. --- diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index f8168a62e..3e47ec29c 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -561,14 +561,14 @@ PRIVATE void init_params_pci(int skip) } } - base_dma = pci_attr_r32(devind, PCI_BAR_5) & 0xffffffe0; + base_dma = pci_attr_r32(devind, PCI_BAR_5) & 0xfffffffc; /* Primary channel not in compatability mode? */ if (interface & ATA_IF_NOTCOMPAT1) { u32_t base_cmd, base_ctl; - base_cmd = pci_attr_r32(devind, PCI_BAR) & 0xffffffe0; - base_ctl = pci_attr_r32(devind, PCI_BAR_2) & 0xffffffe0; + base_cmd = pci_attr_r32(devind, PCI_BAR) & 0xfffffffc; + base_ctl = pci_attr_r32(devind, PCI_BAR_2) & 0xfffffffc; if (base_cmd != REG_CMD_BASE0 && base_cmd != REG_CMD_BASE1) { init_drive(&wini[w_next_drive], base_cmd, base_ctl+PCI_CTL_OFF, @@ -578,6 +578,7 @@ PRIVATE void init_params_pci(int skip) base_dma, irq, 1, irq_hook, 1); if (w_pci_debug) printf("atapci %d: 0x%x 0x%x irq %d\n", devind, base_cmd, base_ctl, irq); + w_next_drive += 2; } else printf("atapci: ignored drives on primary channel, base %x\n", base_cmd); } else @@ -594,19 +595,20 @@ PRIVATE void init_params_pci(int skip) if (interface & ATA_IF_NOTCOMPAT2) { u32_t base_cmd, base_ctl; - base_cmd = pci_attr_r32(devind, PCI_BAR_3) & 0xffffffe0; - base_ctl = pci_attr_r32(devind, PCI_BAR_4) & 0xffffffe0; + base_cmd = pci_attr_r32(devind, PCI_BAR_3) & 0xfffffffc; + base_ctl = pci_attr_r32(devind, PCI_BAR_4) & 0xfffffffc; if (base_dma != 0) base_dma += PCI_DMA_2ND_OFF; if (base_cmd != REG_CMD_BASE0 && base_cmd != REG_CMD_BASE1) { - init_drive(&wini[w_next_drive+2], + init_drive(&wini[w_next_drive], base_cmd, base_ctl+PCI_CTL_OFF, base_dma, irq, 1, irq_hook, 2); - init_drive(&wini[w_next_drive+3], + init_drive(&wini[w_next_drive+1], base_cmd, base_ctl+PCI_CTL_OFF, base_dma, irq, 1, irq_hook, 3); if (w_pci_debug) printf("atapci %d: 0x%x 0x%x irq %d\n", devind, base_cmd, base_ctl, irq); + w_next_drive += 2; } else printf("atapci: ignored drives on secondary channel, base %x\n", base_cmd); } else @@ -618,8 +620,6 @@ PRIVATE void init_params_pci(int skip) wini[i].base_dma= base_dma+PCI_DMA_2ND_OFF; } } - - w_next_drive += 4; } }