diff options
Diffstat (limited to 'sys/dev/ata/atapi-cd.c')
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 7fd80c4..ba0c7c8 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -108,6 +108,18 @@ acd_probe(device_t dev) { struct ata_device *atadev = device_get_softc(dev); + if (atadev->type != ATA_T_ATAPI) + return (ENXIO); + + if (!(atadev->flags & ATA_D_PROBED)) { + atadev->flags |= ATA_D_PROBED; + if (ata_getparam(atadev, 1) == 0) + atadev->flags |= ATA_D_VALID; + } + + if (!(atadev->flags & ATA_D_VALID)) + return (ENXIO); + if ((atadev->param.config & ATA_PROTO_ATAPI) && (atadev->param.config & ATA_ATAPI_TYPE_MASK) == ATA_ATAPI_TYPE_CDROM) return 0; |