2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
21 #include <protocol/types.h>
26 * Fibre Channel Header Structure (FCHS) definition
30 u32 routing
:4; /* routing bits */
31 u32 cat_info
:4; /* category info */
33 u32 cat_info
:4; /* category info */
34 u32 routing
:4; /* routing bits */
36 u32 d_id
:24; /* destination identifier */
38 u32 cs_ctl
:8; /* class specific control */
39 u32 s_id
:24; /* source identifier */
41 u32 type
:8; /* data structure type */
42 u32 f_ctl
:24; /* initial frame control */
44 u8 seq_id
; /* sequence identifier */
45 u8 df_ctl
; /* data field control */
46 u16 seq_cnt
; /* sequence count */
48 u16 ox_id
; /* originator exchange ID */
49 u16 rx_id
; /* responder exchange ID */
51 u32 ro
; /* relative offset */
54 * Fibre Channel BB_E Header Structure
62 #define FC_SEQ_ID_MAX 256
65 * routing bit definitions
68 FC_RTG_FC4_DEV_DATA
= 0x0, /* FC-4 Device Data */
69 FC_RTG_EXT_LINK
= 0x2, /* Extended Link Data */
70 FC_RTG_FC4_LINK_DATA
= 0x3, /* FC-4 Link Data */
71 FC_RTG_VIDEO_DATA
= 0x4, /* Video Data */
72 FC_RTG_EXT_HDR
= 0x5, /* VFT, IFR or Encapsuled */
73 FC_RTG_BASIC_LINK
= 0x8, /* Basic Link data */
74 FC_RTG_LINK_CTRL
= 0xC, /* Link Control */
78 * information category for extended link data and FC-4 Link Data
81 FC_CAT_LD_REQUEST
= 0x2, /* Request */
82 FC_CAT_LD_REPLY
= 0x3, /* Reply */
83 FC_CAT_LD_DIAG
= 0xF, /* for DIAG use only */
87 * information category for extended headers (VFT, IFR or encapsulation)
90 FC_CAT_VFT_HDR
= 0x0, /* Virtual fabric tagging header */
91 FC_CAT_IFR_HDR
= 0x1, /* Inter-Fabric routing header */
92 FC_CAT_ENC_HDR
= 0x2, /* Encapsulation header */
96 * information category for FC-4 device data
99 FC_CAT_UNCATEG_INFO
= 0x0, /* Uncategorized information */
100 FC_CAT_SOLICIT_DATA
= 0x1, /* Solicited Data */
101 FC_CAT_UNSOLICIT_CTRL
= 0x2, /* Unsolicited Control */
102 FC_CAT_SOLICIT_CTRL
= 0x3, /* Solicited Control */
103 FC_CAT_UNSOLICIT_DATA
= 0x4, /* Unsolicited Data */
104 FC_CAT_DATA_DESC
= 0x5, /* Data Descriptor */
105 FC_CAT_UNSOLICIT_CMD
= 0x6, /* Unsolicited Command */
106 FC_CAT_CMD_STATUS
= 0x7, /* Command Status */
110 * information category for Link Control
114 FC_CAT_ACK_0_N
= 0x01,
118 FC_CAT_F_BSY_DATA
= 0x05,
119 FC_CAT_F_BSY_LINK_CTL
= 0x06,
126 * Type Field Definitions. FC-PH Section 18.5 pg. 165
129 FC_TYPE_BLS
= 0x0, /* Basic Link Service */
130 FC_TYPE_ELS
= 0x1, /* Extended Link Service */
131 FC_TYPE_IP
= 0x5, /* IP */
132 FC_TYPE_FCP
= 0x8, /* SCSI-FCP */
133 FC_TYPE_GPP
= 0x9, /* SCSI_GPP */
134 FC_TYPE_SERVICES
= 0x20, /* Fibre Channel Services */
135 FC_TYPE_FC_FSS
= 0x22, /* Fabric Switch Services */
136 FC_TYPE_FC_AL
= 0x23, /* FC-AL */
137 FC_TYPE_FC_SNMP
= 0x24, /* FC-SNMP */
138 FC_TYPE_MAX
= 256, /* 256 FC-4 types */
141 struct fc_fc4types_s
{
142 u8 bits
[FC_TYPE_MAX
/ 8];
146 * Frame Control Definitions. FC-PH Table-45. pg. 168
149 FCTL_EC_ORIG
= 0x000000, /* exchange originator */
150 FCTL_EC_RESP
= 0x800000, /* exchange responder */
151 FCTL_SEQ_INI
= 0x000000, /* sequence initiator */
152 FCTL_SEQ_REC
= 0x400000, /* sequence recipient */
153 FCTL_FS_EXCH
= 0x200000, /* first sequence of xchg */
154 FCTL_LS_EXCH
= 0x100000, /* last sequence of xchg */
155 FCTL_END_SEQ
= 0x080000, /* last frame of sequence */
156 FCTL_SI_XFER
= 0x010000, /* seq initiative transfer */
157 FCTL_RO_PRESENT
= 0x000008, /* relative offset present */
158 FCTL_FILLBYTE_MASK
= 0x000003 /* , fill byte mask */
162 * Fabric Well Known Addresses
165 FC_MIN_WELL_KNOWN_ADDR
= 0xFFFFF0,
166 FC_DOMAIN_CONTROLLER_MASK
= 0xFFFC00,
167 FC_ALIAS_SERVER
= 0xFFFFF8,
168 FC_MGMT_SERVER
= 0xFFFFFA,
169 FC_TIME_SERVER
= 0xFFFFFB,
170 FC_NAME_SERVER
= 0xFFFFFC,
171 FC_FABRIC_CONTROLLER
= 0xFFFFFD,
172 FC_FABRIC_PORT
= 0xFFFFFE,
173 FC_BROADCAST_SERVER
= 0xFFFFFF
177 * domain/area/port defines
179 #define FC_DOMAIN_MASK 0xFF0000
180 #define FC_DOMAIN_SHIFT 16
181 #define FC_AREA_MASK 0x00FF00
182 #define FC_AREA_SHIFT 8
183 #define FC_PORT_MASK 0x0000FF
184 #define FC_PORT_SHIFT 0
186 #define FC_GET_DOMAIN(p) (((p) & FC_DOMAIN_MASK) >> FC_DOMAIN_SHIFT)
187 #define FC_GET_AREA(p) (((p) & FC_AREA_MASK) >> FC_AREA_SHIFT)
188 #define FC_GET_PORT(p) (((p) & FC_PORT_MASK) >> FC_PORT_SHIFT)
190 #define FC_DOMAIN_CTRLR(p) (FC_DOMAIN_CONTROLLER_MASK | (FC_GET_DOMAIN(p)))
193 FC_RXID_ANY
= 0xFFFFU
,
197 * generic ELS command
200 u32 els_code
:8; /* ELS Command Code */
205 * ELS Command Codes. FC-PH Table-75. pg. 223
208 FC_ELS_LS_RJT
= 0x1, /* Link Service Reject. */
209 FC_ELS_ACC
= 0x02, /* Accept */
210 FC_ELS_PLOGI
= 0x03, /* N_Port Login. */
211 FC_ELS_FLOGI
= 0x04, /* F_Port Login. */
212 FC_ELS_LOGO
= 0x05, /* Logout. */
213 FC_ELS_ABTX
= 0x06, /* Abort Exchange */
214 FC_ELS_RES
= 0x08, /* Read Exchange status */
215 FC_ELS_RSS
= 0x09, /* Read sequence status block */
216 FC_ELS_RSI
= 0x0A, /* Request Sequence Initiative */
217 FC_ELS_ESTC
= 0x0C, /* Estimate Credit. */
218 FC_ELS_RTV
= 0x0E, /* Read Timeout Value. */
219 FC_ELS_RLS
= 0x0F, /* Read Link Status. */
220 FC_ELS_ECHO
= 0x10, /* Echo */
221 FC_ELS_TEST
= 0x11, /* Test */
222 FC_ELS_RRQ
= 0x12, /* Reinstate Recovery Qualifier. */
223 FC_ELS_REC
= 0x13, /* Add this for TAPE support in FCR */
224 FC_ELS_PRLI
= 0x20, /* Process Login */
225 FC_ELS_PRLO
= 0x21, /* Process Logout. */
226 FC_ELS_SCN
= 0x22, /* State Change Notification. */
227 FC_ELS_TPRLO
= 0x24, /* Third Party Process Logout. */
228 FC_ELS_PDISC
= 0x50, /* Discover N_Port Parameters. */
229 FC_ELS_FDISC
= 0x51, /* Discover F_Port Parameters. */
230 FC_ELS_ADISC
= 0x52, /* Discover Address. */
231 FC_ELS_FAN
= 0x60, /* Fabric Address Notification */
232 FC_ELS_RSCN
= 0x61, /* Reg State Change Notification */
233 FC_ELS_SCR
= 0x62, /* State Change Registration. */
234 FC_ELS_RTIN
= 0x77, /* Mangement server request */
235 FC_ELS_RNID
= 0x78, /* Mangement server request */
236 FC_ELS_RLIR
= 0x79, /* Registered Link Incident Record */
238 FC_ELS_RPSC
= 0x7D, /* Report Port Speed Capabilities */
239 FC_ELS_QSA
= 0x7E, /* Query Security Attributes. Ref FC-SP */
240 FC_ELS_E2E_LBEACON
= 0x81,
241 /* End-to-End Link Beacon */
242 FC_ELS_AUTH
= 0x90, /* Authentication. Ref FC-SP */
243 FC_ELS_RFCN
= 0x97, /* Request Fabric Change Notification. Ref
249 * Version numbers for FC-PH standards,
250 * used in login to indicate what port
251 * supports. See FC-PH-X table 158.
254 FC_PH_VER_4_3
= 0x09,
255 FC_PH_VER_PH_3
= 0x20,
267 * N_Port PLOGI Common Service Parameters.
268 * FC-PH-x. Figure-76. pg. 308.
270 struct fc_plogi_csp_s
{
271 u8 verhi
; /* FC-PH high version */
272 u8 verlo
; /* FC-PH low version */
273 u16 bbcred
; /* BB_Credit */
276 u8 ciro
:1, /* continuously increasing RO */
277 rro
:1, /* random relative offset */
278 npiv_supp
:1, /* NPIV supported */
279 port_type
:1, /* N_Port/F_port */
280 altbbcred
:1, /* alternate BB_Credit */
281 resolution
:1, /* ms/ns ED_TOV resolution */
282 vvl_info
:1, /* VVL Info included */
291 cisc
:1, /* continuously increasing seq count */
295 resolution
:1, /* ms/ns ED_TOV resolution */
296 altbbcred
:1, /* alternate BB_Credit */
297 port_type
:1, /* N_Port/F_port */
298 npiv_supp
:1, /* NPIV supported */
299 rro
:1, /* random relative offset */
300 ciro
:1; /* continuously increasing RO */
303 cisc
:1, /* continuously increasing seq count */
312 u16 rxsz
; /* recieve data_field size */
321 * N_Port PLOGI Class Specific Parameters.
322 * FC-PH-x. Figure 78. pg. 318.
324 struct fc_plogi_clp_s
{
327 u32 intermix
:1; /* class intermix supported if set =1.
328 * valid only for class1. Reserved for
338 u32 intermix
:1; /* class intermix supported if set =1.
339 * valid only for class1. Reserved for
348 u32 rxsz
:16; /* Receive data_field size */
352 u32 e2e_credit
:16; /* end to end credit */
359 #define FLOGI_VVL_BRCD 0x42524344 /* ASCII value for each character in
363 * PLOGI els command and reply payload
366 struct fc_els_cmd_s els_cmd
; /* ELS command code */
367 struct fc_plogi_csp_s csp
; /* common service params */
370 struct fc_plogi_clp_s class1
; /* class 1 service parameters */
371 struct fc_plogi_clp_s class2
; /* class 2 service parameters */
372 struct fc_plogi_clp_s class3
; /* class 3 service parameters */
373 struct fc_plogi_clp_s class4
; /* class 4 service parameters */
374 u8 vvl
[16]; /* vendor version level */
378 * LOGO els command payload
381 struct fc_els_cmd_s els_cmd
; /* ELS command code */
383 u32 nport_id
:24; /* N_Port identifier of source */
384 wwn_t orig_port_name
; /* Port name of the LOGO originator */
388 * ADISC els command payload
391 struct fc_els_cmd_s els_cmd
; /* ELS command code */
393 u32 orig_HA
:24; /* originator hard address */
394 wwn_t orig_port_name
; /* originator port name */
395 wwn_t orig_node_name
; /* originator node name */
397 u32 nport_id
:24; /* originator NPortID */
401 * Exchange status block
403 struct fc_exch_status_blk_s
{
407 u32 orig_np
:24; /* originator NPortID */
409 u32 resp_np
:24; /* responder NPortID */
413 * un modified section of the fields
418 * RES els command payload
421 struct fc_els_cmd_s els_cmd
; /* ELS command code */
423 u32 nport_id
:24; /* N_Port identifier of source */
430 * RES els accept payload
433 struct fc_els_cmd_s els_cmd
; /* ELS command code */
434 struct fc_exch_status_blk_s fc_exch_blk
; /* Exchange status block */
438 * REC els command payload
441 struct fc_els_cmd_s els_cmd
; /* ELS command code */
443 u32 nport_id
:24; /* N_Port identifier of source */
448 #define FC_REC_ESB_OWN_RSP 0x80000000 /* responder owns */
449 #define FC_REC_ESB_SI 0x40000000 /* SI is owned */
450 #define FC_REC_ESB_COMP 0x20000000 /* exchange is complete */
451 #define FC_REC_ESB_ENDCOND_ABN 0x10000000 /* abnormal ending */
452 #define FC_REC_ESB_RQACT 0x04000000 /* recovery qual active */
453 #define FC_REC_ESB_ERRP_MSK 0x03000000
454 #define FC_REC_ESB_OXID_INV 0x00800000 /* invalid OXID */
455 #define FC_REC_ESB_RXID_INV 0x00400000 /* invalid RXID */
456 #define FC_REC_ESB_PRIO_INUSE 0x00200000
459 * REC els accept payload
461 struct fc_rec_acc_s
{
462 struct fc_els_cmd_s els_cmd
; /* ELS command code */
466 u32 orig_id
:24; /* N_Port id of exchange originator */
468 u32 resp_id
:24; /* N_Port id of exchange responder */
469 u32 count
; /* data transfer count */
470 u32 e_stat
; /* exchange status */
477 struct fc_els_cmd_s els_cmd
;
485 * structure for PRLI paramater pages, both request & response
486 * see FC-PH-X table 113 & 115 for explanation also FCP table 8
488 struct fc_prli_params_s
{
493 u32 task_retry_id
: 1;
506 u32 task_retry_id
: 1;
522 * valid values for rspcode in PRLI ACC payload
525 FC_PRLI_ACC_XQTD
= 0x1, /* request executed */
526 FC_PRLI_ACC_PREDEF_IMG
= 0x5, /* predefined image - no prli needed */
529 struct fc_prli_params_page_s
{
549 struct fc_prli_params_s servparams
;
553 * PRLI request and accept payload, FC-PH-X tables 112 & 114
559 struct fc_prli_params_page_s parampage
;
563 * PRLO logout params page
565 struct fc_prlo_params_page_s
{
569 u32 opa_valid
:1; /* originator process associator
572 u32 rpa_valid
:1; /* responder process associator valid */
576 u32 rpa_valid
:1; /* responder process associator valid */
577 u32 opa_valid
:1; /* originator process associator
581 u32 orig_process_assc
;
582 u32 resp_process_assc
;
588 * PRLO els command payload
594 struct fc_prlo_params_page_s prlo_params
[1];
598 * PRLO Logout response parameter page
600 struct fc_prlo_acc_params_page_s
{
605 u32 opa_valid
:1; /* originator process associator
608 u32 rpa_valid
:1; /* responder process associator valid */
612 u32 rpa_valid
:1; /* responder process associator valid */
613 u32 opa_valid
:1; /* originator process associator
617 u32 orig_process_assc
;
618 u32 resp_process_assc
;
624 * PRLO els command ACC payload
626 struct fc_prlo_acc_s
{
630 struct fc_prlo_acc_params_page_s prlo_acc_params
[1];
634 * SCR els command payload
637 FC_SCR_REG_FUNC_FABRIC_DETECTED
= 0x01,
638 FC_SCR_REG_FUNC_N_PORT_DETECTED
= 0x02,
639 FC_SCR_REG_FUNC_FULL
= 0x03,
640 FC_SCR_REG_FUNC_CLEAR_REG
= 0xFF,
643 /* SCR VU registrations */
645 FC_VU_SCR_REG_FUNC_FABRIC_NAME_CHANGE
= 0x01
651 u32 vu_reg_func
:8; /* Vendor Unique Registrations */
657 * Information category for Basic link data
669 * LS_RJT els reply payload
672 struct fc_els_cmd_s els_cmd
; /* ELS command code */
674 u32 reason_code
:8; /* Reason code for reject */
675 u32 reason_code_expl
:8; /* Reason code explanation */
676 u32 vendor_unique
:8; /* Vendor specific */
680 * LS_RJT reason codes
683 FC_LS_RJT_RSN_INV_CMD_CODE
= 0x01,
684 FC_LS_RJT_RSN_LOGICAL_ERROR
= 0x03,
685 FC_LS_RJT_RSN_LOGICAL_BUSY
= 0x05,
686 FC_LS_RJT_RSN_PROTOCOL_ERROR
= 0x07,
687 FC_LS_RJT_RSN_UNABLE_TO_PERF_CMD
= 0x09,
688 FC_LS_RJT_RSN_CMD_NOT_SUPP
= 0x0B,
692 * LS_RJT reason code explanation
695 FC_LS_RJT_EXP_NO_ADDL_INFO
= 0x00,
696 FC_LS_RJT_EXP_SPARMS_ERR_OPTIONS
= 0x01,
697 FC_LS_RJT_EXP_SPARMS_ERR_INI_CTL
= 0x03,
698 FC_LS_RJT_EXP_SPARMS_ERR_REC_CTL
= 0x05,
699 FC_LS_RJT_EXP_SPARMS_ERR_RXSZ
= 0x07,
700 FC_LS_RJT_EXP_SPARMS_ERR_CONSEQ
= 0x09,
701 FC_LS_RJT_EXP_SPARMS_ERR_CREDIT
= 0x0B,
702 FC_LS_RJT_EXP_INV_PORT_NAME
= 0x0D,
703 FC_LS_RJT_EXP_INV_NODE_FABRIC_NAME
= 0x0E,
704 FC_LS_RJT_EXP_INV_CSP
= 0x0F,
705 FC_LS_RJT_EXP_INV_ASSOC_HDR
= 0x11,
706 FC_LS_RJT_EXP_ASSOC_HDR_REQD
= 0x13,
707 FC_LS_RJT_EXP_INV_ORIG_S_ID
= 0x15,
708 FC_LS_RJT_EXP_INV_OXID_RXID_COMB
= 0x17,
709 FC_LS_RJT_EXP_CMD_ALREADY_IN_PROG
= 0x19,
710 FC_LS_RJT_EXP_LOGIN_REQUIRED
= 0x1E,
711 FC_LS_RJT_EXP_INVALID_NPORT_ID
= 0x1F,
712 FC_LS_RJT_EXP_INSUFF_RES
= 0x29,
713 FC_LS_RJT_EXP_CMD_NOT_SUPP
= 0x2C,
714 FC_LS_RJT_EXP_INV_PAYLOAD_LEN
= 0x2D,
718 * RRQ els command payload
721 struct fc_els_cmd_s els_cmd
; /* ELS command code */
723 u32 s_id
:24; /* exchange originator S_ID */
725 u32 ox_id
:16; /* originator exchange ID */
726 u32 rx_id
:16; /* responder exchange ID */
728 u32 res2
[8]; /* optional association header */
732 * ABTS BA_ACC reply payload
735 u32 seq_id_valid
:8; /* set to 0x00 for Abort Exchange */
736 u32 seq_id
:8; /* invalid for Abort Exchange */
738 u32 ox_id
:16; /* OX_ID from ABTS frame */
739 u32 rx_id
:16; /* RX_ID from ABTS frame */
740 u32 low_seq_cnt
:16; /* set to 0x0000 for Abort Exchange */
741 u32 high_seq_cnt
:16;/* set to 0xFFFF for Abort Exchange */
745 * ABTS BA_RJT reject payload
748 u32 res1
:8; /* Reserved */
749 u32 reason_code
:8; /* reason code for reject */
750 u32 reason_expl
:8; /* reason code explanation */
751 u32 vendor_unique
:8;/* vendor unique reason code,set to 0 */
755 * TPRLO logout parameter page
757 struct fc_tprlo_params_page_s
{
764 u32 tpo_nport_valid
:1;
765 u32 global_process_logout
:1;
769 u32 global_process_logout
:1;
770 u32 tpo_nport_valid
:1;
775 u32 orig_process_assc
;
776 u32 resp_process_assc
;
783 * TPRLO ELS command payload
790 struct fc_tprlo_params_page_s tprlo_params
[1];
799 * TPRLO els command ACC payload
801 struct fc_tprlo_acc_s
{
805 struct fc_prlo_acc_params_page_s tprlo_acc_params
[1];
809 * RSCN els command req payload
811 #define FC_RSCN_PGLEN 0x4
814 FC_RSCN_FORMAT_PORTID
= 0x0,
815 FC_RSCN_FORMAT_AREA
= 0x1,
816 FC_RSCN_FORMAT_DOMAIN
= 0x2,
817 FC_RSCN_FORMAT_FABRIC
= 0x3,
820 struct fc_rscn_event_s
{
831 struct fc_rscn_event_s event
[1];
835 * ECHO els command req payload
838 struct fc_els_cmd_s els_cmd
;
845 #define RNID_NODEID_DATA_FORMAT_COMMON 0x00
846 #define RNID_NODEID_DATA_FORMAT_FCP3 0x08
847 #define RNID_NODEID_DATA_FORMAT_DISCOVERY 0xDF
849 #define RNID_ASSOCIATED_TYPE_UNKNOWN 0x00000001
850 #define RNID_ASSOCIATED_TYPE_OTHER 0x00000002
851 #define RNID_ASSOCIATED_TYPE_HUB 0x00000003
852 #define RNID_ASSOCIATED_TYPE_SWITCH 0x00000004
853 #define RNID_ASSOCIATED_TYPE_GATEWAY 0x00000005
854 #define RNID_ASSOCIATED_TYPE_STORAGE_DEVICE 0x00000009
855 #define RNID_ASSOCIATED_TYPE_HOST 0x0000000A
856 #define RNID_ASSOCIATED_TYPE_STORAGE_SUBSYSTEM 0x0000000B
857 #define RNID_ASSOCIATED_TYPE_STORAGE_ACCESS_DEVICE 0x0000000E
858 #define RNID_ASSOCIATED_TYPE_NAS_SERVER 0x00000011
859 #define RNID_ASSOCIATED_TYPE_BRIDGE 0x00000002
860 #define RNID_ASSOCIATED_TYPE_VIRTUALIZATION_DEVICE 0x00000003
861 #define RNID_ASSOCIATED_TYPE_MULTI_FUNCTION_DEVICE 0x000000FF
864 * RNID els command payload
866 struct fc_rnid_cmd_s
{
867 struct fc_els_cmd_s els_cmd
;
868 u32 node_id_data_format
:8;
873 * RNID els response payload
876 struct fc_rnid_common_id_data_s
{
881 struct fc_rnid_general_topology_data_s
{
882 u32 vendor_unique
[4];
885 u32 num_attached_nodes
;
888 u32 udp_tcp_port_num
:16;
891 u32 vendor_specific
:16;
894 struct fc_rnid_acc_s
{
895 struct fc_els_cmd_s els_cmd
;
896 u32 node_id_data_format
:8;
897 u32 common_id_data_length
:8;
899 u32 specific_id_data_length
:8;
900 struct fc_rnid_common_id_data_s common_id_data
;
901 struct fc_rnid_general_topology_data_s gen_topology_data
;
904 #define RNID_ASSOCIATED_TYPE_UNKNOWN 0x00000001
905 #define RNID_ASSOCIATED_TYPE_OTHER 0x00000002
906 #define RNID_ASSOCIATED_TYPE_HUB 0x00000003
907 #define RNID_ASSOCIATED_TYPE_SWITCH 0x00000004
908 #define RNID_ASSOCIATED_TYPE_GATEWAY 0x00000005
909 #define RNID_ASSOCIATED_TYPE_STORAGE_DEVICE 0x00000009
910 #define RNID_ASSOCIATED_TYPE_HOST 0x0000000A
911 #define RNID_ASSOCIATED_TYPE_STORAGE_SUBSYSTEM 0x0000000B
912 #define RNID_ASSOCIATED_TYPE_STORAGE_ACCESS_DEVICE 0x0000000E
913 #define RNID_ASSOCIATED_TYPE_NAS_SERVER 0x00000011
914 #define RNID_ASSOCIATED_TYPE_BRIDGE 0x00000002
915 #define RNID_ASSOCIATED_TYPE_VIRTUALIZATION_DEVICE 0x00000003
916 #define RNID_ASSOCIATED_TYPE_MULTI_FUNCTION_DEVICE 0x000000FF
918 enum fc_rpsc_speed_cap
{
919 RPSC_SPEED_CAP_1G
= 0x8000,
920 RPSC_SPEED_CAP_2G
= 0x4000,
921 RPSC_SPEED_CAP_4G
= 0x2000,
922 RPSC_SPEED_CAP_10G
= 0x1000,
923 RPSC_SPEED_CAP_8G
= 0x0800,
924 RPSC_SPEED_CAP_16G
= 0x0400,
926 RPSC_SPEED_CAP_UNKNOWN
= 0x0001,
929 enum fc_rpsc_op_speed_s
{
930 RPSC_OP_SPEED_1G
= 0x8000,
931 RPSC_OP_SPEED_2G
= 0x4000,
932 RPSC_OP_SPEED_4G
= 0x2000,
933 RPSC_OP_SPEED_10G
= 0x1000,
934 RPSC_OP_SPEED_8G
= 0x0800,
935 RPSC_OP_SPEED_16G
= 0x0400,
937 RPSC_OP_SPEED_NOT_EST
= 0x0001, /*! speed not established */
940 struct fc_rpsc_speed_info_s
{
941 u16 port_speed_cap
; /*! see fc_rpsc_speed_cap_t */
942 u16 port_op_speed
; /*! see fc_rpsc_op_speed_t */
945 enum link_e2e_beacon_subcmd
{
946 LINK_E2E_BEACON_ON
= 1,
947 LINK_E2E_BEACON_OFF
= 2
951 BEACON_TYPE_NORMAL
= 1, /*! Normal Beaconing. Green */
952 BEACON_TYPE_WARN
= 2, /*! Warning Beaconing. Yellow/Amber */
953 BEACON_TYPE_CRITICAL
= 3 /*! Critical Beaconing. Red */
956 struct link_e2e_beacon_param_s
{
957 u8 beacon_type
; /* Beacon Type. See beacon_type_t */
959 /* Beacon frequency. Number of blinks
962 u16 beacon_duration
;/* Beacon duration (in Seconds). The
963 * command operation should be
964 * terminated at the end of this
967 * Ignored if diag_sub_cmd is
968 * LINK_E2E_BEACON_OFF.
970 * If 0, beaconing will continue till a
971 * BEACON OFF request is received
976 * Link E2E beacon request/good response format. For LS_RJTs use fc_ls_rjt_t
978 struct link_e2e_beacon_req_s
{
979 u32 ls_code
; /*! FC_ELS_E2E_LBEACON in requests *
980 *or FC_ELS_ACC in good replies */
981 u32 ls_sub_cmd
; /*! See link_e2e_beacon_subcmd_t */
982 struct link_e2e_beacon_param_s beacon_parm
;
986 * If RPSC request is sent to the Domain Controller, the request is for
987 * all the ports within that domain (TODO - I don't think FOS implements
990 struct fc_rpsc_cmd_s
{
991 struct fc_els_cmd_s els_cmd
;
997 struct fc_rpsc_acc_s
{
1002 struct fc_rpsc_speed_info_s speed_info
[1];
1006 * If RPSC2 request is sent to the Domain Controller,
1008 #define FC_BRCD_TOKEN 0x42524344
1010 struct fc_rpsc2_cmd_s
{
1011 struct fc_els_cmd_s els_cmd
;
1014 u16 num_pids
; /* Number of pids in the request */
1017 u32 pid
:24; /* port identifier */
1021 enum fc_rpsc2_port_type
{
1022 RPSC2_PORT_TYPE_UNKNOWN
= 0,
1023 RPSC2_PORT_TYPE_NPORT
= 1,
1024 RPSC2_PORT_TYPE_NLPORT
= 2,
1025 RPSC2_PORT_TYPE_NPIV_PORT
= 0x5f,
1026 RPSC2_PORT_TYPE_NPORT_TRUNK
= 0x6f,
1030 * RPSC2 portInfo entry structure
1032 struct fc_rpsc2_port_info_s
{
1035 u16 index
; /* port number / index */
1037 u8 type
; /* port type N/NL/... */
1038 u16 speed
; /* port Operating Speed */
1042 * RPSC2 Accept payload
1044 struct fc_rpsc2_acc_s
{
1047 u16 num_pids
; /* Number of pids in the request */
1048 struct fc_rpsc2_port_info_s port_info
[1]; /* port information */
1052 * bit fields so that multiple classes can be specified
1057 FC_CLASS_2_3
= 0x0C,
1063 struct fc_symname_s
{
1064 u8 symname
[FC_SYMNAME_MAX
];
1068 u8 alpa_bm
[FC_ALPA_MAX
/ 8];
1072 * protocol default timeout values
1075 #define FC_REC_TOV (FC_ED_TOV + 1)
1076 #define FC_RA_TOV 10
1077 #define FC_ELS_TOV (2 * FC_RA_TOV)
1080 * virtual fabric related defines
1082 #define FC_VF_ID_NULL 0 /* must not be used as VF_ID */
1083 #define FC_VF_ID_MIN 1
1084 #define FC_VF_ID_MAX 0xEFF
1085 #define FC_VF_ID_CTL 0xFEF /* control VF_ID */
1088 * Virtual Fabric Tagging header format
1089 * @caution This is defined only in BIG ENDIAN format.