ibmf_rmpp.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_IB_MGT_IBMF_IBMF_RMPP_H
#define _SYS_IB_MGT_IBMF_IBMF_RMPP_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* This file contains the IBMF RMPP implementation dependent structures
* and defines.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* The RMPP context */
typedef struct _ibmf_rmpp_ctx_t {
/* RMPP state definitions */
#define IBMF_RMPP_STATE_UNDEFINED 0
#define IBMF_RMPP_STATE_SENDER_ACTIVE 1
#define IBMF_RMPP_STATE_SENDER_SWITCH 2
#define IBMF_RMPP_STATE_RECEVR_ACTIVE 3
#define IBMF_RMPP_STATE_RECEVR_TERMINATE 4
#define IBMF_RMPP_STATE_ABORT 5
#define IBMF_RMPP_STATE_DONE 6
/* RMPP context flags definition */
#define IBMF_CTX_RMPP_FLAGS_DYN_PYLD 8
#define IBMF_RMPP_DEFAULT_RRESPT 0x1F
#define IBMF_RMPP_TERM_RRESPT 0xE
#define IBMF_RMPP_METHOD_RESP_BIT 0x80
/* RMPP header (IB Architecture Specification 1.1, Section 13.6.2) */
#if defined(_BIT_FIELDS_HTOL)
typedef struct _ibmf_rmpp_hdr_t {
/* Payload len for data or, NewWindowLast for ack packets */
#else
typedef struct _ibmf_rmpp_hdr_t {
/* Payload len for data or, NewWindowLast for ack packets */
#endif
/* RMPP header type definitions */
#define IBMF_RMPP_TYPE_NONE 0
#define IBMF_RMPP_TYPE_DATA 1
#define IBMF_RMPP_TYPE_ACK 2
#define IBMF_RMPP_TYPE_STOP 3
#define IBMF_RMPP_TYPE_ABORT 4
/* RMPP header flags definitions */
#define IBMF_RMPP_FLAGS_ACTIVE 0x1
#define IBMF_RMPP_FLAGS_FIRST_PKT 0x2
#define IBMF_RMPP_FLAGS_LAST_PKT 0x4
/* RMPP_header status definitions */
#define IBMF_RMPP_STATUS_NORMAL 0 /* Normal */
/* Inconsistent last and payload length */
#define IBMF_RMPP_STATUS_ILPL 119
/* Inconsistent first and segment number */
#define IBMF_RMPP_STATUS_IFSN 120
#define IBMF_RMPP_VERSION 1
#define IBMF_RMPP_DEFAULT_WIN_SZ 5
#define IBMF_NO_BLOCK 0
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_MGT_IBMF_IBMF_RMPP_H */