summaryrefslogtreecommitdiff
path: root/sys/dev/biovar.h
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2005-08-17 22:28:55 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2005-08-17 22:28:55 +0000
commit554d489dce3a2e3c280f90fb15459a80f14ade1a (patch)
tree962cd82b610eba666d045cd6567fd43ccb9ff053 /sys/dev/biovar.h
parent8853e50fd4c076e6e0ccc11a4b160551567a16c3 (diff)
Add ioctl for setting the state of disks.
KNF
Diffstat (limited to 'sys/dev/biovar.h')
-rw-r--r--sys/dev/biovar.h92
1 files changed, 54 insertions, 38 deletions
diff --git a/sys/dev/biovar.h b/sys/dev/biovar.h
index c66595c103a..c5e7e739dac 100644
--- a/sys/dev/biovar.h
+++ b/sys/dev/biovar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: biovar.h,v 1.16 2005/08/17 21:35:09 marco Exp $ */
+/* $OpenBSD: biovar.h,v 1.17 2005/08/17 22:28:54 marco Exp $ */
/*
* Copyright (c) 2002 Niklas Hallqvist. All rights reserved.
@@ -35,13 +35,13 @@
#include <sys/types.h>
struct bio_common {
- void *bc_cookie;
+ void *bc_cookie;
};
#define BIOCLOCATE _IOWR('B', 0, struct bio_locate)
struct bio_locate {
- void *bl_cookie;
- char *bl_name;
+ void *bl_cookie;
+ char *bl_name;
};
#ifdef _KERNEL
@@ -54,11 +54,11 @@ void bio_unregister(struct device *);
#define BIOCINQ _IOWR('B', 32, struct bioc_inq)
struct bioc_inq {
- void *bi_cookie;
+ void *bi_cookie;
- char bi_dev[16]; /* controller device */
- int bi_novol; /* nr of volumes */
- int bi_nodisk; /* nr of total disks */
+ char bi_dev[16]; /* controller device */
+ int bi_novol; /* nr of volumes */
+ int bi_nodisk; /* nr of total disks */
};
#define BIOCDISK _IOWR('B', 33, struct bioc_disk)
@@ -66,9 +66,9 @@ struct bioc_inq {
struct bioc_disk {
void *bd_cookie;
- int bd_volid; /* associate with volume, if -1 unused */
- int bd_diskid; /* virtual disk id */
- int bd_status; /* current status */
+ int bd_volid; /* associate with volume */
+ int bd_diskid; /* virtual disk */
+ int bd_status; /* current status */
#define BIOC_SDONLINE 0x00
#define BIOC_SDONLINE_S "Online"
#define BIOC_SDOFFLINE 0x01
@@ -83,17 +83,17 @@ struct bioc_disk {
#define BIOC_SDUNUSED_S "Unused"
#define BIOC_SDINVALID 0xff
#define BIOC_SDINVALID_S "Invalid"
- int bd_resv; /* align */
- u_quad_t bd_size; /* size of the disk */
+ int bd_resv; /* align */
+ u_quad_t bd_size; /* size of the disk */
/* physical data */
u_int16_t bd_channel;
u_int16_t bd_target;
u_int16_t bd_lun;
- u_int16_t bd_other_id; /* unused for now but needed for sas/fc */
- char bd_vendor[32]; /* scsi string */
- char bd_serial[32]; /* serial number */
- char bd_procdev[16]; /* processor device */
+ u_int16_t bd_other_id; /* unused for now */
+ char bd_vendor[32]; /* scsi string */
+ char bd_serial[32]; /* serial number */
+ char bd_procdev[16]; /* processor device */
};
#define BIOCVOL _IOWR('B', 34, struct bioc_vol)
@@ -101,9 +101,9 @@ struct bioc_disk {
struct bioc_vol {
void *bv_cookie;
- int bv_volid; /* volume id */
- int bv_resv1; /* for binary compatibility */
- int bv_status; /* current status */
+ int bv_volid; /* volume id */
+ int bv_resv1; /* for binary compatibility */
+ int bv_status; /* current status */
#define BIOC_SVONLINE 0x00
#define BIOC_SVONLINE_S "Online"
#define BIOC_SVOFFLINE 0x01
@@ -112,25 +112,25 @@ struct bioc_vol {
#define BIOC_SVDEGRADED_S "Degraded"
#define BIOC_SVINVALID 0xff
#define BIOC_SVINVALID_S "Invalid"
- int bv_resv2; /* align */
- u_quad_t bv_size; /* size of the disk */
- int bv_level; /* raid level */
- int bv_nodisk; /* nr of drives */
+ int bv_resv2; /* align */
+ u_quad_t bv_size; /* size of the disk */
+ int bv_level; /* raid level */
+ int bv_nodisk; /* nr of drives */
- char bv_dev[16]; /* device */
- char bv_vendor[32]; /* scsi string */
+ char bv_dev[16]; /* device */
+ char bv_vendor[32]; /* scsi string */
};
#define BIOCALARM _IOWR('B', 35, struct bioc_alarm)
struct bioc_alarm {
- void *ba_cookie;
+ void *ba_cookie;
- int ba_resv1; /* for binary compatibility */
- int ba_resv2; /* for binary compatibility */
- int ba_status; /* only used with get state */
- int ba_resv3; /* for binary compatibility */
+ int ba_resv1; /* for binary compatibility */
+ int ba_resv2; /* for binary compatibility */
+ int ba_status; /* only used with get state */
+ int ba_resv3; /* for binary compatibility */
- int ba_opcode;
+ int ba_opcode;
#define BIOC_SADISABLE 0x00 /* disable alarm */
#define BIOC_SAENABLE 0x01 /* enable alarm */
#define BIOC_SASILENCE 0x02 /* silence alarm */
@@ -142,7 +142,7 @@ struct bioc_alarm {
struct bioc_blink {
void *bb_cookie;
- int bb_volid; /* volume, -1 unused */
+ int bb_volid; /* volume */
int bb_diskid; /* virtual disk id, -1 all */
int bb_status; /* current status */
int bb_resv; /* for binary compatibility */
@@ -153,8 +153,24 @@ struct bioc_blink {
#define BIOC_SBALARM 0x02 /* enable alarm blink */
};
-#define BIOC_INQ 0x01
-#define BIOC_DISK 0x02
-#define BIOC_VOL 0x04
-#define BIOC_ALARM 0x08
-#define BIOC_BLINK 0x10
+#define BIOCSETSTATE _IOWR('B', 37, struct bioc_setstate)
+struct bioc_setstate {
+ void *bs_cookie;
+
+ int bs_volid; /* volume */
+ int bs_diskid; /* virtual disk */
+ int bs_status; /* current status */
+#define BIOC_SSONLINE 0x00 /* online disk */
+#define BIOC_SSOFFLINE 0x01 /* offline disk */
+#define BIOC_SSHOTSPARE 0x02 /* mark as hotspare */
+ int bs_resv1; /* for binary compatibility */
+
+ int bs_resv2;
+};
+
+#define BIOC_INQ 0x0001
+#define BIOC_DISK 0x0002
+#define BIOC_VOL 0x0004
+#define BIOC_ALARM 0x0008
+#define BIOC_BLINK 0x0010
+#define BIOC_SETSTATE 0x0020