[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>
This commit is contained in:
Andrew Vasquez 2006-10-02 12:00:44 -07:00 committed by James Bottomley
parent d8b4521349
commit 1620f7c2d8
3 changed files with 22 additions and 15 deletions

View File

@ -849,6 +849,14 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
return pfc_host_stat; return pfc_host_stat;
} }
static void
qla2x00_get_host_symbolic_name(struct Scsi_Host *shost)
{
scsi_qla_host_t *ha = to_qla_host(shost);
qla2x00_get_sym_node_name(ha, fc_host_symbolic_name(shost));
}
struct fc_function_template qla2xxx_transport_functions = { struct fc_function_template qla2xxx_transport_functions = {
.show_host_node_name = 1, .show_host_node_name = 1,
@ -861,6 +869,8 @@ struct fc_function_template qla2xxx_transport_functions = {
.show_host_speed = 1, .show_host_speed = 1,
.get_host_port_type = qla2x00_get_host_port_type, .get_host_port_type = qla2x00_get_host_port_type,
.show_host_port_type = 1, .show_host_port_type = 1,
.get_host_symbolic_name = qla2x00_get_host_symbolic_name,
.show_host_symbolic_name = 1,
.dd_fcrport_size = sizeof(struct fc_port *), .dd_fcrport_size = sizeof(struct fc_port *),
.show_rport_supported_classes = 1, .show_rport_supported_classes = 1,

View File

@ -287,6 +287,7 @@ extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
extern int qla2x00_fdmi_register(scsi_qla_host_t *); extern int qla2x00_fdmi_register(scsi_qla_host_t *);
extern int qla2x00_gfpn_id(scsi_qla_host_t *, sw_info_t *); extern int qla2x00_gfpn_id(scsi_qla_host_t *, sw_info_t *);
extern int qla2x00_gpsc(scsi_qla_host_t *, sw_info_t *); extern int qla2x00_gpsc(scsi_qla_host_t *, sw_info_t *);
extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *);
/* /*
* Global Function Prototypes in qla_attr.c source file. * Global Function Prototypes in qla_attr.c source file.

View File

@ -612,6 +612,14 @@ qla2x00_rnn_id(scsi_qla_host_t *ha)
return (rval); return (rval);
} }
void
qla2x00_get_sym_node_name(scsi_qla_host_t *ha, uint8_t *snn)
{
sprintf(snn, "%s FW:v%d.%02d.%02d DVR:v%s",ha->model_number,
ha->fw_major_version, ha->fw_minor_version,
ha->fw_subminor_version, qla2x00_version_str);
}
/** /**
* qla2x00_rsnn_nn() - SNS Register Symbolic Node Name (RSNN_NN) of the HBA. * qla2x00_rsnn_nn() - SNS Register Symbolic Node Name (RSNN_NN) of the HBA.
* @ha: HA context * @ha: HA context
@ -622,9 +630,6 @@ int
qla2x00_rsnn_nn(scsi_qla_host_t *ha) qla2x00_rsnn_nn(scsi_qla_host_t *ha)
{ {
int rval; int rval;
uint8_t *snn;
uint8_t version[20];
ms_iocb_entry_t *ms_pkt; ms_iocb_entry_t *ms_pkt;
struct ct_sns_req *ct_req; struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp; struct ct_sns_rsp *ct_rsp;
@ -649,20 +654,11 @@ qla2x00_rsnn_nn(scsi_qla_host_t *ha)
memcpy(ct_req->req.rsnn_nn.node_name, ha->node_name, WWN_SIZE); memcpy(ct_req->req.rsnn_nn.node_name, ha->node_name, WWN_SIZE);
/* Prepare the Symbolic Node Name */ /* Prepare the Symbolic Node Name */
/* Board type */ qla2x00_get_sym_node_name(ha, ct_req->req.rsnn_nn.sym_node_name);
snn = ct_req->req.rsnn_nn.sym_node_name;
strcpy(snn, ha->model_number);
/* Firmware version */
strcat(snn, " FW:v");
sprintf(version, "%d.%02d.%02d", ha->fw_major_version,
ha->fw_minor_version, ha->fw_subminor_version);
strcat(snn, version);
/* Driver version */
strcat(snn, " DVR:v");
strcat(snn, qla2x00_version_str);
/* Calculate SNN length */ /* Calculate SNN length */
ct_req->req.rsnn_nn.name_len = (uint8_t)strlen(snn); ct_req->req.rsnn_nn.name_len =
(uint8_t)strlen(ct_req->req.rsnn_nn.sym_node_name);
/* Update MS IOCB request */ /* Update MS IOCB request */
ms_pkt->req_bytecount = ms_pkt->req_bytecount =