From d8b4521349274ab610d0b29384c704444e55cbca Mon Sep 17 00:00:00 2001 From: Andrew Vasquez Date: Mon, 2 Oct 2006 12:00:43 -0700 Subject: [SCSI] qla2xxx: Add iIDMA support. iIDMA (Intelligent Interleaved Direct Memory Access) allows for the HBA hardware to send FC frames at the rate at which they can be received by a target device. By taking advantage of the higher link rate, the HBA can maximize bandwidth utilization in a heterogeneous multi-speed SAN. Within a fabric topology, port speed detection is done via a Name Server command (GFPN_ID) followed by a Fabric Management command (GPSC). In an FCAL/N2N topology, port speed is based on the HBA link-rate. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley --- drivers/scsi/qla2xxx/qla_attr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/qla2xxx/qla_attr.c') diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 87f90c4f08e..144b0f8459c 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -691,13 +691,13 @@ qla2x00_get_host_speed(struct Scsi_Host *shost) uint32_t speed = 0; switch (ha->link_data_rate) { - case LDR_1GB: + case PORT_SPEED_1GB: speed = 1; break; - case LDR_2GB: + case PORT_SPEED_2GB: speed = 2; break; - case LDR_4GB: + case PORT_SPEED_4GB: speed = 4; break; } -- cgit v1.2.3 From 1620f7c2d8e3fdd7dba04bfe5f9c42201eef1188 Mon Sep 17 00:00:00 2001 From: Andrew Vasquez Date: Mon, 2 Oct 2006 12:00:44 -0700 Subject: [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 Signed-off-by: James Bottomley --- drivers/scsi/qla2xxx/qla_attr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/scsi/qla2xxx/qla_attr.c') diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 144b0f8459c..463846942e1 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) 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 = { .show_host_node_name = 1, @@ -861,6 +869,8 @@ struct fc_function_template qla2xxx_transport_functions = { .show_host_speed = 1, .get_host_port_type = qla2x00_get_host_port_type, .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 *), .show_rport_supported_classes = 1, -- cgit v1.2.3 From a740a3f0407ed3344b28b05926b0ce61768e9893 Mon Sep 17 00:00:00 2001 From: Andrew Vasquez Date: Mon, 2 Oct 2006 12:00:45 -0700 Subject: [SCSI] qla2xxx: Add support for system hostname FC transport attribute. The system hostname will be used during a subsequent FDMI registration with the fabric. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley --- drivers/scsi/qla2xxx/qla_attr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/scsi/qla2xxx/qla_attr.c') diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 463846942e1..4e1e175cb9d 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -857,6 +857,14 @@ qla2x00_get_host_symbolic_name(struct Scsi_Host *shost) qla2x00_get_sym_node_name(ha, fc_host_symbolic_name(shost)); } +static void +qla2x00_set_host_system_hostname(struct Scsi_Host *shost) +{ + scsi_qla_host_t *ha = to_qla_host(shost); + + set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); +} + struct fc_function_template qla2xxx_transport_functions = { .show_host_node_name = 1, @@ -871,6 +879,8 @@ struct fc_function_template qla2xxx_transport_functions = { .show_host_port_type = 1, .get_host_symbolic_name = qla2x00_get_host_symbolic_name, .show_host_symbolic_name = 1, + .set_host_system_hostname = qla2x00_set_host_system_hostname, + .show_host_system_hostname = 1, .dd_fcrport_size = sizeof(struct fc_port *), .show_rport_supported_classes = 1, -- cgit v1.2.3 From 90991c85d398fd46b2b07440b5639eb50dfacb2b Mon Sep 17 00:00:00 2001 From: Andrew Vasquez Date: Mon, 2 Oct 2006 12:00:46 -0700 Subject: [SCSI] qla2xxx: Add support for fabric name FC transport attribute. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley --- drivers/scsi/qla2xxx/qla_attr.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'drivers/scsi/qla2xxx/qla_attr.c') diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 4e1e175cb9d..d4cf51a8796 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -865,6 +865,20 @@ qla2x00_set_host_system_hostname(struct Scsi_Host *shost) set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); } +static void +qla2x00_get_host_fabric_name(struct Scsi_Host *shost) +{ + scsi_qla_host_t *ha = to_qla_host(shost); + u64 node_name; + + if (ha->device_flags & SWITCH_FOUND) + node_name = wwn_to_u64(ha->fabric_node_name); + else + node_name = wwn_to_u64(ha->node_name); + + fc_host_fabric_name(shost) = node_name; +} + struct fc_function_template qla2xxx_transport_functions = { .show_host_node_name = 1, @@ -881,6 +895,8 @@ struct fc_function_template qla2xxx_transport_functions = { .show_host_symbolic_name = 1, .set_host_system_hostname = qla2x00_set_host_system_hostname, .show_host_system_hostname = 1, + .get_host_fabric_name = qla2x00_get_host_fabric_name, + .show_host_fabric_name = 1, .dd_fcrport_size = sizeof(struct fc_port *), .show_rport_supported_classes = 1, -- cgit v1.2.3 From 7047fcddb1bc96a80fc54ac3a88ea18ca3ae77f6 Mon Sep 17 00:00:00 2001 From: Andrew Vasquez Date: Mon, 2 Oct 2006 12:00:47 -0700 Subject: [SCSI] qla2xxx: Add support for host port state FC transport attribute. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley --- drivers/scsi/qla2xxx/qla_attr.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/scsi/qla2xxx/qla_attr.c') diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index d4cf51a8796..ee75a71f3c6 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -879,6 +879,19 @@ qla2x00_get_host_fabric_name(struct Scsi_Host *shost) fc_host_fabric_name(shost) = node_name; } +static void +qla2x00_get_host_port_state(struct Scsi_Host *shost) +{ + scsi_qla_host_t *ha = to_qla_host(shost); + + if (!ha->flags.online) + fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE; + else if (atomic_read(&ha->loop_state) == LOOP_TIMEOUT) + fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN; + else + fc_host_port_state(shost) = FC_PORTSTATE_ONLINE; +} + struct fc_function_template qla2xxx_transport_functions = { .show_host_node_name = 1, @@ -897,6 +910,8 @@ struct fc_function_template qla2xxx_transport_functions = { .show_host_system_hostname = 1, .get_host_fabric_name = qla2x00_get_host_fabric_name, .show_host_fabric_name = 1, + .get_host_port_state = qla2x00_get_host_port_state, + .show_host_port_state = 1, .dd_fcrport_size = sizeof(struct fc_port *), .show_rport_supported_classes = 1, -- cgit v1.2.3