Add ARC_FW_DISK_INITIALIZED flag for device_state and do not treat

it as unknown; in this state the disk is correctly working so set it
as online.

Also remove some bogus htole32() for diskinfo->device_state.

This should fix PR kern/38299 by Hiroyuki Bessho.
This commit is contained in:
xtraeme 2008-04-03 13:59:00 +00:00
parent 6cefaaf7eb
commit 9f5ac6b847
2 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: arcmsr.c,v 1.19 2008/03/05 15:03:36 xtraeme Exp $ */
/* $NetBSD: arcmsr.c,v 1.20 2008/04/03 13:59:00 xtraeme Exp $ */
/* $OpenBSD: arc.c,v 1.68 2007/10/27 03:28:27 dlg Exp $ */
/*
@ -21,7 +21,7 @@
#include "bio.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: arcmsr.c,v 1.19 2008/03/05 15:03:36 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: arcmsr.c,v 1.20 2008/04/03 13:59:00 xtraeme Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -1378,10 +1378,11 @@ arc_bio_disk_filldata(struct arc_softc *sc, struct bioc_disk *bd,
char serial[41];
char rev[17];
switch (htole32(diskinfo->device_state)) {
switch (diskinfo->device_state) {
case ARC_FW_DISK_PASSTHRU:
bd->bd_status = BIOC_SDPASSTHRU;
break;
case ARC_FW_DISK_INITIALIZED:
case ARC_FW_DISK_RAIDMEMBER:
bd->bd_status = BIOC_SDONLINE;
break;
@ -1401,7 +1402,7 @@ arc_bio_disk_filldata(struct arc_softc *sc, struct bioc_disk *bd,
break;
default:
printf("%s: unknown disk device_state: 0x%x\n", __func__,
htole32(diskinfo->device_state));
diskinfo->device_state);
bd->bd_status = BIOC_SDINVALID;
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: arcmsrvar.h,v 1.11 2008/03/05 15:03:36 xtraeme Exp $ */
/* $NetBSD: arcmsrvar.h,v 1.12 2008/04/03 13:59:01 xtraeme Exp $ */
/* Derived from $OpenBSD: arc.c,v 1.68 2007/10/27 03:28:27 dlg Exp $ */
/*
@ -347,6 +347,7 @@ struct arc_fw_diskinfo {
uint32_t capacity;
uint32_t capacity2;
uint8_t device_state;
#define ARC_FW_DISK_INITIALIZED 0x88 /* disk has been initialized */
#define ARC_FW_DISK_RAIDMEMBER 0x89 /* disk is member of a raid set */
#define ARC_FW_DISK_PASSTHRU 0x8b /* pass through disk */
#define ARC_FW_DISK_HOTSPARE 0xa9 /* hotspare disk */