1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright (c) 1996-1998 by Sun Microsystems, Inc. 24*0Sstevel@tonic-gate * All rights reserved. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate #ifndef _SYS_FC4_FCAL_LINKAPP_H 28*0Sstevel@tonic-gate #define _SYS_FC4_FCAL_LINKAPP_H 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate #ifdef __cplusplus 33*0Sstevel@tonic-gate extern "C" { 34*0Sstevel@tonic-gate #endif 35*0Sstevel@tonic-gate 36*0Sstevel@tonic-gate /* 37*0Sstevel@tonic-gate * linkapp.h 38*0Sstevel@tonic-gate * 39*0Sstevel@tonic-gate * This file contains the definitions for structures and macros 40*0Sstevel@tonic-gate * for fiber channel link application payloads and data. 41*0Sstevel@tonic-gate */ 42*0Sstevel@tonic-gate 43*0Sstevel@tonic-gate /* 44*0Sstevel@tonic-gate * Well Known Fiber Chaneel Addresses to reach the fabric for 45*0Sstevel@tonic-gate * various services. 46*0Sstevel@tonic-gate */ 47*0Sstevel@tonic-gate 48*0Sstevel@tonic-gate #define MAX_FCODE_SIZE 0x2000 49*0Sstevel@tonic-gate #define FS_GENERAL_MULTICAST 0xfffff7 50*0Sstevel@tonic-gate #define FS_WELL_KNOWN_MULTICAST 0xfffff8 51*0Sstevel@tonic-gate #define FS_HUNT_GROUP 0xfffff9 52*0Sstevel@tonic-gate #define FS_MANAGEMENT_SERVER 0xfffffa 53*0Sstevel@tonic-gate #define FS_TIME_SERVER 0xfffffb 54*0Sstevel@tonic-gate #define FS_NAME_SERVER 0xfffffc 55*0Sstevel@tonic-gate #define FS_FABRIC_CONTROLLER 0xfffffd 56*0Sstevel@tonic-gate #define FS_FABRIC_F_PORT 0xfffffe 57*0Sstevel@tonic-gate #define FS_BROADCAST 0xffffff 58*0Sstevel@tonic-gate 59*0Sstevel@tonic-gate /* 60*0Sstevel@tonic-gate * Link Application Opcodes. 61*0Sstevel@tonic-gate */ 62*0Sstevel@tonic-gate 63*0Sstevel@tonic-gate #define LA_ELS_RJT 0x01 64*0Sstevel@tonic-gate #define LA_ELS_ACC 0x02 65*0Sstevel@tonic-gate #define LA_ELS_PLOGI 0x03 66*0Sstevel@tonic-gate #define LA_ELS_FLOGI 0x04 67*0Sstevel@tonic-gate #define LA_ELS_LOGO 0x05 68*0Sstevel@tonic-gate #define LA_ELS_ABTX 0x06 69*0Sstevel@tonic-gate #define LA_ELS_RCS 0x07 70*0Sstevel@tonic-gate #define LA_ELS_RES 0x08 71*0Sstevel@tonic-gate #define LA_ELS_RSS 0x09 72*0Sstevel@tonic-gate #define LA_ELS_RSI 0x0a 73*0Sstevel@tonic-gate #define LA_ELS_ESTS 0x0b 74*0Sstevel@tonic-gate #define LA_ELS_ESTC 0x0c 75*0Sstevel@tonic-gate #define LA_ELS_ADVC 0x0d 76*0Sstevel@tonic-gate #define LA_ELS_RTV 0x0e 77*0Sstevel@tonic-gate #define LA_ELS_RLS 0x0f 78*0Sstevel@tonic-gate #define LA_ELS_ECHO 0x10 79*0Sstevel@tonic-gate #define LA_ELS_RRQ 0x12 80*0Sstevel@tonic-gate #define LA_ELS_PRLI 0x20 81*0Sstevel@tonic-gate #define LA_ELS_PRLO 0x21 82*0Sstevel@tonic-gate #define LA_ELS_SCN 0x22 83*0Sstevel@tonic-gate #define LA_ELS_TPLS 0x23 84*0Sstevel@tonic-gate #define LA_ELS_GPRLO 0x24 85*0Sstevel@tonic-gate #define LA_ELS_GAID 0x30 86*0Sstevel@tonic-gate #define LA_ELS_FACT 0x31 87*0Sstevel@tonic-gate #define LA_ELS_FDACT 0x32 88*0Sstevel@tonic-gate #define LA_ELS_NACT 0x33 89*0Sstevel@tonic-gate #define LA_ELS_NDACT 0x34 90*0Sstevel@tonic-gate #define LA_ELS_QoSR 0x40 91*0Sstevel@tonic-gate #define LA_ELS_RVCS 0x41 92*0Sstevel@tonic-gate #define LA_ELS_PDISC 0x50 93*0Sstevel@tonic-gate #define LA_ELS_FDISC 0x51 94*0Sstevel@tonic-gate #define LA_ELS_ADISC 0x52 95*0Sstevel@tonic-gate #define LA_ELS_NEW_IDENT 0xf0 /* SMCC specific */ 96*0Sstevel@tonic-gate #define LA_ELS_DISPLAY 0xf1 /* SMCC specific */ 97*0Sstevel@tonic-gate #define LA_ELS_IDENT 0x20 /* SMCC specifi, SSA compat. */ 98*0Sstevel@tonic-gate 99*0Sstevel@tonic-gate /* 100*0Sstevel@tonic-gate * Events supported by soc+ HBA driver 101*0Sstevel@tonic-gate */ 102*0Sstevel@tonic-gate #define FCAL_INSERT_EVENT "SUNW,sf:DEVICE-INSERTION.1" 103*0Sstevel@tonic-gate #define FCAL_REMOVE_EVENT "SUNW,sf:DEVICE-REMOVAL.1" 104*0Sstevel@tonic-gate 105*0Sstevel@tonic-gate /* Basic Accept Payload. */ 106*0Sstevel@tonic-gate typedef struct la_ba_acc { 107*0Sstevel@tonic-gate uchar_t seq_id:8; 108*0Sstevel@tonic-gate uchar_t org_s_id[3]; 109*0Sstevel@tonic-gate ushort_t ox_id; 110*0Sstevel@tonic-gate ushort_t rx_id; 111*0Sstevel@tonic-gate } la_ba_acc_t; 112*0Sstevel@tonic-gate 113*0Sstevel@tonic-gate /* Basic Reject. */ 114*0Sstevel@tonic-gate typedef struct la_ba_rjt { 115*0Sstevel@tonic-gate uchar_t reserved; 116*0Sstevel@tonic-gate uchar_t reason_code; 117*0Sstevel@tonic-gate uchar_t explanation; 118*0Sstevel@tonic-gate uchar_t vendor; 119*0Sstevel@tonic-gate } la_ba_rjt_t; 120*0Sstevel@tonic-gate 121*0Sstevel@tonic-gate /* 122*0Sstevel@tonic-gate * Basic Reject Reason Codes. 123*0Sstevel@tonic-gate */ 124*0Sstevel@tonic-gate #define RJT_INVALID_CMD 0x01 125*0Sstevel@tonic-gate #define RJT_LOGICAL_ERR 0x03 126*0Sstevel@tonic-gate #define RJT_LOGICAL_BUSY 0x05 127*0Sstevel@tonic-gate #define RJT_PROTOCOL_ERR 0x07 128*0Sstevel@tonic-gate #define RJT_UNABLE 0x09 129*0Sstevel@tonic-gate #define RJT_UNSUPPORTED 0x0B 130*0Sstevel@tonic-gate #define RJT_VENDOR 0xFF 131*0Sstevel@tonic-gate 132*0Sstevel@tonic-gate /* 133*0Sstevel@tonic-gate * Basic Reject Explanation Codes 134*0Sstevel@tonic-gate */ 135*0Sstevel@tonic-gate #define RJT_NOEXPLANATION 0x00 136*0Sstevel@tonic-gate #define RJT_INVALID_OSID 0x01 137*0Sstevel@tonic-gate #define RJT_INVALID_OXID_RXID 0x03 138*0Sstevel@tonic-gate #define RJT_INVALID_SEQID 0x05 139*0Sstevel@tonic-gate #define RJT_ABORT_INACTIVE_SEQ 0x07 140*0Sstevel@tonic-gate #define RJT_UNABLE_TO_SUPPLY 0x09 141*0Sstevel@tonic-gate 142*0Sstevel@tonic-gate /* 143*0Sstevel@tonic-gate * Service parameters. 144*0Sstevel@tonic-gate */ 145*0Sstevel@tonic-gate typedef struct common_service { 146*0Sstevel@tonic-gate uint_t fcph; 147*0Sstevel@tonic-gate uint_t btob_crdt; 148*0Sstevel@tonic-gate uint_t cmn_features; 149*0Sstevel@tonic-gate uint_t reserved; 150*0Sstevel@tonic-gate } common_svc_t; 151*0Sstevel@tonic-gate 152*0Sstevel@tonic-gate typedef struct service_param { 153*0Sstevel@tonic-gate uchar_t data[16]; 154*0Sstevel@tonic-gate } svc_param_t; 155*0Sstevel@tonic-gate 156*0Sstevel@tonic-gate /* World Wide Name formats */ 157*0Sstevel@tonic-gate typedef union la_wwn { 158*0Sstevel@tonic-gate uchar_t raw_wwn[8]; 159*0Sstevel@tonic-gate struct { 160*0Sstevel@tonic-gate uint_t naa_id : 4; 161*0Sstevel@tonic-gate uint_t nport_id : 12; 162*0Sstevel@tonic-gate uint_t wwn_hi : 16; 163*0Sstevel@tonic-gate uint_t wwn_lo; 164*0Sstevel@tonic-gate } w; 165*0Sstevel@tonic-gate } la_wwn_t; 166*0Sstevel@tonic-gate 167*0Sstevel@tonic-gate #define FC_WWN_SIZE 8 168*0Sstevel@tonic-gate 169*0Sstevel@tonic-gate /* 170*0Sstevel@tonic-gate * Values for naa_id 171*0Sstevel@tonic-gate */ 172*0Sstevel@tonic-gate #define NAA_ID_IEEE 1 173*0Sstevel@tonic-gate #define NAA_ID_IEEE_EXTENDED 2 174*0Sstevel@tonic-gate 175*0Sstevel@tonic-gate /* Login Payload. */ 176*0Sstevel@tonic-gate typedef struct la_els_logi { 177*0Sstevel@tonic-gate uchar_t ls_code; 178*0Sstevel@tonic-gate uchar_t mbz[3]; 179*0Sstevel@tonic-gate common_svc_t common_service; 180*0Sstevel@tonic-gate 181*0Sstevel@tonic-gate la_wwn_t nport_ww_name; 182*0Sstevel@tonic-gate la_wwn_t node_ww_name; 183*0Sstevel@tonic-gate 184*0Sstevel@tonic-gate svc_param_t class_1; 185*0Sstevel@tonic-gate svc_param_t class_2; 186*0Sstevel@tonic-gate svc_param_t class_3; 187*0Sstevel@tonic-gate uchar_t reserved[16]; 188*0Sstevel@tonic-gate uchar_t vendor_version_level[16]; 189*0Sstevel@tonic-gate } la_els_logi_t; 190*0Sstevel@tonic-gate 191*0Sstevel@tonic-gate typedef la_els_logi_t la_els_logi_reply_t; 192*0Sstevel@tonic-gate #define la_logi_t la_els_logi_t 193*0Sstevel@tonic-gate 194*0Sstevel@tonic-gate #define SP_F_PORT_LOGIN 0x10 195*0Sstevel@tonic-gate 196*0Sstevel@tonic-gate /* Read Link Error Status */ 197*0Sstevel@tonic-gate typedef struct la_els_rls { 198*0Sstevel@tonic-gate uchar_t ls_code; 199*0Sstevel@tonic-gate uchar_t mbz[3]; 200*0Sstevel@tonic-gate uchar_t reserved; 201*0Sstevel@tonic-gate uchar_t nport_id[3]; 202*0Sstevel@tonic-gate } la_els_rls_t; 203*0Sstevel@tonic-gate 204*0Sstevel@tonic-gate /* Read Link Error Status Reply */ 205*0Sstevel@tonic-gate typedef struct la_els_rls_reply { 206*0Sstevel@tonic-gate uchar_t ls_code; 207*0Sstevel@tonic-gate uchar_t mbz[3]; 208*0Sstevel@tonic-gate uint_t link_failure; 209*0Sstevel@tonic-gate uint_t loss_of_sync; 210*0Sstevel@tonic-gate uint_t loss_of_signal; 211*0Sstevel@tonic-gate uint_t primitive; 212*0Sstevel@tonic-gate uint_t invalid_transmission; 213*0Sstevel@tonic-gate uint_t invalid_crc; 214*0Sstevel@tonic-gate } la_els_rls_reply_t; 215*0Sstevel@tonic-gate 216*0Sstevel@tonic-gate /* Logout payload. */ 217*0Sstevel@tonic-gate typedef struct la_els_logo { 218*0Sstevel@tonic-gate uchar_t ls_code; 219*0Sstevel@tonic-gate uchar_t mbz[3]; 220*0Sstevel@tonic-gate uchar_t reserved; 221*0Sstevel@tonic-gate uchar_t nport_id[3]; 222*0Sstevel@tonic-gate la_wwn_t nport_ww_name; 223*0Sstevel@tonic-gate } la_els_logo_t; 224*0Sstevel@tonic-gate 225*0Sstevel@tonic-gate /* Logout reply payload. */ 226*0Sstevel@tonic-gate typedef la_els_logo_t la_els_logo_reply_t; 227*0Sstevel@tonic-gate 228*0Sstevel@tonic-gate /* Reinstate recovery qualifier */ 229*0Sstevel@tonic-gate typedef struct la_els_rrq { 230*0Sstevel@tonic-gate uchar_t ls_code; 231*0Sstevel@tonic-gate uchar_t mbz[3]; 232*0Sstevel@tonic-gate uchar_t reserved; 233*0Sstevel@tonic-gate uchar_t source_id[3]; 234*0Sstevel@tonic-gate ushort_t ox_id; 235*0Sstevel@tonic-gate ushort_t rx_id; 236*0Sstevel@tonic-gate uchar_t assoc_header[32]; 237*0Sstevel@tonic-gate } la_els_rrq_t; 238*0Sstevel@tonic-gate 239*0Sstevel@tonic-gate /* Reinstate recovery qualifier reply */ 240*0Sstevel@tonic-gate typedef la_els_logo_t la_els_rrq_reply_t; 241*0Sstevel@tonic-gate 242*0Sstevel@tonic-gate /* Process login */ 243*0Sstevel@tonic-gate typedef struct la_els_prli { 244*0Sstevel@tonic-gate uchar_t ls_code; 245*0Sstevel@tonic-gate uchar_t page_length; 246*0Sstevel@tonic-gate ushort_t payload_length; 247*0Sstevel@tonic-gate uchar_t service_params[16]; 248*0Sstevel@tonic-gate } la_els_prli_t; 249*0Sstevel@tonic-gate 250*0Sstevel@tonic-gate /* Process login reply */ 251*0Sstevel@tonic-gate typedef la_els_prli_t la_els_prli_reply_t; 252*0Sstevel@tonic-gate 253*0Sstevel@tonic-gate /* Process logout */ 254*0Sstevel@tonic-gate typedef la_els_prli_t la_els_prlo_t; 255*0Sstevel@tonic-gate 256*0Sstevel@tonic-gate /* process logout reply */ 257*0Sstevel@tonic-gate typedef la_els_prli_t la_els_prlo_reply_t; 258*0Sstevel@tonic-gate 259*0Sstevel@tonic-gate /* Port discovery */ 260*0Sstevel@tonic-gate typedef la_els_logi_t la_els_pdisc_t; 261*0Sstevel@tonic-gate 262*0Sstevel@tonic-gate /* Port discovery reply */ 263*0Sstevel@tonic-gate typedef la_els_logi_reply_t la_els_pdisc_reply_t; 264*0Sstevel@tonic-gate 265*0Sstevel@tonic-gate /* Address discovery */ 266*0Sstevel@tonic-gate typedef struct la_els_adisc { 267*0Sstevel@tonic-gate uchar_t ls_code; 268*0Sstevel@tonic-gate uchar_t mbz[3]; 269*0Sstevel@tonic-gate uint_t hard_address; 270*0Sstevel@tonic-gate uchar_t port_wwn[8]; 271*0Sstevel@tonic-gate uchar_t node_wwn[8]; 272*0Sstevel@tonic-gate uint_t nport_id; 273*0Sstevel@tonic-gate } la_els_adisc_t; 274*0Sstevel@tonic-gate 275*0Sstevel@tonic-gate /* Address discovery reply */ 276*0Sstevel@tonic-gate typedef la_els_adisc_t la_els_adisc_reply_t; 277*0Sstevel@tonic-gate 278*0Sstevel@tonic-gate /* Identify */ 279*0Sstevel@tonic-gate typedef struct la_els_identify { 280*0Sstevel@tonic-gate uint_t ls_code; 281*0Sstevel@tonic-gate uint_t byte_count; 282*0Sstevel@tonic-gate } la_els_identify_t; 283*0Sstevel@tonic-gate 284*0Sstevel@tonic-gate /* Identify reply */ 285*0Sstevel@tonic-gate typedef struct la_els_identify_reply { 286*0Sstevel@tonic-gate uint_t ls_code; 287*0Sstevel@tonic-gate uchar_t fcode[MAX_FCODE_SIZE]; 288*0Sstevel@tonic-gate } la_els_identify_reply; 289*0Sstevel@tonic-gate 290*0Sstevel@tonic-gate /* Link Application Reject */ 291*0Sstevel@tonic-gate typedef struct la_els_rjt { 292*0Sstevel@tonic-gate uchar_t ls_code; 293*0Sstevel@tonic-gate uchar_t mbz[3]; 294*0Sstevel@tonic-gate uchar_t reserved; 295*0Sstevel@tonic-gate uchar_t reason_code; 296*0Sstevel@tonic-gate uchar_t explanation; 297*0Sstevel@tonic-gate uchar_t vendor; 298*0Sstevel@tonic-gate } la_els_rjt_t; 299*0Sstevel@tonic-gate 300*0Sstevel@tonic-gate /* 301*0Sstevel@tonic-gate * LA_RJT Reason Codes. 302*0Sstevel@tonic-gate */ 303*0Sstevel@tonic-gate #define LA_RJT_INVALID 0x01 304*0Sstevel@tonic-gate #define LA_RJT_LOGICAL_ERR 0x03 305*0Sstevel@tonic-gate #define LA_RJT_LOGICAL_BUSY 0x05 306*0Sstevel@tonic-gate #define LA_RJT_PROTOCOL_ERR 0x07 307*0Sstevel@tonic-gate #define LA_RJT_UNABLE_TO_PERFORM 0x09 308*0Sstevel@tonic-gate #define LA_RJT_NOT_SUPPORTED 0x0b 309*0Sstevel@tonic-gate #define LA_RJT_VENDOR 0xff 310*0Sstevel@tonic-gate 311*0Sstevel@tonic-gate /* 312*0Sstevel@tonic-gate * LA_RJT explanations 313*0Sstevel@tonic-gate */ 314*0Sstevel@tonic-gate #define LA_RJT_NOEXPLANATION 0x00 315*0Sstevel@tonic-gate #define LA_RJT_OPTIONS 0x01 316*0Sstevel@tonic-gate #define LA_RJT_INITIATOR 0x03 317*0Sstevel@tonic-gate #define LA_RJT_RECIPIENT 0x05 318*0Sstevel@tonic-gate #define LA_RJT_DATA_FIELD_SIZE 0x07 319*0Sstevel@tonic-gate #define LA_RJT_CONCURRENT 0x09 320*0Sstevel@tonic-gate #define LA_RJT_CREDIT 0x0b 321*0Sstevel@tonic-gate 322*0Sstevel@tonic-gate #define LA_RJT_INVALID_PORT_WWNAME 0x0d 323*0Sstevel@tonic-gate #define LA_RJT_INVALID_NODE_WWNAME 0x0e 324*0Sstevel@tonic-gate #define LA_RJT_INVALID_COMMON_SVC 0x0f 325*0Sstevel@tonic-gate 326*0Sstevel@tonic-gate #define LA_RJT_INVALID_ASSOC_HEADER 0x11 327*0Sstevel@tonic-gate #define LA_RJT_ASSOC_HDR_REQD 0x13 328*0Sstevel@tonic-gate #define LA_RJT_INVALID_ORIG_SID 0x15 329*0Sstevel@tonic-gate #define LA_RJT_INVALID_FQXID 0x17 330*0Sstevel@tonic-gate #define LA_RJT_REQUEST_IN_PROGRESS 0x19 331*0Sstevel@tonic-gate #define LA_RJT_INVALID_NPORT_ID 0x1f 332*0Sstevel@tonic-gate 333*0Sstevel@tonic-gate #define LA_RJT_ INVALID_SEQ_ID 0x21 334*0Sstevel@tonic-gate #define LA_RJT_ABT_INVALID_XID 0x23 335*0Sstevel@tonic-gate #define LA_RJT_ABT_INACTIVE_XID 0x25 336*0Sstevel@tonic-gate #define LA_RJT_RRQ_REQUIRED 0x27 337*0Sstevel@tonic-gate #define LA_RJT_INSUFFICENT 0x29 338*0Sstevel@tonic-gate 339*0Sstevel@tonic-gate #define LA_RJT_REQUESTED_DATA 0x2a 340*0Sstevel@tonic-gate #define LA_RJT_REQUEST_NOT_SUPPORTED 0x2c 341*0Sstevel@tonic-gate 342*0Sstevel@tonic-gate #ifdef __cplusplus 343*0Sstevel@tonic-gate } 344*0Sstevel@tonic-gate #endif 345*0Sstevel@tonic-gate 346*0Sstevel@tonic-gate #endif /* !_SYS_FC4_FCAL_LINKAPP_H */ 347