aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fsf.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2010-09-08 08:40:01 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-09-16 22:54:23 -0400
commitedaed859e63aac174fcc3fed81886b91bb124661 (patch)
treeb79ef611b8cf2bfe9e819ae130eff326ee553234 /drivers/s390/scsi/zfcp_fsf.c
parentc9ff5d0315231b133a43e5af842bc01fb474f0d7 (diff)
[SCSI] zfcp: Replace status modifier functions.
Replace the zfcp_modify_<xxx>_status functions and its accompanying wrappers with dedicated status modifier functions. This eases code readability and maintenance. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c72
1 files changed, 45 insertions, 27 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 813c5b22565b..beaf0916ceab 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -104,7 +104,7 @@ static void zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *req)
104 read_unlock_irqrestore(&adapter->port_list_lock, flags); 104 read_unlock_irqrestore(&adapter->port_list_lock, flags);
105} 105}
106 106
107static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *req, char *id, 107static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *req,
108 struct fsf_link_down_info *link_down) 108 struct fsf_link_down_info *link_down)
109{ 109{
110 struct zfcp_adapter *adapter = req->adapter; 110 struct zfcp_adapter *adapter = req->adapter;
@@ -184,7 +184,7 @@ static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *req, char *id,
184 "the FC fabric is down\n"); 184 "the FC fabric is down\n");
185 } 185 }
186out: 186out:
187 zfcp_erp_adapter_failed(adapter, id, req); 187 zfcp_erp_set_adapter_status(adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
188} 188}
189 189
190static void zfcp_fsf_status_read_link_down(struct zfcp_fsf_req *req) 190static void zfcp_fsf_status_read_link_down(struct zfcp_fsf_req *req)
@@ -195,13 +195,13 @@ static void zfcp_fsf_status_read_link_down(struct zfcp_fsf_req *req)
195 195
196 switch (sr_buf->status_subtype) { 196 switch (sr_buf->status_subtype) {
197 case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK: 197 case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK:
198 zfcp_fsf_link_down_info_eval(req, "fssrld1", ldi); 198 zfcp_fsf_link_down_info_eval(req, ldi);
199 break; 199 break;
200 case FSF_STATUS_READ_SUB_FDISC_FAILED: 200 case FSF_STATUS_READ_SUB_FDISC_FAILED:
201 zfcp_fsf_link_down_info_eval(req, "fssrld2", ldi); 201 zfcp_fsf_link_down_info_eval(req, ldi);
202 break; 202 break;
203 case FSF_STATUS_READ_SUB_FIRMWARE_UPDATE: 203 case FSF_STATUS_READ_SUB_FIRMWARE_UPDATE:
204 zfcp_fsf_link_down_info_eval(req, "fssrld3", NULL); 204 zfcp_fsf_link_down_info_eval(req, NULL);
205 }; 205 };
206} 206}
207 207
@@ -242,9 +242,8 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req)
242 dev_info(&adapter->ccw_device->dev, 242 dev_info(&adapter->ccw_device->dev,
243 "The local link has been restored\n"); 243 "The local link has been restored\n");
244 /* All ports should be marked as ready to run again */ 244 /* All ports should be marked as ready to run again */
245 zfcp_erp_modify_adapter_status(adapter, "fssrh_1", NULL, 245 zfcp_erp_set_adapter_status(adapter,
246 ZFCP_STATUS_COMMON_RUNNING, 246 ZFCP_STATUS_COMMON_RUNNING);
247 ZFCP_SET);
248 zfcp_erp_adapter_reopen(adapter, 247 zfcp_erp_adapter_reopen(adapter,
249 ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | 248 ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED |
250 ZFCP_STATUS_COMMON_ERP_FAILED, 249 ZFCP_STATUS_COMMON_ERP_FAILED,
@@ -359,16 +358,14 @@ static void zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *req)
359 zfcp_erp_adapter_shutdown(adapter, 0, "fspse_4", req); 358 zfcp_erp_adapter_shutdown(adapter, 0, "fspse_4", req);
360 break; 359 break;
361 case FSF_PROT_LINK_DOWN: 360 case FSF_PROT_LINK_DOWN:
362 zfcp_fsf_link_down_info_eval(req, "fspse_5", 361 zfcp_fsf_link_down_info_eval(req, &psq->link_down_info);
363 &psq->link_down_info);
364 /* go through reopen to flush pending requests */ 362 /* go through reopen to flush pending requests */
365 zfcp_erp_adapter_reopen(adapter, 0, "fspse_6", req); 363 zfcp_erp_adapter_reopen(adapter, 0, "fspse_6", req);
366 break; 364 break;
367 case FSF_PROT_REEST_QUEUE: 365 case FSF_PROT_REEST_QUEUE:
368 /* All ports should be marked as ready to run again */ 366 /* All ports should be marked as ready to run again */
369 zfcp_erp_modify_adapter_status(adapter, "fspse_7", NULL, 367 zfcp_erp_set_adapter_status(adapter,
370 ZFCP_STATUS_COMMON_RUNNING, 368 ZFCP_STATUS_COMMON_RUNNING);
371 ZFCP_SET);
372 zfcp_erp_adapter_reopen(adapter, 369 zfcp_erp_adapter_reopen(adapter,
373 ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | 370 ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED |
374 ZFCP_STATUS_COMMON_ERP_FAILED, 371 ZFCP_STATUS_COMMON_ERP_FAILED,
@@ -538,7 +535,7 @@ static void zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *req)
538 atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, 535 atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK,
539 &adapter->status); 536 &adapter->status);
540 537
541 zfcp_fsf_link_down_info_eval(req, "fsecdh2", 538 zfcp_fsf_link_down_info_eval(req,
542 &qtcb->header.fsf_status_qual.link_down_info); 539 &qtcb->header.fsf_status_qual.link_down_info);
543 break; 540 break;
544 default: 541 default:
@@ -604,7 +601,7 @@ static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req)
604 break; 601 break;
605 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: 602 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE:
606 zfcp_fsf_exchange_port_evaluate(req); 603 zfcp_fsf_exchange_port_evaluate(req);
607 zfcp_fsf_link_down_info_eval(req, "fsepdh1", 604 zfcp_fsf_link_down_info_eval(req,
608 &qtcb->header.fsf_status_qual.link_down_info); 605 &qtcb->header.fsf_status_qual.link_down_info);
609 break; 606 break;
610 } 607 }
@@ -797,11 +794,17 @@ static void zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *req)
797 req->status |= ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED; 794 req->status |= ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED;
798 break; 795 break;
799 case FSF_PORT_BOXED: 796 case FSF_PORT_BOXED:
800 zfcp_erp_port_boxed(zfcp_sdev->port, "fsafch3", req); 797 zfcp_erp_set_port_status(zfcp_sdev->port,
798 ZFCP_STATUS_COMMON_ACCESS_BOXED);
799 zfcp_erp_port_reopen(zfcp_sdev->port,
800 ZFCP_STATUS_COMMON_ERP_FAILED, "fsafch3",
801 req);
801 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 802 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
802 break; 803 break;
803 case FSF_LUN_BOXED: 804 case FSF_LUN_BOXED:
804 zfcp_erp_lun_boxed(sdev, "fsafch4", req); 805 zfcp_erp_set_lun_status(sdev, ZFCP_STATUS_COMMON_ACCESS_BOXED);
806 zfcp_erp_lun_reopen(sdev, ZFCP_STATUS_COMMON_ERP_FAILED,
807 "fsafch4", req);
805 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 808 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
806 break; 809 break;
807 case FSF_ADAPTER_STATUS_AVAILABLE: 810 case FSF_ADAPTER_STATUS_AVAILABLE:
@@ -1343,7 +1346,8 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
1343 "Not enough FCP adapter resources to open " 1346 "Not enough FCP adapter resources to open "
1344 "remote port 0x%016Lx\n", 1347 "remote port 0x%016Lx\n",
1345 (unsigned long long)port->wwpn); 1348 (unsigned long long)port->wwpn);
1346 zfcp_erp_port_failed(port, "fsoph_1", req); 1349 zfcp_erp_set_port_status(port,
1350 ZFCP_STATUS_COMMON_ERP_FAILED);
1347 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1351 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1348 break; 1352 break;
1349 case FSF_ADAPTER_STATUS_AVAILABLE: 1353 case FSF_ADAPTER_STATUS_AVAILABLE:
@@ -1453,9 +1457,7 @@ static void zfcp_fsf_close_port_handler(struct zfcp_fsf_req *req)
1453 case FSF_ADAPTER_STATUS_AVAILABLE: 1457 case FSF_ADAPTER_STATUS_AVAILABLE:
1454 break; 1458 break;
1455 case FSF_GOOD: 1459 case FSF_GOOD:
1456 zfcp_erp_modify_port_status(port, "fscph_2", req, 1460 zfcp_erp_clear_port_status(port, ZFCP_STATUS_COMMON_OPEN);
1457 ZFCP_STATUS_COMMON_OPEN,
1458 ZFCP_CLEAR);
1459 break; 1461 break;
1460 } 1462 }
1461} 1463}
@@ -1653,7 +1655,9 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req)
1653 if (sdev_to_zfcp(sdev)->port == port) 1655 if (sdev_to_zfcp(sdev)->port == port)
1654 atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, 1656 atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN,
1655 &sdev_to_zfcp(sdev)->status); 1657 &sdev_to_zfcp(sdev)->status);
1656 zfcp_erp_port_boxed(port, "fscpph2", req); 1658 zfcp_erp_set_port_status(port, ZFCP_STATUS_COMMON_ACCESS_BOXED);
1659 zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED,
1660 "fscpph2", req);
1657 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1661 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1658 break; 1662 break;
1659 case FSF_ADAPTER_STATUS_AVAILABLE: 1663 case FSF_ADAPTER_STATUS_AVAILABLE:
@@ -1751,7 +1755,11 @@ static void zfcp_fsf_open_lun_handler(struct zfcp_fsf_req *req)
1751 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1755 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1752 break; 1756 break;
1753 case FSF_PORT_BOXED: 1757 case FSF_PORT_BOXED:
1754 zfcp_erp_port_boxed(zfcp_sdev->port, "fsouh_2", req); 1758 zfcp_erp_set_port_status(zfcp_sdev->port,
1759 ZFCP_STATUS_COMMON_ACCESS_BOXED);
1760 zfcp_erp_port_reopen(zfcp_sdev->port,
1761 ZFCP_STATUS_COMMON_ERP_FAILED, "fsouh_2",
1762 req);
1755 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1763 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1756 break; 1764 break;
1757 case FSF_LUN_SHARING_VIOLATION: 1765 case FSF_LUN_SHARING_VIOLATION:
@@ -1764,7 +1772,7 @@ static void zfcp_fsf_open_lun_handler(struct zfcp_fsf_req *req)
1764 "0x%016Lx on port 0x%016Lx\n", 1772 "0x%016Lx on port 0x%016Lx\n",
1765 (unsigned long long)zfcp_scsi_dev_lun(sdev), 1773 (unsigned long long)zfcp_scsi_dev_lun(sdev),
1766 (unsigned long long)zfcp_sdev->port->wwpn); 1774 (unsigned long long)zfcp_sdev->port->wwpn);
1767 zfcp_erp_lun_failed(sdev, "fsolh_4", req); 1775 zfcp_erp_set_lun_status(sdev, ZFCP_STATUS_COMMON_ERP_FAILED);
1768 /* fall through */ 1776 /* fall through */
1769 case FSF_INVALID_COMMAND_OPTION: 1777 case FSF_INVALID_COMMAND_OPTION:
1770 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1778 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
@@ -1856,7 +1864,11 @@ static void zfcp_fsf_close_lun_handler(struct zfcp_fsf_req *req)
1856 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1864 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1857 break; 1865 break;
1858 case FSF_PORT_BOXED: 1866 case FSF_PORT_BOXED:
1859 zfcp_erp_port_boxed(zfcp_sdev->port, "fscuh_3", req); 1867 zfcp_erp_set_port_status(zfcp_sdev->port,
1868 ZFCP_STATUS_COMMON_ACCESS_BOXED);
1869 zfcp_erp_port_reopen(zfcp_sdev->port,
1870 ZFCP_STATUS_COMMON_ERP_FAILED, "fscuh_3",
1871 req);
1860 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1872 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1861 break; 1873 break;
1862 case FSF_ADAPTER_STATUS_AVAILABLE: 1874 case FSF_ADAPTER_STATUS_AVAILABLE:
@@ -2032,11 +2044,17 @@ static void zfcp_fsf_fcp_handler_common(struct zfcp_fsf_req *req)
2032 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2044 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2033 break; 2045 break;
2034 case FSF_PORT_BOXED: 2046 case FSF_PORT_BOXED:
2035 zfcp_erp_port_boxed(zfcp_sdev->port, "fssfch5", req); 2047 zfcp_erp_set_port_status(zfcp_sdev->port,
2048 ZFCP_STATUS_COMMON_ACCESS_BOXED);
2049 zfcp_erp_port_reopen(zfcp_sdev->port,
2050 ZFCP_STATUS_COMMON_ERP_FAILED, "fssfch5",
2051 req);
2036 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2052 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2037 break; 2053 break;
2038 case FSF_LUN_BOXED: 2054 case FSF_LUN_BOXED:
2039 zfcp_erp_lun_boxed(sdev, "fssfch6", req); 2055 zfcp_erp_set_lun_status(sdev, ZFCP_STATUS_COMMON_ACCESS_BOXED);
2056 zfcp_erp_lun_reopen(sdev, ZFCP_STATUS_COMMON_ERP_FAILED,
2057 "fssfch6", req);
2040 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2058 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2041 break; 2059 break;
2042 case FSF_ADAPTER_STATUS_AVAILABLE: 2060 case FSF_ADAPTER_STATUS_AVAILABLE: