@@ -389,7 +389,7 @@ zfcp_unit_lookup(struct zfcp_adapter *adapter, int channel, scsi_id_t id,
389
389
struct zfcp_unit * unit , * retval = NULL ;
390
390
391
391
list_for_each_entry (port , & adapter -> port_list_head , list ) {
392
- if (id != port -> scsi_id )
392
+ if (! port -> rport || ( id != port -> rport -> scsi_target_id ) )
393
393
continue ;
394
394
list_for_each_entry (unit , & port -> unit_list_head , list ) {
395
395
if (lun == unit -> scsi_lun ) {
@@ -408,7 +408,7 @@ zfcp_port_lookup(struct zfcp_adapter *adapter, int channel, scsi_id_t id)
408
408
struct zfcp_port * port ;
409
409
410
410
list_for_each_entry (port , & adapter -> port_list_head , list ) {
411
- if (id == port -> scsi_id )
411
+ if (port -> rport && ( id == port -> rport -> scsi_target_id ) )
412
412
return port ;
413
413
}
414
414
return (struct zfcp_port * ) NULL ;
@@ -634,7 +634,6 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
634
634
{
635
635
int retval ;
636
636
struct zfcp_unit * unit = (struct zfcp_unit * ) scpnt -> device -> hostdata ;
637
- struct Scsi_Host * scsi_host = scpnt -> device -> host ;
638
637
639
638
if (!unit ) {
640
639
ZFCP_LOG_NORMAL ("bug: Tried reset for nonexistent unit\n" );
@@ -729,7 +728,6 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt)
729
728
{
730
729
int retval = 0 ;
731
730
struct zfcp_unit * unit ;
732
- struct Scsi_Host * scsi_host = scpnt -> device -> host ;
733
731
734
732
unit = (struct zfcp_unit * ) scpnt -> device -> hostdata ;
735
733
ZFCP_LOG_NORMAL ("bus reset because of problems with "
@@ -753,7 +751,6 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
753
751
{
754
752
int retval = 0 ;
755
753
struct zfcp_unit * unit ;
756
- struct Scsi_Host * scsi_host = scpnt -> device -> host ;
757
754
758
755
unit = (struct zfcp_unit * ) scpnt -> device -> hostdata ;
759
756
ZFCP_LOG_NORMAL ("host reset because of problems with "
@@ -833,6 +830,7 @@ zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter)
833
830
shost = adapter -> scsi_host ;
834
831
if (!shost )
835
832
return ;
833
+ fc_remove_host (shost );
836
834
scsi_remove_host (shost );
837
835
scsi_host_put (shost );
838
836
adapter -> scsi_host = NULL ;
@@ -906,13 +904,30 @@ zfcp_get_node_name(struct scsi_target *starget)
906
904
read_unlock_irqrestore (& zfcp_data .config_lock , flags );
907
905
}
908
906
907
+ void
908
+ zfcp_set_fc_host_attrs (struct zfcp_adapter * adapter )
909
+ {
910
+ struct Scsi_Host * shost = adapter -> scsi_host ;
911
+
912
+ fc_host_node_name (shost ) = adapter -> wwnn ;
913
+ fc_host_port_name (shost ) = adapter -> wwpn ;
914
+ strncpy (fc_host_serial_number (shost ), adapter -> serial_number ,
915
+ min (FC_SERIAL_NUMBER_SIZE , 32 ));
916
+ fc_host_supported_classes (shost ) = FC_COS_CLASS2 | FC_COS_CLASS3 ;
917
+ }
918
+
909
919
struct fc_function_template zfcp_transport_functions = {
910
920
.get_starget_port_id = zfcp_get_port_id ,
911
921
.get_starget_port_name = zfcp_get_port_name ,
912
922
.get_starget_node_name = zfcp_get_node_name ,
913
923
.show_starget_port_id = 1 ,
914
924
.show_starget_port_name = 1 ,
915
925
.show_starget_node_name = 1 ,
926
+ .show_rport_supported_classes = 1 ,
927
+ .show_host_node_name = 1 ,
928
+ .show_host_port_name = 1 ,
929
+ .show_host_supported_classes = 1 ,
930
+ .show_host_serial_number = 1 ,
916
931
};
917
932
918
933
/**
0 commit comments