scsi: mpt3sas: Get sas_device objects using device's rphy
authorSreekanth Reddy <sreekanth.reddy@broadcom.com>
Tue, 27 Oct 2020 13:08:40 +0000 (18:38 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 4 Nov 2020 23:42:24 +0000 (18:42 -0500)
commit6df6be9168f50369ba843f2a12fe8537effbaff1
treee2cd1e0a892b1960d46383b0c5786b03ab4e2626
parentc71ccf93c00c0cef062c2371e9a614526fee9adb
scsi: mpt3sas: Get sas_device objects using device's rphy

In the following scsi_host_template and sas_function_template callback
functions the driver does not have PhysicalPort number information to
retrieve the sas_device object using SAS Address & PhysicalPort number. In
these callback functions the device's rphy object is used to retrieve
sas_device object for the device.

.target_alloc,
.get_enclosure_identifier
.get_bay_identifier

When a rphy (of type sas_rphy) object is allocated then its address is
saved in corresponding sas_device object's rphy field. In
__mpt3sas_get_sdev_by_rphy(), the driver loops over all the sas_device
objects from sas_device_list list to retrieve the sas_device objects whose
rphy matches the provided rphy.

Link: https://lore.kernel.org/r/20201027130847.9962-8-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_base.h
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/mpt3sas/mpt3sas_transport.c