diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2006-10-02 15:00:44 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-10-03 18:28:42 -0400 |
commit | 1620f7c2d8e3fdd7dba04bfe5f9c42201eef1188 (patch) | |
tree | 6d41868193546130bb46b8ec16ffd91e8ead2069 /drivers/scsi/qla2xxx | |
parent | d8b4521349274ab610d0b29384c704444e55cbca (diff) |
[SCSI] qla2xxx: Add support for symbolic nodename FC transport attribute.
Refactored original code from qla_gs.c:qla2x00_rsnn_nn().
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 10 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gbl.h | 1 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gs.c | 26 |
3 files changed, 22 insertions, 15 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 144b0f8459ce..463846942e16 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -849,6 +849,14 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) | |||
849 | return pfc_host_stat; | 849 | return pfc_host_stat; |
850 | } | 850 | } |
851 | 851 | ||
852 | static void | ||
853 | qla2x00_get_host_symbolic_name(struct Scsi_Host *shost) | ||
854 | { | ||
855 | scsi_qla_host_t *ha = to_qla_host(shost); | ||
856 | |||
857 | qla2x00_get_sym_node_name(ha, fc_host_symbolic_name(shost)); | ||
858 | } | ||
859 | |||
852 | struct fc_function_template qla2xxx_transport_functions = { | 860 | struct fc_function_template qla2xxx_transport_functions = { |
853 | 861 | ||
854 | .show_host_node_name = 1, | 862 | .show_host_node_name = 1, |
@@ -861,6 +869,8 @@ struct fc_function_template qla2xxx_transport_functions = { | |||
861 | .show_host_speed = 1, | 869 | .show_host_speed = 1, |
862 | .get_host_port_type = qla2x00_get_host_port_type, | 870 | .get_host_port_type = qla2x00_get_host_port_type, |
863 | .show_host_port_type = 1, | 871 | .show_host_port_type = 1, |
872 | .get_host_symbolic_name = qla2x00_get_host_symbolic_name, | ||
873 | .show_host_symbolic_name = 1, | ||
864 | 874 | ||
865 | .dd_fcrport_size = sizeof(struct fc_port *), | 875 | .dd_fcrport_size = sizeof(struct fc_port *), |
866 | .show_rport_supported_classes = 1, | 876 | .show_rport_supported_classes = 1, |
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index c48e1d8bb100..bef7011378c6 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -287,6 +287,7 @@ extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t); | |||
287 | extern int qla2x00_fdmi_register(scsi_qla_host_t *); | 287 | extern int qla2x00_fdmi_register(scsi_qla_host_t *); |
288 | extern int qla2x00_gfpn_id(scsi_qla_host_t *, sw_info_t *); | 288 | extern int qla2x00_gfpn_id(scsi_qla_host_t *, sw_info_t *); |
289 | extern int qla2x00_gpsc(scsi_qla_host_t *, sw_info_t *); | 289 | extern int qla2x00_gpsc(scsi_qla_host_t *, sw_info_t *); |
290 | extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *); | ||
290 | 291 | ||
291 | /* | 292 | /* |
292 | * Global Function Prototypes in qla_attr.c source file. | 293 | * Global Function Prototypes in qla_attr.c source file. |
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 029953c1a9c8..225cf724dcfb 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c | |||
@@ -612,6 +612,14 @@ qla2x00_rnn_id(scsi_qla_host_t *ha) | |||
612 | return (rval); | 612 | return (rval); |
613 | } | 613 | } |
614 | 614 | ||
615 | void | ||
616 | qla2x00_get_sym_node_name(scsi_qla_host_t *ha, uint8_t *snn) | ||
617 | { | ||
618 | sprintf(snn, "%s FW:v%d.%02d.%02d DVR:v%s",ha->model_number, | ||
619 | ha->fw_major_version, ha->fw_minor_version, | ||
620 | ha->fw_subminor_version, qla2x00_version_str); | ||
621 | } | ||
622 | |||
615 | /** | 623 | /** |
616 | * qla2x00_rsnn_nn() - SNS Register Symbolic Node Name (RSNN_NN) of the HBA. | 624 | * qla2x00_rsnn_nn() - SNS Register Symbolic Node Name (RSNN_NN) of the HBA. |
617 | * @ha: HA context | 625 | * @ha: HA context |
@@ -622,9 +630,6 @@ int | |||
622 | qla2x00_rsnn_nn(scsi_qla_host_t *ha) | 630 | qla2x00_rsnn_nn(scsi_qla_host_t *ha) |
623 | { | 631 | { |
624 | int rval; | 632 | int rval; |
625 | uint8_t *snn; | ||
626 | uint8_t version[20]; | ||
627 | |||
628 | ms_iocb_entry_t *ms_pkt; | 633 | ms_iocb_entry_t *ms_pkt; |
629 | struct ct_sns_req *ct_req; | 634 | struct ct_sns_req *ct_req; |
630 | struct ct_sns_rsp *ct_rsp; | 635 | struct ct_sns_rsp *ct_rsp; |
@@ -649,20 +654,11 @@ qla2x00_rsnn_nn(scsi_qla_host_t *ha) | |||
649 | memcpy(ct_req->req.rsnn_nn.node_name, ha->node_name, WWN_SIZE); | 654 | memcpy(ct_req->req.rsnn_nn.node_name, ha->node_name, WWN_SIZE); |
650 | 655 | ||
651 | /* Prepare the Symbolic Node Name */ | 656 | /* Prepare the Symbolic Node Name */ |
652 | /* Board type */ | 657 | qla2x00_get_sym_node_name(ha, ct_req->req.rsnn_nn.sym_node_name); |
653 | snn = ct_req->req.rsnn_nn.sym_node_name; | ||
654 | strcpy(snn, ha->model_number); | ||
655 | /* Firmware version */ | ||
656 | strcat(snn, " FW:v"); | ||
657 | sprintf(version, "%d.%02d.%02d", ha->fw_major_version, | ||
658 | ha->fw_minor_version, ha->fw_subminor_version); | ||
659 | strcat(snn, version); | ||
660 | /* Driver version */ | ||
661 | strcat(snn, " DVR:v"); | ||
662 | strcat(snn, qla2x00_version_str); | ||
663 | 658 | ||
664 | /* Calculate SNN length */ | 659 | /* Calculate SNN length */ |
665 | ct_req->req.rsnn_nn.name_len = (uint8_t)strlen(snn); | 660 | ct_req->req.rsnn_nn.name_len = |
661 | (uint8_t)strlen(ct_req->req.rsnn_nn.sym_node_name); | ||
666 | 662 | ||
667 | /* Update MS IOCB request */ | 663 | /* Update MS IOCB request */ |
668 | ms_pkt->req_bytecount = | 664 | ms_pkt->req_bytecount = |