Fixed calculation of the number of cylinders. wdp_cylinders (was
wdp_fixedcyl) gives it directly. wdp_removedcyl is "reserved" except in ancient ATA-1 drafts and shouldn't be added. This fixes PR 1288. Changed some fields and comments in struct wdparams to match a less- ancient ATA draft. Fixed bit number for `rdy' in status string.
This commit is contained in:
parent
7dad0d7ef9
commit
5610112b22
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
|
||||
* $Id: wd.c,v 1.107 1996/05/02 10:43:10 phk Exp $
|
||||
* $Id: wd.c,v 1.108 1996/05/03 14:57:27 phk Exp $
|
||||
*/
|
||||
|
||||
/* TODO:
|
||||
@ -1617,15 +1617,14 @@ failed:
|
||||
#ifdef WDDEBUG
|
||||
printf(
|
||||
"\nwd(%d,%d): wdgetctlr: gc %x cyl %d trk %d sec %d type %d sz %d model %s\n",
|
||||
du->dk_ctrlr, du->dk_unit, wp->wdp_config,
|
||||
wp->wdp_fixedcyl + wp->wdp_removcyl, wp->wdp_heads,
|
||||
wp->wdp_sectors, wp->wdp_cntype, wp->wdp_cnsbsz,
|
||||
wp->wdp_model);
|
||||
du->dk_ctrlr, du->dk_unit, wp->wdp_config, wp->wdp_cylinders,
|
||||
wp->wdp_heads, wp->wdp_sectors, wp->wdp_buffertype,
|
||||
wp->wdp_buffersize, wp->wdp_model);
|
||||
#endif
|
||||
|
||||
/* update disklabel given drive information */
|
||||
du->dk_dd.d_secsize = DEV_BSIZE;
|
||||
du->dk_dd.d_ncylinders = wp->wdp_fixedcyl + wp->wdp_removcyl /*+- 1*/ ;
|
||||
du->dk_dd.d_ncylinders = wp->wdp_cylinders; /* +- 1 */
|
||||
du->dk_dd.d_ntracks = wp->wdp_heads;
|
||||
du->dk_dd.d_nsectors = wp->wdp_sectors;
|
||||
du->dk_dd.d_secpercyl = du->dk_dd.d_ntracks * du->dk_dd.d_nsectors;
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)wdreg.h 7.1 (Berkeley) 5/9/91
|
||||
* $Id: wdreg.h,v 1.10 1995/11/04 17:07:58 bde Exp $
|
||||
* $Id: wdreg.h,v 1.11 1996/01/28 22:16:20 wollman Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -71,7 +71,7 @@
|
||||
#define WDCS_INDEX 0x02 /* Index pulse from selected drive */
|
||||
#define WDCS_ERR 0x01 /* Error detect bit. */
|
||||
|
||||
#define WDCS_BITS "\020\010busy\006rdy\006wrtflt\005seekdone\004drq\003ecc_cor\002index\001err"
|
||||
#define WDCS_BITS "\020\010busy\007rdy\006wrtflt\005seekdone\004drq\003ecc_cor\002index\001err"
|
||||
#define WDERR_ABORT 0x04
|
||||
|
||||
#define WDERR_BITS "\020\010badblk\007uncorr\006id_crc\005no_id\003abort\002tr000\001no_dam"
|
||||
@ -111,23 +111,21 @@
|
||||
*/
|
||||
struct wdparams {
|
||||
/* drive info */
|
||||
short wdp_config; /* general configuration */
|
||||
short wdp_fixedcyl; /* number of non-removable cylinders */
|
||||
short wdp_removcyl; /* number of removable cylinders */
|
||||
short wdp_config; /* general configuration bits */
|
||||
short wdp_cylinders; /* number of cylinders */
|
||||
short wdp_reserved;
|
||||
short wdp_heads; /* number of heads */
|
||||
short wdp_unfbytespertrk; /* number of unformatted bytes/track */
|
||||
short wdp_unfbytes; /* number of unformatted bytes/sector */
|
||||
short wdp_sectors; /* number of sectors */
|
||||
short wdp_minisg; /* minimum bytes in inter-sector gap*/
|
||||
short wdp_minplo; /* minimum bytes in postamble */
|
||||
short wdp_vendstat; /* number of words of vendor status */
|
||||
short wdp_sectors; /* number of sectors per track */
|
||||
short wdp_vendorunique[3];
|
||||
/* controller info */
|
||||
char wdp_cnsn[20]; /* controller serial number */
|
||||
short wdp_cntype; /* controller type */
|
||||
char wdp_serial[20]; /* serial number */
|
||||
short wdp_buffertype; /* buffer type */
|
||||
#define WDTYPE_SINGLEPORTSECTOR 1 /* single port, single sector buffer */
|
||||
#define WDTYPE_DUALPORTMULTI 2 /* dual port, multiple sector buffer */
|
||||
#define WDTYPE_DUALPORTMULTICACHE 3 /* above plus track cache */
|
||||
short wdp_cnsbsz; /* sector buffer size, in sectors */
|
||||
short wdp_buffersize; /* buffer size, in 512-byte units */
|
||||
short wdp_necc; /* ecc bytes appended */
|
||||
char wdp_rev[8]; /* firmware revision */
|
||||
char wdp_model[40]; /* model name */
|
||||
|
Loading…
x
Reference in New Issue
Block a user