'\"!  pic | tbl | mmdoc
'\"macro stdmacro
.if n .pH ddi_dki.hdedata @(#)hdedata	40.9 of 10/10/89
.\" Copyright 1989 AT&T
.de IX
.ie '\\n(.z'' .tm .Index: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9	\\n%
.el \\!.IX \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
..
.nr X
.if \nX=0 .ds x} hdedata D4D "3B2" "DDI" "\&"
.if \nX=1 .ds x} hdedata D4D "3B2" "DDI"
.if \nX=2 .ds x} hdedata D4D "" "\&"
.if \nX=3 .ds x} hdedata "" "" "\&"
.TH \*(x}
.IX "\f4hdedata\fP(D4D)"
.SH NAME
\f4hdedata\f1 \- hard disk error data structure
.SH SYNOPSIS
\f4#include <sys/hdelog.h>\f1
.SH DESCRIPTION
The \f4hdedata\f1 data structure temporarily stores hard disk 
error 
information sent to an error queue.
A \f4hdedata\f1 structure
is initialized for every disk on the system by \f4hdeeqd\f1(D3D) when
the system is booted.
An error queue is also initialized
by \f4hdeeqd\f1.
.IX "\f4hdeeqd\fP(D3D)"
.P
When the disk driver finds an error, it provides \f4hdelog\f1(D3D)
.IX "\f4hdelog\fP(D3D)"
with the error information.
\f4hdelog\f1 passes the \f4hdedata\f1 structure
for the error to the error queue.  This error queue
is a queue of bad block reports that have not been
remapped.  This queue resides in the kernel and not
on the disk.
.P
After a number or errors are accumulated,
an administrator examines the list of errors collected
in the queue.  If any of the errors need to be ``fixed,'' the administrator
remaps the bad block.  Remapping means that the block address is
rewritten to a defect table on the disk.
Physical Description sector information points to this defect table.
.P
The following figure illustrates the logging of hard disk errors:
.nf
.PS 2.5
scale=100
define t157 |
[ box invis ht 32 wid 38 with .sw at 0,0
"\fH\s8\&error\f1\s0" at 19,24
"\fH\s8\&queue\f1\s0" at 19,8
] |

define t160 |
[ box invis ht 32 wid 56 with .sw at 0,0
"\fH\s8\&\f4hdedata\f1\s0" at 28,24
"\fH\s8\&structure\f1\s0" at 28,8
] |

box invis ht 128 wid 336 with .sw at 0,0
t157 with .nw at 277,118
t160 with .nw at 140,38
"\fH\s8\&driver\f1\s0" at 40,102
box ht 48 wid 80 with .nw at 0,128 
box ht 48 wid 80 with .nw at 128,128 
box ht 48 wid 80 with .nw at 128,48 
box ht 48 wid 80 with .nw at 256,128 
line -> from 80,104 to 128,104 
line -> from 208,104 to 256,104 
line <-> from 168,80 to 168,48 
"\fH\s8\&\f4hdelog\f1\s0" at 168,102
.PE
.fi
.SH STRUCTURE MEMBERS
.IX "Error Check or Correction (ECC)"
.IX "Cyclic Redundancy Check (CRC)"
.IX "ECC (Error Check or Correction)"
.IX "CRC (Cyclic Redundancy Check)"
.P
.TS
lf4p8 2 lf4p8 2 lf4p8.
o_dev_t	diskdev;	/* Major/minor disk device number */
		/* (major number for character device) */ 
char	dskserno[12];	/* Disk pack serial number (can be all zeros) */ 
daddr_t	blkaddr;	/* Physical block address */
		/* in machine-independent form */
char	readtype;	/* Error type:CRC (cyclical redundancy check) */
		/* or ECC (error check and correction) */
char	severity;	/* Severity type:  marginal or unreadable */
char	badrtcnt;	/* Number of unreadable tries */
char	bitwidth;	/* Bitwidth of corrected error: 0 if CRC */ 
time_t	timestmp;	/* Time stamp */
.TE
.P
\f3NOTE\f1:
The disk pack serial number is not currently evaluated,
but it must contain a value.
Set to all zeros.
.SH SEE ALSO
.na
\f4hdeeqd\f1(D3D),
\f4hdelog\f1(D3D)
.ad
