rmc_comm_dp.h revision 8d96d5b3a759119baa5937624b8716c8abb4d572
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_RMC_COMM_DP_H
#define _SYS_RMC_COMM_DP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/rmc_comm_lproto.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
*/
#define DP_BUFFER_SIZE 2048
/*
* send buffer. These buffers are basically used by the protocol to packetize
* a message to be sent OR to collect data received from the serial device.
* Currently, we just need two for send and receive operations respectively
* session is not started until the previous one has not finished)
*/
#define DP_BUFFER_COUNT 2
#define DP_TX_BUFFER 0
#define DP_RX_BUFFER 1
/*
*/
typedef struct dp_buffer {
} dp_buffer_t;
/*
* Data structure used to collect data from the serial device and to
* assemble protocol packets
*/
/*
* The possible states the message receiver can be in:
*/
#define WAITING_FOR_SYNC 0
#define WAITING_FOR_SYNC_ESC 1
#define WAITING_FOR_HDR 2
#define RECEIVING_HDR 3
#define RECEIVING_HDR_ESC 4
#define RECEIVING_BODY 5
#define RECEIVING_BODY_ESC 6
#define N_RX_STATES 7
/*
* This is the structure passed between the message receiver state routines.
* It keeps track of all the state of a message that is in the process of
* being received.
*/
typedef struct dp_packet {
} dp_packet_t;
/*
*/
typedef struct dp_message {
} dp_message_t;
/*
* structure used by the protocol to send (and, eventually re-send...)
* messages to the remote side. It keeps the status of the data transfer
* (message sent, reply received, etc.). It is also used to match
*/
typedef struct dp_req_resp {
#define MSG_ERROR 0x01
#define MSG_SENT 0x02
#define MSG_ACKED 0x04
#define MSG_REPLY_RXED 0x08
#define MSG_NAKED 0x10
#define MSG_RESET 0x20
#define MSG_SENT_BP 0x40
#define MSG_RXED_BP 0x80
/* threads waiting for a */
/* reply */
/*
* interrupt handler prototype (asynchronous messages notification)
*/
/*
* data structure used to deal with asynchronous notification (requests)
* from the remote side
*/
typedef struct dp_msg_intr {
/* the expected message type */
/*
* data protocol structure
*/
typedef struct rmc_comm_dp_state {
/*
* data protcol mutex (initialized using <dp_iblk>)
*/
/* has been established */
/* already being processed */
/* transmitted */
/* received */
/* remote side */
/* data link at regular */
/* intervals when the link is */
/* down */
/* before acknowledging a */
/* received message. In the */
/* meantime a request can be */
/* sent from this side and, */
/* hence, acnowledge that */
/* message */
/* until it is possible to */
/* send the request (no */
/* pending request */
/* packet from data received */
/* from the serial device */
/* structure */
/* drivers have registered */
/* for an async notification */
/* (soft.intr.) */
/* pool used for */
/* statistical information */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_RMC_COMM_DP_H */