e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * CDDL HEADER START
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * The contents of this file are subject to the terms of the
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * Common Development and Distribution License (the "License").
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * You may not use this file except in compliance with the License.
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * See the License for the specific language governing permissions
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * and limitations under the License.
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * When distributing Covered Code, include this CDDL HEADER in each
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * If applicable, add the following below this CDDL HEADER, with the
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * fields enclosed by brackets "[]" replaced with your own identifying
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * information: Portions Copyright [yyyy] [name of copyright owner]
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * CDDL HEADER END
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * Error definitions
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_TO_OPEN_DEVICE = 1, /* Couldn't open dev path */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_TO_READ_DEVICE, /* Couldn't read the log data */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_NULL_TARGET_PATH, /* Null target path */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_BAD_TARGET_PATH, /* Couldn't find valid target path */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_MODE_SENSE, /* Mode sense error returned */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_MODE_SENSE_OFFSET, /* Offset not correct */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_BAD_DATA_LEN, /* Data length not correct */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_BAD_CONTENT_LEN, /* Content length not correct */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_FORMAT_PAGE_ERR, /* Device doesn't support page */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_NV_UNIQUE, /* Couldn't add unique to nvlist */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_NV_LOG, /* Couldn't add log to nvlist */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_NV_CODE, /* Couldn't add code to nvlist */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_NV_SEV, /* Couldn't add sev to nvlist */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_NV_ENTRY, /* Couldn't add entry to nvlist */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_MODE_SELECT, /* Mode select failed */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney SES_LOG_FAILED_NVLIST_CREATE /* Couldn't create a nvlist */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * define different levels of log entries that could be returned
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer/* Valid size of log entry being returned by expander */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney/* The string log is made from 8 char entries */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer/* Index of where sequence number starts in returned string */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney/* Index of where log code starts */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer/* Index of where log level starts in returned string */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney/* Maximum size the each sub log entry can be */
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney/* Maximum save buffer log entry size */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * Sense return buffer length
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * Arbitrary, could be larger
5cf8276bb0140df747bc83e173b7c851dec6eda2Todd McKenney * 60 seconds for SCSI timeout
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * Defines for different SCSI cmd paramters
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * Defines for nvlist entries
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * Genesis specific log clear control struct
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * Struct to contain information needed to read logs
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer char target_path[MAXPATHLEN]; /* Path to device, passed in */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer char product_id[MAXNAMELEN]; /* product id of expander, passed in */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer hrtime_t poll_time; /* nanosecond poll time, passed in */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer char last_log_entry[MAXNAMELEN]; /* Last entry read, passed in/out */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer int number_log_entries; /* num of log entries read, passed back */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer int size_of_log_entries; /* Total size of all logs read passed back */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer nvlist_t *log_data; /* Log data being returned, passed back */
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer * Basic library functions
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremerextern int access_ses_log(struct ses_log_call_struct *);
e4f5a11d4a234623168c1558fcdf4341e11769e1James Kremer#endif /* _LIBSESLOG_H */