zfcp_fsf.c (92953c6e0aa77d4febcca6dd691e8192910c8a28) | zfcp_fsf.c (7e418833e68948cb9ed15262889173b7db2960cb) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * zfcp device driver 4 * 5 * Implementation of FSF commands. 6 * 7 * Copyright IBM Corp. 2002, 2018 8 */ 9 10#define KMSG_COMPONENT "zfcp" 11#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 12 13#include <linux/blktrace_api.h> | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * zfcp device driver 4 * 5 * Implementation of FSF commands. 6 * 7 * Copyright IBM Corp. 2002, 2018 8 */ 9 10#define KMSG_COMPONENT "zfcp" 11#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 12 13#include <linux/blktrace_api.h> |
14#include <linux/jiffies.h> |
|
14#include <linux/types.h> 15#include <linux/slab.h> 16#include <scsi/fc/fc_els.h> 17#include "zfcp_ext.h" 18#include "zfcp_fc.h" 19#include "zfcp_dbf.h" 20#include "zfcp_qdio.h" 21#include "zfcp_reqlist.h" | 15#include <linux/types.h> 16#include <linux/slab.h> 17#include <scsi/fc/fc_els.h> 18#include "zfcp_ext.h" 19#include "zfcp_fc.h" 20#include "zfcp_dbf.h" 21#include "zfcp_qdio.h" 22#include "zfcp_reqlist.h" |
23#include "zfcp_diag.h" |
|
22 23/* timeout for FSF requests sent during scsi_eh: abort or FCP TMF */ 24#define ZFCP_FSF_SCSI_ER_TIMEOUT (10*HZ) 25/* timeout for: exchange config/port data outside ERP, or open/close WKA port */ 26#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ) 27 28struct kmem_cache *zfcp_fsf_qtcb_cache; 29 --- 620 unchanged lines hidden (view full) --- 650 memcpy(fc_host_supported_fc4s(shost), bottom->supported_fc4_types, 651 FC_FC4_LIST_SIZE); 652 memcpy(fc_host_active_fc4s(shost), bottom->active_fc4_types, 653 FC_FC4_LIST_SIZE); 654} 655 656static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) 657{ | 24 25/* timeout for FSF requests sent during scsi_eh: abort or FCP TMF */ 26#define ZFCP_FSF_SCSI_ER_TIMEOUT (10*HZ) 27/* timeout for: exchange config/port data outside ERP, or open/close WKA port */ 28#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ) 29 30struct kmem_cache *zfcp_fsf_qtcb_cache; 31 --- 620 unchanged lines hidden (view full) --- 652 memcpy(fc_host_supported_fc4s(shost), bottom->supported_fc4_types, 653 FC_FC4_LIST_SIZE); 654 memcpy(fc_host_active_fc4s(shost), bottom->active_fc4_types, 655 FC_FC4_LIST_SIZE); 656} 657 658static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) 659{ |
660 struct zfcp_diag_header *const diag_hdr = 661 &req->adapter->diagnostics->port_data.header; |
|
658 struct fsf_qtcb *qtcb = req->qtcb; | 662 struct fsf_qtcb *qtcb = req->qtcb; |
663 struct fsf_qtcb_bottom_port *bottom = &qtcb->bottom.port; |
|
659 660 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) 661 return; 662 663 switch (qtcb->header.fsf_status) { 664 case FSF_GOOD: | 664 665 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) 666 return; 667 668 switch (qtcb->header.fsf_status) { 669 case FSF_GOOD: |
670 /* 671 * usually we wait with an update till the cache is too old, 672 * but because we have the data available, update it anyway 673 */ 674 zfcp_diag_update_xdata(diag_hdr, bottom, false); 675 |
|
665 zfcp_fsf_exchange_port_evaluate(req); 666 break; 667 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: | 676 zfcp_fsf_exchange_port_evaluate(req); 677 break; 678 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: |
679 zfcp_diag_update_xdata(diag_hdr, bottom, true); |
|
668 req->status |= ZFCP_STATUS_FSFREQ_XDATAINCOMPLETE; 669 670 zfcp_fsf_exchange_port_evaluate(req); 671 zfcp_fsf_link_down_info_eval(req, 672 &qtcb->header.fsf_status_qual.link_down_info); 673 break; 674 } 675} --- 1833 unchanged lines hidden --- | 680 req->status |= ZFCP_STATUS_FSFREQ_XDATAINCOMPLETE; 681 682 zfcp_fsf_exchange_port_evaluate(req); 683 zfcp_fsf_link_down_info_eval(req, 684 &qtcb->header.fsf_status_qual.link_down_info); 685 break; 686 } 687} --- 1833 unchanged lines hidden --- |