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.
This commit is contained in:
parent
085a2b4010
commit
6c35773729
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user