-/* $OpenBSD: acd.c,v 1.22 1997/02/23 18:48:13 niklas Exp $ */
+/* $OpenBSD: acd.c,v 1.23 1997/03/26 01:53:49 deraadt Exp $ */
/*
* Copyright (c) 1996 Manuel Bouyer. All rights reserved.
bzero(acd->sc_dk.dk_cpulabel, sizeof(struct cpu_disklabel));
lp->d_secsize = acd->params.blksize;
-#if 0
- /* I don't think this is necessary anymore. */
- if (lp->d_secsize > 2048)
- lp->d_secsize = 2048;
-#endif
lp->d_ntracks = 1;
lp->d_nsectors = 100;
lp->d_ncylinders = (acd->params.disksize / 100) + 1;
}
acd->params.blksize = _4btol((u_int8_t*)&rdcap.blksize);
+ if (acd->params.blksize < 512 || acd->params.blksize > 2048)
+ acd->params.blksize = 2048; /* some drives lie ! */
acd->params.disksize = _4btol((u_int8_t*)&rdcap.size);
ATAPI_DEBUG_PRINT(("acd_size: %ld %ld\n", acd->params.blksize,
-/* $OpenBSD: cd.c,v 1.20 1997/01/04 08:50:20 deraadt Exp $ */
+/* $OpenBSD: cd.c,v 1.21 1997/03/26 01:53:48 deraadt Exp $ */
/* $NetBSD: cd.c,v 1.92 1996/05/05 19:52:50 christos Exp $ */
/*
bzero(cd->sc_dk.dk_cpulabel, sizeof(struct cpu_disklabel));
lp->d_secsize = cd->params.blksize;
- if (lp->d_secsize > 2048)
- lp->d_secsize = 2048;
lp->d_ntracks = 1;
lp->d_nsectors = 100;
lp->d_ncylinders = (cd->params.disksize / 100) + 1;
return 0;
blksize = _4btol(rdcap.length);
- if (blksize < 512)
+ if (blksize < 512 || blksize > 2048)
blksize = 2048; /* some drives lie ! */
cd->params.blksize = blksize;