2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License, Version 1.0 only
2N/A * (the "License"). You may not use this file except in compliance
2N/A * with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _PCP_COMMON_H
2N/A#define _PCP_COMMON_H
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * This file is shared by both ALOM and Solaris sides of
2N/A * Platform Channel Protocol users. So this file should
2N/A * include only common shared things.
2N/A */
2N/A
2N/A/*
2N/A * Platform Channel Request Message Header.
2N/A */
2N/Atypedef struct pcp_req_msg_hdr {
2N/A uint32_t magic_num; /* magic number */
2N/A uint8_t proto_ver; /* version info for */
2N/A /* backward compatibility */
2N/A uint8_t msg_type; /* provided by user apps */
2N/A uint8_t sub_type; /* provided by user apps */
2N/A uint8_t rsvd_pad; /* padding bits */
2N/A uint32_t xid; /* transaction id */
2N/A uint32_t timeout; /* timeout in seconds */
2N/A uint32_t msg_len; /* length of request or response data */
2N/A uint16_t msg_cksum; /* 16-bit checksum of req msg data */
2N/A uint16_t hdr_cksum; /* 16-bit checksum of req hdr */
2N/A} pcp_req_msg_hdr_t;
2N/A
2N/A
2N/A/*
2N/A * Platform Channel Response Message Header.
2N/A */
2N/Atypedef struct pcp_resp_msg_hdr {
2N/A uint32_t magic_num; /* magic number */
2N/A uint8_t proto_ver; /* version info for */
2N/A /* backward compatibility */
2N/A uint8_t msg_type; /* passed to user apps */
2N/A uint8_t sub_type; /* passed to user apps */
2N/A uint8_t rsvd_pad; /* for padding */
2N/A uint32_t xid; /* transaction id */
2N/A uint32_t timeout; /* timeout in seconds */
2N/A uint32_t msg_len; /* length of request or response data */
2N/A uint32_t status; /* response status */
2N/A uint16_t msg_cksum; /* 16-bit checksum of resp msg data */
2N/A uint16_t hdr_cksum; /* 16-bit checksum of resp hdr */
2N/A} pcp_resp_msg_hdr_t;
2N/A
2N/A/*
2N/A * magic number for Platform Channel Protocol (PCP)
2N/A * ~(rot13("PCP_") = 0xAFBCAFA0
2N/A * rot13 is a simple Caesar-cypher encryption that replaces each English letter
2N/A * with the one 13 places forward or back along the alphabet.
2N/A */
2N/A#define PCP_MAGIC_NUM (0xAFBCAFA0)
2N/A
2N/A
2N/A/* Platform channel protocol versions. */
2N/A#define PCP_PROT_VER_1 1
2N/A
2N/A
2N/A/* Error codes for 'status' field in response message header */
2N/A
2N/A#define PCP_OK (0) /* message received okay */
2N/A#define PCP_ERROR (1) /* generic error */
2N/A#define PCP_HDR_CKSUM_ERROR (2) /* header checksum error */
2N/A#define PCP_MSG_CKSUM_ERROR (3) /* message checksum error */
2N/A#define PCP_XPORT_ERROR (4) /* message in complete error */
2N/A
2N/A/* defines for 'timeout' */
2N/A#define PCP_TO_NO_RESPONSE (0xFFFFFFFF) /* no response required */
2N/A#define PCP_TO_WAIT_FOREVER (0) /* wait forever..(in reality, */
2N/A /* it waits until glvc driver */
2N/A /* call returns; curently glvc */
2N/A /* calls are blocking calls. */
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _PCP_COMMON_H */