11da177e4SLinus Torvalds /* 2553448f6SChristof Schmitt * zfcp device driver 31da177e4SLinus Torvalds * 4553448f6SChristof Schmitt * Interface to the FSF support functions. 51da177e4SLinus Torvalds * 6d46f384aSChristof Schmitt * Copyright IBM Corporation 2002, 2009 71da177e4SLinus Torvalds */ 81da177e4SLinus Torvalds 91da177e4SLinus Torvalds #ifndef FSF_H 101da177e4SLinus Torvalds #define FSF_H 111da177e4SLinus Torvalds 1245633fdcSChristof Schmitt #include <linux/pfn.h> 13d46f384aSChristof Schmitt #include <linux/scatterlist.h> 1445633fdcSChristof Schmitt 1506506d00SAndreas Herrmann #define FSF_QTCB_CURRENT_VERSION 0x00000001 161da177e4SLinus Torvalds 171da177e4SLinus Torvalds /* FSF commands */ 181da177e4SLinus Torvalds #define FSF_QTCB_FCP_CMND 0x00000001 191da177e4SLinus Torvalds #define FSF_QTCB_ABORT_FCP_CMND 0x00000002 201da177e4SLinus Torvalds #define FSF_QTCB_OPEN_PORT_WITH_DID 0x00000005 211da177e4SLinus Torvalds #define FSF_QTCB_OPEN_LUN 0x00000006 221da177e4SLinus Torvalds #define FSF_QTCB_CLOSE_LUN 0x00000007 231da177e4SLinus Torvalds #define FSF_QTCB_CLOSE_PORT 0x00000008 241da177e4SLinus Torvalds #define FSF_QTCB_CLOSE_PHYSICAL_PORT 0x00000009 251da177e4SLinus Torvalds #define FSF_QTCB_SEND_ELS 0x0000000B 261da177e4SLinus Torvalds #define FSF_QTCB_SEND_GENERIC 0x0000000C 271da177e4SLinus Torvalds #define FSF_QTCB_EXCHANGE_CONFIG_DATA 0x0000000D 281da177e4SLinus Torvalds #define FSF_QTCB_EXCHANGE_PORT_DATA 0x0000000E 291da177e4SLinus Torvalds #define FSF_QTCB_DOWNLOAD_CONTROL_FILE 0x00000012 301da177e4SLinus Torvalds #define FSF_QTCB_UPLOAD_CONTROL_FILE 0x00000013 311da177e4SLinus Torvalds 321da177e4SLinus Torvalds /* FSF QTCB types */ 331da177e4SLinus Torvalds #define FSF_IO_COMMAND 0x00000001 341da177e4SLinus Torvalds #define FSF_SUPPORT_COMMAND 0x00000002 351da177e4SLinus Torvalds #define FSF_CONFIG_COMMAND 0x00000003 361da177e4SLinus Torvalds #define FSF_PORT_COMMAND 0x00000004 371da177e4SLinus Torvalds 381da177e4SLinus Torvalds /* FSF control file upload/download operations' subtype and options */ 391da177e4SLinus Torvalds #define FSF_CFDC_OPERATION_SUBTYPE 0x00020001 401da177e4SLinus Torvalds #define FSF_CFDC_OPTION_NORMAL_MODE 0x00000000 411da177e4SLinus Torvalds #define FSF_CFDC_OPTION_FORCE 0x00000001 421da177e4SLinus Torvalds #define FSF_CFDC_OPTION_FULL_ACCESS 0x00000002 431da177e4SLinus Torvalds #define FSF_CFDC_OPTION_RESTRICTED_ACCESS 0x00000004 441da177e4SLinus Torvalds 4506506d00SAndreas Herrmann /* FSF protocol states */ 461da177e4SLinus Torvalds #define FSF_PROT_GOOD 0x00000001 471da177e4SLinus Torvalds #define FSF_PROT_QTCB_VERSION_ERROR 0x00000010 481da177e4SLinus Torvalds #define FSF_PROT_SEQ_NUMB_ERROR 0x00000020 491da177e4SLinus Torvalds #define FSF_PROT_UNSUPP_QTCB_TYPE 0x00000040 501da177e4SLinus Torvalds #define FSF_PROT_HOST_CONNECTION_INITIALIZING 0x00000080 511da177e4SLinus Torvalds #define FSF_PROT_FSF_STATUS_PRESENTED 0x00000100 521da177e4SLinus Torvalds #define FSF_PROT_DUPLICATE_REQUEST_ID 0x00000200 531da177e4SLinus Torvalds #define FSF_PROT_LINK_DOWN 0x00000400 541da177e4SLinus Torvalds #define FSF_PROT_REEST_QUEUE 0x00000800 551da177e4SLinus Torvalds #define FSF_PROT_ERROR_STATE 0x01000000 561da177e4SLinus Torvalds 5706506d00SAndreas Herrmann /* FSF states */ 581da177e4SLinus Torvalds #define FSF_GOOD 0x00000000 591da177e4SLinus Torvalds #define FSF_PORT_ALREADY_OPEN 0x00000001 601da177e4SLinus Torvalds #define FSF_LUN_ALREADY_OPEN 0x00000002 611da177e4SLinus Torvalds #define FSF_PORT_HANDLE_NOT_VALID 0x00000003 621da177e4SLinus Torvalds #define FSF_LUN_HANDLE_NOT_VALID 0x00000004 631da177e4SLinus Torvalds #define FSF_HANDLE_MISMATCH 0x00000005 641da177e4SLinus Torvalds #define FSF_SERVICE_CLASS_NOT_SUPPORTED 0x00000006 651da177e4SLinus Torvalds #define FSF_FCPLUN_NOT_VALID 0x00000009 661da177e4SLinus Torvalds #define FSF_ACCESS_DENIED 0x00000010 671da177e4SLinus Torvalds #define FSF_LUN_SHARING_VIOLATION 0x00000012 681da177e4SLinus Torvalds #define FSF_FCP_COMMAND_DOES_NOT_EXIST 0x00000022 691da177e4SLinus Torvalds #define FSF_DIRECTION_INDICATOR_NOT_VALID 0x00000030 701da177e4SLinus Torvalds #define FSF_CMND_LENGTH_NOT_VALID 0x00000033 711da177e4SLinus Torvalds #define FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED 0x00000040 721da177e4SLinus Torvalds #define FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED 0x00000041 731da177e4SLinus Torvalds #define FSF_ELS_COMMAND_REJECTED 0x00000050 741da177e4SLinus Torvalds #define FSF_GENERIC_COMMAND_REJECTED 0x00000051 751da177e4SLinus Torvalds #define FSF_PORT_BOXED 0x00000059 761da177e4SLinus Torvalds #define FSF_LUN_BOXED 0x0000005A 771da177e4SLinus Torvalds #define FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE 0x0000005B 781da177e4SLinus Torvalds #define FSF_PAYLOAD_SIZE_MISMATCH 0x00000060 791da177e4SLinus Torvalds #define FSF_REQUEST_SIZE_TOO_LARGE 0x00000061 801da177e4SLinus Torvalds #define FSF_RESPONSE_SIZE_TOO_LARGE 0x00000062 811da177e4SLinus Torvalds #define FSF_SBAL_MISMATCH 0x00000063 821da177e4SLinus Torvalds #define FSF_ADAPTER_STATUS_AVAILABLE 0x000000AD 831da177e4SLinus Torvalds #define FSF_UNKNOWN_COMMAND 0x000000E2 841da177e4SLinus Torvalds #define FSF_UNKNOWN_OP_SUBTYPE 0x000000E3 851da177e4SLinus Torvalds #define FSF_INVALID_COMMAND_OPTION 0x000000E5 861da177e4SLinus Torvalds /* #define FSF_ERROR 0x000000FF */ 871da177e4SLinus Torvalds 888a36e453SMaxim Shchetynin #define FSF_PROT_STATUS_QUAL_SIZE 16 891da177e4SLinus Torvalds #define FSF_STATUS_QUALIFIER_SIZE 16 901da177e4SLinus Torvalds 911da177e4SLinus Torvalds /* FSF status qualifier, recommendations */ 921da177e4SLinus Torvalds #define FSF_SQ_NO_RECOM 0x00 931da177e4SLinus Torvalds #define FSF_SQ_FCP_RSP_AVAILABLE 0x01 941da177e4SLinus Torvalds #define FSF_SQ_RETRY_IF_POSSIBLE 0x02 951da177e4SLinus Torvalds #define FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED 0x03 961da177e4SLinus Torvalds #define FSF_SQ_INVOKE_LINK_TEST_PROCEDURE 0x04 971da177e4SLinus Torvalds #define FSF_SQ_COMMAND_ABORTED 0x06 981da177e4SLinus Torvalds #define FSF_SQ_NO_RETRY_POSSIBLE 0x07 991da177e4SLinus Torvalds 1001da177e4SLinus Torvalds /* FSF status qualifier (most significant 4 bytes), local link down */ 101aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_NO_LIGHT 0x00000004 102aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_WRAP_PLUG 0x00000008 103aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_NO_FCP 0x00000010 104aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_FIRMWARE_UPDATE 0x00000020 105aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_INVALID_WWPN 0x00000100 106aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_NO_NPIV_SUPPORT 0x00000200 107aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_NO_FCP_RESOURCES 0x00000400 108aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_NO_FABRIC_RESOURCES 0x00000800 109aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_FABRIC_LOGIN_UNABLE 0x00001000 110aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_WWPN_ASSIGNMENT_CORRUPTED 0x00002000 111aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_MODE_TABLE_CURRUPTED 0x00004000 112aef4a983SMaxim Shchetynin #define FSF_PSQ_LINK_NO_WWPN_ASSIGNMENT 0x00008000 1131da177e4SLinus Torvalds 1141da177e4SLinus Torvalds /* payload size in status read buffer */ 1151da177e4SLinus Torvalds #define FSF_STATUS_READ_PAYLOAD_SIZE 4032 1161da177e4SLinus Torvalds 1171da177e4SLinus Torvalds /* number of status read buffers that should be sent by ULP */ 1181da177e4SLinus Torvalds #define FSF_STATUS_READS_RECOM 16 1191da177e4SLinus Torvalds 1201da177e4SLinus Torvalds /* status types in status read buffer */ 1211da177e4SLinus Torvalds #define FSF_STATUS_READ_PORT_CLOSED 0x00000001 1221da177e4SLinus Torvalds #define FSF_STATUS_READ_INCOMING_ELS 0x00000002 1231da177e4SLinus Torvalds #define FSF_STATUS_READ_SENSE_DATA_AVAIL 0x00000003 1241da177e4SLinus Torvalds #define FSF_STATUS_READ_BIT_ERROR_THRESHOLD 0x00000004 125aef4a983SMaxim Shchetynin #define FSF_STATUS_READ_LINK_DOWN 0x00000005 1261da177e4SLinus Torvalds #define FSF_STATUS_READ_LINK_UP 0x00000006 1279eb69affSMaxim Shchetynin #define FSF_STATUS_READ_NOTIFICATION_LOST 0x00000009 1281da177e4SLinus Torvalds #define FSF_STATUS_READ_CFDC_UPDATED 0x0000000A 129aef4a983SMaxim Shchetynin #define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C 1301da177e4SLinus Torvalds 131aef4a983SMaxim Shchetynin /* status subtypes for link down */ 132aef4a983SMaxim Shchetynin #define FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK 0x00000000 133aef4a983SMaxim Shchetynin #define FSF_STATUS_READ_SUB_FDISC_FAILED 0x00000001 134aef4a983SMaxim Shchetynin #define FSF_STATUS_READ_SUB_FIRMWARE_UPDATE 0x00000002 135aef4a983SMaxim Shchetynin 1369eb69affSMaxim Shchetynin /* status subtypes for unsolicited status notification lost */ 1379eb69affSMaxim Shchetynin #define FSF_STATUS_READ_SUB_INCOMING_ELS 0x00000001 1389eb69affSMaxim Shchetynin #define FSF_STATUS_READ_SUB_ACT_UPDATED 0x00000020 1391da177e4SLinus Torvalds 1401da177e4SLinus Torvalds /* topologie that is detected by the adapter */ 1411da177e4SLinus Torvalds #define FSF_TOPO_P2P 0x00000001 1421da177e4SLinus Torvalds #define FSF_TOPO_FABRIC 0x00000002 1431da177e4SLinus Torvalds #define FSF_TOPO_AL 0x00000003 1441da177e4SLinus Torvalds 1451da177e4SLinus Torvalds /* data direction for FCP commands */ 1461da177e4SLinus Torvalds #define FSF_DATADIR_WRITE 0x00000001 1471da177e4SLinus Torvalds #define FSF_DATADIR_READ 0x00000002 1481da177e4SLinus Torvalds #define FSF_DATADIR_CMND 0x00000004 1491da177e4SLinus Torvalds 1501da177e4SLinus Torvalds /* fc service class */ 1511da177e4SLinus Torvalds #define FSF_CLASS_3 0x00000003 1521da177e4SLinus Torvalds 1531da177e4SLinus Torvalds /* SBAL chaining */ 1541da177e4SLinus Torvalds #define FSF_MAX_SBALS_PER_REQ 36 1551da177e4SLinus Torvalds 1561da177e4SLinus Torvalds /* logging space behind QTCB */ 1571da177e4SLinus Torvalds #define FSF_QTCB_LOG_SIZE 1024 1581da177e4SLinus Torvalds 1591da177e4SLinus Torvalds /* channel features */ 1601da177e4SLinus Torvalds #define FSF_FEATURE_CFDC 0x00000002 1611da177e4SLinus Torvalds #define FSF_FEATURE_LUN_SHARING 0x00000004 1629eb69affSMaxim Shchetynin #define FSF_FEATURE_NOTIFICATION_LOST 0x00000008 1631da177e4SLinus Torvalds #define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010 16439eb7e9aSChristof Schmitt #define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020 165aef4a983SMaxim Shchetynin #define FSF_FEATURE_UPDATE_ALERT 0x00000100 1666d9d63b9SSwen Schillig #define FSF_FEATURE_MEASUREMENT_DATA 0x00000200 167aef4a983SMaxim Shchetynin 168aef4a983SMaxim Shchetynin /* host connection features */ 169aef4a983SMaxim Shchetynin #define FSF_FEATURE_NPIV_MODE 0x00000001 1701da177e4SLinus Torvalds 1711da177e4SLinus Torvalds /* option */ 1721da177e4SLinus Torvalds #define FSF_OPEN_LUN_SUPPRESS_BOXING 0x00000001 1731da177e4SLinus Torvalds 1741da177e4SLinus Torvalds /* open LUN access flags*/ 1751da177e4SLinus Torvalds #define FSF_UNIT_ACCESS_EXCLUSIVE 0x02000000 1761da177e4SLinus Torvalds #define FSF_UNIT_ACCESS_OUTBOUND_TRANSFER 0x10000000 1771da177e4SLinus Torvalds 17845633fdcSChristof Schmitt /* FSF interface for CFDC */ 17945633fdcSChristof Schmitt #define ZFCP_CFDC_MAX_SIZE 127 * 1024 18045633fdcSChristof Schmitt #define ZFCP_CFDC_PAGES PFN_UP(ZFCP_CFDC_MAX_SIZE) 18145633fdcSChristof Schmitt 18245633fdcSChristof Schmitt struct zfcp_fsf_cfdc { 18345633fdcSChristof Schmitt struct scatterlist sg[ZFCP_CFDC_PAGES]; 18445633fdcSChristof Schmitt u32 command; 18545633fdcSChristof Schmitt u32 option; 18645633fdcSChristof Schmitt }; 18745633fdcSChristof Schmitt 1881da177e4SLinus Torvalds struct fsf_queue_designator { 1891da177e4SLinus Torvalds u8 cssid; 1901da177e4SLinus Torvalds u8 chpid; 1911da177e4SLinus Torvalds u8 hla; 1921da177e4SLinus Torvalds u8 ua; 1931da177e4SLinus Torvalds u32 res1; 1941da177e4SLinus Torvalds } __attribute__ ((packed)); 1951da177e4SLinus Torvalds 1961da177e4SLinus Torvalds struct fsf_bit_error_payload { 1971da177e4SLinus Torvalds u32 res1; 1981da177e4SLinus Torvalds u32 link_failure_error_count; 1991da177e4SLinus Torvalds u32 loss_of_sync_error_count; 2001da177e4SLinus Torvalds u32 loss_of_signal_error_count; 2011da177e4SLinus Torvalds u32 primitive_sequence_error_count; 2021da177e4SLinus Torvalds u32 invalid_transmission_word_error_count; 2031da177e4SLinus Torvalds u32 crc_error_count; 2041da177e4SLinus Torvalds u32 primitive_sequence_event_timeout_count; 2051da177e4SLinus Torvalds u32 elastic_buffer_overrun_error_count; 2061da177e4SLinus Torvalds u32 fcal_arbitration_timeout_count; 2071da177e4SLinus Torvalds u32 advertised_receive_b2b_credit; 2081da177e4SLinus Torvalds u32 current_receive_b2b_credit; 2091da177e4SLinus Torvalds u32 advertised_transmit_b2b_credit; 2101da177e4SLinus Torvalds u32 current_transmit_b2b_credit; 2111da177e4SLinus Torvalds } __attribute__ ((packed)); 2121da177e4SLinus Torvalds 213aef4a983SMaxim Shchetynin struct fsf_link_down_info { 214aef4a983SMaxim Shchetynin u32 error_code; 215aef4a983SMaxim Shchetynin u32 res1; 216aef4a983SMaxim Shchetynin u8 res2[2]; 217aef4a983SMaxim Shchetynin u8 primary_status; 218aef4a983SMaxim Shchetynin u8 ioerr_code; 219aef4a983SMaxim Shchetynin u8 action_code; 220aef4a983SMaxim Shchetynin u8 reason_code; 221aef4a983SMaxim Shchetynin u8 explanation_code; 222aef4a983SMaxim Shchetynin u8 vendor_specific_code; 2231da177e4SLinus Torvalds } __attribute__ ((packed)); 2241da177e4SLinus Torvalds 225c41f8cbdSSwen Schillig struct fsf_status_read_buffer { 226c41f8cbdSSwen Schillig u32 status_type; 227c41f8cbdSSwen Schillig u32 status_subtype; 228c41f8cbdSSwen Schillig u32 length; 229c41f8cbdSSwen Schillig u32 res1; 230c41f8cbdSSwen Schillig struct fsf_queue_designator queue_designator; 231c41f8cbdSSwen Schillig u32 d_id; 232c41f8cbdSSwen Schillig u32 class; 233c41f8cbdSSwen Schillig u64 fcp_lun; 234c41f8cbdSSwen Schillig u8 res3[24]; 235c41f8cbdSSwen Schillig union { 236c41f8cbdSSwen Schillig u8 data[FSF_STATUS_READ_PAYLOAD_SIZE]; 237c41f8cbdSSwen Schillig u32 word[FSF_STATUS_READ_PAYLOAD_SIZE/sizeof(u32)]; 238c41f8cbdSSwen Schillig struct fsf_link_down_info link_down_info; 239c41f8cbdSSwen Schillig struct fsf_bit_error_payload bit_error; 240c41f8cbdSSwen Schillig } payload; 241c41f8cbdSSwen Schillig } __attribute__ ((packed)); 242c41f8cbdSSwen Schillig 243c41f8cbdSSwen Schillig struct fsf_qual_version_error { 244c41f8cbdSSwen Schillig u32 fsf_version; 245c41f8cbdSSwen Schillig u32 res1[3]; 246c41f8cbdSSwen Schillig } __attribute__ ((packed)); 247c41f8cbdSSwen Schillig 248c41f8cbdSSwen Schillig struct fsf_qual_sequence_error { 249c41f8cbdSSwen Schillig u32 exp_req_seq_no; 250c41f8cbdSSwen Schillig u32 res1[3]; 251c41f8cbdSSwen Schillig } __attribute__ ((packed)); 252c41f8cbdSSwen Schillig 253c9615858SChristof Schmitt struct fsf_qual_latency_info { 254c9615858SChristof Schmitt u32 channel_lat; 255c9615858SChristof Schmitt u32 fabric_lat; 256c9615858SChristof Schmitt u8 res1[8]; 257c9615858SChristof Schmitt } __attribute__ ((packed)); 258c9615858SChristof Schmitt 2591da177e4SLinus Torvalds union fsf_prot_status_qual { 260553448f6SChristof Schmitt u32 word[FSF_PROT_STATUS_QUAL_SIZE / sizeof(u32)]; 2618a36e453SMaxim Shchetynin u64 doubleword[FSF_PROT_STATUS_QUAL_SIZE / sizeof(u64)]; 2621da177e4SLinus Torvalds struct fsf_qual_version_error version_error; 2631da177e4SLinus Torvalds struct fsf_qual_sequence_error sequence_error; 264aef4a983SMaxim Shchetynin struct fsf_link_down_info link_down_info; 265c9615858SChristof Schmitt struct fsf_qual_latency_info latency_info; 2661da177e4SLinus Torvalds } __attribute__ ((packed)); 2671da177e4SLinus Torvalds 2681da177e4SLinus Torvalds struct fsf_qtcb_prefix { 2691da177e4SLinus Torvalds u64 req_id; 2701da177e4SLinus Torvalds u32 qtcb_version; 2711da177e4SLinus Torvalds u32 ulp_info; 2721da177e4SLinus Torvalds u32 qtcb_type; 2731da177e4SLinus Torvalds u32 req_seq_no; 2741da177e4SLinus Torvalds u32 prot_status; 2751da177e4SLinus Torvalds union fsf_prot_status_qual prot_status_qual; 2761da177e4SLinus Torvalds u8 res1[20]; 2771da177e4SLinus Torvalds } __attribute__ ((packed)); 2781da177e4SLinus Torvalds 2796d9d63b9SSwen Schillig struct fsf_statistics_info { 2806d9d63b9SSwen Schillig u64 input_req; 2816d9d63b9SSwen Schillig u64 output_req; 2826d9d63b9SSwen Schillig u64 control_req; 2836d9d63b9SSwen Schillig u64 input_mb; 2846d9d63b9SSwen Schillig u64 output_mb; 2856d9d63b9SSwen Schillig u64 seconds_act; 2866d9d63b9SSwen Schillig } __attribute__ ((packed)); 2876d9d63b9SSwen Schillig 2881da177e4SLinus Torvalds union fsf_status_qual { 2891da177e4SLinus Torvalds u8 byte[FSF_STATUS_QUALIFIER_SIZE]; 2901da177e4SLinus Torvalds u16 halfword[FSF_STATUS_QUALIFIER_SIZE / sizeof (u16)]; 2911da177e4SLinus Torvalds u32 word[FSF_STATUS_QUALIFIER_SIZE / sizeof (u32)]; 2928a36e453SMaxim Shchetynin u64 doubleword[FSF_STATUS_QUALIFIER_SIZE / sizeof(u64)]; 2931da177e4SLinus Torvalds struct fsf_queue_designator fsf_queue_designator; 294aef4a983SMaxim Shchetynin struct fsf_link_down_info link_down_info; 2951da177e4SLinus Torvalds } __attribute__ ((packed)); 2961da177e4SLinus Torvalds 2971da177e4SLinus Torvalds struct fsf_qtcb_header { 2981da177e4SLinus Torvalds u64 req_handle; 2991da177e4SLinus Torvalds u32 fsf_command; 3001da177e4SLinus Torvalds u32 res1; 3011da177e4SLinus Torvalds u32 port_handle; 3021da177e4SLinus Torvalds u32 lun_handle; 3031da177e4SLinus Torvalds u32 res2; 3041da177e4SLinus Torvalds u32 fsf_status; 3051da177e4SLinus Torvalds union fsf_status_qual fsf_status_qual; 3061da177e4SLinus Torvalds u8 res3[28]; 3071da177e4SLinus Torvalds u16 log_start; 3081da177e4SLinus Torvalds u16 log_length; 3091da177e4SLinus Torvalds u8 res4[16]; 3101da177e4SLinus Torvalds } __attribute__ ((packed)); 3111da177e4SLinus Torvalds 3121da177e4SLinus Torvalds struct fsf_nport_serv_param { 3131da177e4SLinus Torvalds u8 common_serv_param[16]; 3141da177e4SLinus Torvalds u64 wwpn; 3151da177e4SLinus Torvalds u64 wwnn; 3161da177e4SLinus Torvalds u8 class1_serv_param[16]; 3171da177e4SLinus Torvalds u8 class2_serv_param[16]; 3181da177e4SLinus Torvalds u8 class3_serv_param[16]; 3191da177e4SLinus Torvalds u8 class4_serv_param[16]; 3201da177e4SLinus Torvalds u8 vendor_version_level[16]; 3211da177e4SLinus Torvalds } __attribute__ ((packed)); 3221da177e4SLinus Torvalds 32339eb7e9aSChristof Schmitt #define FSF_PLOGI_MIN_LEN 112 3241da177e4SLinus Torvalds struct fsf_plogi { 3251da177e4SLinus Torvalds u32 code; 3261da177e4SLinus Torvalds struct fsf_nport_serv_param serv_param; 3271da177e4SLinus Torvalds } __attribute__ ((packed)); 3281da177e4SLinus Torvalds 3291da177e4SLinus Torvalds #define FSF_FCP_CMND_SIZE 288 3301da177e4SLinus Torvalds #define FSF_FCP_RSP_SIZE 128 3311da177e4SLinus Torvalds 3321da177e4SLinus Torvalds struct fsf_qtcb_bottom_io { 3331da177e4SLinus Torvalds u32 data_direction; 3341da177e4SLinus Torvalds u32 service_class; 3351da177e4SLinus Torvalds u8 res1[8]; 3361da177e4SLinus Torvalds u32 fcp_cmnd_length; 3371da177e4SLinus Torvalds u8 res2[12]; 3381da177e4SLinus Torvalds u8 fcp_cmnd[FSF_FCP_CMND_SIZE]; 3391da177e4SLinus Torvalds u8 fcp_rsp[FSF_FCP_RSP_SIZE]; 3401da177e4SLinus Torvalds u8 res3[64]; 3411da177e4SLinus Torvalds } __attribute__ ((packed)); 3421da177e4SLinus Torvalds 3431da177e4SLinus Torvalds struct fsf_qtcb_bottom_support { 3441da177e4SLinus Torvalds u32 operation_subtype; 3451da177e4SLinus Torvalds u8 res1[12]; 3461da177e4SLinus Torvalds u32 d_id; 3471da177e4SLinus Torvalds u32 option; 3481da177e4SLinus Torvalds u64 fcp_lun; 3491da177e4SLinus Torvalds u64 res2; 3501da177e4SLinus Torvalds u64 req_handle; 3511da177e4SLinus Torvalds u32 service_class; 3521da177e4SLinus Torvalds u8 res3[3]; 3531da177e4SLinus Torvalds u8 timeout; 3541da177e4SLinus Torvalds u32 lun_access_info; 3551da177e4SLinus Torvalds u8 res4[180]; 3561da177e4SLinus Torvalds u32 els1_length; 3571da177e4SLinus Torvalds u32 els2_length; 3581da177e4SLinus Torvalds u32 req_buf_length; 3591da177e4SLinus Torvalds u32 resp_buf_length; 3601da177e4SLinus Torvalds u8 els[256]; 3611da177e4SLinus Torvalds } __attribute__ ((packed)); 3621da177e4SLinus Torvalds 3631da177e4SLinus Torvalds struct fsf_qtcb_bottom_config { 3641da177e4SLinus Torvalds u32 lic_version; 3651da177e4SLinus Torvalds u32 feature_selection; 3661da177e4SLinus Torvalds u32 high_qtcb_version; 3671da177e4SLinus Torvalds u32 low_qtcb_version; 3681da177e4SLinus Torvalds u32 max_qtcb_size; 3691da177e4SLinus Torvalds u32 max_data_transfer_size; 370aef4a983SMaxim Shchetynin u32 adapter_features; 371aef4a983SMaxim Shchetynin u32 connection_features; 3721da177e4SLinus Torvalds u32 fc_topology; 3731da177e4SLinus Torvalds u32 fc_link_speed; 3741da177e4SLinus Torvalds u32 adapter_type; 3751da177e4SLinus Torvalds u32 peer_d_id; 376c9615858SChristof Schmitt u8 res1[2]; 377c9615858SChristof Schmitt u16 timer_interval; 378c9615858SChristof Schmitt u8 res2[8]; 3791da177e4SLinus Torvalds u32 s_id; 3801da177e4SLinus Torvalds struct fsf_nport_serv_param nport_serv_param; 3816f71d9bcS u8 reserved_nport_serv_param[16]; 3821da177e4SLinus Torvalds u8 res3[8]; 3831da177e4SLinus Torvalds u32 adapter_ports; 3841da177e4SLinus Torvalds u32 hardware_version; 3851da177e4SLinus Torvalds u8 serial_number[32]; 3866f71d9bcS struct fsf_nport_serv_param plogi_payload; 3876d9d63b9SSwen Schillig struct fsf_statistics_info stat_info; 3886d9d63b9SSwen Schillig u8 res4[112]; 3891da177e4SLinus Torvalds } __attribute__ ((packed)); 3901da177e4SLinus Torvalds 3911da177e4SLinus Torvalds struct fsf_qtcb_bottom_port { 392aef4a983SMaxim Shchetynin u64 wwpn; 3931da177e4SLinus Torvalds u32 fc_port_id; 3941da177e4SLinus Torvalds u32 port_type; 3951da177e4SLinus Torvalds u32 port_state; 3961da177e4SLinus Torvalds u32 class_of_service; /* should be 0x00000006 for class 2 and 3 */ 3971da177e4SLinus Torvalds u8 supported_fc4_types[32]; /* should be 0x00000100 for scsi fcp */ 3981da177e4SLinus Torvalds u8 active_fc4_types[32]; 3991da177e4SLinus Torvalds u32 supported_speed; /* 0x0001 for 1 GBit/s or 0x0002 for 2 GBit/s */ 4001da177e4SLinus Torvalds u32 maximum_frame_size; /* fixed value of 2112 */ 4011da177e4SLinus Torvalds u64 seconds_since_last_reset; 4021da177e4SLinus Torvalds u64 tx_frames; 4031da177e4SLinus Torvalds u64 tx_words; 4041da177e4SLinus Torvalds u64 rx_frames; 4051da177e4SLinus Torvalds u64 rx_words; 4061da177e4SLinus Torvalds u64 lip; /* 0 */ 4071da177e4SLinus Torvalds u64 nos; /* currently 0 */ 4081da177e4SLinus Torvalds u64 error_frames; /* currently 0 */ 4091da177e4SLinus Torvalds u64 dumped_frames; /* currently 0 */ 4101da177e4SLinus Torvalds u64 link_failure; 4111da177e4SLinus Torvalds u64 loss_of_sync; 4121da177e4SLinus Torvalds u64 loss_of_signal; 4131da177e4SLinus Torvalds u64 psp_error_counts; 4141da177e4SLinus Torvalds u64 invalid_tx_words; 4151da177e4SLinus Torvalds u64 invalid_crcs; 4161da177e4SLinus Torvalds u64 input_requests; 4171da177e4SLinus Torvalds u64 output_requests; 4181da177e4SLinus Torvalds u64 control_requests; 4191da177e4SLinus Torvalds u64 input_mb; /* where 1 MByte == 1.000.000 Bytes */ 4201da177e4SLinus Torvalds u64 output_mb; /* where 1 MByte == 1.000.000 Bytes */ 4216d9d63b9SSwen Schillig u8 cp_util; 4226d9d63b9SSwen Schillig u8 cb_util; 4236d9d63b9SSwen Schillig u8 a_util; 4246d9d63b9SSwen Schillig u8 res2[253]; 4251da177e4SLinus Torvalds } __attribute__ ((packed)); 4261da177e4SLinus Torvalds 4271da177e4SLinus Torvalds union fsf_qtcb_bottom { 4281da177e4SLinus Torvalds struct fsf_qtcb_bottom_io io; 4291da177e4SLinus Torvalds struct fsf_qtcb_bottom_support support; 4301da177e4SLinus Torvalds struct fsf_qtcb_bottom_config config; 4311da177e4SLinus Torvalds struct fsf_qtcb_bottom_port port; 4321da177e4SLinus Torvalds }; 4331da177e4SLinus Torvalds 4341da177e4SLinus Torvalds struct fsf_qtcb { 4351da177e4SLinus Torvalds struct fsf_qtcb_prefix prefix; 4361da177e4SLinus Torvalds struct fsf_qtcb_header header; 4371da177e4SLinus Torvalds union fsf_qtcb_bottom bottom; 4381da177e4SLinus Torvalds u8 log[FSF_QTCB_LOG_SIZE]; 4391da177e4SLinus Torvalds } __attribute__ ((packed)); 4401da177e4SLinus Torvalds 4410997f1c5SStefan Raspl struct zfcp_blk_drv_data { 4420997f1c5SStefan Raspl #define ZFCP_BLK_DRV_DATA_MAGIC 0x1 4430997f1c5SStefan Raspl u32 magic; 4440997f1c5SStefan Raspl #define ZFCP_BLK_LAT_VALID 0x1 4450997f1c5SStefan Raspl #define ZFCP_BLK_REQ_ERROR 0x2 4460997f1c5SStefan Raspl u16 flags; 4470997f1c5SStefan Raspl u8 inb_usage; 4480997f1c5SStefan Raspl u8 outb_usage; 4490997f1c5SStefan Raspl u64 channel_lat; 4500997f1c5SStefan Raspl u64 fabric_lat; 4510997f1c5SStefan Raspl } __attribute__ ((packed)); 4520997f1c5SStefan Raspl 4531da177e4SLinus Torvalds #endif /* FSF_H */ 454