diff options
author | sos <sos@FreeBSD.org> | 2004-10-07 17:37:09 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2004-10-07 17:37:09 +0000 |
commit | 058a8fa0b8d64f4e20b3b2576702171acacabc42 (patch) | |
tree | 17f8420f709854f556957da9885e99ea7cfb91b3 | |
parent | 0d30f6aba945db1c6c52389c46ab66f602652ddd (diff) | |
download | FreeBSD-src-058a8fa0b8d64f4e20b3b2576702171acacabc42.zip FreeBSD-src-058a8fa0b8d64f4e20b3b2576702171acacabc42.tar.gz |
Move the PC98 specific geometry "gunk" to geom_pc98.c where it belongs.
This also adds support for bigger disks on the controller I have access to,
and maybe others if I understood the adhoc methods used on those.
Those with more PC98 bigdrive controllers it is hereby invited to add/fix
support for those in geom_pc98.c and not using #ifdef PC98 all over the place.
-rw-r--r-- | sys/dev/ata/ata-all.h | 3 | ||||
-rw-r--r-- | sys/dev/ata/ata-cbus.c | 2 | ||||
-rw-r--r-- | sys/dev/ata/ata-disk.c | 6 | ||||
-rw-r--r-- | sys/geom/geom_pc98.c | 19 |
4 files changed, 22 insertions, 8 deletions
diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h index e12b579..28d36c8 100644 --- a/sys/dev/ata/ata-all.h +++ b/sys/dev/ata/ata-all.h @@ -343,8 +343,7 @@ struct ata_channel { int flags; /* channel flags */ #define ATA_NO_SLAVE 0x01 #define ATA_USE_16BIT 0x02 -#define ATA_USE_PC98GEOM 0x04 -#define ATA_ATAPI_DMA_RO 0x08 +#define ATA_ATAPI_DMA_RO 0x04 #define ATA_48BIT_ACTIVE 0x10 #define ATA_IMMEDIATE_MODE 0x20 #define ATA_HWGONE 0x40 diff --git a/sys/dev/ata/ata-cbus.c b/sys/dev/ata/ata-cbus.c index 925b30f..5c39261 100644 --- a/sys/dev/ata/ata-cbus.c +++ b/sys/dev/ata/ata-cbus.c @@ -329,7 +329,7 @@ ata_cbussub_probe(device_t dev) ch->r_io[ATA_ALTSTAT].offset = 0; /* initialize softc for this channel */ - ch->flags |= ATA_USE_16BIT | ATA_USE_PC98GEOM; + ch->flags |= ATA_USE_16BIT; ch->locking = ctlr->locking; ch->device[MASTER].setmode = ctlr->setmode; ch->device[SLAVE].setmode = ctlr->setmode; diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 847736d..ccba1de 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -92,11 +92,7 @@ ad_attach(struct ata_device *atadev) adp->heads = atadev->param->heads; adp->sectors = atadev->param->sectors; adp->total_secs = atadev->param->cylinders * adp->heads * adp->sectors; - if (adp->device->channel->flags & ATA_USE_PC98GEOM && - adp->total_secs < 17 * 8 * 65536) { - adp->sectors = 17; - adp->heads = 8; - } + mtx_init(&adp->queue_mtx, "ATA disk bioqueue lock", NULL, MTX_DEF); bioq_init(&adp->queue); diff --git a/sys/geom/geom_pc98.c b/sys/geom/geom_pc98.c index afbc59f..355e121 100644 --- a/sys/geom/geom_pc98.c +++ b/sys/geom/geom_pc98.c @@ -258,6 +258,25 @@ g_pc98_taste(struct g_class *mp, struct g_provider *pp, int flags) sectorsize = cp->provider->sectorsize; if (sectorsize < 512) break; + if (cp->provider->mediasize/sectorsize < 17*8*65535) { + fwsectors = 17; + fwheads = 8; + } + else if (cp->provider->mediasize/sectorsize < 63*16*65535) { + if (fwsectors > 63) + fwsectors = 63; + if (fwheads > 16) + fwheads = 16; + } + else if (cp->provider->mediasize/sectorsize < 255*16*65535) { + fwsectors = 255; + if (fwheads > 16) + fwheads = 16; + } + else { + fwsectors = 255; + fwheads = 255; + } buf = g_read_data(cp, 0, 8192, &error); if (buf == NULL || error != 0) break; |