summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/atapi-cd.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-12-06 00:10:13 +0000
committermav <mav@FreeBSD.org>2009-12-06 00:10:13 +0000
commit6a3018e7cff16ab166672e276b4b39154ad09739 (patch)
tree8def18d183a8f2ec2847c5ef06fe2fac081d798e /sys/dev/ata/atapi-cd.c
parent9bb92ae41af45cc801f28a880e08648aad72e241 (diff)
downloadFreeBSD-src-6a3018e7cff16ab166672e276b4b39154ad09739.zip
FreeBSD-src-6a3018e7cff16ab166672e276b4b39154ad09739.tar.gz
MFp4:
Introduce ATA_CAM kernel option, turning ata(4) controller drivers into cam(4) interface modules. When enabled, this options deprecates all ata(4) peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers (ada, cd, ...) and interfaces to be natively used instead. As side effect of this, ata(4) mode setting code was completely rewritten to make controller API more strict and permit above change. While doing this, SATA revision was separated from PATA mode. It allows DMA-incapable SATA devices to operate and makes hw.ata.atapi_dma tunable work again. Also allow ata(4) controller drivers (except some specific or broken ones) to handle larger data transfers. Previous constraint of 64K was artificial and is not really required by PCI ATA BM specification or hardware. Submitted by: nwitehorn (powerpc part)
Diffstat (limited to 'sys/dev/ata/atapi-cd.c')
-rw-r--r--sys/dev/ata/atapi-cd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index a021e00..5d0c0f7 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -126,7 +126,7 @@ acd_attach(device_t dev)
}
cdp->block_size = 2048;
device_set_ivars(dev, cdp);
- ATA_SETMODE(device_get_parent(dev), dev);
+ ata_setmode(dev);
ata_controlcmd(dev, ATA_DEVICE_RESET, 0, 0, 0);
acd_get_cap(dev);
g_post_event(acd_geom_attach, dev, M_WAITOK, NULL);
@@ -163,7 +163,7 @@ acd_reinit(device_t dev)
if (!(ch->devices & (ATA_ATAPI_MASTER << atadev->unit)))
return 1;
- ATA_SETMODE(device_get_parent(dev), dev);
+ ata_setmode(dev);
return 0;
}
@@ -1724,7 +1724,8 @@ acd_describe(device_t dev)
printf("%s %dKB buffer", comma ? "," : "", cdp->cap.buf_size);
comma = 1;
}
- printf("%s %s\n", comma ? "," : "", ata_mode2str(atadev->mode));
+ printf("%s %s %s\n", comma ? "," : "", ata_mode2str(atadev->mode),
+ ata_satarev2str(ATA_GETREV(device_get_parent(dev), atadev->unit)));
device_printf(dev, "Reads:");
comma = 0;
@@ -1874,10 +1875,11 @@ acd_describe(device_t dev)
"CDROM");
if (cdp->changer_info)
printf("with %d CD changer ", cdp->changer_info->slots);
- printf("<%.40s/%.8s> at ata%d-%s %s\n",
+ printf("<%.40s/%.8s> at ata%d-%s %s %s\n",
atadev->param.model, atadev->param.revision,
device_get_unit(ch->dev), ata_unit2str(atadev),
- ata_mode2str(atadev->mode) );
+ ata_mode2str(atadev->mode),
+ ata_satarev2str(ATA_GETREV(device_get_parent(dev), atadev->unit)));
}
}
OpenPOWER on IntegriCloud