[SCSI] qla2xxx: Add support for fabric name FC transport attribute.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by Andrew Vasquez and committed by James Bottomley 90991c85 a740a3f0

+19 -1
+16
drivers/scsi/qla2xxx/qla_attr.c
··· 865 865 set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); 866 866 } 867 867 868 + static void 869 + qla2x00_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 + 868 882 struct fc_function_template qla2xxx_transport_functions = { 869 883 870 884 .show_host_node_name = 1, ··· 895 881 .show_host_symbolic_name = 1, 896 882 .set_host_system_hostname = qla2x00_set_host_system_hostname, 897 883 .show_host_system_hostname = 1, 884 + .get_host_fabric_name = qla2x00_get_host_fabric_name, 885 + .show_host_fabric_name = 1, 898 886 899 887 .dd_fcrport_size = sizeof(struct fc_port *), 900 888 .show_rport_supported_classes = 1,
+1
drivers/scsi/qla2xxx/qla_def.h
··· 2362 2362 2363 2363 uint8_t *node_name; 2364 2364 uint8_t *port_name; 2365 + uint8_t fabric_node_name[WWN_SIZE]; 2365 2366 uint32_t isp_abort_cnt; 2366 2367 2367 2368 /* Option ROM information. */
+2 -1
drivers/scsi/qla2xxx/qla_init.c
··· 2280 2280 loop_id = NPH_F_PORT; 2281 2281 else 2282 2282 loop_id = SNS_FL_PORT; 2283 - rval = qla2x00_get_port_name(ha, loop_id, NULL, 0); 2283 + rval = qla2x00_get_port_name(ha, loop_id, ha->fabric_node_name, 1); 2284 2284 if (rval != QLA_SUCCESS) { 2285 2285 DEBUG2(printk("scsi(%ld): MBC_GET_PORT_NAME Failed, No FL " 2286 2286 "Port\n", ha->host_no)); ··· 2288 2288 ha->device_flags &= ~SWITCH_FOUND; 2289 2289 return (QLA_SUCCESS); 2290 2290 } 2291 + ha->device_flags |= SWITCH_FOUND; 2291 2292 2292 2293 /* Mark devices that need re-synchronization. */ 2293 2294 rval2 = qla2x00_device_resync(ha);