diff options
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r-- | sys/arch/hp300/dev/hd.c | 76 | ||||
-rw-r--r-- | sys/arch/hp300/dev/hdvar.h | 11 |
2 files changed, 51 insertions, 36 deletions
diff --git a/sys/arch/hp300/dev/hd.c b/sys/arch/hp300/dev/hd.c index ee2086fe45b..0b6415cdfa9 100644 --- a/sys/arch/hp300/dev/hd.c +++ b/sys/arch/hp300/dev/hd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hd.c,v 1.31 2005/11/14 19:54:08 miod Exp $ */ +/* $OpenBSD: hd.c,v 1.32 2005/11/14 20:20:30 miod Exp $ */ /* $NetBSD: rd.c,v 1.33 1997/07/10 18:14:08 kleink Exp $ */ /* @@ -68,74 +68,98 @@ #include <hp300/hp300/leds.h> #endif -int hderrthresh = HDRETRY-1; /* when to start reporting errors */ +#define HDUNIT(x) DISKUNIT(x) +#define HDPART(x) DISKPART(x) +#define HDLABELDEV(d) MAKEDISKDEV(major(d), HDUNIT(d), RAW_PART) + +#define b_cylin b_resid + +#ifndef HDRETRY +#define HDRETRY 5 +#endif + +#ifndef HDWAITC +#define HDWAITC 1 /* min time for timeout in seconds */ +#endif + +int hderrthresh = HDRETRY - 1; /* when to start reporting errors */ #ifdef DEBUG /* error message tables */ -char *err_reject[] = { - 0, 0, +const char *err_reject[16] = { + NULL, + NULL, "channel parity error", /* 0x2000 */ - 0, 0, + NULL, + NULL, "illegal opcode", /* 0x0400 */ "module addressing", /* 0x0200 */ "address bounds", /* 0x0100 */ "parameter bounds", /* 0x0080 */ "illegal parameter", /* 0x0040 */ "message sequence", /* 0x0020 */ - 0, + NULL, "message length", /* 0x0008 */ - 0, 0, 0 + NULL, + NULL, + NULL }; -char *err_fault[] = { - 0, +const char *err_fault[16] = { + NULL, "cross unit", /* 0x4000 */ - 0, + NULL, "controller fault", /* 0x1000 */ - 0, 0, + NULL, + NULL, "unit fault", /* 0x0200 */ - 0, + NULL, "diagnostic result", /* 0x0080 */ - 0, + NULL, "operator release request", /* 0x0020 */ "diagnostic release request", /* 0x0010 */ "internal maintenance release request", /* 0x0008 */ - 0, + NULL, "power fail", /* 0x0002 */ "retransmit" /* 0x0001 */ }; -char *err_access[] = { +const char *err_access[16] = { "illegal parallel operation", /* 0x8000 */ "uninitialized media", /* 0x4000 */ "no spares available", /* 0x2000 */ "not ready", /* 0x1000 */ "write protect", /* 0x0800 */ "no data found", /* 0x0400 */ - 0, 0, + NULL, + NULL, "unrecoverable data overflow", /* 0x0080 */ "unrecoverable data", /* 0x0040 */ - 0, + NULL, "end of file", /* 0x0010 */ "end of volume", /* 0x0008 */ - 0, 0, 0 + NULL, + NULL, + NULL }; -char *err_info[] = { +const char *err_info[16] = { "operator release request", /* 0x8000 */ "diagnostic release request", /* 0x4000 */ "internal maintenance release request", /* 0x2000 */ "media wear", /* 0x1000 */ "latency induced", /* 0x0800 */ - 0, 0, + NULL, + NULL, "auto sparing invoked", /* 0x0100 */ - 0, + NULL, "recoverable data overflow", /* 0x0040 */ "marginal data", /* 0x0020 */ "recoverable data", /* 0x0010 */ - 0, + NULL, "maintenance track overflow", /* 0x0004 */ - 0, 0 + NULL, + NULL }; int hddebug = 0x80; @@ -228,7 +252,7 @@ void hdgo(void *); int hdstatus(struct hd_softc *); int hderror(int); #ifdef DEBUG -void hdprinterr(char *, short, char **); +void hdprinterr(const char *, short, const char **); #endif int hdmatch(struct device *, void *, void *); @@ -1197,9 +1221,9 @@ hdsize(dev) #ifdef DEBUG void hdprinterr(str, err, tab) - char *str; + const char *str; short err; - char **tab; + const char **tab; { int i; int printed; diff --git a/sys/arch/hp300/dev/hdvar.h b/sys/arch/hp300/dev/hdvar.h index 19403bcd3c7..1dd72546181 100644 --- a/sys/arch/hp300/dev/hdvar.h +++ b/sys/arch/hp300/dev/hdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hdvar.h,v 1.6 2005/11/12 23:10:04 miod Exp $ */ +/* $OpenBSD: hdvar.h,v 1.7 2005/11/14 20:20:30 miod Exp $ */ /* $NetBSD: rdvar.h,v 1.6 1997/01/30 09:14:19 thorpej Exp $ */ /* @@ -88,15 +88,6 @@ struct hd_softc { #define HDF_WANTED 0x20 #define HDF_WLABEL 0x40 -#define HDUNIT(x) DISKUNIT(x) -#define HDPART(x) DISKPART(x) -#define HDLABELDEV(d) MAKEDISKDEV(major(d), HDUNIT(d), RAW_PART) - -#define b_cylin b_resid - -#define HDRETRY 5 -#define HDWAITC 1 /* min time for timeout in seconds */ - #ifdef _KERNEL extern const struct hdidentinfo hdidentinfo[]; #endif |