aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fsf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c142
1 files changed, 59 insertions, 83 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 662ec571d73..6335f922918 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -1,19 +1,8 @@
1/* 1/*
2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
2 * 4 *
3 * linux/drivers/s390/scsi/zfcp_fsf.c 5 * (C) Copyright IBM Corp. 2002, 2006
4 *
5 * FCP adapter driver for IBM eServer zSeries
6 *
7 * (C) Copyright IBM Corp. 2002, 2004
8 *
9 * Author(s): Martin Peschke <mpeschke@de.ibm.com>
10 * Raimund Schroeder <raimund.schroeder@de.ibm.com>
11 * Aron Zeh
12 * Wolfgang Taphorn
13 * Stefan Bader <stefan.bader@de.ibm.com>
14 * Heiko Carstens <heiko.carstens@de.ibm.com>
15 * Andreas Herrmann <aherrman@de.ibm.com>
16 * Volker Sameske <sameske@de.ibm.com>
17 * 6 *
18 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -877,6 +866,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
877 struct zfcp_adapter *adapter = fsf_req->adapter; 866 struct zfcp_adapter *adapter = fsf_req->adapter;
878 struct fsf_status_read_buffer *status_buffer = 867 struct fsf_status_read_buffer *status_buffer =
879 (struct fsf_status_read_buffer *) fsf_req->data; 868 (struct fsf_status_read_buffer *) fsf_req->data;
869 struct fsf_bit_error_payload *fsf_bit_error;
880 870
881 if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { 871 if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {
882 zfcp_hba_dbf_event_fsf_unsol("dism", adapter, status_buffer); 872 zfcp_hba_dbf_event_fsf_unsol("dism", adapter, status_buffer);
@@ -903,10 +893,37 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
903 break; 893 break;
904 894
905 case FSF_STATUS_READ_BIT_ERROR_THRESHOLD: 895 case FSF_STATUS_READ_BIT_ERROR_THRESHOLD:
906 ZFCP_LOG_NORMAL("Bit error threshold data received:\n"); 896 fsf_bit_error = (struct fsf_bit_error_payload *)
907 ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, 897 status_buffer->payload;
908 (char *) status_buffer, 898 ZFCP_LOG_NORMAL("Warning: bit error threshold data "
909 sizeof (struct fsf_status_read_buffer)); 899 "received (adapter %s, "
900 "link failures = %i, loss of sync errors = %i, "
901 "loss of signal errors = %i, "
902 "primitive sequence errors = %i, "
903 "invalid transmission word errors = %i, "
904 "CRC errors = %i)\n",
905 zfcp_get_busid_by_adapter(adapter),
906 fsf_bit_error->link_failure_error_count,
907 fsf_bit_error->loss_of_sync_error_count,
908 fsf_bit_error->loss_of_signal_error_count,
909 fsf_bit_error->primitive_sequence_error_count,
910 fsf_bit_error->invalid_transmission_word_error_count,
911 fsf_bit_error->crc_error_count);
912 ZFCP_LOG_INFO("Additional bit error threshold data "
913 "(adapter %s, "
914 "primitive sequence event time-outs = %i, "
915 "elastic buffer overrun errors = %i, "
916 "advertised receive buffer-to-buffer credit = %i, "
917 "current receice buffer-to-buffer credit = %i, "
918 "advertised transmit buffer-to-buffer credit = %i, "
919 "current transmit buffer-to-buffer credit = %i)\n",
920 zfcp_get_busid_by_adapter(adapter),
921 fsf_bit_error->primitive_sequence_event_timeout_count,
922 fsf_bit_error->elastic_buffer_overrun_error_count,
923 fsf_bit_error->advertised_receive_b2b_credit,
924 fsf_bit_error->current_receive_b2b_credit,
925 fsf_bit_error->advertised_transmit_b2b_credit,
926 fsf_bit_error->current_transmit_b2b_credit);
910 break; 927 break;
911 928
912 case FSF_STATUS_READ_LINK_DOWN: 929 case FSF_STATUS_READ_LINK_DOWN:
@@ -1427,7 +1444,8 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool,
1427 1444
1428 /* settings in QTCB */ 1445 /* settings in QTCB */
1429 fsf_req->qtcb->header.port_handle = port->handle; 1446 fsf_req->qtcb->header.port_handle = port->handle;
1430 fsf_req->qtcb->bottom.support.service_class = adapter->fc_service_class; 1447 fsf_req->qtcb->bottom.support.service_class =
1448 ZFCP_FC_SERVICE_CLASS_DEFAULT;
1431 fsf_req->qtcb->bottom.support.timeout = ct->timeout; 1449 fsf_req->qtcb->bottom.support.timeout = ct->timeout;
1432 fsf_req->data = (unsigned long) ct; 1450 fsf_req->data = (unsigned long) ct;
1433 1451
@@ -1496,18 +1514,10 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1496 break; 1514 break;
1497 1515
1498 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 1516 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
1499 if (adapter->fc_service_class <= 3) { 1517 ZFCP_LOG_INFO("error: adapter %s does not support fc "
1500 ZFCP_LOG_INFO("error: adapter %s does not support fc " 1518 "class %d.\n",
1501 "class %d.\n", 1519 zfcp_get_busid_by_port(port),
1502 zfcp_get_busid_by_port(port), 1520 ZFCP_FC_SERVICE_CLASS_DEFAULT);
1503 adapter->fc_service_class);
1504 } else {
1505 ZFCP_LOG_INFO("bug: The fibre channel class at the "
1506 "adapter %s is invalid. "
1507 "(debug info %d)\n",
1508 zfcp_get_busid_by_port(port),
1509 adapter->fc_service_class);
1510 }
1511 /* stop operation for this adapter */ 1521 /* stop operation for this adapter */
1512 debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup"); 1522 debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup");
1513 zfcp_erp_adapter_shutdown(adapter, 0); 1523 zfcp_erp_adapter_shutdown(adapter, 0);
@@ -1730,7 +1740,8 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
1730 1740
1731 /* settings in QTCB */ 1741 /* settings in QTCB */
1732 fsf_req->qtcb->bottom.support.d_id = d_id; 1742 fsf_req->qtcb->bottom.support.d_id = d_id;
1733 fsf_req->qtcb->bottom.support.service_class = adapter->fc_service_class; 1743 fsf_req->qtcb->bottom.support.service_class =
1744 ZFCP_FC_SERVICE_CLASS_DEFAULT;
1734 fsf_req->qtcb->bottom.support.timeout = ZFCP_ELS_TIMEOUT; 1745 fsf_req->qtcb->bottom.support.timeout = ZFCP_ELS_TIMEOUT;
1735 fsf_req->data = (unsigned long) els; 1746 fsf_req->data = (unsigned long) els;
1736 1747
@@ -1800,18 +1811,10 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1800 break; 1811 break;
1801 1812
1802 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 1813 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
1803 if (adapter->fc_service_class <= 3) { 1814 ZFCP_LOG_INFO("error: adapter %s does not support fc "
1804 ZFCP_LOG_INFO("error: adapter %s does " 1815 "class %d.\n",
1805 "not support fibrechannel class %d.\n", 1816 zfcp_get_busid_by_adapter(adapter),
1806 zfcp_get_busid_by_adapter(adapter), 1817 ZFCP_FC_SERVICE_CLASS_DEFAULT);
1807 adapter->fc_service_class);
1808 } else {
1809 ZFCP_LOG_INFO("bug: The fibrechannel class at "
1810 "adapter %s is invalid. "
1811 "(debug info %d)\n",
1812 zfcp_get_busid_by_adapter(adapter),
1813 adapter->fc_service_class);
1814 }
1815 /* stop operation for this adapter */ 1818 /* stop operation for this adapter */
1816 debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup"); 1819 debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup");
1817 zfcp_erp_adapter_shutdown(adapter, 0); 1820 zfcp_erp_adapter_shutdown(adapter, 0);
@@ -1940,14 +1943,6 @@ skip_fsfstatus:
1940 return retval; 1943 return retval;
1941} 1944}
1942 1945
1943/*
1944 * function:
1945 *
1946 * purpose:
1947 *
1948 * returns: address of initiated FSF request
1949 * NULL - request could not be initiated
1950 */
1951int 1946int
1952zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) 1947zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action)
1953{ 1948{
@@ -2565,8 +2560,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2565 if (!atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN, &port->status)) 2560 if (!atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN, &port->status))
2566 { 2561 {
2567 if (fsf_req->qtcb->bottom.support.els1_length < 2562 if (fsf_req->qtcb->bottom.support.els1_length <
2568 ((((unsigned long) &plogi->serv_param.wwpn) - 2563 sizeof (struct fsf_plogi)) {
2569 ((unsigned long) plogi)) + sizeof (u64))) {
2570 ZFCP_LOG_INFO( 2564 ZFCP_LOG_INFO(
2571 "warning: insufficient length of " 2565 "warning: insufficient length of "
2572 "PLOGI payload (%i)\n", 2566 "PLOGI payload (%i)\n",
@@ -2585,8 +2579,10 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2585 atomic_clear_mask( 2579 atomic_clear_mask(
2586 ZFCP_STATUS_PORT_DID_DID, 2580 ZFCP_STATUS_PORT_DID_DID,
2587 &port->status); 2581 &port->status);
2588 } else 2582 } else {
2589 port->wwnn = plogi->serv_param.wwnn; 2583 port->wwnn = plogi->serv_param.wwnn;
2584 zfcp_plogi_evaluate(port, plogi);
2585 }
2590 } 2586 }
2591 } 2587 }
2592 break; 2588 break;
@@ -2993,8 +2989,8 @@ zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
2993 erp_action->fsf_req->qtcb->bottom.support.fcp_lun = 2989 erp_action->fsf_req->qtcb->bottom.support.fcp_lun =
2994 erp_action->unit->fcp_lun; 2990 erp_action->unit->fcp_lun;
2995 if (!(erp_action->adapter->connection_features & FSF_FEATURE_NPIV_MODE)) 2991 if (!(erp_action->adapter->connection_features & FSF_FEATURE_NPIV_MODE))
2996 erp_action->fsf_req->qtcb->bottom.support.option = 2992 erp_action->fsf_req->qtcb->bottom.support.option =
2997 FSF_OPEN_LUN_SUPPRESS_BOXING; 2993 FSF_OPEN_LUN_SUPPRESS_BOXING;
2998 atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status); 2994 atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status);
2999 erp_action->fsf_req->data = (unsigned long) erp_action->unit; 2995 erp_action->fsf_req->data = (unsigned long) erp_action->unit;
3000 erp_action->fsf_req->erp_action = erp_action; 2996 erp_action->fsf_req->erp_action = erp_action;
@@ -3569,7 +3565,7 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
3569 } 3565 }
3570 3566
3571 /* set FC service class in QTCB (3 per default) */ 3567 /* set FC service class in QTCB (3 per default) */
3572 fsf_req->qtcb->bottom.io.service_class = adapter->fc_service_class; 3568 fsf_req->qtcb->bottom.io.service_class = ZFCP_FC_SERVICE_CLASS_DEFAULT;
3573 3569
3574 /* set FCP_LUN in FCP_CMND IU in QTCB */ 3570 /* set FCP_LUN in FCP_CMND IU in QTCB */
3575 fcp_cmnd_iu->fcp_lun = unit->fcp_lun; 3571 fcp_cmnd_iu->fcp_lun = unit->fcp_lun;
@@ -3667,18 +3663,6 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
3667 return retval; 3663 return retval;
3668} 3664}
3669 3665
3670/*
3671 * function: zfcp_fsf_send_fcp_command_task_management
3672 *
3673 * purpose:
3674 *
3675 * returns:
3676 *
3677 * FIXME(design): should be watched by a timeout!!!
3678 * FIXME(design) shouldn't this be modified to return an int
3679 * also...don't know how though
3680 *
3681 */
3682struct zfcp_fsf_req * 3666struct zfcp_fsf_req *
3683zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter, 3667zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter,
3684 struct zfcp_unit *unit, 3668 struct zfcp_unit *unit,
@@ -3720,7 +3704,7 @@ zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter,
3720 fsf_req->qtcb->header.lun_handle = unit->handle; 3704 fsf_req->qtcb->header.lun_handle = unit->handle;
3721 fsf_req->qtcb->header.port_handle = unit->port->handle; 3705 fsf_req->qtcb->header.port_handle = unit->port->handle;
3722 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; 3706 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND;
3723 fsf_req->qtcb->bottom.io.service_class = adapter->fc_service_class; 3707 fsf_req->qtcb->bottom.io.service_class = ZFCP_FC_SERVICE_CLASS_DEFAULT;
3724 fsf_req->qtcb->bottom.io.fcp_cmnd_length = 3708 fsf_req->qtcb->bottom.io.fcp_cmnd_length =
3725 sizeof (struct fcp_cmnd_iu) + sizeof (fcp_dl_t); 3709 sizeof (struct fcp_cmnd_iu) + sizeof (fcp_dl_t);
3726 3710
@@ -3843,18 +3827,10 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3843 break; 3827 break;
3844 3828
3845 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 3829 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
3846 if (fsf_req->adapter->fc_service_class <= 3) { 3830 ZFCP_LOG_INFO("error: adapter %s does not support fc "
3847 ZFCP_LOG_NORMAL("error: The adapter %s does " 3831 "class %d.\n",
3848 "not support fibrechannel class %d.\n", 3832 zfcp_get_busid_by_unit(unit),
3849 zfcp_get_busid_by_unit(unit), 3833 ZFCP_FC_SERVICE_CLASS_DEFAULT);
3850 fsf_req->adapter->fc_service_class);
3851 } else {
3852 ZFCP_LOG_NORMAL("bug: The fibrechannel class at "
3853 "adapter %s is invalid. "
3854 "(debug info %d)\n",
3855 zfcp_get_busid_by_unit(unit),
3856 fsf_req->adapter->fc_service_class);
3857 }
3858 /* stop operation for this adapter */ 3834 /* stop operation for this adapter */
3859 debug_text_exception(fsf_req->adapter->erp_dbf, 0, 3835 debug_text_exception(fsf_req->adapter->erp_dbf, 0,
3860 "fsf_s_class_nsup"); 3836 "fsf_s_class_nsup");