diff options
author | sos <sos@FreeBSD.org> | 2002-12-17 16:26:22 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2002-12-17 16:26:22 +0000 |
commit | e4d7800551873bd09210020bd42e58b18482d25b (patch) | |
tree | 6f5602c61464ef855ad5c2a36cf90c143b303bb7 /sys/dev | |
parent | ebfad8464d84b3682dda610b020001446234f295 (diff) | |
download | FreeBSD-src-e4d7800551873bd09210020bd42e58b18482d25b.zip FreeBSD-src-e4d7800551873bd09210020bd42e58b18482d25b.tar.gz |
This should be the way PC98 ATA disks are seen geometry wise.
Should go into 5_0_RELEASE as well.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/ata-all.h | 7 | ||||
-rw-r--r-- | sys/dev/ata/ata-cbus.c | 2 | ||||
-rw-r--r-- | sys/dev/ata/ata-disk.c | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h index f8c3039..d32a7b6 100644 --- a/sys/dev/ata/ata-all.h +++ b/sys/dev/ata/ata-all.h @@ -213,9 +213,10 @@ struct ata_channel { int flags; /* controller flags */ #define ATA_NO_SLAVE 0x01 #define ATA_USE_16BIT 0x02 -#define ATA_ATAPI_DMA_RO 0x04 -#define ATA_QUEUED 0x08 -#define ATA_DMA_ACTIVE 0x10 +#define ATA_USE_PC98GEOM 0x04 +#define ATA_ATAPI_DMA_RO 0x08 +#define ATA_QUEUED 0x10 +#define ATA_DMA_ACTIVE 0x20 struct ata_device device[2]; /* devices on this channel */ #define MASTER 0x00 diff --git a/sys/dev/ata/ata-cbus.c b/sys/dev/ata/ata-cbus.c index f0bc10d..6a2b0a4 100644 --- a/sys/dev/ata/ata-cbus.c +++ b/sys/dev/ata/ata-cbus.c @@ -239,7 +239,7 @@ ata_cbussub_probe(device_t dev) ch->unit = i; } free(children, M_TEMP); - ch->flags |= ATA_USE_16BIT; + ch->flags |= ATA_USE_16BIT | ATA_USE_PC98GEOM; ch->intr_func = ata_cbus_intr; ch->lock_func = ata_cbus_banking; return ata_probe(dev); diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 9dc33db..b4fdbe8 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -124,6 +124,11 @@ ad_attach(struct ata_device *atadev) adp->sectors = atadev->param->sectors; adp->total_secs = atadev->param->cylinders * adp->heads * adp->sectors; adp->max_iosize = 256 * DEV_BSIZE; + if (adp->device->channel->flags & ATA_USE_PC98GEOM && + adp->total_secs < 17 * 8 * 65536) { + adp->sectors = 17; + adp->heads = 8; + } bioq_init(&adp->queue); lbasize = (u_int32_t)atadev->param->lba_size_1 | |