summaryrefslogtreecommitdiff
path: root/sys/scsi/scsi_ses.h
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2005-04-06 20:49:49 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2005-04-06 20:49:49 +0000
commit643565899a789f7f10ac41fcb178d7a04c1e5cbf (patch)
treeefd59aceac668141b34204b8b1341afd3983f0dd /sys/scsi/scsi_ses.h
parent12a1e6181325fb6247c3a2e714b89c56a5275b65 (diff)
Move ses crud into its own file.
Requested mickey@
Diffstat (limited to 'sys/scsi/scsi_ses.h')
-rw-r--r--sys/scsi/scsi_ses.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/sys/scsi/scsi_ses.h b/sys/scsi/scsi_ses.h
new file mode 100644
index 00000000000..cee7da5407b
--- /dev/null
+++ b/sys/scsi/scsi_ses.h
@@ -0,0 +1,101 @@
+/* $OpenBSD: scsi_ses.h,v 1.1 2005/04/06 20:49:48 marco Exp $ */
+/*
+ * Copyright (c) 2005 Marco Peereboom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef _SCSI_SES_H_
+#define _SCSI_SES_H_
+
+/* FIXME add all other elements as well currently this only contains "device" */
+
+/* control structures, control structs are uses when SENDING */
+struct ses_dev_elmt_ctrl_diag {
+ u_int8_t common_ctrl;
+ u_int8_t reserved;
+ u_int8_t byte3;
+#define SDECD_RQST_IDENT 0x02
+#define SDECD_RQST_REMOVE 0x04
+#define SDECD_RQST_INSERT 0x08
+#define SDECD_DONT_REMOVE 0x40
+#define SDECD_ACTIVE 0x80
+ u_int8_t byte4;
+#define SDECD_ENABLE_BYP_B 0x04
+#define SDECD_ENABLE_BYP_A 0x08
+#define SDECD_DEVICE_OFF 0x10
+#define SDECD_RQST_FAULT 0x20
+};
+
+struct ses_enc_ctrl_diag_page {
+ u_int8_t page_code;
+ u_int8_t byte2;
+#define SECDP_UNREC 0x01
+#define SECDP_CRIT 0x02
+#define SECDP_NONCRIT 0x04
+#define SECDP_INFO 0x08
+ u_int8_t length[2];
+ u_int8_t gencode[4];
+ u_int8_t overallctrl[4];
+ /* first element starts here */
+ struct ses_dev_elmt_ctrl_diag elmts[0];
+};
+
+/* status structures, status structs are uses when RECEIVING */
+struct ses_dev_elmt_status_diag {
+ u_int8_t common_status;
+ u_int8_t slot_addr;
+ u_int8_t byte3;
+#define SDESD_REPORT 0x01
+#define SDESD_IDENT 0x02
+#define SDESD_RMV 0x04
+#define SDESD_RDY_INSRT 0x08
+#define SDESD_ENC_BYP_B 0x10
+#define SDESD_ENC_BYP_A 0x20
+#define SDESD_DONT_REMV 0x40
+#define SDESD_CLNT_BYP_A 0x80
+ u_int8_t byte4;
+#define SDESD_DEV_BYP_B 0x01
+#define SDESD_DEV_BYP_A 0x02
+#define SDESD_BYP_B 0x04
+#define SDESD_BYP_A 0x08
+#define SDESD_DEV_OFF 0x10
+#define SDESD_FLT_RQSTD 0x20
+#define SDESD_FLT_SENSED 0x40
+#define SDESD_CLNT_BYP_B 0x80
+};
+
+struct ses_enc_stat_diag_page {
+ u_int8_t page_code;
+ u_int8_t byte2;
+#define SESDP_UNREC 0x01
+#define SESDP_CRIT 0x02
+#define SESDP_NONCRIT 0x04
+#define SESDP_INFO 0x08
+ u_int8_t length[2];
+ u_int8_t gencode[4];
+ u_int8_t overallstat[4];
+ struct ses_dev_elmt_status_diag elmts[0];
+};
+#endif /* _SCSI_SES_H_ */