From 39e6971cba818b476ded579b3582f0d2dc1c3176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Fri, 8 Oct 2004 21:27:27 +0000 Subject: [PATCH] Only do the geometry translations on ad* devices, other devices seems to have their own way of life. Those other devices translations should be moved here as well. --- sys/geom/geom_pc98.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/sys/geom/geom_pc98.c b/sys/geom/geom_pc98.c index 355e121f8ae..9551b3f62e3 100644 --- a/sys/geom/geom_pc98.c +++ b/sys/geom/geom_pc98.c @@ -258,24 +258,28 @@ 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; + if (!strncmp(gp->name, "ad", 2)) { + u_int total_secs = cp->provider->mediasize/sectorsize; + + if (total_secs < 17*8*65535) { + fwsectors = 17; + fwheads = 8; + } + else if (total_secs < 63*16*65535) { + if (fwsectors > 63) + fwsectors = 63; + if (fwheads > 16) + fwheads = 16; + } + else if (total_secs < 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)