svn commit: r235489 - in projects/zfsd/head: sys/cam/scsi
usr.bin/kdump
Alexander Motin
mav at FreeBSD.org
Tue May 15 22:55:24 UTC 2012
Author: mav
Date: Tue May 15 22:55:23 2012
New Revision: 235489
URL: http://svn.freebsd.org/changeset/base/235489
Log:
Restore old API/ABI compatibility to make this code mergeable.
Modified:
projects/zfsd/head/sys/cam/scsi/scsi_enc.h
projects/zfsd/head/sys/cam/scsi/scsi_ses.h
projects/zfsd/head/usr.bin/kdump/mkioctls
Modified: projects/zfsd/head/sys/cam/scsi/scsi_enc.h
==============================================================================
--- projects/zfsd/head/sys/cam/scsi/scsi_enc.h Tue May 15 22:50:47 2012 (r235488)
+++ projects/zfsd/head/sys/cam/scsi/scsi_enc.h Tue May 15 22:55:23 2012 (r235489)
@@ -125,10 +125,10 @@ typedef struct encioc_element {
unsigned int elm_idx;
/* ID of SubEnclosure containing Element*/
- unsigned int elm_subenc_id;
+ unsigned char elm_subenc_id;
/* Element Type */
- elm_type_t elm_type;
+ unsigned char elm_type;
} encioc_element_t;
/*
Modified: projects/zfsd/head/sys/cam/scsi/scsi_ses.h
==============================================================================
--- projects/zfsd/head/sys/cam/scsi/scsi_ses.h Tue May 15 22:50:47 2012 (r235488)
+++ projects/zfsd/head/sys/cam/scsi/scsi_ses.h Tue May 15 22:55:23 2012 (r235489)
@@ -32,8 +32,107 @@
#ifndef _SCSI_SES_H_
#define _SCSI_SES_H_
+#include <sys/cdefs.h>
+#include <sys/stdint.h>
#include <cam/scsi/scsi_all.h>
+#if 1 /* Legacy API compatibility */
+
+#define SESIOC ('s' - 040)
+#define SESIOC_GETNOBJ _IO(SESIOC, 1)
+#define SESIOC_GETOBJMAP _IO(SESIOC, 2)
+#define SESIOC_GETENCSTAT _IO(SESIOC, 3)
+#define SESIOC_SETENCSTAT _IO(SESIOC, 4)
+#define SESIOC_GETOBJSTAT _IO(SESIOC, 5)
+#define SESIOC_SETOBJSTAT _IO(SESIOC, 6)
+#define SESIOC_GETTEXT _IO(SESIOC, 7)
+#define SESIOC_INIT _IO(SESIOC, 8)
+
+typedef struct {
+ unsigned int obj_id; /* Object Identifier */
+ unsigned char subencid; /* SubEnclosure ID */
+ unsigned char object_type; /* Object Type */
+} ses_object;
+
+/* Object Types */
+#define SESTYP_UNSPECIFIED 0x00
+#define SESTYP_DEVICE 0x01
+#define SESTYP_POWER 0x02
+#define SESTYP_FAN 0x03
+#define SESTYP_THERM 0x04
+#define SESTYP_DOORLOCK 0x05
+#define SESTYP_ALARM 0x06
+#define SESTYP_ESCC 0x07 /* Enclosure SCC */
+#define SESTYP_SCC 0x08 /* SCC */
+#define SESTYP_NVRAM 0x09
+#define SESTYP_UPS 0x0b
+#define SESTYP_DISPLAY 0x0c
+#define SESTYP_KEYPAD 0x0d
+#define SESTYP_ENCLOSURE 0x0e
+#define SESTYP_SCSIXVR 0x0f
+#define SESTYP_LANGUAGE 0x10
+#define SESTYP_COMPORT 0x11
+#define SESTYP_VOM 0x12
+#define SESTYP_AMMETER 0x13
+#define SESTYP_SCSI_TGT 0x14
+#define SESTYP_SCSI_INI 0x15
+#define SESTYP_SUBENC 0x16
+#define SESTYP_ARRAY 0x17
+#define SESTYP_SASEXPANDER 0x18
+#define SESTYP_SASCONNECTOR 0x19
+
+/*
+ * Overall Enclosure Status
+ */
+typedef unsigned char ses_encstat;
+
+/*
+ * Object Status
+ */
+typedef struct {
+ unsigned int obj_id;
+ unsigned char cstat[4];
+} ses_objstat;
+
+/* Summary SES Status Defines, Common Status Codes */
+#define SES_OBJSTAT_UNSUPPORTED 0
+#define SES_OBJSTAT_OK 1
+#define SES_OBJSTAT_CRIT 2
+#define SES_OBJSTAT_NONCRIT 3
+#define SES_OBJSTAT_UNRECOV 4
+#define SES_OBJSTAT_NOTINSTALLED 5
+#define SES_OBJSTAT_UNKNOWN 6
+#define SES_OBJSTAT_NOTAVAIL 7
+
+/*
+ * For control pages, cstat[0] is the same for the
+ * enclosure and is common across all device types.
+ *
+ * If SESCTL_CSEL is set, then PRDFAIL, DISABLE and RSTSWAP
+ * are checked, otherwise bits that are specific to the device
+ * type in the other 3 bytes of cstat or checked.
+ */
+#define SESCTL_CSEL 0x80
+#define SESCTL_PRDFAIL 0x40
+#define SESCTL_DISABLE 0x20
+#define SESCTL_RSTSWAP 0x10
+
+
+/* Control bits, Device Elements, byte 2 */
+#define SESCTL_DRVLCK 0x40 /* "DO NOT REMOVE" */
+#define SESCTL_RQSINS 0x08 /* RQST INSERT */
+#define SESCTL_RQSRMV 0x04 /* RQST REMOVE */
+#define SESCTL_RQSID 0x02 /* RQST IDENT */
+/* Control bits, Device Elements, byte 3 */
+#define SESCTL_RQSFLT 0x20 /* RQST FAULT */
+#define SESCTL_DEVOFF 0x10 /* DEVICE OFF */
+
+/* Control bits, Generic, byte 3 */
+#define SESCTL_RQSTFAIL 0x40
+#define SESCTL_RQSTON 0x20
+
+#endif /* Legacy API compatibility */
+
/*========================== Field Extraction Macros =========================*/
#define MK_ENUM(S, F, SUFFIX) S ## _ ## F ## SUFFIX
@@ -92,7 +191,7 @@ ses_page_length(const struct ses_page_hd
* code field.
*/
return (scsi_2btoul(hdr->length)
- + offsetof(struct ses_page_hdr, gen_code));
+ + __offsetof(struct ses_page_hdr, gen_code));
}
/*============= SCSI ENC Configuration Diagnostic Page Structures ============*/
Modified: projects/zfsd/head/usr.bin/kdump/mkioctls
==============================================================================
--- projects/zfsd/head/usr.bin/kdump/mkioctls Tue May 15 22:50:47 2012 (r235488)
+++ projects/zfsd/head/usr.bin/kdump/mkioctls Tue May 15 22:55:23 2012 (r235489)
@@ -63,8 +63,6 @@ BEGIN {
print "#include <netinet6/ip6_mroute.h>"
print "#include <stdio.h>"
print "#include <cam/cam.h>"
- print "#include <stddef.h>"
- print "#include <stdint.h>"
print ""
print ioctl_includes
print ""
More information about the svn-src-projects
mailing list