aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorRalph Wuerthner <rwuerthn@de.ibm.com>2006-05-22 12:24:33 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-05-28 12:45:15 -0400
commit75bfc2837bbcc329193d51e8b7115184b78beae0 (patch)
tree6d1511fce28948bd134f7148a996c04dc04e9d32 /drivers/s390
parentb7a52fa7fff2309031a2f849bc489206afd2fa4a (diff)
[SCSI] zfcp: evaluate plogi payload to set maxframe_size, supported_classes of rports
Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c21
-rw-r--r--drivers/s390/scsi/zfcp_def.h2
-rw-r--r--drivers/s390/scsi/zfcp_erp.c6
-rw-r--r--drivers/s390/scsi/zfcp_ext.h1
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c7
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c1
6 files changed, 34 insertions, 4 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index bdaad5535e22..9cd789b8acd4 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -1748,4 +1748,25 @@ zfcp_handle_els_rjt(u32 sq, struct zfcp_ls_rjt_par *rjt_par)
1748 return ret; 1748 return ret;
1749} 1749}
1750 1750
1751/**
1752 * zfcp_plogi_evaluate - evaluate PLOGI playload and copy important fields
1753 * into zfcp_port structure
1754 * @port: zfcp_port structure
1755 * @plogi: plogi payload
1756 */
1757void
1758zfcp_plogi_evaluate(struct zfcp_port *port, struct fsf_plogi *plogi)
1759{
1760 port->maxframe_size = plogi->serv_param.common_serv_param[7] |
1761 ((plogi->serv_param.common_serv_param[6] & 0x0F) << 8);
1762 if (plogi->serv_param.class1_serv_param[0] & 0x80)
1763 port->supported_classes |= FC_COS_CLASS1;
1764 if (plogi->serv_param.class2_serv_param[0] & 0x80)
1765 port->supported_classes |= FC_COS_CLASS2;
1766 if (plogi->serv_param.class3_serv_param[0] & 0x80)
1767 port->supported_classes |= FC_COS_CLASS3;
1768 if (plogi->serv_param.class4_serv_param[0] & 0x80)
1769 port->supported_classes |= FC_COS_CLASS4;
1770}
1771
1751#undef ZFCP_LOG_AREA 1772#undef ZFCP_LOG_AREA
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index e93272f18827..a67d608388a1 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -959,6 +959,8 @@ struct zfcp_port {
959 u32 handle; /* handle assigned by FSF */ 959 u32 handle; /* handle assigned by FSF */
960 struct zfcp_erp_action erp_action; /* pending error recovery */ 960 struct zfcp_erp_action erp_action; /* pending error recovery */
961 atomic_t erp_counter; 961 atomic_t erp_counter;
962 u32 maxframe_size;
963 u32 supported_classes;
962}; 964};
963 965
964/* the struct device sysfs_device must be at the beginning of this structure. 966/* the struct device sysfs_device must be at the beginning of this structure.
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index ce852c0de129..05c47f6ca924 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -3257,8 +3257,12 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
3257 "(adapter %s, wwpn=0x%016Lx)\n", 3257 "(adapter %s, wwpn=0x%016Lx)\n",
3258 zfcp_get_busid_by_port(port), 3258 zfcp_get_busid_by_port(port),
3259 port->wwpn); 3259 port->wwpn);
3260 else 3260 else {
3261 scsi_flush_work(adapter->scsi_host); 3261 scsi_flush_work(adapter->scsi_host);
3262 port->rport->maxframe_size = port->maxframe_size;
3263 port->rport->supported_classes =
3264 port->supported_classes;
3265 }
3262 } 3266 }
3263 zfcp_port_put(port); 3267 zfcp_port_put(port);
3264 break; 3268 break;
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 6be2bb71c737..ab38b8ce27aa 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -115,6 +115,7 @@ extern int zfcp_nameserver_enqueue(struct zfcp_adapter *);
115extern int zfcp_ns_gid_pn_request(struct zfcp_erp_action *); 115extern int zfcp_ns_gid_pn_request(struct zfcp_erp_action *);
116extern int zfcp_check_ct_response(struct ct_hdr *); 116extern int zfcp_check_ct_response(struct ct_hdr *);
117extern int zfcp_handle_els_rjt(u32, struct zfcp_ls_rjt_par *); 117extern int zfcp_handle_els_rjt(u32, struct zfcp_ls_rjt_par *);
118extern void zfcp_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *);
118 119
119/******************************* SCSI ****************************************/ 120/******************************* SCSI ****************************************/
120extern int zfcp_adapter_scsi_register(struct zfcp_adapter *); 121extern int zfcp_adapter_scsi_register(struct zfcp_adapter *);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 55785acf8709..6335f9229184 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -2560,8 +2560,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2560 if (!atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN, &port->status)) 2560 if (!atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN, &port->status))
2561 { 2561 {
2562 if (fsf_req->qtcb->bottom.support.els1_length < 2562 if (fsf_req->qtcb->bottom.support.els1_length <
2563 ((((unsigned long) &plogi->serv_param.wwpn) - 2563 sizeof (struct fsf_plogi)) {
2564 ((unsigned long) plogi)) + sizeof (u64))) {
2565 ZFCP_LOG_INFO( 2564 ZFCP_LOG_INFO(
2566 "warning: insufficient length of " 2565 "warning: insufficient length of "
2567 "PLOGI payload (%i)\n", 2566 "PLOGI payload (%i)\n",
@@ -2580,8 +2579,10 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2580 atomic_clear_mask( 2579 atomic_clear_mask(
2581 ZFCP_STATUS_PORT_DID_DID, 2580 ZFCP_STATUS_PORT_DID_DID,
2582 &port->status); 2581 &port->status);
2583 } else 2582 } else {
2584 port->wwnn = plogi->serv_param.wwnn; 2583 port->wwnn = plogi->serv_param.wwnn;
2584 zfcp_plogi_evaluate(port, plogi);
2585 }
2585 } 2586 }
2586 } 2587 }
2587 break; 2588 break;
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index f198814196a4..30e87197f5f8 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -805,6 +805,7 @@ struct fc_function_template zfcp_transport_functions = {
805 .show_starget_port_name = 1, 805 .show_starget_port_name = 1,
806 .show_starget_node_name = 1, 806 .show_starget_node_name = 1,
807 .show_rport_supported_classes = 1, 807 .show_rport_supported_classes = 1,
808 .show_rport_maxframe_size = 1,
808 .show_host_node_name = 1, 809 .show_host_node_name = 1,
809 .show_host_port_name = 1, 810 .show_host_port_name = 1,
810 .show_host_permanent_port_name = 1, 811 .show_host_permanent_port_name = 1,