do what the comment says: move this [sun_dkioctl] to compat/sunos. use <dev/sun/disklabel.h>
This commit is contained in:
parent
cbffcd18f0
commit
abeeaf00ec
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: disksubr.c,v 1.21 1998/03/29 05:08:46 mrg Exp $ */
|
||||
/* $NetBSD: disksubr.c,v 1.22 1998/06/20 03:45:27 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Gordon W. Ross
|
||||
@ -44,13 +44,14 @@
|
||||
#include <dev/scsipi/scsipi_all.h>
|
||||
#include <dev/scsipi/scsiconf.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/autoconf.h>
|
||||
#include <machine/sun_disklabel.h>
|
||||
#include <machine/cpu.h>
|
||||
#if defined(SUN4)
|
||||
#include <machine/oldmon.h>
|
||||
#endif
|
||||
|
||||
#include <dev/sun/disklabel.h>
|
||||
|
||||
#include <sparc/dev/sbusvar.h>
|
||||
|
||||
static char *disklabel_sun_to_bsd __P((char *, struct disklabel *));
|
||||
@ -507,52 +508,6 @@ disklabel_bsd_to_sun(lp, cp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* move this to compat/sunos */
|
||||
int
|
||||
sun_dkioctl(dk, cmd, data, partition)
|
||||
struct disk *dk;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int partition;
|
||||
{
|
||||
register struct partition *p;
|
||||
|
||||
switch (cmd) {
|
||||
case DKIOCGGEOM:
|
||||
#define geom ((struct sun_dkgeom *)data)
|
||||
bzero(data, sizeof(*geom));
|
||||
geom->sdkc_ncylinders = dk->dk_label->d_ncylinders;
|
||||
geom->sdkc_acylinders = dk->dk_label->d_acylinders;
|
||||
geom->sdkc_ntracks = dk->dk_label->d_ntracks;
|
||||
geom->sdkc_nsectors = dk->dk_label->d_nsectors;
|
||||
geom->sdkc_interleave = dk->dk_label->d_interleave;
|
||||
geom->sdkc_sparespercyl = dk->dk_label->d_sparespercyl;
|
||||
geom->sdkc_rpm = dk->dk_label->d_rpm;
|
||||
geom->sdkc_pcylinders =
|
||||
dk->dk_label->d_ncylinders + dk->dk_label->d_acylinders;
|
||||
#undef geom
|
||||
break;
|
||||
case DKIOCINFO:
|
||||
/* Homey don't do DKIOCINFO */
|
||||
bzero(data, sizeof(struct sun_dkctlr));
|
||||
break;
|
||||
case DKIOCGPART:
|
||||
if (dk->dk_label->d_secpercyl == 0)
|
||||
return (ERANGE); /* XXX */
|
||||
p = &dk->dk_label->d_partitions[partition];
|
||||
if (p->p_offset % dk->dk_label->d_secpercyl != 0)
|
||||
return (ERANGE); /* XXX */
|
||||
#define part ((struct sun_dkpart *)data)
|
||||
part->sdkp_cyloffset = p->p_offset / dk->dk_label->d_secpercyl;
|
||||
part->sdkp_nsectors = p->p_size;
|
||||
#undef part
|
||||
break;
|
||||
default:
|
||||
return (-1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Search the bad sector table looking for the specified sector.
|
||||
* Return index if found.
|
||||
|
Loading…
Reference in New Issue
Block a user