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 */
59 * Fibre Channel BB_E Header Structure
67 #define FC_SEQ_ID_MAX 256
70 * routing bit definitions
73 FC_RTG_FC4_DEV_DATA = 0x0, /* FC-4 Device Data */
74 FC_RTG_EXT_LINK = 0x2, /* Extended Link Data */
75 FC_RTG_FC4_LINK_DATA = 0x3, /* FC-4 Link Data */
76 FC_RTG_VIDEO_DATA = 0x4, /* Video Data */
77 FC_RTG_EXT_HDR = 0x5, /* VFT, IFR or Encapsuled */
78 FC_RTG_BASIC_LINK = 0x8, /* Basic Link data */
79 FC_RTG_LINK_CTRL = 0xC, /* Link Control */
83 * information category for extended link data and FC-4 Link Data
86 FC_CAT_LD_REQUEST = 0x2, /* Request */
87 FC_CAT_LD_REPLY = 0x3, /* Reply */
88 FC_CAT_LD_DIAG = 0xF, /* for DIAG use only */
92 * information category for extended headers (VFT, IFR or encapsulation)
95 FC_CAT_VFT_HDR = 0x0, /* Virtual fabric tagging header */
96 FC_CAT_IFR_HDR = 0x1, /* Inter-Fabric routing header */
97 FC_CAT_ENC_HDR = 0x2, /* Encapsulation header */
101 * information category for FC-4 device data
104 FC_CAT_UNCATEG_INFO = 0x0, /* Uncategorized information */
105 FC_CAT_SOLICIT_DATA = 0x1, /* Solicited Data */
106 FC_CAT_UNSOLICIT_CTRL = 0x2, /* Unsolicited Control */
107 FC_CAT_SOLICIT_CTRL = 0x3, /* Solicited Control */
108 FC_CAT_UNSOLICIT_DATA = 0x4, /* Unsolicited Data */
109 FC_CAT_DATA_DESC = 0x5, /* Data Descriptor */
110 FC_CAT_UNSOLICIT_CMD = 0x6, /* Unsolicited Command */
111 FC_CAT_CMD_STATUS = 0x7, /* Command Status */
115 * information category for Link Control
119 FC_CAT_ACK_0_N = 0x01,
123 FC_CAT_F_BSY_DATA = 0x05,
124 FC_CAT_F_BSY_LINK_CTL = 0x06,
131 * Type Field Definitions. FC-PH Section 18.5 pg. 165
134 FC_TYPE_BLS = 0x0, /* Basic Link Service */
135 FC_TYPE_ELS = 0x1, /* Extended Link Service */
136 FC_TYPE_IP = 0x5, /* IP */
137 FC_TYPE_FCP = 0x8, /* SCSI-FCP */
138 FC_TYPE_GPP = 0x9, /* SCSI_GPP */
139 FC_TYPE_SERVICES = 0x20, /* Fibre Channel Services */
140 FC_TYPE_FC_FSS = 0x22, /* Fabric Switch Services */
141 FC_TYPE_FC_AL = 0x23, /* FC-AL */
142 FC_TYPE_FC_SNMP = 0x24, /* FC-SNMP */
143 FC_TYPE_MAX = 256, /* 256 FC-4 types */
146 struct fc_fc4types_s{
147 u8 bits[FC_TYPE_MAX / 8];
151 * Frame Control Definitions. FC-PH Table-45. pg. 168
154 FCTL_EC_ORIG = 0x000000, /* exchange originator */
155 FCTL_EC_RESP = 0x800000, /* exchange responder */
156 FCTL_SEQ_INI = 0x000000, /* sequence initiator */
157 FCTL_SEQ_REC = 0x400000, /* sequence recipient */
158 FCTL_FS_EXCH = 0x200000, /* first sequence of xchg */
159 FCTL_LS_EXCH = 0x100000, /* last sequence of xchg */
160 FCTL_END_SEQ = 0x080000, /* last frame of sequence */
161 FCTL_SI_XFER = 0x010000, /* seq initiative transfer */
162 FCTL_RO_PRESENT = 0x000008, /* relative offset present */
163 FCTL_FILLBYTE_MASK = 0x000003 /* , fill byte mask */
167 * Fabric Well Known Addresses
170 FC_MIN_WELL_KNOWN_ADDR = 0xFFFFF0,
171 FC_DOMAIN_CONTROLLER_MASK = 0xFFFC00,
172 FC_ALIAS_SERVER = 0xFFFFF8,
173 FC_MGMT_SERVER = 0xFFFFFA,
174 FC_TIME_SERVER = 0xFFFFFB,
175 FC_NAME_SERVER = 0xFFFFFC,
176 FC_FABRIC_CONTROLLER = 0xFFFFFD,
177 FC_FABRIC_PORT = 0xFFFFFE,
178 FC_BROADCAST_SERVER = 0xFFFFFF
182 * domain/area/port defines
184 #define FC_DOMAIN_MASK 0xFF0000
185 #define FC_DOMAIN_SHIFT 16
186 #define FC_AREA_MASK 0x00FF00
187 #define FC_AREA_SHIFT 8
188 #define FC_PORT_MASK 0x0000FF
189 #define FC_PORT_SHIFT 0
191 #define FC_GET_DOMAIN(p) (((p) & FC_DOMAIN_MASK) >> FC_DOMAIN_SHIFT)
192 #define FC_GET_AREA(p) (((p) & FC_AREA_MASK) >> FC_AREA_SHIFT)
193 #define FC_GET_PORT(p) (((p) & FC_PORT_MASK) >> FC_PORT_SHIFT)
195 #define FC_DOMAIN_CTRLR(p) (FC_DOMAIN_CONTROLLER_MASK | (FC_GET_DOMAIN(p)))
198 FC_RXID_ANY = 0xFFFFU,
202 * generic ELS command
205 u32 els_code:8; /* ELS Command Code */
210 * ELS Command Codes. FC-PH Table-75. pg. 223
213 FC_ELS_LS_RJT = 0x1, /* Link Service Reject. */
214 FC_ELS_ACC = 0x02, /* Accept */
215 FC_ELS_PLOGI = 0x03, /* N_Port Login. */
216 FC_ELS_FLOGI = 0x04, /* F_Port Login. */
217 FC_ELS_LOGO = 0x05, /* Logout. */
218 FC_ELS_ABTX = 0x06, /* Abort Exchange */
219 FC_ELS_RES = 0x08, /* Read Exchange status */
220 FC_ELS_RSS = 0x09, /* Read sequence status block */
221 FC_ELS_RSI = 0x0A, /* Request Sequence Initiative */
222 FC_ELS_ESTC = 0x0C, /* Estimate Credit. */
223 FC_ELS_RTV = 0x0E, /* Read Timeout Value. */
224 FC_ELS_RLS = 0x0F, /* Read Link Status. */
225 FC_ELS_ECHO = 0x10, /* Echo */
226 FC_ELS_TEST = 0x11, /* Test */
227 FC_ELS_RRQ = 0x12, /* Reinstate Recovery Qualifier. */
228 FC_ELS_REC = 0x13, /* Add this for TAPE support in FCR */
229 FC_ELS_PRLI = 0x20, /* Process Login */
230 FC_ELS_PRLO = 0x21, /* Process Logout. */
231 FC_ELS_SCN = 0x22, /* State Change Notification. */
232 FC_ELS_TPRLO = 0x24, /* Third Party Process Logout. */
233 FC_ELS_PDISC = 0x50, /* Discover N_Port Parameters. */
234 FC_ELS_FDISC = 0x51, /* Discover F_Port Parameters. */
235 FC_ELS_ADISC = 0x52, /* Discover Address. */
236 FC_ELS_FAN = 0x60, /* Fabric Address Notification */
237 FC_ELS_RSCN = 0x61, /* Reg State Change Notification */
238 FC_ELS_SCR = 0x62, /* State Change Registration. */
239 FC_ELS_RTIN = 0x77, /* Mangement server request */
240 FC_ELS_RNID = 0x78, /* Mangement server request */
241 FC_ELS_RLIR = 0x79, /* Registered Link Incident Record */
243 FC_ELS_RPSC = 0x7D, /* Report Port Speed Capabilities */
244 FC_ELS_QSA = 0x7E, /* Query Security Attributes. Ref FC-SP */
245 FC_ELS_E2E_LBEACON = 0x81,
246 /* End-to-End Link Beacon */
247 FC_ELS_AUTH = 0x90, /* Authentication. Ref FC-SP */
248 FC_ELS_RFCN = 0x97, /* Request Fabric Change Notification. Ref
254 * Version numbers for FC-PH standards,
255 * used in login to indicate what port
256 * supports. See FC-PH-X table 158.
259 FC_PH_VER_4_3 = 0x09,
260 FC_PH_VER_PH_3 = 0x20,
272 * N_Port PLOGI Common Service Parameters.
273 * FC-PH-x. Figure-76. pg. 308.
275 struct fc_plogi_csp_s{
276 u8 verhi; /* FC-PH high version */
277 u8 verlo; /* FC-PH low version */
278 u16 bbcred; /* BB_Credit */
281 u8 ciro:1, /* continuously increasing RO */
282 rro:1, /* random relative offset */
283 npiv_supp:1, /* NPIV supported */
284 port_type:1, /* N_Port/F_port */
285 altbbcred:1, /* alternate BB_Credit */
286 resolution:1, /* ms/ns ED_TOV resolution */
287 vvl_info:1, /* VVL Info included */
296 cisc:1, /* continuously increasing seq count */
300 resolution:1, /* ms/ns ED_TOV resolution */
301 altbbcred:1, /* alternate BB_Credit */
302 port_type:1, /* N_Port/F_port */
303 npiv_supp:1, /* NPIV supported */
304 rro:1, /* random relative offset */
305 ciro:1; /* continuously increasing RO */
308 cisc:1, /* continuously increasing seq count */
317 u16 rxsz; /* recieve data_field size */
326 * N_Port PLOGI Class Specific Parameters.
327 * FC-PH-x. Figure 78. pg. 318.
329 struct fc_plogi_clp_s{
332 u32 intermix:1; /* class intermix supported if set =1.
333 * valid only for class1. Reserved for
343 u32 intermix:1; /* class intermix supported if set =1.
344 * valid only for class1. Reserved for
353 u32 rxsz:16; /* Receive data_field size */
357 u32 e2e_credit:16; /* end to end credit */
364 #define FLOGI_VVL_BRCD 0x42524344 /* ASCII value for each character in
368 * PLOGI els command and reply payload
371 struct fc_els_cmd_s els_cmd; /* ELS command code */
372 struct fc_plogi_csp_s csp; /* common service params */
375 struct fc_plogi_clp_s class1; /* class 1 service parameters */
376 struct fc_plogi_clp_s class2; /* class 2 service parameters */
377 struct fc_plogi_clp_s class3; /* class 3 service parameters */
378 struct fc_plogi_clp_s class4; /* class 4 service parameters */
379 u8 vvl[16]; /* vendor version level */
383 * LOGO els command payload
386 struct fc_els_cmd_s els_cmd; /* ELS command code */
388 u32 nport_id:24; /* N_Port identifier of source */
389 wwn_t orig_port_name; /* Port name of the LOGO originator */
393 * ADISC els command payload
396 struct fc_els_cmd_s els_cmd; /* ELS command code */
398 u32 orig_HA:24; /* originator hard address */
399 wwn_t orig_port_name; /* originator port name */
400 wwn_t orig_node_name; /* originator node name */
402 u32 nport_id:24; /* originator NPortID */
406 * Exchange status block
408 struct fc_exch_status_blk_s{
412 u32 orig_np:24; /* originator NPortID */
414 u32 resp_np:24; /* responder NPortID */
418 * un modified section of the fields
423 * RES els command payload
426 struct fc_els_cmd_s els_cmd; /* ELS command code */
428 u32 nport_id:24; /* N_Port identifier of source */
435 * RES els accept payload
438 struct fc_els_cmd_s els_cmd; /* ELS command code */
439 struct fc_exch_status_blk_s fc_exch_blk; /* Exchange status block */
443 * REC els command payload
446 struct fc_els_cmd_s els_cmd; /* ELS command code */
448 u32 nport_id:24; /* N_Port identifier of source */
453 #define FC_REC_ESB_OWN_RSP 0x80000000 /* responder owns */
454 #define FC_REC_ESB_SI 0x40000000 /* SI is owned */
455 #define FC_REC_ESB_COMP 0x20000000 /* exchange is complete */
456 #define FC_REC_ESB_ENDCOND_ABN 0x10000000 /* abnormal ending */
457 #define FC_REC_ESB_RQACT 0x04000000 /* recovery qual active */
458 #define FC_REC_ESB_ERRP_MSK 0x03000000
459 #define FC_REC_ESB_OXID_INV 0x00800000 /* invalid OXID */
460 #define FC_REC_ESB_RXID_INV 0x00400000 /* invalid RXID */
461 #define FC_REC_ESB_PRIO_INUSE 0x00200000
464 * REC els accept payload
466 struct fc_rec_acc_s {
467 struct fc_els_cmd_s els_cmd; /* ELS command code */
471 u32 orig_id:24; /* N_Port id of exchange originator */
473 u32 resp_id:24; /* N_Port id of exchange responder */
474 u32 count; /* data transfer count */
475 u32 e_stat; /* exchange status */
482 struct fc_els_cmd_s els_cmd;
490 * structure for PRLI paramater pages, both request & response
491 * see FC-PH-X table 113 & 115 for explanation also FCP table 8
493 struct fc_prli_params_s{
527 * valid values for rspcode in PRLI ACC payload
530 FC_PRLI_ACC_XQTD = 0x1, /* request executed */
531 FC_PRLI_ACC_PREDEF_IMG = 0x5, /* predefined image - no prli needed */
534 struct fc_prli_params_page_s{
554 struct fc_prli_params_s servparams;
558 * PRLI request and accept payload, FC-PH-X tables 112 & 114
564 struct fc_prli_params_page_s parampage;
568 * PRLO logout params page
570 struct fc_prlo_params_page_s{
574 u32 opa_valid:1; /* originator process associator
577 u32 rpa_valid:1; /* responder process associator valid */
581 u32 rpa_valid:1; /* responder process associator valid */
582 u32 opa_valid:1; /* originator process associator
586 u32 orig_process_assc;
587 u32 resp_process_assc;
593 * PRLO els command payload
599 struct fc_prlo_params_page_s prlo_params[1];
603 * PRLO Logout response parameter page
605 struct fc_prlo_acc_params_page_s{
610 u32 opa_valid:1; /* originator process associator
613 u32 rpa_valid:1; /* responder process associator valid */
617 u32 rpa_valid:1; /* responder process associator valid */
618 u32 opa_valid:1; /* originator process associator
622 u32 orig_process_assc;
623 u32 resp_process_assc;
629 * PRLO els command ACC payload
631 struct fc_prlo_acc_s{
635 struct fc_prlo_acc_params_page_s prlo_acc_params[1];
639 * SCR els command payload
642 FC_SCR_REG_FUNC_FABRIC_DETECTED = 0x01,
643 FC_SCR_REG_FUNC_N_PORT_DETECTED = 0x02,
644 FC_SCR_REG_FUNC_FULL = 0x03,
645 FC_SCR_REG_FUNC_CLEAR_REG = 0xFF,
648 /* SCR VU registrations */
650 FC_VU_SCR_REG_FUNC_FABRIC_NAME_CHANGE = 0x01
656 u32 vu_reg_func:8; /* Vendor Unique Registrations */
662 * Information category for Basic link data
674 * LS_RJT els reply payload
677 struct fc_els_cmd_s els_cmd; /* ELS command code */
679 u32 reason_code:8; /* Reason code for reject */
680 u32 reason_code_expl:8; /* Reason code explanation */
681 u32 vendor_unique:8; /* Vendor specific */
685 * LS_RJT reason codes
688 FC_LS_RJT_RSN_INV_CMD_CODE = 0x01,
689 FC_LS_RJT_RSN_LOGICAL_ERROR = 0x03,
690 FC_LS_RJT_RSN_LOGICAL_BUSY = 0x05,
691 FC_LS_RJT_RSN_PROTOCOL_ERROR = 0x07,
692 FC_LS_RJT_RSN_UNABLE_TO_PERF_CMD = 0x09,
693 FC_LS_RJT_RSN_CMD_NOT_SUPP = 0x0B,
697 * LS_RJT reason code explanation
700 FC_LS_RJT_EXP_NO_ADDL_INFO = 0x00,
701 FC_LS_RJT_EXP_SPARMS_ERR_OPTIONS = 0x01,
702 FC_LS_RJT_EXP_SPARMS_ERR_INI_CTL = 0x03,
703 FC_LS_RJT_EXP_SPARMS_ERR_REC_CTL = 0x05,
704 FC_LS_RJT_EXP_SPARMS_ERR_RXSZ = 0x07,
705 FC_LS_RJT_EXP_SPARMS_ERR_CONSEQ = 0x09,
706 FC_LS_RJT_EXP_SPARMS_ERR_CREDIT = 0x0B,
707 FC_LS_RJT_EXP_INV_PORT_NAME = 0x0D,
708 FC_LS_RJT_EXP_INV_NODE_FABRIC_NAME = 0x0E,
709 FC_LS_RJT_EXP_INV_CSP = 0x0F,
710 FC_LS_RJT_EXP_INV_ASSOC_HDR = 0x11,
711 FC_LS_RJT_EXP_ASSOC_HDR_REQD = 0x13,
712 FC_LS_RJT_EXP_INV_ORIG_S_ID = 0x15,
713 FC_LS_RJT_EXP_INV_OXID_RXID_COMB = 0x17,
714 FC_LS_RJT_EXP_CMD_ALREADY_IN_PROG = 0x19,
715 FC_LS_RJT_EXP_LOGIN_REQUIRED = 0x1E,
716 FC_LS_RJT_EXP_INVALID_NPORT_ID = 0x1F,
717 FC_LS_RJT_EXP_INSUFF_RES = 0x29,
718 FC_LS_RJT_EXP_CMD_NOT_SUPP = 0x2C,
719 FC_LS_RJT_EXP_INV_PAYLOAD_LEN = 0x2D,
723 * RRQ els command payload
726 struct fc_els_cmd_s els_cmd; /* ELS command code */
728 u32 s_id:24; /* exchange originator S_ID */
730 u32 ox_id:16; /* originator exchange ID */
731 u32 rx_id:16; /* responder exchange ID */
733 u32 res2[8]; /* optional association header */
737 * ABTS BA_ACC reply payload
740 u32 seq_id_valid:8; /* set to 0x00 for Abort Exchange */
741 u32 seq_id:8; /* invalid for Abort Exchange */
743 u32 ox_id:16; /* OX_ID from ABTS frame */
744 u32 rx_id:16; /* RX_ID from ABTS frame */
745 u32 low_seq_cnt:16; /* set to 0x0000 for Abort Exchange */
746 u32 high_seq_cnt:16;/* set to 0xFFFF for Abort Exchange */
750 * ABTS BA_RJT reject payload
753 u32 res1:8; /* Reserved */
754 u32 reason_code:8; /* reason code for reject */
755 u32 reason_expl:8; /* reason code explanation */
756 u32 vendor_unique:8;/* vendor unique reason code,set to 0 */
760 * TPRLO logout parameter page
762 struct fc_tprlo_params_page_s{
769 u32 tpo_nport_valid:1;
770 u32 global_process_logout:1;
774 u32 global_process_logout:1;
775 u32 tpo_nport_valid:1;
780 u32 orig_process_assc;
781 u32 resp_process_assc;
788 * TPRLO ELS command payload
795 struct fc_tprlo_params_page_s tprlo_params[1];
804 * TPRLO els command ACC payload
806 struct fc_tprlo_acc_s{
810 struct fc_prlo_acc_params_page_s tprlo_acc_params[1];
814 * RSCN els command req payload
816 #define FC_RSCN_PGLEN 0x4
819 FC_RSCN_FORMAT_PORTID = 0x0,
820 FC_RSCN_FORMAT_AREA = 0x1,
821 FC_RSCN_FORMAT_DOMAIN = 0x2,
822 FC_RSCN_FORMAT_FABRIC = 0x3,
825 struct fc_rscn_event_s{
836 struct fc_rscn_event_s event[1];
840 * ECHO els command req payload
843 struct fc_els_cmd_s els_cmd;
850 #define RNID_NODEID_DATA_FORMAT_COMMON 0x00
851 #define RNID_NODEID_DATA_FORMAT_FCP3 0x08
852 #define RNID_NODEID_DATA_FORMAT_DISCOVERY 0xDF
854 #define RNID_ASSOCIATED_TYPE_UNKNOWN 0x00000001
855 #define RNID_ASSOCIATED_TYPE_OTHER 0x00000002
856 #define RNID_ASSOCIATED_TYPE_HUB 0x00000003
857 #define RNID_ASSOCIATED_TYPE_SWITCH 0x00000004
858 #define RNID_ASSOCIATED_TYPE_GATEWAY 0x00000005
859 #define RNID_ASSOCIATED_TYPE_STORAGE_DEVICE 0x00000009
860 #define RNID_ASSOCIATED_TYPE_HOST 0x0000000A
861 #define RNID_ASSOCIATED_TYPE_STORAGE_SUBSYSTEM 0x0000000B
862 #define RNID_ASSOCIATED_TYPE_STORAGE_ACCESS_DEVICE 0x0000000E
863 #define RNID_ASSOCIATED_TYPE_NAS_SERVER 0x00000011
864 #define RNID_ASSOCIATED_TYPE_BRIDGE 0x00000002
865 #define RNID_ASSOCIATED_TYPE_VIRTUALIZATION_DEVICE 0x00000003
866 #define RNID_ASSOCIATED_TYPE_MULTI_FUNCTION_DEVICE 0x000000FF
869 * RNID els command payload
871 struct fc_rnid_cmd_s{
872 struct fc_els_cmd_s els_cmd;
873 u32 node_id_data_format:8;
878 * RNID els response payload
881 struct fc_rnid_common_id_data_s{
886 struct fc_rnid_general_topology_data_s{
887 u32 vendor_unique[4];
890 u32 num_attached_nodes;
893 u32 udp_tcp_port_num:16;
896 u32 vendor_specific:16;
899 struct fc_rnid_acc_s{
900 struct fc_els_cmd_s els_cmd;
901 u32 node_id_data_format:8;
902 u32 common_id_data_length:8;
904 u32 specific_id_data_length:8;
905 struct fc_rnid_common_id_data_s common_id_data;
906 struct fc_rnid_general_topology_data_s gen_topology_data;
909 #define RNID_ASSOCIATED_TYPE_UNKNOWN 0x00000001
910 #define RNID_ASSOCIATED_TYPE_OTHER 0x00000002
911 #define RNID_ASSOCIATED_TYPE_HUB 0x00000003
912 #define RNID_ASSOCIATED_TYPE_SWITCH 0x00000004
913 #define RNID_ASSOCIATED_TYPE_GATEWAY 0x00000005
914 #define RNID_ASSOCIATED_TYPE_STORAGE_DEVICE 0x00000009
915 #define RNID_ASSOCIATED_TYPE_HOST 0x0000000A
916 #define RNID_ASSOCIATED_TYPE_STORAGE_SUBSYSTEM 0x0000000B
917 #define RNID_ASSOCIATED_TYPE_STORAGE_ACCESS_DEVICE 0x0000000E
918 #define RNID_ASSOCIATED_TYPE_NAS_SERVER 0x00000011
919 #define RNID_ASSOCIATED_TYPE_BRIDGE 0x00000002
920 #define RNID_ASSOCIATED_TYPE_VIRTUALIZATION_DEVICE 0x00000003
921 #define RNID_ASSOCIATED_TYPE_MULTI_FUNCTION_DEVICE 0x000000FF
923 enum fc_rpsc_speed_cap{
924 RPSC_SPEED_CAP_1G = 0x8000,
925 RPSC_SPEED_CAP_2G = 0x4000,
926 RPSC_SPEED_CAP_4G = 0x2000,
927 RPSC_SPEED_CAP_10G = 0x1000,
928 RPSC_SPEED_CAP_8G = 0x0800,
929 RPSC_SPEED_CAP_16G = 0x0400,
931 RPSC_SPEED_CAP_UNKNOWN = 0x0001,
934 enum fc_rpsc_op_speed_s{
935 RPSC_OP_SPEED_1G = 0x8000,
936 RPSC_OP_SPEED_2G = 0x4000,
937 RPSC_OP_SPEED_4G = 0x2000,
938 RPSC_OP_SPEED_10G = 0x1000,
939 RPSC_OP_SPEED_8G = 0x0800,
940 RPSC_OP_SPEED_16G = 0x0400,
942 RPSC_OP_SPEED_NOT_EST = 0x0001, /*! speed not established */
945 struct fc_rpsc_speed_info_s{
946 u16 port_speed_cap; /*! see fc_rpsc_speed_cap_t */
947 u16 port_op_speed; /*! see fc_rpsc_op_speed_t */
950 enum link_e2e_beacon_subcmd{
951 LINK_E2E_BEACON_ON = 1,
952 LINK_E2E_BEACON_OFF = 2
956 BEACON_TYPE_NORMAL = 1, /*! Normal Beaconing. Green */
957 BEACON_TYPE_WARN = 2, /*! Warning Beaconing. Yellow/Amber */
958 BEACON_TYPE_CRITICAL = 3 /*! Critical Beaconing. Red */
961 struct link_e2e_beacon_param_s {
962 u8 beacon_type; /* Beacon Type. See beacon_type_t */
964 /* Beacon frequency. Number of blinks
967 u16 beacon_duration;/* Beacon duration (in Seconds). The
968 * command operation should be
969 * terminated at the end of this
972 * Ignored if diag_sub_cmd is
973 * LINK_E2E_BEACON_OFF.
975 * If 0, beaconing will continue till a
976 * BEACON OFF request is received
981 * Link E2E beacon request/good response format. For LS_RJTs use fc_ls_rjt_t
983 struct link_e2e_beacon_req_s{
984 u32 ls_code; /*! FC_ELS_E2E_LBEACON in requests *
985 *or FC_ELS_ACC in good replies */
986 u32 ls_sub_cmd; /*! See link_e2e_beacon_subcmd_t */
987 struct link_e2e_beacon_param_s beacon_parm;
991 * If RPSC request is sent to the Domain Controller, the request is for
992 * all the ports within that domain (TODO - I don't think FOS implements
995 struct fc_rpsc_cmd_s{
996 struct fc_els_cmd_s els_cmd;
1002 struct fc_rpsc_acc_s{
1007 struct fc_rpsc_speed_info_s speed_info[1];
1011 * If RPSC2 request is sent to the Domain Controller,
1013 #define FC_BRCD_TOKEN 0x42524344
1015 struct fc_rpsc2_cmd_s{
1016 struct fc_els_cmd_s els_cmd;
1019 u16 num_pids; /* Number of pids in the request */
1022 u32 pid:24; /* port identifier */
1026 enum fc_rpsc2_port_type{
1027 RPSC2_PORT_TYPE_UNKNOWN = 0,
1028 RPSC2_PORT_TYPE_NPORT = 1,
1029 RPSC2_PORT_TYPE_NLPORT = 2,
1030 RPSC2_PORT_TYPE_NPIV_PORT = 0x5f,
1031 RPSC2_PORT_TYPE_NPORT_TRUNK = 0x6f,
1035 * RPSC2 portInfo entry structure
1037 struct fc_rpsc2_port_info_s{
1040 u16 index; /* port number / index */
1042 u8 type; /* port type N/NL/... */
1043 u16 speed; /* port Operating Speed */
1047 * RPSC2 Accept payload
1049 struct fc_rpsc2_acc_s{
1052 u16 num_pids; /* Number of pids in the request */
1053 struct fc_rpsc2_port_info_s port_info[1]; /* port information */
1057 * bit fields so that multiple classes can be specified
1062 FC_CLASS_2_3 = 0x0C,
1068 struct fc_symname_s{
1069 u8 symname[FC_SYMNAME_MAX];
1073 u8 alpa_bm[FC_ALPA_MAX / 8];
1077 * protocol default timeout values
1080 #define FC_REC_TOV (FC_ED_TOV + 1)
1081 #define FC_RA_TOV 10
1082 #define FC_ELS_TOV (2 * FC_RA_TOV)
1085 * virtual fabric related defines
1087 #define FC_VF_ID_NULL 0 /* must not be used as VF_ID */
1088 #define FC_VF_ID_MIN 1
1089 #define FC_VF_ID_MAX 0xEFF
1090 #define FC_VF_ID_CTL 0xFEF /* control VF_ID */
1093 * Virtual Fabric Tagging header format
1094 * @caution This is defined only in BIG ENDIAN format.