Commit a10a61e8 authored by Benjamin Block's avatar Benjamin Block Committed by Martin K. Petersen

scsi: zfcp: support retrieval of SFP Data via Exchange Port Data

A new FCP channel feature allows us to read the diagnostics from our local
SFP transceivers. To make use of that add a flag
(FSF_FEATURE_REQUEST_SFP_DATA) to the feature-set we request from the FCP
channel. Whether the channel actually implements this can be determined via
an other new flag (FSF_FEATURE_REPORT_SFP_DATA), that is set in the
adapter_features field of the adapter structure after Exchange Config Data
finished.

Also add the corresponding definitions in the QTCB Bottom for Exchange Port
Data. These new definitions are only valid, if FSF_FEATURE_REPORT_SFP_DATA
is set.

Link: https://lore.kernel.org/r/ee1eba4de71eb06b4d82207ad4f428429346156f.1572018132.git.bblock@linux.ibm.comReviewed-by: default avatarSteffen Maier <maier@linux.ibm.com>
Signed-off-by: default avatarBenjamin Block <bblock@linux.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 08821023
...@@ -1286,7 +1286,8 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) ...@@ -1286,7 +1286,8 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action)
req->qtcb->bottom.config.feature_selection = req->qtcb->bottom.config.feature_selection =
FSF_FEATURE_NOTIFICATION_LOST | FSF_FEATURE_NOTIFICATION_LOST |
FSF_FEATURE_UPDATE_ALERT; FSF_FEATURE_UPDATE_ALERT |
FSF_FEATURE_REQUEST_SFP_DATA;
req->erp_action = erp_action; req->erp_action = erp_action;
req->handler = zfcp_fsf_exchange_config_data_handler; req->handler = zfcp_fsf_exchange_config_data_handler;
erp_action->fsf_req_id = req->req_id; erp_action->fsf_req_id = req->req_id;
...@@ -1339,7 +1340,8 @@ int zfcp_fsf_exchange_config_data_sync(struct zfcp_qdio *qdio, ...@@ -1339,7 +1340,8 @@ int zfcp_fsf_exchange_config_data_sync(struct zfcp_qdio *qdio,
req->qtcb->bottom.config.feature_selection = req->qtcb->bottom.config.feature_selection =
FSF_FEATURE_NOTIFICATION_LOST | FSF_FEATURE_NOTIFICATION_LOST |
FSF_FEATURE_UPDATE_ALERT; FSF_FEATURE_UPDATE_ALERT |
FSF_FEATURE_REQUEST_SFP_DATA;
if (data) if (data)
req->data = data; req->data = data;
......
...@@ -163,6 +163,8 @@ ...@@ -163,6 +163,8 @@
#define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020 #define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020
#define FSF_FEATURE_UPDATE_ALERT 0x00000100 #define FSF_FEATURE_UPDATE_ALERT 0x00000100
#define FSF_FEATURE_MEASUREMENT_DATA 0x00000200 #define FSF_FEATURE_MEASUREMENT_DATA 0x00000200
#define FSF_FEATURE_REQUEST_SFP_DATA 0x00000200
#define FSF_FEATURE_REPORT_SFP_DATA 0x00000800
#define FSF_FEATURE_DIF_PROT_TYPE1 0x00010000 #define FSF_FEATURE_DIF_PROT_TYPE1 0x00010000
#define FSF_FEATURE_DIX_PROT_TCPIP 0x00020000 #define FSF_FEATURE_DIX_PROT_TCPIP 0x00020000
...@@ -407,7 +409,24 @@ struct fsf_qtcb_bottom_port { ...@@ -407,7 +409,24 @@ struct fsf_qtcb_bottom_port {
u8 cp_util; u8 cp_util;
u8 cb_util; u8 cb_util;
u8 a_util; u8 a_util;
u8 res2[253]; u8 res2;
u16 temperature;
u16 vcc;
u16 tx_bias;
u16 tx_power;
u16 rx_power;
union {
u16 raw;
struct {
u16 fec_active :1;
u16:7;
u16 connector_type :2;
u16 sfp_invalid :1;
u16 optical_port :1;
u16 port_tx_type :4;
};
} sfp_flags;
u8 res3[240];
} __attribute__ ((packed)); } __attribute__ ((packed));
union fsf_qtcb_bottom { union fsf_qtcb_bottom {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment