From f74abb9b6e332f32005a7f8c108f7292b35d5452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Mon, 19 Mar 2001 13:31:58 +0000 Subject: [PATCH] Try not to engage to ATA channels that are disabled by the BIOS. --- sys/dev/ata/ata-pci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 280c476b7d9b..4968fd948cea 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -245,6 +245,11 @@ ata_pci_attach(device_t dev) subclass = pci_get_subclass(dev); cmd = pci_read_config(dev, PCIR_COMMAND, 4); + if (!(cmd & PCIM_CMD_PORTEN)) { + device_printf(dev, "ATA channel disabled by BIOS\n"); + return 0; + } + /* is busmastering supported ? */ if ((cmd & (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN)) == (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN)) {