2 * Copyright (c) 2005-2010 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.
26 #define FC_SYMNAME_MAX 256 /* max name server symbolic name size */
30 #define MAC_ADDRLEN (6)
31 struct mac_s
{ u8 mac
[MAC_ADDRLEN
]; };
32 #define mac_t struct mac_s
35 * generic SCSI cdb definition
37 #define SCSI_MAX_CDBLEN 16
39 u8 scsi_cdb
[SCSI_MAX_CDBLEN
];
42 /* ------------------------------------------------------------
43 * SCSI status byte values
44 * ------------------------------------------------------------
46 #define SCSI_STATUS_GOOD 0x00
47 #define SCSI_STATUS_CHECK_CONDITION 0x02
48 #define SCSI_STATUS_CONDITION_MET 0x04
49 #define SCSI_STATUS_BUSY 0x08
50 #define SCSI_STATUS_INTERMEDIATE 0x10
51 #define SCSI_STATUS_ICM 0x14 /* intermediate condition met */
52 #define SCSI_STATUS_RESERVATION_CONFLICT 0x18
53 #define SCSI_STATUS_COMMAND_TERMINATED 0x22
54 #define SCSI_STATUS_QUEUE_FULL 0x28
55 #define SCSI_STATUS_ACA_ACTIVE 0x30
57 #define SCSI_MAX_ALLOC_LEN 0xFF /* maximum allocarion length */
59 #define SCSI_SENSE_CUR_ERR 0x70
60 #define SCSI_SENSE_DEF_ERR 0x71
63 * SCSI additional sense codes
65 #define SCSI_ASC_LUN_NOT_READY 0x04
66 #define SCSI_ASC_LUN_NOT_SUPPORTED 0x25
67 #define SCSI_ASC_TOCC 0x3F
70 * SCSI additional sense code qualifiers
72 #define SCSI_ASCQ_MAN_INTR_REQ 0x03 /* manual intervention req */
73 #define SCSI_ASCQ_RL_DATA_CHANGED 0x0E /* report luns data changed */
76 * Methods of reporting informational exceptions
78 #define SCSI_MP_IEC_UNIT_ATTN 0x2 /* generate unit attention */
80 struct scsi_report_luns_data_s
{
81 u32 lun_list_length
; /* length of LUN list length */
83 struct scsi_lun lun
[1]; /* first LUN in lun list */
86 struct scsi_inquiry_vendor_s
{
90 struct scsi_inquiry_prodid_s
{
94 struct scsi_inquiry_prodrev_s
{
98 struct scsi_inquiry_data_s
{
100 u8 peripheral_qual
:3; /* peripheral qualifier */
101 u8 device_type
:5; /* peripheral device type */
102 u8 rmb
:1; /* removable medium bit */
103 u8 device_type_mod
:7; /* device type modifier */
105 u8 aenc
:1; /* async evt notification capability */
106 u8 trm_iop
:1; /* terminate I/O process */
107 u8 norm_aca
:1; /* normal ACA supported */
108 u8 hi_support
:1; /* SCSI-3: supports REPORT LUNS */
109 u8 rsp_data_format
:4;
114 u8 enc_serv
:1; /* enclosure service component */
116 u8 multi_port
:1; /* multi-port device */
117 u8 m_chngr
:1; /* device in medium transport element */
118 u8 ack_req_q
:1; /* SIP specific bit */
119 u8 addr32
:1; /* SIP specific bit */
120 u8 addr16
:1; /* SIP specific bit */
121 u8 rel_adr
:1; /* relative address */
125 u8 linked_commands
:1;
127 u8 cmd_queue
:1; /* command queueing supported */
128 u8 soft_reset
:1; /* soft reset alternative (VS) */
130 u8 device_type
:5; /* peripheral device type */
131 u8 peripheral_qual
:3; /* peripheral qualifier */
132 u8 device_type_mod
:7; /* device type modifier */
133 u8 rmb
:1; /* removable medium bit */
135 u8 rsp_data_format
:4;
136 u8 hi_support
:1; /* SCSI-3: supports REPORT LUNS */
137 u8 norm_aca
:1; /* normal ACA supported */
138 u8 terminate_iop
:1;/* terminate I/O process */
139 u8 aenc
:1; /* async evt notification capability */
143 u8 addr16
:1; /* SIP specific bit */
144 u8 addr32
:1; /* SIP specific bit */
145 u8 ack_req_q
:1; /* SIP specific bit */
146 u8 m_chngr
:1; /* device in medium transport element */
147 u8 multi_port
:1; /* multi-port device */
148 u8 reserved3
:1; /* TBD - Vendor Specific */
149 u8 enc_serv
:1; /* enclosure service component */
151 u8 soft_seset
:1; /* soft reset alternative (VS) */
152 u8 cmd_queue
:1; /* command queueing supported */
154 u8 linked_commands
:1;
158 u8 rel_adr
:1; /* relative address */
160 struct scsi_inquiry_vendor_s vendor_id
;
161 struct scsi_inquiry_prodid_s product_id
;
162 struct scsi_inquiry_prodrev_s product_rev
;
163 u8 vendor_specific
[20];
168 * SCSI sense data format
170 struct scsi_sense_s
{
181 u8 eom
:1; /* end of media */
182 u8 ili
:1; /* incorrect length indicator */
188 u8 ili
:1; /* incorrect length indicator */
189 u8 eom
:1; /* end of media */
192 u8 information
[4]; /* device-type or cmd specific info */
193 u8 add_sense_length
; /* additional sense length */
194 u8 command_info
[4];/* command specific information */
195 u8 asc
; /* additional sense code */
196 u8 ascq
; /* additional sense code qualifier */
197 u8 fru_code
; /* field replaceable unit code */
199 u8 sksv
:1; /* sense key specific valid */
200 u8 c_d
:1; /* command/data bit */
202 u8 bpv
:1; /* bit pointer valid */
203 u8 bpointer
:3; /* bit pointer */
205 u8 bpointer
:3; /* bit pointer */
206 u8 bpv
:1; /* bit pointer valid */
208 u8 c_d
:1; /* command/data bit */
209 u8 sksv
:1; /* sense key specific valid */
211 u8 fpointer
[2]; /* field pointer */
215 * Fibre Channel Header Structure (FCHS) definition
219 u32 routing
:4; /* routing bits */
220 u32 cat_info
:4; /* category info */
222 u32 cat_info
:4; /* category info */
223 u32 routing
:4; /* routing bits */
225 u32 d_id
:24; /* destination identifier */
227 u32 cs_ctl
:8; /* class specific control */
228 u32 s_id
:24; /* source identifier */
230 u32 type
:8; /* data structure type */
231 u32 f_ctl
:24; /* initial frame control */
233 u8 seq_id
; /* sequence identifier */
234 u8 df_ctl
; /* data field control */
235 u16 seq_cnt
; /* sequence count */
237 __be16 ox_id
; /* originator exchange ID */
238 u16 rx_id
; /* responder exchange ID */
240 u32 ro
; /* relative offset */
244 * routing bit definitions
247 FC_RTG_FC4_DEV_DATA
= 0x0, /* FC-4 Device Data */
248 FC_RTG_EXT_LINK
= 0x2, /* Extended Link Data */
249 FC_RTG_FC4_LINK_DATA
= 0x3, /* FC-4 Link Data */
250 FC_RTG_VIDEO_DATA
= 0x4, /* Video Data */
251 FC_RTG_EXT_HDR
= 0x5, /* VFT, IFR or Encapsuled */
252 FC_RTG_BASIC_LINK
= 0x8, /* Basic Link data */
253 FC_RTG_LINK_CTRL
= 0xC, /* Link Control */
257 * information category for extended link data and FC-4 Link Data
260 FC_CAT_LD_REQUEST
= 0x2, /* Request */
261 FC_CAT_LD_REPLY
= 0x3, /* Reply */
262 FC_CAT_LD_DIAG
= 0xF, /* for DIAG use only */
266 * information category for extended headers (VFT, IFR or encapsulation)
269 FC_CAT_VFT_HDR
= 0x0, /* Virtual fabric tagging header */
270 FC_CAT_IFR_HDR
= 0x1, /* Inter-Fabric routing header */
271 FC_CAT_ENC_HDR
= 0x2, /* Encapsulation header */
275 * information category for FC-4 device data
278 FC_CAT_UNCATEG_INFO
= 0x0, /* Uncategorized information */
279 FC_CAT_SOLICIT_DATA
= 0x1, /* Solicited Data */
280 FC_CAT_UNSOLICIT_CTRL
= 0x2, /* Unsolicited Control */
281 FC_CAT_SOLICIT_CTRL
= 0x3, /* Solicited Control */
282 FC_CAT_UNSOLICIT_DATA
= 0x4, /* Unsolicited Data */
283 FC_CAT_DATA_DESC
= 0x5, /* Data Descriptor */
284 FC_CAT_UNSOLICIT_CMD
= 0x6, /* Unsolicited Command */
285 FC_CAT_CMD_STATUS
= 0x7, /* Command Status */
289 * Type Field Definitions. FC-PH Section 18.5 pg. 165
292 FC_TYPE_BLS
= 0x0, /* Basic Link Service */
293 FC_TYPE_ELS
= 0x1, /* Extended Link Service */
294 FC_TYPE_IP
= 0x5, /* IP */
295 FC_TYPE_FCP
= 0x8, /* SCSI-FCP */
296 FC_TYPE_GPP
= 0x9, /* SCSI_GPP */
297 FC_TYPE_SERVICES
= 0x20, /* Fibre Channel Services */
298 FC_TYPE_FC_FSS
= 0x22, /* Fabric Switch Services */
299 FC_TYPE_FC_AL
= 0x23, /* FC-AL */
300 FC_TYPE_FC_SNMP
= 0x24, /* FC-SNMP */
301 FC_TYPE_FC_SPINFAB
= 0xEE, /* SPINFAB */
302 FC_TYPE_FC_DIAG
= 0xEF, /* DIAG */
303 FC_TYPE_MAX
= 256, /* 256 FC-4 types */
307 * Frame Control Definitions. FC-PH Table-45. pg. 168
310 FCTL_EC_ORIG
= 0x000000, /* exchange originator */
311 FCTL_EC_RESP
= 0x800000, /* exchange responder */
312 FCTL_SEQ_INI
= 0x000000, /* sequence initiator */
313 FCTL_SEQ_REC
= 0x400000, /* sequence recipient */
314 FCTL_FS_EXCH
= 0x200000, /* first sequence of xchg */
315 FCTL_LS_EXCH
= 0x100000, /* last sequence of xchg */
316 FCTL_END_SEQ
= 0x080000, /* last frame of sequence */
317 FCTL_SI_XFER
= 0x010000, /* seq initiative transfer */
318 FCTL_RO_PRESENT
= 0x000008, /* relative offset present */
319 FCTL_FILLBYTE_MASK
= 0x000003 /* , fill byte mask */
323 * Fabric Well Known Addresses
326 FC_MIN_WELL_KNOWN_ADDR
= 0xFFFFF0,
327 FC_DOMAIN_CONTROLLER_MASK
= 0xFFFC00,
328 FC_ALIAS_SERVER
= 0xFFFFF8,
329 FC_MGMT_SERVER
= 0xFFFFFA,
330 FC_TIME_SERVER
= 0xFFFFFB,
331 FC_NAME_SERVER
= 0xFFFFFC,
332 FC_FABRIC_CONTROLLER
= 0xFFFFFD,
333 FC_FABRIC_PORT
= 0xFFFFFE,
334 FC_BROADCAST_SERVER
= 0xFFFFFF
338 * domain/area/port defines
340 #define FC_DOMAIN_MASK 0xFF0000
341 #define FC_DOMAIN_SHIFT 16
342 #define FC_AREA_MASK 0x00FF00
343 #define FC_AREA_SHIFT 8
344 #define FC_PORT_MASK 0x0000FF
345 #define FC_PORT_SHIFT 0
347 #define FC_GET_DOMAIN(p) (((p) & FC_DOMAIN_MASK) >> FC_DOMAIN_SHIFT)
348 #define FC_GET_AREA(p) (((p) & FC_AREA_MASK) >> FC_AREA_SHIFT)
349 #define FC_GET_PORT(p) (((p) & FC_PORT_MASK) >> FC_PORT_SHIFT)
351 #define FC_DOMAIN_CTRLR(p) (FC_DOMAIN_CONTROLLER_MASK | (FC_GET_DOMAIN(p)))
354 FC_RXID_ANY
= 0xFFFFU
,
358 * generic ELS command
360 struct fc_els_cmd_s
{
361 u32 els_code
:8; /* ELS Command Code */
366 * ELS Command Codes. FC-PH Table-75. pg. 223
369 FC_ELS_LS_RJT
= 0x1, /* Link Service Reject. */
370 FC_ELS_ACC
= 0x02, /* Accept */
371 FC_ELS_PLOGI
= 0x03, /* N_Port Login. */
372 FC_ELS_FLOGI
= 0x04, /* F_Port Login. */
373 FC_ELS_LOGO
= 0x05, /* Logout. */
374 FC_ELS_ABTX
= 0x06, /* Abort Exchange */
375 FC_ELS_RES
= 0x08, /* Read Exchange status */
376 FC_ELS_RSS
= 0x09, /* Read sequence status block */
377 FC_ELS_RSI
= 0x0A, /* Request Sequence Initiative */
378 FC_ELS_ESTC
= 0x0C, /* Estimate Credit. */
379 FC_ELS_RTV
= 0x0E, /* Read Timeout Value. */
380 FC_ELS_RLS
= 0x0F, /* Read Link Status. */
381 FC_ELS_ECHO
= 0x10, /* Echo */
382 FC_ELS_TEST
= 0x11, /* Test */
383 FC_ELS_RRQ
= 0x12, /* Reinstate Recovery Qualifier. */
384 FC_ELS_REC
= 0x13, /* Add this for TAPE support in FCR */
385 FC_ELS_PRLI
= 0x20, /* Process Login */
386 FC_ELS_PRLO
= 0x21, /* Process Logout. */
387 FC_ELS_SCN
= 0x22, /* State Change Notification. */
388 FC_ELS_TPRLO
= 0x24, /* Third Party Process Logout. */
389 FC_ELS_PDISC
= 0x50, /* Discover N_Port Parameters. */
390 FC_ELS_FDISC
= 0x51, /* Discover F_Port Parameters. */
391 FC_ELS_ADISC
= 0x52, /* Discover Address. */
392 FC_ELS_FARP_REQ
= 0x54, /* FARP Request. */
393 FC_ELS_FARP_REP
= 0x55, /* FARP Reply. */
394 FC_ELS_FAN
= 0x60, /* Fabric Address Notification */
395 FC_ELS_RSCN
= 0x61, /* Reg State Change Notification */
396 FC_ELS_SCR
= 0x62, /* State Change Registration. */
397 FC_ELS_RTIN
= 0x77, /* Mangement server request */
398 FC_ELS_RNID
= 0x78, /* Mangement server request */
399 FC_ELS_RLIR
= 0x79, /* Registered Link Incident Record */
401 FC_ELS_RPSC
= 0x7D, /* Report Port Speed Capabilities */
402 FC_ELS_QSA
= 0x7E, /* Query Security Attributes. Ref FC-SP */
403 FC_ELS_E2E_LBEACON
= 0x81,
404 /* End-to-End Link Beacon */
405 FC_ELS_AUTH
= 0x90, /* Authentication. Ref FC-SP */
406 FC_ELS_RFCN
= 0x97, /* Request Fabric Change Notification. Ref
411 * Version numbers for FC-PH standards,
412 * used in login to indicate what port
413 * supports. See FC-PH-X table 158.
416 FC_PH_VER_4_3
= 0x09,
417 FC_PH_VER_PH_3
= 0x20,
429 * N_Port PLOGI Common Service Parameters.
430 * FC-PH-x. Figure-76. pg. 308.
432 struct fc_plogi_csp_s
{
433 u8 verhi
; /* FC-PH high version */
434 u8 verlo
; /* FC-PH low version */
435 __be16 bbcred
; /* BB_Credit */
438 u8 ciro
:1, /* continuously increasing RO */
439 rro
:1, /* random relative offset */
440 npiv_supp
:1, /* NPIV supported */
441 port_type
:1, /* N_Port/F_port */
442 altbbcred
:1, /* alternate BB_Credit */
443 resolution
:1, /* ms/ns ED_TOV resolution */
444 vvl_info
:1, /* VVL Info included */
453 cisc
:1, /* continuously increasing seq count */
457 resolution
:1, /* ms/ns ED_TOV resolution */
458 altbbcred
:1, /* alternate BB_Credit */
459 port_type
:1, /* N_Port/F_port */
460 npiv_supp
:1, /* NPIV supported */
461 rro
:1, /* random relative offset */
462 ciro
:1; /* continuously increasing RO */
465 cisc
:1, /* continuously increasing seq count */
473 __be16 rxsz
; /* receive data_field size */
480 * N_Port PLOGI Class Specific Parameters.
481 * FC-PH-x. Figure 78. pg. 318.
483 struct fc_plogi_clp_s
{
486 u32 intermix
:1; /* class intermix supported if set =1.
487 * valid only for class1. Reserved for
496 u32 intermix
:1; /* class intermix supported if set =1.
497 * valid only for class1. Reserved for
504 u32 rxsz
:16; /* Receive data_field size */
508 u32 e2e_credit
:16; /* end to end credit */
515 /* ASCII value for each character in string "BRCD" */
516 #define FLOGI_VVL_BRCD 0x42524344
519 * PLOGI els command and reply payload
522 struct fc_els_cmd_s els_cmd
; /* ELS command code */
523 struct fc_plogi_csp_s csp
; /* common service params */
526 struct fc_plogi_clp_s class1
; /* class 1 service parameters */
527 struct fc_plogi_clp_s class2
; /* class 2 service parameters */
528 struct fc_plogi_clp_s class3
; /* class 3 service parameters */
529 struct fc_plogi_clp_s class4
; /* class 4 service parameters */
530 u8 vvl
[16]; /* vendor version level */
534 * LOGO els command payload
537 struct fc_els_cmd_s els_cmd
; /* ELS command code */
539 u32 nport_id
:24; /* N_Port identifier of source */
540 wwn_t orig_port_name
; /* Port name of the LOGO originator */
544 * ADISC els command payload
547 struct fc_els_cmd_s els_cmd
; /* ELS command code */
549 u32 orig_HA
:24; /* originator hard address */
550 wwn_t orig_port_name
; /* originator port name */
551 wwn_t orig_node_name
; /* originator node name */
553 u32 nport_id
:24; /* originator NPortID */
557 * Exchange status block
559 struct fc_exch_status_blk_s
{
563 u32 orig_np
:24; /* originator NPortID */
565 u32 resp_np
:24; /* responder NPortID */
569 * un modified section of the fields
574 * RES els command payload
577 struct fc_els_cmd_s els_cmd
; /* ELS command code */
579 u32 nport_id
:24; /* N_Port identifier of source */
586 * RES els accept payload
588 struct fc_res_acc_s
{
589 struct fc_els_cmd_s els_cmd
; /* ELS command code */
590 struct fc_exch_status_blk_s fc_exch_blk
; /* Exchange status block */
594 * REC els command payload
597 struct fc_els_cmd_s els_cmd
; /* ELS command code */
599 u32 nport_id
:24; /* N_Port identifier of source */
604 #define FC_REC_ESB_OWN_RSP 0x80000000 /* responder owns */
605 #define FC_REC_ESB_SI 0x40000000 /* SI is owned */
606 #define FC_REC_ESB_COMP 0x20000000 /* exchange is complete */
607 #define FC_REC_ESB_ENDCOND_ABN 0x10000000 /* abnormal ending */
608 #define FC_REC_ESB_RQACT 0x04000000 /* recovery qual active */
609 #define FC_REC_ESB_ERRP_MSK 0x03000000
610 #define FC_REC_ESB_OXID_INV 0x00800000 /* invalid OXID */
611 #define FC_REC_ESB_RXID_INV 0x00400000 /* invalid RXID */
612 #define FC_REC_ESB_PRIO_INUSE 0x00200000
615 * REC els accept payload
617 struct fc_rec_acc_s
{
618 struct fc_els_cmd_s els_cmd
; /* ELS command code */
622 u32 orig_id
:24; /* N_Port id of exchange originator */
624 u32 resp_id
:24; /* N_Port id of exchange responder */
625 u32 count
; /* data transfer count */
626 u32 e_stat
; /* exchange status */
633 struct fc_els_cmd_s els_cmd
;
641 * structure for PRLI paramater pages, both request & response
642 * see FC-PH-X table 113 & 115 for explanation also FCP table 8
644 struct fc_prli_params_s
{
678 * valid values for rspcode in PRLI ACC payload
681 FC_PRLI_ACC_XQTD
= 0x1, /* request executed */
682 FC_PRLI_ACC_PREDEF_IMG
= 0x5, /* predefined image - no prli needed */
685 struct fc_prli_params_page_s
{
705 struct fc_prli_params_s servparams
;
709 * PRLI request and accept payload, FC-PH-X tables 112 & 114
715 struct fc_prli_params_page_s parampage
;
719 * PRLO logout params page
721 struct fc_prlo_params_page_s
{
725 u32 opa_valid
:1; /* originator process associator valid */
726 u32 rpa_valid
:1; /* responder process associator valid */
730 u32 rpa_valid
:1; /* responder process associator valid */
731 u32 opa_valid
:1; /* originator process associator valid */
733 u32 orig_process_assc
;
734 u32 resp_process_assc
;
740 * PRLO els command payload
746 struct fc_prlo_params_page_s prlo_params
[1];
750 * PRLO Logout response parameter page
752 struct fc_prlo_acc_params_page_s
{
757 u32 opa_valid
:1; /* originator process associator valid */
758 u32 rpa_valid
:1; /* responder process associator valid */
762 u32 rpa_valid
:1; /* responder process associator valid */
763 u32 opa_valid
:1; /* originator process associator valid */
765 u32 orig_process_assc
;
766 u32 resp_process_assc
;
772 * PRLO els command ACC payload
774 struct fc_prlo_acc_s
{
778 struct fc_prlo_acc_params_page_s prlo_acc_params
[1];
782 * SCR els command payload
785 FC_SCR_REG_FUNC_FABRIC_DETECTED
= 0x01,
786 FC_SCR_REG_FUNC_N_PORT_DETECTED
= 0x02,
787 FC_SCR_REG_FUNC_FULL
= 0x03,
788 FC_SCR_REG_FUNC_CLEAR_REG
= 0xFF,
791 /* SCR VU registrations */
793 FC_VU_SCR_REG_FUNC_FABRIC_NAME_CHANGE
= 0x01
799 u32 vu_reg_func
:8; /* Vendor Unique Registrations */
805 * Information category for Basic link data
817 * LS_RJT els reply payload
820 struct fc_els_cmd_s els_cmd
; /* ELS command code */
822 u32 reason_code
:8; /* Reason code for reject */
823 u32 reason_code_expl
:8; /* Reason code explanation */
824 u32 vendor_unique
:8; /* Vendor specific */
828 * LS_RJT reason codes
831 FC_LS_RJT_RSN_INV_CMD_CODE
= 0x01,
832 FC_LS_RJT_RSN_LOGICAL_ERROR
= 0x03,
833 FC_LS_RJT_RSN_LOGICAL_BUSY
= 0x05,
834 FC_LS_RJT_RSN_PROTOCOL_ERROR
= 0x07,
835 FC_LS_RJT_RSN_UNABLE_TO_PERF_CMD
= 0x09,
836 FC_LS_RJT_RSN_CMD_NOT_SUPP
= 0x0B,
840 * LS_RJT reason code explanation
843 FC_LS_RJT_EXP_NO_ADDL_INFO
= 0x00,
844 FC_LS_RJT_EXP_SPARMS_ERR_OPTIONS
= 0x01,
845 FC_LS_RJT_EXP_SPARMS_ERR_INI_CTL
= 0x03,
846 FC_LS_RJT_EXP_SPARMS_ERR_REC_CTL
= 0x05,
847 FC_LS_RJT_EXP_SPARMS_ERR_RXSZ
= 0x07,
848 FC_LS_RJT_EXP_SPARMS_ERR_CONSEQ
= 0x09,
849 FC_LS_RJT_EXP_SPARMS_ERR_CREDIT
= 0x0B,
850 FC_LS_RJT_EXP_INV_PORT_NAME
= 0x0D,
851 FC_LS_RJT_EXP_INV_NODE_FABRIC_NAME
= 0x0E,
852 FC_LS_RJT_EXP_INV_CSP
= 0x0F,
853 FC_LS_RJT_EXP_INV_ASSOC_HDR
= 0x11,
854 FC_LS_RJT_EXP_ASSOC_HDR_REQD
= 0x13,
855 FC_LS_RJT_EXP_INV_ORIG_S_ID
= 0x15,
856 FC_LS_RJT_EXP_INV_OXID_RXID_COMB
= 0x17,
857 FC_LS_RJT_EXP_CMD_ALREADY_IN_PROG
= 0x19,
858 FC_LS_RJT_EXP_LOGIN_REQUIRED
= 0x1E,
859 FC_LS_RJT_EXP_INVALID_NPORT_ID
= 0x1F,
860 FC_LS_RJT_EXP_INSUFF_RES
= 0x29,
861 FC_LS_RJT_EXP_CMD_NOT_SUPP
= 0x2C,
862 FC_LS_RJT_EXP_INV_PAYLOAD_LEN
= 0x2D,
866 * RRQ els command payload
869 struct fc_els_cmd_s els_cmd
; /* ELS command code */
871 u32 s_id
:24; /* exchange originator S_ID */
873 u32 ox_id
:16; /* originator exchange ID */
874 u32 rx_id
:16; /* responder exchange ID */
876 u32 res2
[8]; /* optional association header */
880 * ABTS BA_ACC reply payload
883 u32 seq_id_valid
:8; /* set to 0x00 for Abort Exchange */
884 u32 seq_id
:8; /* invalid for Abort Exchange */
886 u32 ox_id
:16; /* OX_ID from ABTS frame */
887 u32 rx_id
:16; /* RX_ID from ABTS frame */
888 u32 low_seq_cnt
:16; /* set to 0x0000 for Abort Exchange */
889 u32 high_seq_cnt
:16; /* set to 0xFFFF for Abort Exchange */
893 * ABTS BA_RJT reject payload
896 u32 res1
:8; /* Reserved */
897 u32 reason_code
:8; /* reason code for reject */
898 u32 reason_expl
:8; /* reason code explanation */
899 u32 vendor_unique
:8; /* vendor unique reason code,set to 0 */
903 * TPRLO logout parameter page
905 struct fc_tprlo_params_page_s
{
912 u32 tpo_nport_valid
:1;
913 u32 global_process_logout
:1;
917 u32 global_process_logout
:1;
918 u32 tpo_nport_valid
:1;
923 u32 orig_process_assc
;
924 u32 resp_process_assc
;
931 * TPRLO ELS command payload
938 struct fc_tprlo_params_page_s tprlo_params
[1];
947 * TPRLO els command ACC payload
949 struct fc_tprlo_acc_s
{
953 struct fc_prlo_acc_params_page_s tprlo_acc_params
[1];
957 * RSCN els command req payload
959 #define FC_RSCN_PGLEN 0x4
961 enum fc_rscn_format
{
962 FC_RSCN_FORMAT_PORTID
= 0x0,
963 FC_RSCN_FORMAT_AREA
= 0x1,
964 FC_RSCN_FORMAT_DOMAIN
= 0x2,
965 FC_RSCN_FORMAT_FABRIC
= 0x3,
968 struct fc_rscn_event_s
{
975 struct fc_rscn_pl_s
{
979 struct fc_rscn_event_s event
[1];
983 * ECHO els command req payload
986 struct fc_els_cmd_s els_cmd
;
992 #define RNID_NODEID_DATA_FORMAT_COMMON 0x00
993 #define RNID_NODEID_DATA_FORMAT_FCP3 0x08
994 #define RNID_NODEID_DATA_FORMAT_DISCOVERY 0xDF
996 #define RNID_ASSOCIATED_TYPE_UNKNOWN 0x00000001
997 #define RNID_ASSOCIATED_TYPE_OTHER 0x00000002
998 #define RNID_ASSOCIATED_TYPE_HUB 0x00000003
999 #define RNID_ASSOCIATED_TYPE_SWITCH 0x00000004
1000 #define RNID_ASSOCIATED_TYPE_GATEWAY 0x00000005
1001 #define RNID_ASSOCIATED_TYPE_STORAGE_DEVICE 0x00000009
1002 #define RNID_ASSOCIATED_TYPE_HOST 0x0000000A
1003 #define RNID_ASSOCIATED_TYPE_STORAGE_SUBSYSTEM 0x0000000B
1004 #define RNID_ASSOCIATED_TYPE_STORAGE_ACCESS_DEVICE 0x0000000E
1005 #define RNID_ASSOCIATED_TYPE_NAS_SERVER 0x00000011
1006 #define RNID_ASSOCIATED_TYPE_BRIDGE 0x00000002
1007 #define RNID_ASSOCIATED_TYPE_VIRTUALIZATION_DEVICE 0x00000003
1008 #define RNID_ASSOCIATED_TYPE_MULTI_FUNCTION_DEVICE 0x000000FF
1011 * RNID els command payload
1013 struct fc_rnid_cmd_s
{
1014 struct fc_els_cmd_s els_cmd
;
1015 u32 node_id_data_format
:8;
1020 * RNID els response payload
1023 struct fc_rnid_common_id_data_s
{
1028 struct fc_rnid_general_topology_data_s
{
1029 u32 vendor_unique
[4];
1032 __be32 num_attached_nodes
;
1035 u32 udp_tcp_port_num
:16;
1038 u32 vendor_specific
:16;
1041 struct fc_rnid_acc_s
{
1042 struct fc_els_cmd_s els_cmd
;
1043 u32 node_id_data_format
:8;
1044 u32 common_id_data_length
:8;
1046 u32 specific_id_data_length
:8;
1047 struct fc_rnid_common_id_data_s common_id_data
;
1048 struct fc_rnid_general_topology_data_s gen_topology_data
;
1051 #define RNID_ASSOCIATED_TYPE_UNKNOWN 0x00000001
1052 #define RNID_ASSOCIATED_TYPE_OTHER 0x00000002
1053 #define RNID_ASSOCIATED_TYPE_HUB 0x00000003
1054 #define RNID_ASSOCIATED_TYPE_SWITCH 0x00000004
1055 #define RNID_ASSOCIATED_TYPE_GATEWAY 0x00000005
1056 #define RNID_ASSOCIATED_TYPE_STORAGE_DEVICE 0x00000009
1057 #define RNID_ASSOCIATED_TYPE_HOST 0x0000000A
1058 #define RNID_ASSOCIATED_TYPE_STORAGE_SUBSYSTEM 0x0000000B
1059 #define RNID_ASSOCIATED_TYPE_STORAGE_ACCESS_DEVICE 0x0000000E
1060 #define RNID_ASSOCIATED_TYPE_NAS_SERVER 0x00000011
1061 #define RNID_ASSOCIATED_TYPE_BRIDGE 0x00000002
1062 #define RNID_ASSOCIATED_TYPE_VIRTUALIZATION_DEVICE 0x00000003
1063 #define RNID_ASSOCIATED_TYPE_MULTI_FUNCTION_DEVICE 0x000000FF
1065 enum fc_rpsc_speed_cap
{
1066 RPSC_SPEED_CAP_1G
= 0x8000,
1067 RPSC_SPEED_CAP_2G
= 0x4000,
1068 RPSC_SPEED_CAP_4G
= 0x2000,
1069 RPSC_SPEED_CAP_10G
= 0x1000,
1070 RPSC_SPEED_CAP_8G
= 0x0800,
1071 RPSC_SPEED_CAP_16G
= 0x0400,
1073 RPSC_SPEED_CAP_UNKNOWN
= 0x0001,
1076 enum fc_rpsc_op_speed
{
1077 RPSC_OP_SPEED_1G
= 0x8000,
1078 RPSC_OP_SPEED_2G
= 0x4000,
1079 RPSC_OP_SPEED_4G
= 0x2000,
1080 RPSC_OP_SPEED_10G
= 0x1000,
1081 RPSC_OP_SPEED_8G
= 0x0800,
1082 RPSC_OP_SPEED_16G
= 0x0400,
1084 RPSC_OP_SPEED_NOT_EST
= 0x0001, /* speed not established */
1087 struct fc_rpsc_speed_info_s
{
1088 __be16 port_speed_cap
; /* see enum fc_rpsc_speed_cap */
1089 __be16 port_op_speed
; /* see enum fc_rpsc_op_speed */
1093 * If RPSC request is sent to the Domain Controller, the request is for
1094 * all the ports within that domain.
1096 struct fc_rpsc_cmd_s
{
1097 struct fc_els_cmd_s els_cmd
;
1103 struct fc_rpsc_acc_s
{
1108 struct fc_rpsc_speed_info_s speed_info
[1];
1112 * If RPSC2 request is sent to the Domain Controller,
1114 #define FC_BRCD_TOKEN 0x42524344
1116 struct fc_rpsc2_cmd_s
{
1117 struct fc_els_cmd_s els_cmd
;
1120 __be16 num_pids
; /* Number of pids in the request */
1123 u32 pid
:24; /* port identifier */
1127 enum fc_rpsc2_port_type
{
1128 RPSC2_PORT_TYPE_UNKNOWN
= 0,
1129 RPSC2_PORT_TYPE_NPORT
= 1,
1130 RPSC2_PORT_TYPE_NLPORT
= 2,
1131 RPSC2_PORT_TYPE_NPIV_PORT
= 0x5f,
1132 RPSC2_PORT_TYPE_NPORT_TRUNK
= 0x6f,
1136 * RPSC2 portInfo entry structure
1138 struct fc_rpsc2_port_info_s
{
1139 __be32 pid
; /* PID */
1141 __be16 index
; /* port number / index */
1143 u8 type
; /* port type N/NL/... */
1144 __be16 speed
; /* port Operating Speed */
1148 * RPSC2 Accept payload
1150 struct fc_rpsc2_acc_s
{
1153 __be16 num_pids
; /* Number of pids in the request */
1154 struct fc_rpsc2_port_info_s port_info
[1]; /* port information */
1158 * bit fields so that multiple classes can be specified
1163 FC_CLASS_2_3
= 0x0C,
1169 struct fc_symname_s
{
1170 u8 symname
[FC_SYMNAME_MAX
];
1174 * protocol default timeout values
1177 #define FC_REC_TOV (FC_ED_TOV + 1)
1178 #define FC_RA_TOV 10
1179 #define FC_ELS_TOV ((2 * FC_RA_TOV) + 1)
1180 #define FC_FCCT_TOV (3 * FC_RA_TOV)
1183 * virtual fabric related defines
1185 #define FC_VF_ID_NULL 0 /* must not be used as VF_ID */
1186 #define FC_VF_ID_MIN 1
1187 #define FC_VF_ID_MAX 0xEFF
1188 #define FC_VF_ID_CTL 0xFEF /* control VF_ID */
1191 * Virtual Fabric Tagging header format
1192 * @caution This is defined only in BIG ENDIAN format.
1207 * FCP_CMND definitions
1209 #define FCP_CMND_CDB_LEN 16
1210 #define FCP_CMND_LUN_LEN 8
1213 struct scsi_lun lun
; /* 64-bit LU number */
1214 u8 crn
; /* command reference number */
1217 priority
:4, /* FCP-3: SAM-3 priority */
1218 taskattr
:3; /* scsi task attribute */
1220 u8 taskattr
:3, /* scsi task attribute */
1221 priority
:4, /* FCP-3: SAM-3 priority */
1224 u8 tm_flags
; /* task management flags */
1226 u8 addl_cdb_len
:6, /* additional CDB length words */
1227 iodir
:2; /* read/write FCP_DATA IUs */
1229 u8 iodir
:2, /* read/write FCP_DATA IUs */
1230 addl_cdb_len
:6; /* additional CDB length */
1232 struct scsi_cdb_s cdb
;
1234 __be32 fcp_dl
; /* bytes to be transferred */
1237 #define fcp_cmnd_cdb_len(_cmnd) ((_cmnd)->addl_cdb_len * 4 + FCP_CMND_CDB_LEN)
1238 #define fcp_cmnd_fcpdl(_cmnd) ((&(_cmnd)->fcp_dl)[(_cmnd)->addl_cdb_len])
1241 * struct fcp_cmnd_s .iodir field values
1245 FCP_IODIR_WRITE
= 1,
1251 * Task management flags field - only one bit shall be set
1254 FCP_TM_ABORT_TASK_SET
= BIT(1),
1255 FCP_TM_CLEAR_TASK_SET
= BIT(2),
1256 FCP_TM_LUN_RESET
= BIT(4),
1257 FCP_TM_TARGET_RESET
= BIT(5), /* obsolete in FCP-3 */
1258 FCP_TM_CLEAR_ACA
= BIT(6),
1262 * FCP_RSP residue flags
1265 FCP_NO_RESIDUE
= 0, /* no residue */
1266 FCP_RESID_OVER
= 1, /* more data left that was not sent */
1267 FCP_RESID_UNDER
= 2, /* less data than requested */
1270 struct fcp_rspinfo_s
{
1272 u32 rsp_code
:8; /* response code (as above) */
1277 u32 reserved
[2]; /* 2 words reserved */
1281 u8 fcp_conf_req
:1; /* FCP_CONF is requested */
1282 u8 resid_flags
:2; /* underflow/overflow */
1283 u8 sns_len_valid
:1; /* sense len is valid */
1284 u8 rsp_len_valid
:1; /* response len is valid */
1286 u8 rsp_len_valid
:1; /* response len is valid */
1287 u8 sns_len_valid
:1; /* sense len is valid */
1288 u8 resid_flags
:2; /* underflow/overflow */
1289 u8 fcp_conf_req
:1; /* FCP_CONF is requested */
1292 u8 scsi_status
; /* one byte SCSI status */
1293 u32 residue
; /* residual data bytes */
1294 u32 sns_len
; /* length od sense info */
1295 u32 rsp_len
; /* length of response info */
1298 #define fcp_snslen(__fcprsp) ((__fcprsp)->sns_len_valid ? \
1299 (__fcprsp)->sns_len : 0)
1300 #define fcp_rsplen(__fcprsp) ((__fcprsp)->rsp_len_valid ? \
1301 (__fcprsp)->rsp_len : 0)
1302 #define fcp_rspinfo(__fcprsp) ((struct fcp_rspinfo_s *)((__fcprsp) + 1))
1303 #define fcp_snsinfo(__fcprsp) (((u8 *)fcp_rspinfo(__fcprsp)) + \
1304 fcp_rsplen(__fcprsp))
1309 u32 rev_id
:8; /* Revision of the CT */
1310 u32 in_id
:24; /* Initiator Id */
1311 u32 gs_type
:8; /* Generic service Type */
1312 u32 gs_sub_type
:8; /* Generic service sub type */
1313 u32 options
:8; /* options */
1314 u32 rsvrd
:8; /* reserved */
1315 u32 cmd_rsp_code
:16;/* ct command/response code */
1316 u32 max_res_size
:16;/* maximum/residual size */
1317 u32 frag_id
:8; /* fragment ID */
1318 u32 reason_code
:8; /* reason code */
1319 u32 exp_code
:8; /* explanation code */
1320 u32 vendor_unq
:8; /* vendor unique */
1324 * defines for the Revision
1327 CT_GS3_REVISION
= 0x01,
1331 * defines for gs_type
1334 CT_GSTYPE_KEYSERVICE
= 0xF7,
1335 CT_GSTYPE_ALIASSERVICE
= 0xF8,
1336 CT_GSTYPE_MGMTSERVICE
= 0xFA,
1337 CT_GSTYPE_TIMESERVICE
= 0xFB,
1338 CT_GSTYPE_DIRSERVICE
= 0xFC,
1342 * defines for gs_sub_type for gs type directory service
1345 CT_GSSUBTYPE_NAMESERVER
= 0x02,
1349 * defines for gs_sub_type for gs type management service
1352 CT_GSSUBTYPE_CFGSERVER
= 0x01,
1353 CT_GSSUBTYPE_UNZONED_NS
= 0x02,
1354 CT_GSSUBTYPE_ZONESERVER
= 0x03,
1355 CT_GSSUBTYPE_LOCKSERVER
= 0x04,
1356 CT_GSSUBTYPE_HBA_MGMTSERVER
= 0x10, /* for FDMI */
1360 * defines for CT response code field
1363 CT_RSP_REJECT
= 0x8001,
1364 CT_RSP_ACCEPT
= 0x8002,
1368 * defintions for CT reason code
1371 CT_RSN_INV_CMD
= 0x01,
1372 CT_RSN_INV_VER
= 0x02,
1373 CT_RSN_LOGIC_ERR
= 0x03,
1374 CT_RSN_INV_SIZE
= 0x04,
1375 CT_RSN_LOGICAL_BUSY
= 0x05,
1376 CT_RSN_PROTO_ERR
= 0x07,
1377 CT_RSN_UNABLE_TO_PERF
= 0x09,
1378 CT_RSN_NOT_SUPP
= 0x0B,
1379 CT_RSN_SERVER_NOT_AVBL
= 0x0D,
1380 CT_RSN_SESSION_COULD_NOT_BE_ESTBD
= 0x0E,
1381 CT_RSN_VENDOR_SPECIFIC
= 0xFF,
1386 * definitions for explanations code for Name server
1389 CT_NS_EXP_NOADDITIONAL
= 0x00,
1390 CT_NS_EXP_ID_NOT_REG
= 0x01,
1391 CT_NS_EXP_PN_NOT_REG
= 0x02,
1392 CT_NS_EXP_NN_NOT_REG
= 0x03,
1393 CT_NS_EXP_CS_NOT_REG
= 0x04,
1394 CT_NS_EXP_IPN_NOT_REG
= 0x05,
1395 CT_NS_EXP_IPA_NOT_REG
= 0x06,
1396 CT_NS_EXP_FT_NOT_REG
= 0x07,
1397 CT_NS_EXP_SPN_NOT_REG
= 0x08,
1398 CT_NS_EXP_SNN_NOT_REG
= 0x09,
1399 CT_NS_EXP_PT_NOT_REG
= 0x0A,
1400 CT_NS_EXP_IPP_NOT_REG
= 0x0B,
1401 CT_NS_EXP_FPN_NOT_REG
= 0x0C,
1402 CT_NS_EXP_HA_NOT_REG
= 0x0D,
1403 CT_NS_EXP_FD_NOT_REG
= 0x0E,
1404 CT_NS_EXP_FF_NOT_REG
= 0x0F,
1405 CT_NS_EXP_ACCESSDENIED
= 0x10,
1406 CT_NS_EXP_UNACCEPTABLE_ID
= 0x11,
1407 CT_NS_EXP_DATABASEEMPTY
= 0x12,
1408 CT_NS_EXP_NOT_REG_IN_SCOPE
= 0x13,
1409 CT_NS_EXP_DOM_ID_NOT_PRESENT
= 0x14,
1410 CT_NS_EXP_PORT_NUM_NOT_PRESENT
= 0x15,
1411 CT_NS_EXP_NO_DEVICE_ATTACHED
= 0x16
1415 * defintions for the explanation code for all servers
1418 CT_EXP_AUTH_EXCEPTION
= 0xF1,
1419 CT_EXP_DB_FULL
= 0xF2,
1420 CT_EXP_DB_EMPTY
= 0xF3,
1421 CT_EXP_PROCESSING_REQ
= 0xF4,
1422 CT_EXP_UNABLE_TO_VERIFY_CONN
= 0xF5,
1423 CT_EXP_DEVICES_NOT_IN_CMN_ZONE
= 0xF6
1427 * Command codes for Name server
1430 GS_GID_PN
= 0x0121, /* Get Id on port name */
1431 GS_GPN_ID
= 0x0112, /* Get port name on ID */
1432 GS_GNN_ID
= 0x0113, /* Get node name on ID */
1433 GS_GID_FT
= 0x0171, /* Get Id on FC4 type */
1434 GS_GSPN_ID
= 0x0118, /* Get symbolic PN on ID */
1435 GS_RFT_ID
= 0x0217, /* Register fc4type on ID */
1436 GS_RSPN_ID
= 0x0218, /* Register symbolic PN on ID */
1437 GS_RPN_ID
= 0x0212, /* Register port name */
1438 GS_RNN_ID
= 0x0213, /* Register node name */
1439 GS_RCS_ID
= 0x0214, /* Register class of service */
1440 GS_RPT_ID
= 0x021A, /* Register port type */
1441 GS_GA_NXT
= 0x0100, /* Get all next */
1442 GS_RFF_ID
= 0x021F, /* Register FC4 Feature */
1445 struct fcgs_id_req_s
{
1447 u32 dap
:24; /* port identifier */
1449 #define fcgs_gpnid_req_t struct fcgs_id_req_s
1450 #define fcgs_gnnid_req_t struct fcgs_id_req_s
1451 #define fcgs_gspnid_req_t struct fcgs_id_req_s
1453 struct fcgs_gidpn_req_s
{
1454 wwn_t port_name
; /* port wwn */
1457 struct fcgs_gidpn_resp_s
{
1459 u32 dap
:24; /* port identifier */
1465 struct fcgs_rftid_req_s
{
1467 u32 dap
:24; /* port identifier */
1468 __be32 fc4_type
[8]; /* fc4 types */
1472 * RFF_ID : Register FC4 features.
1474 #define FC_GS_FCP_FC4_FEATURE_INITIATOR 0x02
1475 #define FC_GS_FCP_FC4_FEATURE_TARGET 0x01
1477 struct fcgs_rffid_req_s
{
1479 u32 dap
:24; /* port identifier */
1481 u32 fc4ftr_bits
:8; /* fc4 feature bits */
1482 u32 fc4_type
:8; /* corresponding FC4 Type */
1488 struct fcgs_gidft_req_s
{
1490 u8 domain_id
; /* domain, 0 - all fabric */
1491 u8 area_id
; /* area, 0 - whole domain */
1492 u8 fc4_type
; /* FC_TYPE_FCP for SCSI devices */
1498 struct fcgs_gidft_resp_s
{
1499 u8 last
:1; /* last port identifier flag */
1501 u32 pid
:24; /* port identifier */
1507 struct fcgs_rspnid_req_s
{
1509 u32 dap
:24; /* port identifier */
1510 u8 spn_len
; /* symbolic port name length */
1511 u8 spn
[256]; /* symbolic port name */
1517 struct fcgs_rpnid_req_s
{
1526 struct fcgs_rnnid_req_s
{
1535 struct fcgs_rcsid_req_s
{
1544 struct fcgs_rptid_req_s
{
1554 struct fcgs_ganxt_req_s
{
1562 struct fcgs_ganxt_rsp_s
{
1563 u32 port_type
:8; /* Port Type */
1564 u32 port_id
:24; /* Port Identifier */
1565 wwn_t port_name
; /* Port Name */
1566 u8 spn_len
; /* Length of Symbolic Port Name */
1567 char spn
[255]; /* Symbolic Port Name */
1568 wwn_t node_name
; /* Node Name */
1569 u8 snn_len
; /* Length of Symbolic Node Name */
1570 char snn
[255]; /* Symbolic Node Name */
1571 u8 ipa
[8]; /* Initial Process Associator */
1572 u8 ip
[16]; /* IP Address */
1573 u32 cos
; /* Class of Service */
1574 u32 fc4types
[8]; /* FC-4 TYPEs */
1575 wwn_t fabric_port_name
; /* Fabric Port Name */
1576 u32 rsvd
:8; /* Reserved */
1577 u32 hard_addr
:24; /* Hard Address */
1581 * Command codes for Fabric Configuration Server
1584 GS_FC_GFN_CMD
= 0x0114, /* GS FC Get Fabric Name */
1585 GS_FC_GMAL_CMD
= 0x0116, /* GS FC GMAL */
1586 GS_FC_TRACE_CMD
= 0x0400, /* GS FC Trace Route */
1587 GS_FC_PING_CMD
= 0x0401, /* GS FC Ping */
1591 * GMAL Command ( Get ( interconnect Element) Management Address List)
1592 * To retrieve the IP Address of a Switch.
1594 #define CT_GMAL_RESP_PREFIX_TELNET "telnet://"
1595 #define CT_GMAL_RESP_PREFIX_HTTP "http://"
1597 /* GMAL/GFN request */
1599 wwn_t wwn
; /* PWWN/NWWN */
1602 #define fcgs_gmal_req_t struct fcgs_req_s
1603 #define fcgs_gfn_req_t struct fcgs_req_s
1605 /* Accept Response to GMAL */
1606 struct fcgs_gmal_resp_s
{
1607 __be32 ms_len
; /* Num of entries */
1611 struct fcgs_gmal_entry_s
{
1613 u8 prefix
[7]; /* like "http://" */
1618 * FDMI Command Codes
1620 #define FDMI_GRHL 0x0100
1621 #define FDMI_GHAT 0x0101
1622 #define FDMI_GRPL 0x0102
1623 #define FDMI_GPAT 0x0110
1624 #define FDMI_RHBA 0x0200
1625 #define FDMI_RHAT 0x0201
1626 #define FDMI_RPRT 0x0210
1627 #define FDMI_RPA 0x0211
1628 #define FDMI_DHBA 0x0300
1629 #define FDMI_DPRT 0x0310
1634 #define FDMI_NO_ADDITIONAL_EXP 0x00
1635 #define FDMI_HBA_ALREADY_REG 0x10
1636 #define FDMI_HBA_ATTRIB_NOT_REG 0x11
1637 #define FDMI_HBA_ATTRIB_MULTIPLE 0x12
1638 #define FDMI_HBA_ATTRIB_LENGTH_INVALID 0x13
1639 #define FDMI_HBA_ATTRIB_NOT_PRESENT 0x14
1640 #define FDMI_PORT_ORIG_NOT_IN_LIST 0x15
1641 #define FDMI_PORT_HBA_NOT_IN_LIST 0x16
1642 #define FDMI_PORT_ATTRIB_NOT_REG 0x20
1643 #define FDMI_PORT_NOT_REG 0x21
1644 #define FDMI_PORT_ATTRIB_MULTIPLE 0x22
1645 #define FDMI_PORT_ATTRIB_LENGTH_INVALID 0x23
1646 #define FDMI_PORT_ALREADY_REGISTEREED 0x24
1649 * FDMI Transmission Speed Mask values
1651 #define FDMI_TRANS_SPEED_1G 0x00000001
1652 #define FDMI_TRANS_SPEED_2G 0x00000002
1653 #define FDMI_TRANS_SPEED_10G 0x00000004
1654 #define FDMI_TRANS_SPEED_4G 0x00000008
1655 #define FDMI_TRANS_SPEED_8G 0x00000010
1656 #define FDMI_TRANS_SPEED_16G 0x00000020
1657 #define FDMI_TRANS_SPEED_UNKNOWN 0x00008000
1660 * FDMI HBA attribute types
1662 enum fdmi_hba_attribute_type
{
1663 FDMI_HBA_ATTRIB_NODENAME
= 1, /* 0x0001 */
1664 FDMI_HBA_ATTRIB_MANUFACTURER
, /* 0x0002 */
1665 FDMI_HBA_ATTRIB_SERIALNUM
, /* 0x0003 */
1666 FDMI_HBA_ATTRIB_MODEL
, /* 0x0004 */
1667 FDMI_HBA_ATTRIB_MODEL_DESC
, /* 0x0005 */
1668 FDMI_HBA_ATTRIB_HW_VERSION
, /* 0x0006 */
1669 FDMI_HBA_ATTRIB_DRIVER_VERSION
, /* 0x0007 */
1670 FDMI_HBA_ATTRIB_ROM_VERSION
, /* 0x0008 */
1671 FDMI_HBA_ATTRIB_FW_VERSION
, /* 0x0009 */
1672 FDMI_HBA_ATTRIB_OS_NAME
, /* 0x000A */
1673 FDMI_HBA_ATTRIB_MAX_CT
, /* 0x000B */
1675 FDMI_HBA_ATTRIB_MAX_TYPE
1679 * FDMI Port attribute types
1681 enum fdmi_port_attribute_type
{
1682 FDMI_PORT_ATTRIB_FC4_TYPES
= 1, /* 0x0001 */
1683 FDMI_PORT_ATTRIB_SUPP_SPEED
, /* 0x0002 */
1684 FDMI_PORT_ATTRIB_PORT_SPEED
, /* 0x0003 */
1685 FDMI_PORT_ATTRIB_FRAME_SIZE
, /* 0x0004 */
1686 FDMI_PORT_ATTRIB_DEV_NAME
, /* 0x0005 */
1687 FDMI_PORT_ATTRIB_HOST_NAME
, /* 0x0006 */
1689 FDMI_PORT_ATTR_MAX_TYPE
1695 struct fdmi_attr_s
{
1702 * HBA Attribute Block
1704 struct fdmi_hba_attr_s
{
1705 __be32 attr_count
; /* # of attributes */
1706 struct fdmi_attr_s hba_attr
; /* n attributes */
1710 * Registered Port List
1712 struct fdmi_port_list_s
{
1713 __be32 num_ports
; /* number Of Port Entries */
1714 wwn_t port_entry
; /* one or more */
1718 * Port Attribute Block
1720 struct fdmi_port_attr_s
{
1721 __be32 attr_count
; /* # of attributes */
1722 struct fdmi_attr_s port_attr
; /* n attributes */
1726 * FDMI Register HBA Attributes
1728 struct fdmi_rhba_s
{
1729 wwn_t hba_id
; /* HBA Identifier */
1730 struct fdmi_port_list_s port_list
; /* Registered Port List */
1731 struct fdmi_hba_attr_s hba_attr_blk
; /* HBA attribute block */
1735 * FDMI Register Port
1737 struct fdmi_rprt_s
{
1738 wwn_t hba_id
; /* HBA Identifier */
1739 wwn_t port_name
; /* Port wwn */
1740 struct fdmi_port_attr_s port_attr_blk
; /* Port Attr Block */
1744 * FDMI Register Port Attributes
1747 wwn_t port_name
; /* port wwn */
1748 struct fdmi_port_attr_s port_attr_blk
; /* Port Attr Block */
1753 #endif /* __BFA_FC_H__ */