1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright (c) 1995,1997-1998 by Sun Microsystems, Inc. 24*7c478bd9Sstevel@tonic-gate * All rights reserved. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifndef _SYS_FC4_LINKAPP_H 28*7c478bd9Sstevel@tonic-gate #define _SYS_FC4_LINKAPP_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 33*7c478bd9Sstevel@tonic-gate extern "C" { 34*7c478bd9Sstevel@tonic-gate #endif 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate /* 37*7c478bd9Sstevel@tonic-gate * linkapp.h 38*7c478bd9Sstevel@tonic-gate * 39*7c478bd9Sstevel@tonic-gate * This file contains the definitions for structures and macros 40*7c478bd9Sstevel@tonic-gate * for fiber channel link application payloads and data. 41*7c478bd9Sstevel@tonic-gate */ 42*7c478bd9Sstevel@tonic-gate 43*7c478bd9Sstevel@tonic-gate /* 44*7c478bd9Sstevel@tonic-gate * Well Known Fiber Chaneel Addresses to reach the fabric for 45*7c478bd9Sstevel@tonic-gate * various services. 46*7c478bd9Sstevel@tonic-gate */ 47*7c478bd9Sstevel@tonic-gate 48*7c478bd9Sstevel@tonic-gate #define FS_GENERAL_MULTICAST 0xfffff7 49*7c478bd9Sstevel@tonic-gate #define FS_WELL_KNOWN_MULTICAST 0xfffff8 50*7c478bd9Sstevel@tonic-gate #define FS_HUNT_GROUP 0xfffff9 51*7c478bd9Sstevel@tonic-gate #define FS_MANAGEMENT_SERVER 0xfffffa 52*7c478bd9Sstevel@tonic-gate #define FS_TIME_SERVER 0xfffffb 53*7c478bd9Sstevel@tonic-gate #define FS_NAME_SERVER 0xfffffc 54*7c478bd9Sstevel@tonic-gate #define FS_FABRIC_CONTROLLER 0xfffffd 55*7c478bd9Sstevel@tonic-gate #define FS_FABRIC_F_PORT 0xfffffe 56*7c478bd9Sstevel@tonic-gate #define FS_BROADCAST 0xffffff 57*7c478bd9Sstevel@tonic-gate 58*7c478bd9Sstevel@tonic-gate /* 59*7c478bd9Sstevel@tonic-gate * Link Application Opcodes. 60*7c478bd9Sstevel@tonic-gate */ 61*7c478bd9Sstevel@tonic-gate 62*7c478bd9Sstevel@tonic-gate #define LA_RJT 0x01000000 63*7c478bd9Sstevel@tonic-gate #define LA_ACC 0x02000000 64*7c478bd9Sstevel@tonic-gate #define LA_LOGI 0x03000000 65*7c478bd9Sstevel@tonic-gate #define LA_LOGO 0x04000000 66*7c478bd9Sstevel@tonic-gate #define LA_RLS 0x0d000000 67*7c478bd9Sstevel@tonic-gate #define LA_IDENT 0x20000000 68*7c478bd9Sstevel@tonic-gate 69*7c478bd9Sstevel@tonic-gate /* Basic Accept Payload. */ 70*7c478bd9Sstevel@tonic-gate typedef struct ba_acc { 71*7c478bd9Sstevel@tonic-gate uchar_t seq_id:8; 72*7c478bd9Sstevel@tonic-gate uchar_t org_s_id[3]; 73*7c478bd9Sstevel@tonic-gate ushort_t ox_id; 74*7c478bd9Sstevel@tonic-gate ushort_t rx_id; 75*7c478bd9Sstevel@tonic-gate } ba_acc_t; 76*7c478bd9Sstevel@tonic-gate 77*7c478bd9Sstevel@tonic-gate /* Basic Reject. */ 78*7c478bd9Sstevel@tonic-gate typedef struct ba_rjt { 79*7c478bd9Sstevel@tonic-gate uchar_t reseved; 80*7c478bd9Sstevel@tonic-gate uchar_t reason_code; 81*7c478bd9Sstevel@tonic-gate uchar_t explanation; 82*7c478bd9Sstevel@tonic-gate uchar_t vendor; 83*7c478bd9Sstevel@tonic-gate } ba_rjt_t; 84*7c478bd9Sstevel@tonic-gate 85*7c478bd9Sstevel@tonic-gate /* 86*7c478bd9Sstevel@tonic-gate * Basic Reject Reason Codes. 87*7c478bd9Sstevel@tonic-gate */ 88*7c478bd9Sstevel@tonic-gate #define RJT_INVALID_CMD 0x01 89*7c478bd9Sstevel@tonic-gate #define RJT_LOGICAL_ERR 0x03 90*7c478bd9Sstevel@tonic-gate #define RJT_LOGICAL_BUSY 0x05 91*7c478bd9Sstevel@tonic-gate #define RJT_PROTOCOL_ERR 0x07 92*7c478bd9Sstevel@tonic-gate #define RJT_UNABLE 0x09 93*7c478bd9Sstevel@tonic-gate #define RJT_UNSUPPORTED 0x0B 94*7c478bd9Sstevel@tonic-gate #define RJT_VENDOR 0xFF 95*7c478bd9Sstevel@tonic-gate 96*7c478bd9Sstevel@tonic-gate /* 97*7c478bd9Sstevel@tonic-gate * Basic Reject Explanation Codes 98*7c478bd9Sstevel@tonic-gate */ 99*7c478bd9Sstevel@tonic-gate #define RJT_NOEXPLANATION 0x00 100*7c478bd9Sstevel@tonic-gate #define RJT_INVALID_OSID 0x01 101*7c478bd9Sstevel@tonic-gate #define RJT_INVALID_OXID_RXID 0x03 102*7c478bd9Sstevel@tonic-gate #define RJT_INVALID_SEQID 0x05 103*7c478bd9Sstevel@tonic-gate #define RJT_ABORT_INACTIVE_SEQ 0x07 104*7c478bd9Sstevel@tonic-gate #define RJT_UNABLE_TO_SUPPLY 0x09 105*7c478bd9Sstevel@tonic-gate 106*7c478bd9Sstevel@tonic-gate /* 107*7c478bd9Sstevel@tonic-gate * Service parameters. 108*7c478bd9Sstevel@tonic-gate */ 109*7c478bd9Sstevel@tonic-gate typedef struct common_service { 110*7c478bd9Sstevel@tonic-gate uint_t fcph; 111*7c478bd9Sstevel@tonic-gate uint_t btob_crdt; 112*7c478bd9Sstevel@tonic-gate uint_t cmn_features; 113*7c478bd9Sstevel@tonic-gate uint_t reserved; 114*7c478bd9Sstevel@tonic-gate } common_svc_t; 115*7c478bd9Sstevel@tonic-gate 116*7c478bd9Sstevel@tonic-gate typedef struct service_param { 117*7c478bd9Sstevel@tonic-gate uchar_t data[16]; 118*7c478bd9Sstevel@tonic-gate } svc_param_t; 119*7c478bd9Sstevel@tonic-gate 120*7c478bd9Sstevel@tonic-gate /* World Wide Name formats */ 121*7c478bd9Sstevel@tonic-gate typedef union la_wwn { 122*7c478bd9Sstevel@tonic-gate uchar_t raw_wwn[8]; 123*7c478bd9Sstevel@tonic-gate struct { 124*7c478bd9Sstevel@tonic-gate uint_t naa_id : 4; 125*7c478bd9Sstevel@tonic-gate uint_t nport_id : 12; 126*7c478bd9Sstevel@tonic-gate uint_t wwn_hi : 16; 127*7c478bd9Sstevel@tonic-gate uint_t wwn_lo; 128*7c478bd9Sstevel@tonic-gate } w; 129*7c478bd9Sstevel@tonic-gate } la_wwn_t; 130*7c478bd9Sstevel@tonic-gate 131*7c478bd9Sstevel@tonic-gate /* 132*7c478bd9Sstevel@tonic-gate * Values for naa_id 133*7c478bd9Sstevel@tonic-gate */ 134*7c478bd9Sstevel@tonic-gate #define NAA_ID_IEEE 1 135*7c478bd9Sstevel@tonic-gate #define NAA_ID_IEEE_EXTENDED 2 136*7c478bd9Sstevel@tonic-gate 137*7c478bd9Sstevel@tonic-gate /* Login Payload. */ 138*7c478bd9Sstevel@tonic-gate typedef struct la_logi { 139*7c478bd9Sstevel@tonic-gate unsigned code; 140*7c478bd9Sstevel@tonic-gate common_svc_t common_service; 141*7c478bd9Sstevel@tonic-gate 142*7c478bd9Sstevel@tonic-gate la_wwn_t nport_ww_name; 143*7c478bd9Sstevel@tonic-gate la_wwn_t node_ww_name; 144*7c478bd9Sstevel@tonic-gate 145*7c478bd9Sstevel@tonic-gate svc_param_t class_1; 146*7c478bd9Sstevel@tonic-gate svc_param_t class_2; 147*7c478bd9Sstevel@tonic-gate svc_param_t class_3; 148*7c478bd9Sstevel@tonic-gate } la_logi_t; 149*7c478bd9Sstevel@tonic-gate 150*7c478bd9Sstevel@tonic-gate #define SP_F_PORT_LOGIN 0x10 151*7c478bd9Sstevel@tonic-gate 152*7c478bd9Sstevel@tonic-gate /* Read Link Error Status */ 153*7c478bd9Sstevel@tonic-gate typedef struct la_rls { 154*7c478bd9Sstevel@tonic-gate unsigned code; 155*7c478bd9Sstevel@tonic-gate uchar_t reserved; 156*7c478bd9Sstevel@tonic-gate uchar_t nport_id[3]; 157*7c478bd9Sstevel@tonic-gate } la_rls_t; 158*7c478bd9Sstevel@tonic-gate 159*7c478bd9Sstevel@tonic-gate /* Read Link Error Status Reply */ 160*7c478bd9Sstevel@tonic-gate typedef struct la_rls_reply { 161*7c478bd9Sstevel@tonic-gate unsigned code; 162*7c478bd9Sstevel@tonic-gate unsigned link_failure; 163*7c478bd9Sstevel@tonic-gate unsigned loss_of_sync; 164*7c478bd9Sstevel@tonic-gate unsigned loss_of_signal; 165*7c478bd9Sstevel@tonic-gate unsigned primitive; 166*7c478bd9Sstevel@tonic-gate unsigned invalid_transmission; 167*7c478bd9Sstevel@tonic-gate unsigned invalid_crc; 168*7c478bd9Sstevel@tonic-gate } la_rls_reply_t; 169*7c478bd9Sstevel@tonic-gate 170*7c478bd9Sstevel@tonic-gate /* Logout payload. */ 171*7c478bd9Sstevel@tonic-gate typedef struct la_logo { 172*7c478bd9Sstevel@tonic-gate unsigned cmd; 173*7c478bd9Sstevel@tonic-gate } la_logo_t; 174*7c478bd9Sstevel@tonic-gate 175*7c478bd9Sstevel@tonic-gate /* Logout reply payload. */ 176*7c478bd9Sstevel@tonic-gate typedef la_logo_t la_logo_reply_t; 177*7c478bd9Sstevel@tonic-gate 178*7c478bd9Sstevel@tonic-gate /* Link Application Reject */ 179*7c478bd9Sstevel@tonic-gate typedef struct la_rjt { 180*7c478bd9Sstevel@tonic-gate int code; 181*7c478bd9Sstevel@tonic-gate uchar_t reserved; 182*7c478bd9Sstevel@tonic-gate uchar_t reason_code; 183*7c478bd9Sstevel@tonic-gate uchar_t explanation; 184*7c478bd9Sstevel@tonic-gate uchar_t vendor; 185*7c478bd9Sstevel@tonic-gate } la_rjt_t; 186*7c478bd9Sstevel@tonic-gate 187*7c478bd9Sstevel@tonic-gate /* 188*7c478bd9Sstevel@tonic-gate * LA_RJT Reason Codes. 189*7c478bd9Sstevel@tonic-gate */ 190*7c478bd9Sstevel@tonic-gate #define LA_RJT_INVALID 0x01 191*7c478bd9Sstevel@tonic-gate #define LA_RJT_LOGICAL_ERR 0x03 192*7c478bd9Sstevel@tonic-gate #define LA_RJT_LOGICAL_BUSY 0x05 193*7c478bd9Sstevel@tonic-gate #define LA_RJT_PROTOCOL_ERR 0x07 194*7c478bd9Sstevel@tonic-gate #define LA_RJT_UNABLE_TO_PERFORM 0x09 195*7c478bd9Sstevel@tonic-gate #define LA_RJT_NOT_SUPPORTED 0x0b 196*7c478bd9Sstevel@tonic-gate #define LA_RJT_VENDOR 0xff 197*7c478bd9Sstevel@tonic-gate 198*7c478bd9Sstevel@tonic-gate /* 199*7c478bd9Sstevel@tonic-gate * LA_RJT explanations 200*7c478bd9Sstevel@tonic-gate */ 201*7c478bd9Sstevel@tonic-gate #define LA_RJT_NOEXPLANATION 0x00 202*7c478bd9Sstevel@tonic-gate #define LA_RJT_OPTIONS 0x01 203*7c478bd9Sstevel@tonic-gate #define LA_RJT_INITIATOR 0x03 204*7c478bd9Sstevel@tonic-gate #define LA_RJT_RECIPIENT 0x05 205*7c478bd9Sstevel@tonic-gate #define LA_RJT_DATA_FIELD_SIZE 0x07 206*7c478bd9Sstevel@tonic-gate #define LA_RJT_CONCURRENT 0x09 207*7c478bd9Sstevel@tonic-gate #define LA_RJT_CREDIT 0x0b 208*7c478bd9Sstevel@tonic-gate 209*7c478bd9Sstevel@tonic-gate #define LA_RJT_INVALID_PORT_WWNAME 0x0d 210*7c478bd9Sstevel@tonic-gate #define LA_RJT_INVALID_NODE_WWNAME 0x0e 211*7c478bd9Sstevel@tonic-gate #define LA_RJT_INVALID_COMMON_SVC 0x0f 212*7c478bd9Sstevel@tonic-gate 213*7c478bd9Sstevel@tonic-gate #define LA_RJT_INSUFFICENT 0x29 214*7c478bd9Sstevel@tonic-gate 215*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 216*7c478bd9Sstevel@tonic-gate } 217*7c478bd9Sstevel@tonic-gate #endif 218*7c478bd9Sstevel@tonic-gate 219*7c478bd9Sstevel@tonic-gate #endif /* !_SYS_FC4_LINKAPP_H */ 220