1*fcf3ce44SJohn Forte /* 2*fcf3ce44SJohn Forte * CDDL HEADER START 3*fcf3ce44SJohn Forte * 4*fcf3ce44SJohn Forte * The contents of this file are subject to the terms of the 5*fcf3ce44SJohn Forte * Common Development and Distribution License (the "License"). 6*fcf3ce44SJohn Forte * You may not use this file except in compliance with the License. 7*fcf3ce44SJohn Forte * 8*fcf3ce44SJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*fcf3ce44SJohn Forte * or http://www.opensolaris.org/os/licensing. 10*fcf3ce44SJohn Forte * See the License for the specific language governing permissions 11*fcf3ce44SJohn Forte * and limitations under the License. 12*fcf3ce44SJohn Forte * 13*fcf3ce44SJohn Forte * When distributing Covered Code, include this CDDL HEADER in each 14*fcf3ce44SJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*fcf3ce44SJohn Forte * If applicable, add the following below this CDDL HEADER, with the 16*fcf3ce44SJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying 17*fcf3ce44SJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner] 18*fcf3ce44SJohn Forte * 19*fcf3ce44SJohn Forte * CDDL HEADER END 20*fcf3ce44SJohn Forte */ 21*fcf3ce44SJohn Forte /* 22*fcf3ce44SJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23*fcf3ce44SJohn Forte * Use is subject to license terms. 24*fcf3ce44SJohn Forte */ 25*fcf3ce44SJohn Forte 26*fcf3ce44SJohn Forte #ifndef _SYS_FIBRE_CHANNEL_IMPL_FC_LINKAPP_H 27*fcf3ce44SJohn Forte #define _SYS_FIBRE_CHANNEL_IMPL_FC_LINKAPP_H 28*fcf3ce44SJohn Forte 29*fcf3ce44SJohn Forte 30*fcf3ce44SJohn Forte 31*fcf3ce44SJohn Forte #include <sys/note.h> 32*fcf3ce44SJohn Forte 33*fcf3ce44SJohn Forte #ifdef __cplusplus 34*fcf3ce44SJohn Forte extern "C" { 35*fcf3ce44SJohn Forte #endif 36*fcf3ce44SJohn Forte 37*fcf3ce44SJohn Forte #if !defined(_BIT_FIELDS_LTOH) && !defined(_BIT_FIELDS_HTOL) 38*fcf3ce44SJohn Forte #error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined 39*fcf3ce44SJohn Forte #endif /* _BIT_FIELDS_LTOH */ 40*fcf3ce44SJohn Forte 41*fcf3ce44SJohn Forte /* 42*fcf3ce44SJohn Forte * Link Application Opcodes. 43*fcf3ce44SJohn Forte */ 44*fcf3ce44SJohn Forte #define LA_ELS_RJT 0x01 45*fcf3ce44SJohn Forte #define LA_ELS_ACC 0x02 46*fcf3ce44SJohn Forte #define LA_ELS_PLOGI 0x03 47*fcf3ce44SJohn Forte #define LA_ELS_FLOGI 0x04 48*fcf3ce44SJohn Forte #define LA_ELS_LOGO 0x05 49*fcf3ce44SJohn Forte #define LA_ELS_ABTX 0x06 50*fcf3ce44SJohn Forte #define LA_ELS_RCS 0x07 51*fcf3ce44SJohn Forte #define LA_ELS_RES 0x08 52*fcf3ce44SJohn Forte #define LA_ELS_RSS 0x09 53*fcf3ce44SJohn Forte #define LA_ELS_RSI 0x0a 54*fcf3ce44SJohn Forte #define LA_ELS_ESTS 0x0b 55*fcf3ce44SJohn Forte #define LA_ELS_ESTC 0x0c 56*fcf3ce44SJohn Forte #define LA_ELS_ADVC 0x0d 57*fcf3ce44SJohn Forte #define LA_ELS_RTV 0x0e 58*fcf3ce44SJohn Forte #define LA_ELS_RLS 0x0f 59*fcf3ce44SJohn Forte #define LA_ELS_ECHO 0x10 60*fcf3ce44SJohn Forte #define LA_ELS_RRQ 0x12 61*fcf3ce44SJohn Forte #define LA_ELS_PRLI 0x20 62*fcf3ce44SJohn Forte #define LA_ELS_PRLO 0x21 63*fcf3ce44SJohn Forte #define LA_ELS_SCN 0x22 64*fcf3ce44SJohn Forte #define LA_ELS_TPLS 0x23 65*fcf3ce44SJohn Forte #define LA_ELS_GPRLO 0x24 66*fcf3ce44SJohn Forte #define LA_ELS_GAID 0x30 67*fcf3ce44SJohn Forte #define LA_ELS_FACT 0x31 68*fcf3ce44SJohn Forte #define LA_ELS_FDACT 0x32 69*fcf3ce44SJohn Forte #define LA_ELS_NACT 0x33 70*fcf3ce44SJohn Forte #define LA_ELS_NDACT 0x34 71*fcf3ce44SJohn Forte #define LA_ELS_QoSR 0x40 72*fcf3ce44SJohn Forte #define LA_ELS_RVCS 0x41 73*fcf3ce44SJohn Forte #define LA_ELS_PDISC 0x50 74*fcf3ce44SJohn Forte #define LA_ELS_FDISC 0x51 75*fcf3ce44SJohn Forte #define LA_ELS_ADISC 0x52 76*fcf3ce44SJohn Forte #define LA_ELS_RSCN 0x61 77*fcf3ce44SJohn Forte #define LA_ELS_SCR 0x62 78*fcf3ce44SJohn Forte #define LA_ELS_LINIT 0x70 79*fcf3ce44SJohn Forte #define LA_ELS_RNID 0x78 80*fcf3ce44SJohn Forte 81*fcf3ce44SJohn Forte /* 82*fcf3ce44SJohn Forte * LINIT status codes in the ACC 83*fcf3ce44SJohn Forte */ 84*fcf3ce44SJohn Forte #define FC_LINIT_SUCCESS 0x01 85*fcf3ce44SJohn Forte #define FC_LINIT_FAILURE 0x02 86*fcf3ce44SJohn Forte 87*fcf3ce44SJohn Forte /* Basic Accept Payload. */ 88*fcf3ce44SJohn Forte typedef struct la_ba_acc { 89*fcf3ce44SJohn Forte 90*fcf3ce44SJohn Forte #if defined(_BIT_FIELDS_LTOH) 91*fcf3ce44SJohn Forte uint32_t org_sid : 24, 92*fcf3ce44SJohn Forte seq_id : 8; 93*fcf3ce44SJohn Forte 94*fcf3ce44SJohn Forte #else 95*fcf3ce44SJohn Forte uint32_t seq_id : 8, 96*fcf3ce44SJohn Forte org_sid : 24; 97*fcf3ce44SJohn Forte 98*fcf3ce44SJohn Forte #endif /* _BIT_FIELDS_LTOH */ 99*fcf3ce44SJohn Forte 100*fcf3ce44SJohn Forte uint16_t ox_id; 101*fcf3ce44SJohn Forte uint16_t rx_id; 102*fcf3ce44SJohn Forte } la_ba_acc_t; 103*fcf3ce44SJohn Forte 104*fcf3ce44SJohn Forte 105*fcf3ce44SJohn Forte /* Basic Reject. */ 106*fcf3ce44SJohn Forte typedef struct la_ba_rjt { 107*fcf3ce44SJohn Forte uchar_t reserved; 108*fcf3ce44SJohn Forte uchar_t reason_code; 109*fcf3ce44SJohn Forte uchar_t explanation; 110*fcf3ce44SJohn Forte uchar_t vendor; 111*fcf3ce44SJohn Forte } la_ba_rjt_t; 112*fcf3ce44SJohn Forte 113*fcf3ce44SJohn Forte 114*fcf3ce44SJohn Forte /* Logout payload. */ 115*fcf3ce44SJohn Forte typedef struct la_els_logo { 116*fcf3ce44SJohn Forte ls_code_t ls_code; 117*fcf3ce44SJohn Forte fc_portid_t nport_id; 118*fcf3ce44SJohn Forte la_wwn_t nport_ww_name; 119*fcf3ce44SJohn Forte } la_els_logo_t; 120*fcf3ce44SJohn Forte 121*fcf3ce44SJohn Forte /* Address discovery */ 122*fcf3ce44SJohn Forte typedef struct la_els_adisc { 123*fcf3ce44SJohn Forte ls_code_t ls_code; 124*fcf3ce44SJohn Forte fc_hardaddr_t hard_addr; 125*fcf3ce44SJohn Forte la_wwn_t port_wwn; 126*fcf3ce44SJohn Forte la_wwn_t node_wwn; 127*fcf3ce44SJohn Forte fc_portid_t nport_id; 128*fcf3ce44SJohn Forte } la_els_adisc_t; 129*fcf3ce44SJohn Forte 130*fcf3ce44SJohn Forte 131*fcf3ce44SJohn Forte /* Link Application Reject */ 132*fcf3ce44SJohn Forte typedef struct la_els_rjt { 133*fcf3ce44SJohn Forte ls_code_t ls_code; 134*fcf3ce44SJohn Forte uchar_t action; 135*fcf3ce44SJohn Forte uchar_t reason; 136*fcf3ce44SJohn Forte uchar_t reserved; 137*fcf3ce44SJohn Forte uchar_t vu; 138*fcf3ce44SJohn Forte } la_els_rjt_t; 139*fcf3ce44SJohn Forte 140*fcf3ce44SJohn Forte /* Process Login/Logout Service Parameter Page */ 141*fcf3ce44SJohn Forte #define SP_OPA_VALID 0x8000 142*fcf3ce44SJohn Forte #define SP_RPA_VALID 0x4000 143*fcf3ce44SJohn Forte #define SP_ESTABLISH_IMAGE_PAIR 0x2000 144*fcf3ce44SJohn Forte #define SP_RESP_CODE_MASK 0x0F00 145*fcf3ce44SJohn Forte #define SP_RESP_CODE_REQ_EXECUTED 0x0100 146*fcf3ce44SJohn Forte 147*fcf3ce44SJohn Forte typedef struct service_parameter_page { 148*fcf3ce44SJohn Forte uint8_t type_code; 149*fcf3ce44SJohn Forte uint8_t type_code_ext; 150*fcf3ce44SJohn Forte uint16_t flags; 151*fcf3ce44SJohn Forte uint32_t opa; 152*fcf3ce44SJohn Forte uint32_t rpa; 153*fcf3ce44SJohn Forte uint32_t sp; 154*fcf3ce44SJohn Forte } service_parameter_page_t; 155*fcf3ce44SJohn Forte 156*fcf3ce44SJohn Forte /* Process login */ 157*fcf3ce44SJohn Forte typedef struct la_els_prli { 158*fcf3ce44SJohn Forte #if defined(_BIT_FIELDS_LTOH) 159*fcf3ce44SJohn Forte uint32_t payload_length : 16, 160*fcf3ce44SJohn Forte page_length : 8, 161*fcf3ce44SJohn Forte ls_code : 8; 162*fcf3ce44SJohn Forte 163*fcf3ce44SJohn Forte #elif defined(_BIT_FIELDS_HTOL) 164*fcf3ce44SJohn Forte uint32_t ls_code : 8, 165*fcf3ce44SJohn Forte page_length : 8, 166*fcf3ce44SJohn Forte payload_length : 16; 167*fcf3ce44SJohn Forte 168*fcf3ce44SJohn Forte #endif /* _BIT_FIELDS_LTOH */ 169*fcf3ce44SJohn Forte uchar_t service_params[16]; 170*fcf3ce44SJohn Forte } la_els_prli_t; 171*fcf3ce44SJohn Forte 172*fcf3ce44SJohn Forte /* Process Logout */ 173*fcf3ce44SJohn Forte typedef struct la_els_prlo { 174*fcf3ce44SJohn Forte uint8_t ls_code; 175*fcf3ce44SJohn Forte uint8_t page_length; 176*fcf3ce44SJohn Forte uint16_t payload_length; 177*fcf3ce44SJohn Forte uint8_t type_code; 178*fcf3ce44SJohn Forte uint8_t type_code_extension; 179*fcf3ce44SJohn Forte uint16_t flags; 180*fcf3ce44SJohn Forte uint32_t opa; 181*fcf3ce44SJohn Forte uint32_t rpa; 182*fcf3ce44SJohn Forte uint32_t reserved; 183*fcf3ce44SJohn Forte } la_els_prlo_t; 184*fcf3ce44SJohn Forte 185*fcf3ce44SJohn Forte #if !defined(__lint) 186*fcf3ce44SJohn Forte _NOTE(SCHEME_PROTECTS_DATA("unique per request", la_ba_rjt)) 187*fcf3ce44SJohn Forte _NOTE(SCHEME_PROTECTS_DATA("unique per request", la_els_logo)) 188*fcf3ce44SJohn Forte _NOTE(SCHEME_PROTECTS_DATA("unique per request", la_els_adisc)) 189*fcf3ce44SJohn Forte _NOTE(SCHEME_PROTECTS_DATA("unique per request", la_els_rjt)) 190*fcf3ce44SJohn Forte _NOTE(SCHEME_PROTECTS_DATA("unique per request", la_els_prli_t)) 191*fcf3ce44SJohn Forte _NOTE(SCHEME_PROTECTS_DATA("unique per request", la_ba_acc)) 192*fcf3ce44SJohn Forte #endif /* __lint */ 193*fcf3ce44SJohn Forte 194*fcf3ce44SJohn Forte 195*fcf3ce44SJohn Forte #ifdef __cplusplus 196*fcf3ce44SJohn Forte } 197*fcf3ce44SJohn Forte #endif 198*fcf3ce44SJohn Forte 199*fcf3ce44SJohn Forte #endif /* _SYS_FIBRE_CHANNEL_IMPL_FC_LINKAPP_H */ 200