diff options
author | grehan <grehan@FreeBSD.org> | 2013-10-11 18:27:12 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2013-10-11 18:27:12 +0000 |
commit | e63a0d23bfc4424df90eeb5ea7a1b3f7672d1cb6 (patch) | |
tree | 1f0186d0bfc74c0d3c85611e1e8c73b0a7aca40c | |
parent | 696eae7a90c8515e50b2fdd792310b0b5776b986 (diff) | |
download | FreeBSD-src-e63a0d23bfc4424df90eeb5ea7a1b3f7672d1cb6.zip FreeBSD-src-e63a0d23bfc4424df90eeb5ea7a1b3f7672d1cb6.tar.gz |
MFC r256304
Allow the legacy CDROM device to be accessed in a FreeBSD guest, while
still using enlightened drivers for other block devices.
Approved by: re@ (gjb)
-rw-r--r-- | sys/dev/ata/ata-all.c | 2 | ||||
-rw-r--r-- | sys/dev/ata/ata-card.c | 2 | ||||
-rw-r--r-- | sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c | 30 |
3 files changed, 10 insertions, 24 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index cfd025f..4860faf 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -92,7 +92,7 @@ FEATURE(ata_cam, "ATA devices are accessed through the cam(4) driver"); int ata_probe(device_t dev) { - return 0; + return (BUS_PROBE_DEFAULT); } int diff --git a/sys/dev/ata/ata-card.c b/sys/dev/ata/ata-card.c index eb49c2c..5346b8f 100644 --- a/sys/dev/ata/ata-card.c +++ b/sys/dev/ata/ata-card.c @@ -140,7 +140,7 @@ ata_pccard_attach(device_t dev) ch-> flags |= ATA_NO_SLAVE; ata_generic_hw(dev); err = ata_probe(dev); - if (err) + if (err > 0) return (err); return (ata_attach(dev)); } diff --git a/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c b/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c index 9e5cf55..6ca0665 100644 --- a/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c +++ b/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c @@ -92,6 +92,7 @@ static int hv_check_for_hyper_v(void); static int hv_ata_pci_probe(device_t dev) { + device_t parent = device_get_parent(dev); int ata_disk_enable; ata_disk_enable = 0; @@ -102,23 +103,9 @@ hv_ata_pci_probe(device_t dev) if (!hv_check_for_hyper_v()) return (ENXIO); - if (bootverbose) - device_printf(dev, - "hv_ata_pci_probe dev_class/subslcass = %d, %d\n", - pci_get_class(dev), pci_get_subclass(dev)); - - /* is this a storage class device ? */ - if (pci_get_class(dev) != PCIC_STORAGE) + if (device_get_unit(parent) != 0 || device_get_ivars(dev) != 0) return (ENXIO); - /* is this an IDE/ATA type device ? */ - if (pci_get_subclass(dev) != PCIS_STORAGE_IDE) - return (ENXIO); - - if(bootverbose) - device_printf(dev, - "Hyper-V probe for disabling ATA-PCI, emulated driver\n"); - /* * On Hyper-V the default is to use the enlightened driver for * IDE disks. However, if the user wishes to use the native @@ -126,15 +113,14 @@ hv_ata_pci_probe(device_t dev) * hw_ata.disk_enable must be explicitly set to 1. */ if (getenv_int("hw.ata.disk_enable", &ata_disk_enable)) { - if(bootverbose) + if (bootverbose) device_printf(dev, "hw.ata.disk_enable flag is disabling Hyper-V" " ATA driver support\n"); return (ENXIO); } - if (bootverbose) - device_printf(dev, "Hyper-V ATA storage driver enabled.\n"); + device_set_desc(dev, "Hyper-V ATA storage disengage driver"); return (BUS_PROBE_VENDOR); } @@ -193,12 +179,12 @@ static device_method_t hv_ata_pci_methods[] = { devclass_t hv_ata_pci_devclass; static driver_t hv_ata_pci_disengage_driver = { - "pciata-disable", + "ata", hv_ata_pci_methods, - sizeof(struct ata_pci_controller), + 0, }; -DRIVER_MODULE(atapci_dis, pci, hv_ata_pci_disengage_driver, - hv_ata_pci_devclass, NULL, NULL); +DRIVER_MODULE(atapci_dis, atapci, hv_ata_pci_disengage_driver, + hv_ata_pci_devclass, NULL, NULL); MODULE_VERSION(atapci_dis, 1); MODULE_DEPEND(atapci_dis, ata, 1, 1, 1); |