fcph.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_FIBRE_CHANNEL_IMPL_FCPH_H
#define _SYS_FIBRE_CHANNEL_IMPL_FCPH_H
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(_BIT_FIELDS_LTOH) && !defined(_BIT_FIELDS_HTOL)
#endif /* _BIT_FIELDS_LTOH */
/* legal values for r_ctl */
/* legal values for r_ctl: Device Data */
#define R_CTL_UNCATEGORIZED 0x00
#define R_CTL_SOLICITED_DATA 0x01
#define R_CTL_UNSOL_CONTROL 0x02
#define R_CTL_SOLICITED_CONTROL 0x03
#define R_CTL_UNSOL_DATA 0x04
#define R_CTL_XFER_RDY 0x05
#define R_CTL_COMMAND 0x06
#define R_CTL_STATUS 0x07
/* legal values for r_ctl: Basic Link Services, type 0 */
#define R_CTL_LS_NOP 0x80
#define R_CTL_LS_ABTS 0x81
#define R_CTL_LS_RMC 0x82
#define R_CTL_LS_BA_ACC 0x84
#define R_CTL_LS_BA_RJT 0x85
/* legal values for r_ctl: Extended Link Services, type 1 */
#define R_CTL_ELS_REQ 0x22
#define R_CTL_ELS_RSP 0x23
/* legal values for r_ctl: Link Control */
#define R_CTL_ACK_1 0xC0
#define R_CTL_ACK_N 0xC1
#define R_CTL_P_RJT 0xC2
#define R_CTL_F_RJT 0xC3
#define R_CTL_P_BSY 0xC4
#define R_CTL_F_BSY_DF 0xC5
#define R_CTL_F_BSY_LC 0xC6
#define R_CTL_LCR 0xC7
/* type field definitions for Link Data frames: */
#define FC_TYPE_BASIC_LS 0x00
#define FC_TYPE_EXTENDED_LS 0x01
/* type field definitions for Device Data frames (from FC-PH 4.1): */
#define FC_TYPE_IS8802 0x04
#define FC_TYPE_IS8802_SNAP 0x05
#define FC_TYPE_SCSI_FCP 0x08
#define FC_TYPE_SCSI_GPP 0x09
#define FC_TYPE_HIPP_FP 0x0a
#define FC_TYPE_IPI3_MASTER 0x11
#define FC_TYPE_IPI3_SLAVE 0x12
#define FC_TYPE_IPI3_PEER 0x13
#define FC_TYPE_FC_SERVICES 0x20
#define F_CTL_RESERVED 0x003F00
/* values for DF_CTL */
#define DF_CTL_EXT_FR_HDR 0x80
#define DF_CTL_EXP_SEC_HDR 0x40
#define DF_CTL_NET_HDR 0x20
#define DF_CTL_ASSOC_HDR 0x10
#define DF_CTL_RESERVED 0x0C
#define DF_CTL_DEV_HDR_16 0x01
#define DF_CTL_DEV_HDR_32 0x02
#define DF_CTL_DEV_HDR_64 0x03
#define DF_CTL_NO_DEV_HDR 0x00
/* Well known addresses ... */
#define NPORT_ID_DOM_CTLR_END 0xFFFCFE
#define FS_GENERAL_MULTICAST 0xFFFFF7
#define FS_WELL_KNOWN_MULTICAST 0xFFFFF8
#define FS_HUNT_GROUP 0xFFFFF9
#define FS_MANAGEMENT_SERVER 0xFFFFFA
#define FS_TIME_SERVER 0xFFFFFB
#define FS_NAME_SERVER 0xFFFFFC
#define FS_FABRIC_CONTROLLER 0xFFFFFD
#define FS_FABRIC_F_PORT 0xFFFFFE
#define FS_BROADCAST 0xFFFFFF
#define FC_WELL_KNOWN_START 0xFFFFF0
#define FC_WELL_KNOWN_END 0xFFFFFF
#define FC_WELL_KNOWN_ADDR(x) (((x) >= FC_WELL_KNOWN_START &&\
(x) <= FC_WELL_KNOWN_END) || \
((x) >= NPORT_ID_DOM_CTLR_START && \
(x) <= NPORT_ID_DOM_CTLR_END))
/*
* frame header
*/
typedef struct frame_header {
#if defined(_BIT_FIELDS_LTOH)
r_ctl : 8;
rsvd : 8;
type : 8;
df_ctl : 8,
seq_id : 8;
ox_id : 16;
#else
d_id : 24;
s_id : 24;
f_ctl : 24;
df_ctl : 8,
seq_cnt : 16;
rx_id : 16;
#endif /* _BIT_FIELDS_LTOH */
#if !defined(__lint)
#endif /* __lint */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FIBRE_CHANNEL_IMPL_FCPH_H */