aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c57
1 files changed, 54 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 87f90c4f08e9..ee75a71f3c66 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)
691 uint32_t speed = 0; 691 uint32_t speed = 0;
692 692
693 switch (ha->link_data_rate) { 693 switch (ha->link_data_rate) {
694 case LDR_1GB: 694 case PORT_SPEED_1GB:
695 speed = 1; 695 speed = 1;
696 break; 696 break;
697 case LDR_2GB: 697 case PORT_SPEED_2GB:
698 speed = 2; 698 speed = 2;
699 break; 699 break;
700 case LDR_4GB: 700 case PORT_SPEED_4GB:
701 speed = 4; 701 speed = 4;
702 break; 702 break;
703 } 703 }
@@ -849,6 +849,49 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
849 return pfc_host_stat; 849 return pfc_host_stat;
850} 850}
851 851
852static void
853qla2x00_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
860static void
861qla2x00_set_host_system_hostname(struct Scsi_Host *shost)
862{
863 scsi_qla_host_t *ha = to_qla_host(shost);
864
865 set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags);
866}
867
868static void
869qla2x00_get_host_fabric_name(struct Scsi_Host *shost)
870{
871 scsi_qla_host_t *ha = to_qla_host(shost);
872 u64 node_name;
873
874 if (ha->device_flags & SWITCH_FOUND)
875 node_name = wwn_to_u64(ha->fabric_node_name);
876 else
877 node_name = wwn_to_u64(ha->node_name);
878
879 fc_host_fabric_name(shost) = node_name;
880}
881
882static void
883qla2x00_get_host_port_state(struct Scsi_Host *shost)
884{
885 scsi_qla_host_t *ha = to_qla_host(shost);
886
887 if (!ha->flags.online)
888 fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
889 else if (atomic_read(&ha->loop_state) == LOOP_TIMEOUT)
890 fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN;
891 else
892 fc_host_port_state(shost) = FC_PORTSTATE_ONLINE;
893}
894
852struct fc_function_template qla2xxx_transport_functions = { 895struct fc_function_template qla2xxx_transport_functions = {
853 896
854 .show_host_node_name = 1, 897 .show_host_node_name = 1,
@@ -861,6 +904,14 @@ struct fc_function_template qla2xxx_transport_functions = {
861 .show_host_speed = 1, 904 .show_host_speed = 1,
862 .get_host_port_type = qla2x00_get_host_port_type, 905 .get_host_port_type = qla2x00_get_host_port_type,
863 .show_host_port_type = 1, 906 .show_host_port_type = 1,
907 .get_host_symbolic_name = qla2x00_get_host_symbolic_name,
908 .show_host_symbolic_name = 1,
909 .set_host_system_hostname = qla2x00_set_host_system_hostname,
910 .show_host_system_hostname = 1,
911 .get_host_fabric_name = qla2x00_get_host_fabric_name,
912 .show_host_fabric_name = 1,
913 .get_host_port_state = qla2x00_get_host_port_state,
914 .show_host_port_state = 1,
864 915
865 .dd_fcrport_size = sizeof(struct fc_port *), 916 .dd_fcrport_size = sizeof(struct fc_port *),
866 .show_rport_supported_classes = 1, 917 .show_rport_supported_classes = 1,